All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing/kprobes: fix probe parsing
@ 2010-02-10 16:23 Heiko Carstens
  2010-02-10 22:26 ` Masami Hiramatsu
  2010-02-14  9:13 ` [tip:tracing/urgent] tracing/kprobes: Fix " tip-bot for Heiko Carstens
  0 siblings, 2 replies; 3+ messages in thread
From: Heiko Carstens @ 2010-02-10 16:23 UTC (permalink / raw)
  To: Frederic Weisbecker, Ingo Molnar, Masami Hiramatsu; +Cc: linux-kernel

From: Heiko Carstens <heiko.carstens@de.ibm.com>

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.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 kernel/trace/trace_kprobe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing/kprobes: fix probe parsing
  2010-02-10 16:23 [PATCH] tracing/kprobes: fix probe parsing Heiko Carstens
@ 2010-02-10 22:26 ` Masami Hiramatsu
  2010-02-14  9:13 ` [tip:tracing/urgent] tracing/kprobes: Fix " tip-bot for Heiko Carstens
  1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2010-02-10 22:26 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel

Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> 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.

Right, it's a bug! Thank you!


> 
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Acked-by: Masami Hiramatsu <mhiramat@redhat.com>

> ---
>  kernel/trace/trace_kprobe.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -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;

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:tracing/urgent] tracing/kprobes: Fix probe parsing
  2010-02-10 16:23 [PATCH] tracing/kprobes: fix probe parsing Heiko Carstens
  2010-02-10 22:26 ` Masami Hiramatsu
@ 2010-02-14  9:13 ` tip-bot for Heiko Carstens
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Heiko Carstens @ 2010-02-14  9:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, rostedt, heiko.carstens,
	tglx, mhiramat, mingo

Commit-ID:  a9bb18f36c8056f0712fb28c52c0f85d98438dfb
Gitweb:     http://git.kernel.org/tip/a9bb18f36c8056f0712fb28c52c0f85d98438dfb
Author:     Heiko Carstens <heiko.carstens@de.ibm.com>
AuthorDate: Wed, 10 Feb 2010 17:23:47 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
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.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100210162346.GA6933@osiris.boeblingen.de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/trace/trace_kprobe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 6ea90c0..50b1b82 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-14  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10 16:23 [PATCH] tracing/kprobes: fix probe parsing Heiko Carstens
2010-02-10 22:26 ` Masami Hiramatsu
2010-02-14  9:13 ` [tip:tracing/urgent] tracing/kprobes: Fix " tip-bot for Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.