summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOndrej Mosnacek <omosnace@redhat.com>2023-05-03 16:01:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 23:16:52 +0900
commitc5a513f55dc3c0e284dc46f3dac342bdd50d4abe (patch)
tree886bef565876c6753635a32434f3abb0fefb61a3 /kernel
parenta4cb459a35ca8fe58f4b27d7de5736b4ecddba8d (diff)
downloadlinux-stable-c5a513f55dc3c0e284dc46f3dac342bdd50d4abe.tar.gz
linux-stable-c5a513f55dc3c0e284dc46f3dac342bdd50d4abe.tar.bz2
linux-stable-c5a513f55dc3c0e284dc46f3dac342bdd50d4abe.zip
tracing: Fix permissions for the buffer_percent file
commit 4f94559f40ad06d627c0fdfc3319cec778a2845b upstream. 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: 03329f993978 ("tracing: Add tracefs file buffer_percentage") Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 36a6037823cd..5909aaf2f4c0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9658,7 +9658,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);