tracing/kprobes: Fix strpbrk() argument order
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 1 Nov 2018 14:29:28 +0000 (23:29 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 5 Nov 2018 14:47:14 +0000 (09:47 -0500)
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>
kernel/trace/trace_probe.c

index 3ef15a6683c002bc2c5402b5be8ad07c903021bc..bd30e9398d2a8b2afbc49839c969efd277ae2728 100644 (file)
@@ -535,7 +535,7 @@ int traceprobe_update_arg(struct probe_arg *arg)
                        if (code[1].op != FETCH_OP_IMM)
                                return -EINVAL;
 
-                       tmp = strpbrk("+-", code->data);
+                       tmp = strpbrk(code->data, "+-");
                        if (tmp)
                                c = *tmp;
                        ret = traceprobe_split_symbol_offset(code->data,