x86: save/restore eflags in context switch
(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. Tested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
@@ -209,6 +209,10 @@ ENTRY(ret_from_fork)
|
||||
GET_THREAD_INFO(%ebp)
|
||||
popl %eax
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
pushl $0x0202 # Reset kernel eflags
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
popfl
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
jmp syscall_exit
|
||||
CFI_ENDPROC
|
||||
|
||||
|
Reference in New Issue
Block a user