]> git.baikalelectronics.ru Git - 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)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 21 Nov 2019 18:37:44 +0000 (19:37 +0100)
commit76cfa86c22d904e5871b5a8f9cc7a28de5d020c2
tree7eff4b7910d6460b397c3b1601dd532536321aab
parentf23549d5f3e283949885134562abe9510e9c37e9
x86/entry/32: Fix NMI vs ESPFIX

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: b6fc43a30826 ("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
arch/x86/entry/entry_32.S