提交 bcabd91c 编写于 作者: L Li Zefan 提交者: Ingo Molnar

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: NLi Zefan <lizf@cn.fujitsu.com>
Acked-by: NTom Zanussi <tzanussi@gmail.com>
Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49E04C43.1050504@cn.fujitsu.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 8433a40e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册