]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 5 Dec 2019 22:29:54 +0000 (16:29 -0600)
commit53cb9fc8c8b270d970e2d39e2bc9330f9076ce8f
treed2bbb685deadb0b2b7cbed2f18036bf3cc903a7d
parent8c36b3df608b75631bf6d2e4892fdb5840c21221
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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/entry/entry_32.S