diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-09-08 11:20:37 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-09-08 12:08:01 -0400 |
commit | 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 (patch) | |
tree | 0f86d1e27fbfc31cba108e71643d686315468db9 | |
parent | 4177c42a6301a34c20038ec2771a33dcc30bb338 (diff) |
tracing: Do not allow llseek to set_ftrace_filter
Reading the file set_ftrace_filter does three things.
1) shows whether or not filters are set for the function tracer
2) shows what functions are set for the function tracer
3) shows what triggers are set on any functions
3 is independent from 1 and 2.
The way this file currently works is that it is a state machine,
and as you read it, it may change state. But this assumption breaks
when you use lseek() on the file. The state machine gets out of sync
and the t_show() may use the wrong pointer and cause a kernel oops.
Luckily, this will only kill the app that does the lseek, but the app
dies while holding a mutex. This prevents anyone else from using the
set_ftrace_filter file (or any other function tracing file for that matter).
A real fix for this is to rewrite the code, but that is too much for
a -rc release or stable. This patch simply disables llseek on the
set_ftrace_filter() file for now, and we can do the proper fix for the
next major release.
Reported-by: Robert Swiecki <swiecki@google.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Tavis Ormandy <taviso@google.com>
Cc: Eugene Teo <eugene@redhat.com>
Cc: vendor-sec@lst.de
Cc: <stable@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7cb1f45a1de1..83a16e9ee518 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2416,7 +2416,7 @@ static const struct file_operations ftrace_filter_fops = { | |||
2416 | .open = ftrace_filter_open, | 2416 | .open = ftrace_filter_open, |
2417 | .read = seq_read, | 2417 | .read = seq_read, |
2418 | .write = ftrace_filter_write, | 2418 | .write = ftrace_filter_write, |
2419 | .llseek = ftrace_regex_lseek, | 2419 | .llseek = no_llseek, |
2420 | .release = ftrace_filter_release, | 2420 | .release = ftrace_filter_release, |
2421 | }; | 2421 | }; |
2422 | 2422 | ||