lkml.org 
[lkml]   [2009]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:tracing/urgent] tracing/filters: fix NULL pointer dereference
Commit-ID:  bcabd91c271e50eebc0cb9220ac92700332b452e
Gitweb: http://git.kernel.org/tip/bcabd91c271e50eebc0cb9220ac92700332b452e
Author: Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Sat, 11 Apr 2009 15:52:35 +0800
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 12 Apr 2009 11:59:28 +0200

tracing/filters: fix NULL pointer dereference

Try this, and you'll see NULL pointer dereference bug:

# echo -n 'parent_comm ==' > sched/sched_process_fork/filter
Because we passed NULL ptr to simple_strtoull().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Tom Zanussi <tzanussi@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49E04C43.1050504@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
kernel/trace/trace_events_filter.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 026be41..9d2162f 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -410,6 +410,11 @@ int filter_parse(char **pbuf, struct filter_pred *pred)
}
}

+ if (!val_str) {
+ pred->field_name = NULL;
+ return -EINVAL;
+ }
+
pred->field_name = kstrdup(pred->field_name, GFP_KERNEL);
if (!pred->field_name)
return -ENOMEM;

\
 
 \ /
  Last update: 2009-04-12 12:09    [from the cache]
©2003-2011 Jasper Spaans