Masami found a slight bug in his code where he transposed the arguments of a
call to strpbrk.

The reason this wasn't detected in our tests is that the only way this would
transpire is when a kprobe event with a symbol offset is attached to a
function that belongs to a module that isn't loaded yet. When the kprobe
trace event is added, the offset would be truncated after it was parsed,
and when the module is loaded, it would use the symbol without the offset
(as the nul character added by the parsing would not be replaced with the
original character).
tracing/kprobes: Fix strpbrk() argument order

Fix strpbrk()'s argument order, it must pass acceptable string
in 2nd argument. Note that this can cause a kernel panic where
it recovers backup character to code->data.

Link: http://lkml.kernel.org/r/154108256792.2604.1816052586385217811.stgit@devbox

Fixes: a6682814f371 ("tracing/kprobes: Allow kprobe-events to record module symbol")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed