public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe  address
@ 2009-07-28 23:44 Masami Hiramatsu
  2009-07-29  4:24 ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2009-07-28 23:44 UTC (permalink / raw)
  To: Linus Torvalds, lkml, Ananth N Mavinakayanahalli
  Cc: systemtap, Masami Hiramatsu, Ananth N Mavinakayanahalli, Jim Keniston

Use kernel_text_address() for checking probe address instead of
__kernel_text_address(), because __kernel_text_address() returns
!0 for init functions even after relaseing those functions.
That will hit a BUG() in text_poke().

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
---

 kernel/kprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 16b5739..0540948 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -694,7 +694,7 @@ int __kprobes register_kprobe(struct kprobe *p)
 	p->addr = addr;
 
 	preempt_disable();
-	if (!__kernel_text_address((unsigned long) p->addr) ||
+	if (!kernel_text_address((unsigned long) p->addr) ||
 	    in_kprobes_functions((unsigned long) p->addr)) {
 		preempt_enable();
 		return -EINVAL;


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* Re: [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking  probe address
  2009-07-28 23:44 [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe address Masami Hiramatsu
@ 2009-07-29  4:24 ` Ananth N Mavinakayanahalli
  0 siblings, 0 replies; 2+ messages in thread
From: Ananth N Mavinakayanahalli @ 2009-07-29  4:24 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Linus Torvalds, lkml, systemtap, Jim Keniston

On Tue, Jul 28, 2009 at 07:47:23PM -0400, Masami Hiramatsu wrote:
> Use kernel_text_address() for checking probe address instead of
> __kernel_text_address(), because __kernel_text_address() returns
> !0 for init functions even after relaseing those functions.
> That will hit a BUG() in text_poke().
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Jim Keniston <jkenisto@us.ibm.com>

Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

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

end of thread, other threads:[~2009-07-29  4:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-28 23:44 [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe address Masami Hiramatsu
2009-07-29  4:24 ` Ananth N Mavinakayanahalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).