[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181106091156.1a373d76@gandalf.local.home>
Date: Tue, 6 Nov 2018 09:11:56 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>
Subject: [GIT PULL] tracing/kprobes: Fix strpbrk() argument order
Linus,
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).
Please pull the latest trace-v4.20-rc1 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.20-rc1
Tag SHA1: 112b3ade59dcaec85ec3402c4dd270e051b660dd
Head SHA1: ee474b81fe5aa5dc0faae920bf66240fbf55f891
Masami Hiramatsu (1):
tracing/kprobes: Fix strpbrk() argument order
----
kernel/trace/trace_probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------
commit ee474b81fe5aa5dc0faae920bf66240fbf55f891
Author: Masami Hiramatsu <mhiramat@...nel.org>
Date: Thu Nov 1 23:29:28 2018 +0900
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@...nel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 3ef15a6683c0..bd30e9398d2a 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -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,
Powered by blists - more mailing lists