diff options
author | Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> | 2006-09-26 04:52:36 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:36 -0400 |
commit | 06039754d775d3e48e4a292e4f353321205eff53 (patch) | |
tree | a6abdd9ca0efb34006792e7275c4a2c954b229be /arch/i386/kernel/entry.S | |
parent | 6f6b1e0477ccb2f25a9b045e38440347d2ce21c8 (diff) |
[PATCH] i386: Disallow kprobes on NMI handlers
A kprobe executes IRET early and that could cause NMI recursion and stack
corruption.
Note: This problem was originally spotted and solved by Andi Kleen in the
x86_64 architecture. This patch is an adaption of his patch for i386.
AK: Merged with current code which was a bit different.
AK: Removed printk in nmi handler that shouldn't be there in the first time
AK: Added missing include.
AK: added KPROBES_END
Signed-off-by: Fernando Vazquez <fernando@intellilink.co.jp>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/kernel/entry.S')
-rw-r--r-- | arch/i386/kernel/entry.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index dede506e5bd0..0928f70639aa 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S | |||
@@ -729,7 +729,7 @@ KPROBE_END(debug) | |||
729 | * check whether we got an NMI on the debug path where the debug | 729 | * check whether we got an NMI on the debug path where the debug |
730 | * fault happened on the sysenter path. | 730 | * fault happened on the sysenter path. |
731 | */ | 731 | */ |
732 | ENTRY(nmi) | 732 | KPROBE_ENTRY(nmi) |
733 | RING0_INT_FRAME | 733 | RING0_INT_FRAME |
734 | pushl %eax | 734 | pushl %eax |
735 | CFI_ADJUST_CFA_OFFSET 4 | 735 | CFI_ADJUST_CFA_OFFSET 4 |
@@ -805,6 +805,7 @@ nmi_16bit_stack: | |||
805 | .align 4 | 805 | .align 4 |
806 | .long 1b,iret_exc | 806 | .long 1b,iret_exc |
807 | .previous | 807 | .previous |
808 | KPROBE_END(nmi) | ||
808 | 809 | ||
809 | KPROBE_ENTRY(int3) | 810 | KPROBE_ENTRY(int3) |
810 | RING0_INT_FRAME | 811 | RING0_INT_FRAME |