Skip to content

Commit eb0146d

Browse files
mhiramatRussell King
authored andcommitted
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: 24ba613 ("ARM kprobes: core code") Signed-off-by: Masami Hiramatsu <[email protected]> Cc: [email protected] Signed-off-by: Russell King <[email protected]>
1 parent 70948c0 commit eb0146d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm/kernel/traps.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/uaccess.h>
2020
#include <linux/hardirq.h>
2121
#include <linux/kdebug.h>
22+
#include <linux/kprobes.h>
2223
#include <linux/module.h>
2324
#include <linux/kexec.h>
2425
#include <linux/bug.h>
@@ -417,7 +418,8 @@ void unregister_undef_hook(struct undef_hook *hook)
417418
raw_spin_unlock_irqrestore(&undef_lock, flags);
418419
}
419420

420-
static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
421+
static nokprobe_inline
422+
int call_undef_hook(struct pt_regs *regs, unsigned int instr)
421423
{
422424
struct undef_hook *hook;
423425
unsigned long flags;
@@ -490,6 +492,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
490492

491493
arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6);
492494
}
495+
NOKPROBE_SYMBOL(do_undefinstr)
493496

494497
/*
495498
* Handle FIQ similarly to NMI on x86 systems.

0 commit comments

Comments
 (0)