tracing/kprobes: fix probe parsing
PATCH 1/1 tracing/kprobes: fix probe parsing
From: Heiko Carstens <[email protected]>
Trying to add a probe like
echo p:myprobe 0x10000 > /sys/kernel/debug/tracing/kprobe_events
will fail since the wrong pointer is passed to strict_strtoul when trying to convert the address to an unsigned long.
--- kernel/trace/trace_kprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_kprobe.c +1 -1
@@ -689,7 +689,7 @@ static int create_trace_probe(int argc,return -EINVAL ; }/* an address specified */ - ret =strict_strtoul (&argv[0 ][2 ],0 , (unsigned long *)&addr); + ret =strict_strtoul (&argv[1 ][0 ],0 , (unsigned long *)&addr);if (ret) {pr_info ("Failed to parse address.\n" );return ret;
Quoted 8 lines · Heiko Carstens
From: Heiko Carstens <[email protected]>
Trying to add a probe like
echo p:myprobe
0x10000>/sys/kernel/debug/tracing/kprobe_eventswill fail since the wrong pointer is passed to
strict_strtoulwhen trying to convert the address to an unsigned long.
Right, it's a bug! Thank you!
Quoted 2 lines
Signed-off-by Heiko Carstens <[email protected]>
Quoted 15 lines
--- kernel/trace/trace_kprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/trace_kprobe.c +1
-1@@ -689,7 +689,7 @@ static int create_trace_probe(int argc,return -EINVAL ; }/* an address specified */ - ret =strict_strtoul (&argv[0 ][2 ],0 , (unsigned long *)&addr); + ret =strict_strtoul (&argv[1 ][0 ],0 , (unsigned long *)&addr);if (ret) {pr_info ("Failed to parse address.\n" );return ret;
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
[tip:tracing/urgent] tracing/kprobes: Fix probe parsing
In reply to Heiko CarstensCommit-ID: a9bb18f36c8056f0712fb28c52c0f85d98438dfb Gitweb: http://git.kernel.org/tip/a9bb18f36c8056f0712fb28c52c0f85d98438dfb Author: Heiko Carstens <[email protected]> AuthorDate: Wed, 10 Feb 2010 17:23:47 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Sun, 14 Feb 2010 09:43:58 +0100
tracing/kprobes: Fix probe parsing
Trying to add a probe like:
echo p:myprobe 0x10000 > /sys/kernel/debug/tracing/kprobe_events
will fail since the wrong pointer is passed to strict_strtoul when trying to convert the address to an unsigned long.
LKML-Reference: <[email protected]>
--- kernel/trace/trace_kprobe.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/trace_kprobe.c +1 -1
@@ -689,7 +689,7 @@ static int create_trace_probe(int argc, char **argv)return -EINVAL ; }/* an address specified */ - ret =strict_strtoul (&argv[0 ][2 ],0 , (unsigned long *)&addr); + ret =strict_strtoul (&argv[1 ][0 ],0 , (unsigned long *)&addr);if (ret) {pr_info ("Failed to parse address.\n" );return ret;