]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/entry/32: Fix NMI vs ESPFIX
authorPeter Zijlstra <peterz@infradead.org>
Wed, 20 Nov 2019 14:02:26 +0000 (15:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2019 09:08:08 +0000 (10:08 +0100)
commit25a997e3db80a803aba030579c54f2702194a6d3
tree850e321f23613ed59f9f2065564c8520427da4d4
parenta7f55f897d234b3df8a155a013191e5f73d39a35
x86/entry/32: Fix NMI vs ESPFIX

commit 895429076512e9d1cf5428181076299c90713159 upstream.

When the NMI lands on an ESPFIX_SS, we are on the entry stack and must
swizzle, otherwise we'll run do_nmi() on the entry stack, which is
BAD.

Also, similar to the normal exception path, we need to correct the
ESPFIX magic before leaving the entry stack, otherwise pt_regs will
present a non-flat stack pointer.

Tested by running sigreturn_32 concurrent with perf-record.

Fixes: e5862d0515ad ("x86/entry/32: Leave the kernel via trampoline stack")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/entry/entry_32.S