Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 true
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Masami Hiramatsu and committed by
Linus Torvalds
ec30c5f3 90a09c9c

+1 -1
+1 -1
kernel/kprobes.c
··· 694 694 p->addr = addr; 695 695 696 696 preempt_disable(); 697 - if (!__kernel_text_address((unsigned long) p->addr) || 697 + if (!kernel_text_address((unsigned long) p->addr) || 698 698 in_kprobes_functions((unsigned long) p->addr)) { 699 699 preempt_enable(); 700 700 return -EINVAL;