[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-bcabd91c271e50eebc0cb9220ac92700332b452e@git.kernel.org>
Date: Sun, 12 Apr 2009 10:06:47 GMT
From: Li Zefan <lizf@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
tzanussi@...il.com, lizf@...fujitsu.com, fweisbec@...il.com,
rostedt@...dmis.org, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:tracing/urgent] tracing/filters: fix NULL pointer dereference
Commit-ID: bcabd91c271e50eebc0cb9220ac92700332b452e
Gitweb: http://git.kernel.org/tip/bcabd91c271e50eebc0cb9220ac92700332b452e
Author: Li Zefan <lizf@...fujitsu.com>
AuthorDate: Sat, 11 Apr 2009 15:52:35 +0800
Committer: Ingo Molnar <mingo@...e.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@...fujitsu.com>
Acked-by: Tom Zanussi <tzanussi@...il.com>
Acked-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
LKML-Reference: <49E04C43.1050504@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists