Skip to contentSkip to conversation

tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread

GIT PULL Steven Rostedt 2 participants 2 messages Sep 10, 2010

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

The previous fixed only fixed lseek, Chris's fix also handles pread().

Please pull the latest tip/perf/urgent tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/urgent

Chris Wright (1):
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread

----

 kernel/trace/ftrace.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---------------------------
commit df09162550fbb53354f0c88e85b5d0e6129ee9cc
Author: Chris Wright <[email protected]>
Date:   Thu Sep 9 16:34:59 2010 -0700

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.

kernel/trace/ftrace.c +2 -0
index 83a16e9..fa7ece6 100644
@@ -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;
 	}
 
#1 lore raw
Quoted 11 lines · Steven Rostedt

Ingo,

The previous fixed only fixed lseek, Chris's fix also handles pread().

Please pull the latest tip/perf/urgent tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/urgent

Quoted 6 lines

Chris Wright (1):
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread

----

 kernel/trace/ftrace.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Pulled, thanks Steve!

Ingo