tracing: fix file mode of trace and README
PATCH 1/1 tracing: fix file mode of trace and README
trace is read-write and README is read-only.
--- kernel/trace/trace.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace.c +2 -2
@@ -4002,7 +4002,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("available_tracers" ,0444 , d_tracer, &global_trace, &show_traces_fops); -trace_create_file ("current_tracer" ,0444 , d_tracer, +trace_create_file ("current_tracer" ,0644 , d_tracer, &global_trace, &set_tracer_fops); trace_create_file("tracing_max_latency", 0644, d_tracer,
@@ -4011,7 +4011,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("tracing_thresh" ,0644 , d_tracer, &tracing_thresh, &tracing_max_lat_fops); -trace_create_file ("README" ,0644 , d_tracer, +trace_create_file ("README" ,0444 , d_tracer,NULL , &tracing_readme_fops); trace_create_file("trace_pipe", 0444, d_tracer,
Signature · 1 line
1.5.4.rc3
Quoted 12 lines · Li Zefan
trace is read-write and README is read-only.
Signed-off-by Li Zefan <[email protected]>--- kernel/trace/trace.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)kernel/trace/trace.c +0
-0
kernel/trace/trace.c static __init int tracer_init_debugfs(void) · line 4006
Quoted 6 lines
kernel/trace/trace.c +1
-1@@ -4002,7 +4002,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("available_tracers" ,0444 , d_tracer, &global_trace, &show_traces_fops); -trace_create_file ("current_tracer" ,0444 , d_tracer, +trace_create_file ("current_tracer" ,0644 , d_tracer, &global_trace, &set_tracer_fops);
Oh!
I wonder how much time we ran with this false permission. It clearly shows a bug in debugfs permission (or something near this this layer), we have be running with this file for a while and I've never seen any issue while writing into it.
And we have seen several patches with 0444 permissions for the tracing tree containing writeable files, showing that the authors ran them whithout problems.
Adding Greg in Cc.
kernel/trace/trace.c static __init int tracer_init_debugfs(void) · line 4015
Quoted 9 lines
kernel/trace/trace.c +1
-1trace_create_file("tracing_max_latency", 0644, d_tracer,@@ -4011,7 +4011,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("tracing_thresh" ,0644 , d_tracer, &tracing_thresh, &tracing_max_lat_fops); -trace_create_file ("README" ,0644 , d_tracer, +trace_create_file ("README" ,0444 , d_tracer,NULL , &tracing_readme_fops);
At least this one was harmless, but still it fixes the correctness.
Thanks,
Quoted 4 lines
kernel/trace/trace.c +0
-0trace_create_file("trace_pipe", 0444, d_tracer,Signature · 1 line
1.5.4.rc3
Quoted 13 lines
kernel/trace/trace.c static __init int tracer_init_debugfs(void) · line 4006
Quoted 4 lines
kernel/trace/trace.c +1
-1-trace_create_file ("current_tracer" ,0444 , d_tracer, +trace_create_file ("current_tracer" ,0644 , d_tracer, &global_trace, &set_tracer_fops);Oh!
I wonder how much time we ran with this false permission. It clearly shows a bug in debugfs permission (or something near this this layer), we have be running with this file for a while and I've never seen any issue while writing into it.
Quoted 4 lines
And we have seen several patches with 0444 permissions for the tracing tree containing writeable files, showing that the authors ran them whithout problems.
It's not a bug in debugfs or vfs. It's just because root can do anything. ;)
Quoted 2 lines
Adding Greg in Cc.
Commit-ID: 339ae5d3c3fc2025e3657637921495fd600027c7 Gitweb: http://git.kernel.org/tip/339ae5d3c3fc2025e3657637921495fd600027c7 Author: Li Zefan <[email protected]> AuthorDate: Fri, 17 Apr 2009 10:34:30 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 17 Apr 2009 18:04:36 +0200
tracing: fix file mode of trace and README
trace is read-write and README is read-only.
[ Impact: fix /debug/tracing/ file permissions. ]
LKML-Reference: <[email protected]>
--- kernel/trace/trace.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace.c +2 -2
@@ -4002,7 +4002,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("available_tracers" ,0444 , d_tracer, &global_trace, &show_traces_fops); -trace_create_file ("current_tracer" ,0444 , d_tracer, +trace_create_file ("current_tracer" ,0644 , d_tracer, &global_trace, &set_tracer_fops); trace_create_file("tracing_max_latency", 0644, d_tracer,
@@ -4011,7 +4011,7 @@ static __init int tracer_init_debugfs(void)trace_create_file ("tracing_thresh" ,0644 , d_tracer, &tracing_thresh, &tracing_max_lat_fops); -trace_create_file ("README" ,0644 , d_tracer, +trace_create_file ("README" ,0444 , d_tracer,NULL , &tracing_readme_fops); trace_create_file("trace_pipe", 0444, d_tracer,