Commit 97a5d2e5 authored by Ammar Faizi's avatar Ammar Faizi Committed by Steven Rostedt (Google)

tracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse()

If `WARN_ON(!glob)` is ever triggered, we will still continue executing
the next lines. This will trigger the more serious problem, a NULL
pointer dereference bug.

Just return -EINVAL if @glob is NULL.

Link: https://lkml.kernel.org/r/20220417185630.199062-2-ammarfaizi2@gnuweeb.org

Cc: Ingo Molnar <mingo@redhat.com>
Cc: GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent cb1c45fb
......@@ -6214,7 +6214,8 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
lockdep_assert_held(&event_mutex);
WARN_ON(!glob);
if (WARN_ON(!glob))
return -EINVAL;
if (strlen(glob)) {
hist_err_clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment