]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing: Fix to set write permission to per-cpu buffer_size_kb
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 10 Feb 2026 08:43:36 +0000 (17:43 +0900)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 11 Feb 2026 15:48:44 +0000 (10:48 -0500)
Since the per-cpu buffer_size_kb file is writable for changing
per-cpu ring buffer size, the file should have the write access
permission.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/177071301597.2293046.11683339475076917920.stgit@mhiramat.tok.corp.google.com
Fixes: 21ccc9cd7211 ("tracing: Disable "other" permission bits in the tracefs files")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c

index 845b8a165daf3c747fcafd77181ed7cc19fc0596..fd470675809b381729bd5def0b9feeb84e63a046 100644 (file)
@@ -8613,7 +8613,7 @@ tracing_init_tracefs_percpu(struct trace_array *tr, long cpu)
        trace_create_cpu_file("stats", TRACE_MODE_READ, d_cpu,
                                tr, cpu, &tracing_stats_fops);
 
-       trace_create_cpu_file("buffer_size_kb", TRACE_MODE_READ, d_cpu,
+       trace_create_cpu_file("buffer_size_kb", TRACE_MODE_WRITE, d_cpu,
                                tr, cpu, &tracing_entries_fops);
 
        if (tr->range_addr_start)