Skip to content

Commit

Permalink
tracing/filters: fix NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Apr 12, 2009
1 parent 8433a40 commit bcabd91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bcabd91

Please sign in to comment.