Skip to contentSkip to conversation

small fix to espfix code

PATCH In review Stas Sergeev 2 participants 2 messages Feb 23, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 small fix to espfix code

Hi.

The attached patch fixes a tiny
bug introduced by this patch:
http://lkml.org/lkml/2006/9/30/134
The patch was changing the espfix stack to be 32bit instead of 16bit, but this place seems to have been overlooked.
The code was like this:
---
pushl %esp
movzwl %sp, %esp
addw $4, (%esp)
---
and the patch did:
---
pushl %esp CFI_ADJUST_CFA_OFFSET 4
- movzwl %sp, %esp
addw $4, (%esp)
---
but the addw was forgotten to adjust.

The bug is mostly theoretical, I can't really test the effect of this patch. So, it is completely untested.

---
Fix tiny bug in the espfix NMI handling code. The bug was inroduced by this patch:
http://lkml.org/lkml/2006/9/30/134
and can practically never be triggered.

CC Zachary Amsden <[email protected]>
CC Chuck Ebbert <[email protected]>
arch/x86/kernel/entry_32.S +1 -1
@@ -881,7 +881,7 @@
 	CFI_ADJUST_CFA_OFFSET 4
 	pushl %esp
 	CFI_ADJUST_CFA_OFFSET 4
-	addw $4, (%esp)
+	addl $4, (%esp)
 	/* copy the iret frame of 12 bytes */
 	.rept 3
 	pushl 16(%esp)
#1 lore raw
Quoted 5 lines · Stas Sergeev

The bug is mostly theoretical, I can't
really test the effect of this patch.
So, it is completely untested.

It's not a bug, as the stack is aligned such that 16-bit overflow can't happen. However, it is arguably cleaner to have addl here.

-hpa