diff options
author | Andi Kleen <ak@suse.de> | 2006-02-03 15:50:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-04 19:43:12 -0500 |
commit | eddb6fb9a54cdc8c7c37e056a2b4bbbc8a128a36 (patch) | |
tree | c8b9a0773518f45aa86d861fce959c3c4f946b06 /arch/x86_64/kernel/nmi.c | |
parent | 2f01942536d8c686a3f6b3b38f1257caa2fb763e (diff) |
[PATCH] x86_64: Disallow kprobes on NMI handlers
A kprobe executes IRET early and that could cause NMI recursion
and stack corruption.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/nmi.c')
-rw-r--r-- | arch/x86_64/kernel/nmi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c index 5fae6f0cd994..8be407a1f62d 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86_64/kernel/nmi.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/sysdev.h> | 24 | #include <linux/sysdev.h> |
25 | #include <linux/nmi.h> | 25 | #include <linux/nmi.h> |
26 | #include <linux/sysctl.h> | 26 | #include <linux/sysctl.h> |
27 | #include <linux/kprobes.h> | ||
27 | 28 | ||
28 | #include <asm/smp.h> | 29 | #include <asm/smp.h> |
29 | #include <asm/mtrr.h> | 30 | #include <asm/mtrr.h> |
@@ -468,7 +469,7 @@ void touch_nmi_watchdog (void) | |||
468 | touch_softlockup_watchdog(); | 469 | touch_softlockup_watchdog(); |
469 | } | 470 | } |
470 | 471 | ||
471 | void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) | 472 | void __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason) |
472 | { | 473 | { |
473 | int sum; | 474 | int sum; |
474 | int touched = 0; | 475 | int touched = 0; |
@@ -512,14 +513,14 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) | |||
512 | } | 513 | } |
513 | } | 514 | } |
514 | 515 | ||
515 | static int dummy_nmi_callback(struct pt_regs * regs, int cpu) | 516 | static __kprobes int dummy_nmi_callback(struct pt_regs * regs, int cpu) |
516 | { | 517 | { |
517 | return 0; | 518 | return 0; |
518 | } | 519 | } |
519 | 520 | ||
520 | static nmi_callback_t nmi_callback = dummy_nmi_callback; | 521 | static nmi_callback_t nmi_callback = dummy_nmi_callback; |
521 | 522 | ||
522 | asmlinkage void do_nmi(struct pt_regs * regs, long error_code) | 523 | asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code) |
523 | { | 524 | { |
524 | int cpu = safe_smp_processor_id(); | 525 | int cpu = safe_smp_processor_id(); |
525 | 526 | ||