Commit 92339109 authored by Ondrej Mosnacek's avatar Ondrej Mosnacek Committed by Zheng Yejian
Browse files

tracing: Fix permissions for the buffer_percent file

mainline inclusion
from mainline-v6.4-rc1
commit 4f94559f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IA7NPI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f94559f40ad06d627c0fdfc3319cec778a2845b

--------------------------------

This file defines both read and write operations, yet it is being
created as read-only. This means that it can't be written to without the
CAP_DAC_OVERRIDE capability. Fix the permissions to allow root to write
to it without the need to override DAC perms.

Link: https://lore.kernel.org/linux-trace-kernel/20230503140114.3280002-1-omosnace@redhat.com



Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 03329f99 ("tracing: Add tracefs file buffer_percentage")
Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
parent 98b5de4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9220,7 +9220,7 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)

	tr->buffer_percent = 50;

	trace_create_file("buffer_percent", TRACE_MODE_READ, d_tracer,
	trace_create_file("buffer_percent", TRACE_MODE_WRITE, d_tracer,
			tr, &buffer_percent_fops);

	create_trace_options_dir(tr);