ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr

Prohibit kprobes on do_undefinstr because kprobes on
arm is implemented by undefined instruction. This means
if we probe do_undefinstr(), it can cause infinit
recursive exception.

Fixes: 24ba613c9d6c ("ARM kprobes: core code")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by Masami Hiramatsu and committed by Russell King eb0146da 70948c05

+4 -1
+4 -1
arch/arm/kernel/traps.c
··· 19 19 #include <linux/uaccess.h> 20 20 #include <linux/hardirq.h> 21 21 #include <linux/kdebug.h> 22 + #include <linux/kprobes.h> 22 23 #include <linux/module.h> 23 24 #include <linux/kexec.h> 24 25 #include <linux/bug.h> ··· 418 417 raw_spin_unlock_irqrestore(&undef_lock, flags); 419 418 } 420 419 421 - static int call_undef_hook(struct pt_regs *regs, unsigned int instr) 420 + static nokprobe_inline 421 + int call_undef_hook(struct pt_regs *regs, unsigned int instr) 422 422 { 423 423 struct undef_hook *hook; 424 424 unsigned long flags; ··· 492 490 493 491 arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); 494 492 } 493 + NOKPROBE_SYMBOL(do_undefinstr) 495 494 496 495 /* 497 496 * Handle FIQ similarly to NMI on x86 systems.