Skip to contentSkip to conversation

kprobes: Use kernel_text_address() for checking probe address

PATCH In review Masami Hiramatsu 2 participants 2 messages Jul 28, 2009 – Jul 29, 2009 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Jim Keniston <[email protected]>

---

 kernel/kprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/kprobes.c +1 -1
index 16b5739..0540948 100644
@@ -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;
Signature · 7 lines
Masami Hiramatsu

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

e-mail: [email protected]
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Masami Hiramatsu

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().

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Jim Keniston <[email protected]>