aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/entry.S
diff options
context:
space:
mode:
authorStas Sergeev <stsp@aknet.ru>2005-04-16 15:24:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:24:01 -0700
commit5df240826c90afdc7956f55a004ea6b702df9203 (patch)
tree1782971ae77b3d902fdf56e77e9649b3b6c48ca4 /arch/i386/kernel/entry.S
parente493073d8d053429fbb42331b57a95dd0d61cadb (diff)
downloadlinux-5df240826c90afdc7956f55a004ea6b702df9203.tar.gz
[PATCH] fix crash in entry.S restore_all
Fix the access-above-bottom-of-stack crash. 1. Allows to preserve the valueable optimization 2. Works for NMIs 3. Doesn't care whether or not there are more of the like instances where the stack is left empty. 4. Seems to work for me without the crashes:) (akpm: this is still under discussion, although I _think_ it's OK. You might want to hold off) Signed-off-by: Stas Sergeev <stsp@aknet.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/entry.S')
-rw-r--r--arch/i386/kernel/entry.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 1e45ff292bc99..3c73dc865ead3 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -245,6 +245,9 @@ syscall_exit:
restore_all:
movl EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
+ # Warning: OLDSS(%esp) contains the wrong/random values if we
+ # are returning to the kernel.
+ # See comments in process.c:copy_thread() for details.
movb OLDSS(%esp), %ah
movb CS(%esp), %al
andl $(VM_MASK | (4 << 8) | 3), %eax