]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread
authorChris Wright <chrisw@sous-sol.org>
Thu, 9 Sep 2010 23:34:59 +0000 (16:34 -0700)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Jan 2011 23:07:46 +0000 (18:07 -0500)
commit df09162550fbb53354f0c88e85b5d0e6129ee9cc upstream.

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
kernel/trace/ftrace.c

index 7d51cab6219227adf3355d0b29b39e25fb92cd33..73dedb305c0cef8af148c078b8bb1d987b6713c3 100644 (file)
@@ -1488,6 +1488,8 @@ static void *t_start(struct seq_file *m, loff_t *pos)
                if (*pos > 0)
                        return t_hash_start(m, pos);
                iter->flags |= FTRACE_ITER_PRINTALL;
+               /* reset in case of seek/pread */
+               iter->flags &= ~FTRACE_ITER_HASH;
                return iter;
        }