diff options
| author | Masami Hiramatsu <mhiramat@kernel.org> | 2018-05-13 00:04:16 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-05-19 06:35:56 -0400 |
| commit | eb0146daefdde65665b7f076fbff7b49dade95b9 (patch) | |
| tree | b7e478904c9cd985c4349977d67b92178369392d | |
| parent | 70948c05fdde0aac32f9667856a88725c192fa40 (diff) | |
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>
| -rw-r--r-- | arch/arm/kernel/traps.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 5e3633c24e63..2fe87109ae46 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/uaccess.h> | 19 | #include <linux/uaccess.h> |
| 20 | #include <linux/hardirq.h> | 20 | #include <linux/hardirq.h> |
| 21 | #include <linux/kdebug.h> | 21 | #include <linux/kdebug.h> |
| 22 | #include <linux/kprobes.h> | ||
| 22 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 23 | #include <linux/kexec.h> | 24 | #include <linux/kexec.h> |
| 24 | #include <linux/bug.h> | 25 | #include <linux/bug.h> |
| @@ -417,7 +418,8 @@ void unregister_undef_hook(struct undef_hook *hook) | |||
| 417 | raw_spin_unlock_irqrestore(&undef_lock, flags); | 418 | raw_spin_unlock_irqrestore(&undef_lock, flags); |
| 418 | } | 419 | } |
| 419 | 420 | ||
| 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) | ||
| 421 | { | 423 | { |
| 422 | struct undef_hook *hook; | 424 | struct undef_hook *hook; |
| 423 | unsigned long flags; | 425 | unsigned long flags; |
| @@ -490,6 +492,7 @@ die_sig: | |||
| 490 | 492 | ||
| 491 | arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); | 493 | arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); |
| 492 | } | 494 | } |
| 495 | NOKPROBE_SYMBOL(do_undefinstr) | ||
| 493 | 496 | ||
| 494 | /* | 497 | /* |
| 495 | * Handle FIQ similarly to NMI on x86 systems. | 498 | * Handle FIQ similarly to NMI on x86 systems. |
