This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe address
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Linus Torvalds<torvalds at linux-foundation dot org>, lkml<linux-kernel at vger dot kernel dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>
- Cc: systemtap<systemtap at sources dot redhat dot com>, Masami Hiramatsu <mhiramat at redhat dot com>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Jim Keniston <jkenisto at us dot ibm dot com>
- Date: Tue, 28 Jul 2009 19:47:23 -0400
- Subject: [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe address
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