Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH] tracing: Fix permissions for the buffer_percent file
@ 2023-05-03 14:01 Ondrej Mosnacek
  2023-05-03 16:46 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Mosnacek @ 2023-05-03 14:01 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu; +Cc: linux-trace-kernel, linux-kernel

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.

Fixes: 03329f993978 ("tracing: Add tracefs file buffer_percentage")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 45551c7b4c365..e278f4202a7ed 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9655,7 +9655,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);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-03 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 14:01 [PATCH] tracing: Fix permissions for the buffer_percent file Ondrej Mosnacek
2023-05-03 16:46 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox