• Andi Kleen's avatar
    x86/split-lock: Avoid returning with interrupts enabled · e14fd4ba
    Andi Kleen authored
    When a split lock is detected always make sure to disable interrupts
    before returning from the trap handler.
    
    The kernel exit code assumes that all exits run with interrupts
    disabled, otherwise the SWAPGS sequence can race against interrupts and
    cause recursing page faults and later panics.
    
    The problem will only happen on CPUs with split lock disable
    functionality, so Icelake Server, Tiger Lake, Snow Ridge, Jacobsville.
    
    Fixes: ca4c6a98 ("x86/traps: Make interrupt enable/disable symmetric in C code")
    Fixes: bce9b042 ("x86/traps: Disable interrupts in exc_aligment_check()") # v5.8+
    Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e14fd4ba
traps.c 31.8 KB