• Peter Zijlstra's avatar
    x86/entry/32: Fix NMI vs ESPFIX · 89542907
    Peter Zijlstra authored
    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: e5862d05 ("x86/entry/32: Leave the kernel via trampoline stack")
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
    Cc: stable@kernel.org
    89542907
entry_32.S 40.2 KB