diff options
author | Chris Wright <chrisw@sous-sol.org> | 2010-09-09 19:34:59 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-09-09 22:43:49 -0400 |
commit | df09162550fbb53354f0c88e85b5d0e6129ee9cc (patch) | |
tree | e8ba6014c442cf72d587948733f8c29e0d330925 /kernel/trace | |
parent | 5e11637e2c929e34dcc0fbbfb48bdb638937701a (diff) |
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread
Be sure to avoid entering t_show() with FTRACE_ITER_HASH set without
having properly started the iterator to iterate the hash. This case is
degenerate and, as discovered by Robert Swiecki, can cause t_hash_show()
to misuse a pointer. This causes a NULL ptr deref with possible security
implications. Tracked as CVE-2010-3079.
Cc: Robert Swiecki <swiecki@google.com>
Cc: Eugene Teo <eugene@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 83a16e9ee518..fa7ece649fe1 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1510,6 +1510,8 @@ static void *t_start(struct seq_file *m, loff_t *pos) | |||
1510 | if (*pos > 0) | 1510 | if (*pos > 0) |
1511 | return t_hash_start(m, pos); | 1511 | return t_hash_start(m, pos); |
1512 | iter->flags |= FTRACE_ITER_PRINTALL; | 1512 | iter->flags |= FTRACE_ITER_PRINTALL; |
1513 | /* reset in case of seek/pread */ | ||
1514 | iter->flags &= ~FTRACE_ITER_HASH; | ||
1513 | return iter; | 1515 | return iter; |
1514 | } | 1516 | } |
1515 | 1517 | ||