Commit df091625 authored by Chris Wright's avatar Chris Wright Committed by Steven Rostedt
Browse files

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: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 5e11637e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1510,6 +1510,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;
	}