]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
tracing: Fix event trigger to accept redundant spaces
authorMasami Hiramatsu <mhiramat@kernel.org>
Sat, 20 Jun 2020 03:46:03 +0000 (12:46 +0900)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commitda3005bcda0e555d2e7ab70d21b9884f8603f346
treea4deb788ffdf942083e756529dea2953b7138693
parent0b195fcffeb229dd903e8d7518e4d85892b0313c
tracing: Fix event trigger to accept redundant spaces

BugLink: https://bugs.launchpad.net/bugs/1885942
commit 6784beada631800f2c5afd567e5628c843362cee upstream.

Fix the event trigger to accept redundant spaces in
the trigger input.

For example, these return -EINVAL

echo " traceon" > events/ftrace/print/trigger
echo "traceon  if common_pid == 0" > events/ftrace/print/trigger
echo "disable_event:kmem:kmalloc " > events/ftrace/print/trigger

But these are hard to find what is wrong.

To fix this issue, use skip_spaces() to remove spaces
in front of actual tokens, and set NULL if there is no
token.

Link: http://lkml.kernel.org/r/159262476352.185015.5261566783045364186.stgit@devnote2
Cc: Tom Zanussi <zanussi@kernel.org>
Cc: stable@vger.kernel.org
Fixes: 85f2b08268c0 ("tracing: Add basic event trigger framework")
Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
kernel/trace/trace_events_trigger.c