summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2007-01-04 23:23:27 +0100
committerAdrian Bunk <bunk@stusta.de>2007-01-04 23:23:27 +0100
commit09d9056ce65466da2a4634c62fcfecfa70fc9605 (patch)
treefe562e70b2fa660de32148a7a981843130025bee /arch
parentbb3e712f45f05c380ee6efed0afd588ed3ce18fb (diff)
i386: save/restore eflags in context switch (CVE-2006-5173)
(And reset it on new thread creation) It turns out that eflags is important to save and restore not just because of iopl, but due to the magic bits like the NT bit, which we don't want leaking between different threads. Backported to 2.6.16 by Chuck Ebbert <76306.1226@compuserve.com> [Backport consisted of removing the CFI annotations.] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/entry.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 4d704724b2f5..a14218c9ec6c 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -128,6 +128,8 @@ ENTRY(ret_from_fork)
call schedule_tail
GET_THREAD_INFO(%ebp)
popl %eax
+ pushl $0x0202 # Reset kernel eflags
+ popfl
jmp syscall_exit
/*