x86, entry: Switch stacks on a paranoid entry from userspace
authorAndy Lutomirski <luto@amacapital.net>
Tue, 11 Nov 2014 20:49:41 +0000 (12:49 -0800)
committerAndy Lutomirski <luto@amacapital.net>
Fri, 2 Jan 2015 18:22:45 +0000 (10:22 -0800)
commit48e08d0fb265b007ebbb29a72297ff7e40938969
tree424a8207cc53c2b0dfbd9fb12bee15952ce822ae
parent734d16801349fbe951d2f780191d32c5b8a892d1
x86, entry: Switch stacks on a paranoid entry from userspace

This causes all non-NMI, non-double-fault kernel entries from
userspace to run on the normal kernel stack.  Double-fault is
exempt to minimize confusion if we double-fault directly from
userspace due to a bad kernel stack.

This is, suprisingly, simpler and shorter than the current code.  It
removes the IMO rather frightening paranoid_userspace path, and it
make sync_regs much simpler.

There is no risk of stack overflow due to this change -- the kernel
stack that we switch to is empty.

This will also enable us to create non-atomic sections within
machine checks from userspace, which will simplify memory failure
handling.  It will also allow the upcoming fsgsbase code to be
simplified, because it doesn't need to worry about usergs when
scheduling in paranoid_exit, as that code no longer exists.

Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Tony Luck <tony.luck@intel.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Documentation/x86/entry_64.txt
Documentation/x86/x86_64/kernel-stacks
arch/x86/kernel/entry_64.S
arch/x86/kernel/traps.c
This page took 0.026533 seconds and 5 git commands to generate.