* [PATCH] tracing: fix file mode of trace and README
@ 2009-04-17 2:34 Li Zefan
2009-04-17 5:44 ` Frederic Weisbecker
2009-04-17 16:10 ` [tip:tracing/core] " tip-bot for Li Zefan
0 siblings, 2 replies; 4+ messages in thread
From: Li Zefan @ 2009-04-17 2:34 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Steven Rostedt, Frederic Weisbecker, LKML
trace is read-write and README is read-only.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/trace/trace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 031c46f..f681f64 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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,
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] tracing: fix file mode of trace and README
2009-04-17 2:34 [PATCH] tracing: fix file mode of trace and README Li Zefan
@ 2009-04-17 5:44 ` Frederic Weisbecker
2009-04-17 5:52 ` Li Zefan
2009-04-17 16:10 ` [tip:tracing/core] " tip-bot for Li Zefan
1 sibling, 1 reply; 4+ messages in thread
From: Frederic Weisbecker @ 2009-04-17 5:44 UTC (permalink / raw)
To: Li Zefan, Greg KH; +Cc: Ingo Molnar, Steven Rostedt, LKML
On Fri, Apr 17, 2009 at 10:34:30AM +0800, Li Zefan wrote:
> trace is read-write and README is read-only.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> kernel/trace/trace.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 031c46f..f681f64 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -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.
>
> 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);
At least this one was harmless, but still it fixes the correctness.
Thanks,
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> trace_create_file("trace_pipe", 0444, d_tracer,
> --
> 1.5.4.rc3
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] tracing: fix file mode of trace and README
2009-04-17 5:44 ` Frederic Weisbecker
@ 2009-04-17 5:52 ` Li Zefan
0 siblings, 0 replies; 4+ messages in thread
From: Li Zefan @ 2009-04-17 5:52 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Greg KH, Ingo Molnar, Steven Rostedt, LKML
>> - 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.
>
It's not a bug in debugfs or vfs. It's just because root can
do anything. ;)
> Adding Greg in Cc.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:tracing/core] tracing: fix file mode of trace and README
2009-04-17 2:34 [PATCH] tracing: fix file mode of trace and README Li Zefan
2009-04-17 5:44 ` Frederic Weisbecker
@ 2009-04-17 16:10 ` tip-bot for Li Zefan
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Li Zefan @ 2009-04-17 16:10 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, fweisbec, rostedt, lizf, tglx, mingo
Commit-ID: 339ae5d3c3fc2025e3657637921495fd600027c7
Gitweb: http://git.kernel.org/tip/339ae5d3c3fc2025e3657637921495fd600027c7
Author: Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Fri, 17 Apr 2009 10:34:30 +0800
Committer: Ingo Molnar <mingo@elte.hu>
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. ]
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49E7EAB6.4070605@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/trace/trace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 031c46f..f681f64 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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,
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-17 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 2:34 [PATCH] tracing: fix file mode of trace and README Li Zefan
2009-04-17 5:44 ` Frederic Weisbecker
2009-04-17 5:52 ` Li Zefan
2009-04-17 16:10 ` [tip:tracing/core] " tip-bot for Li Zefan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox