linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix sysenter crash with enabled nmi oopser
@ 2003-05-31 18:08 manfred
  0 siblings, 0 replies; only message in thread
From: manfred @ 2003-05-31 18:08 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hi Linus,

below is again my patch to the nmi entry point: without it, I can't boot
RH9 with both nmi oopser and page unmapping enabled.

Background:

The nmi handler must detect the combination of nmi+syscall+debug fault. It
does that by reading from (%esp)16. This can crash, if it's a "normal" nmi
and (%esp)16 doesn't exist - either above end-of-memory, or the page that
follows behind the stack is unmapped for AGP GART. RH9 crashes on every
boot with page unmap debugging enabled, the interrupted %eip is
sysenter_past_esp.

Could you apply the patch to your tree? I would prefer a symbolic constant
instead of 0x1fff (THREAD_SIZE-1) and 0x1fec
(THREAD_SIZE-3*sizeof(unsigned long)), but the current definitions are not
compatible with the assembler.

--
	Manfred
<<<
--- 2.5/arch/i386/kernel/entry.S	2003-05-24 07:56:36.000000000 +0200
+++ build-2.5/arch/i386/kernel/entry.S	2003-05-25 22:56:18.000000000 +0200
@@ -534,6 +534,15 @@
 ENTRY(nmi)
 	cmpl $sysenter_entry,(%esp)
 	je nmi_stack_fixup
+	pushl %eax
+	movl %esp,%eax
+	/* Do not access memory above the end of our stack page,
+	 * it might not exist.
+	 */
+	andl $0x1fff,%eax
+	cmpl $0x1fec,%eax
+	popl %eax
+	jae nmi_stack_correct
 	cmpl $sysenter_entry,12(%esp)
 	je nmi_debug_stack_check
 nmi_stack_correct:
<<<


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-31 17:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-31 18:08 [PATCH] fix sysenter crash with enabled nmi oopser manfred

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).