• Yazen Ghannam's avatar
    x86/MCE/AMD: Always give panic severity for UC errors in kernel context · d65dfc81
    Yazen Ghannam authored
    The AMD severity grading function was introduced in kernel 4.1. The
    current logic can possibly give MCE_AR_SEVERITY for uncorrectable
    errors in kernel context. The system may then get stuck in a loop as
    memory_failure() will try to handle the bad kernel memory and find it
    busy.
    
    Return MCE_PANIC_SEVERITY for all UC errors IN_KERNEL context on AMD
    systems.
    
    After:
    
      b2f9d678 ("x86/mce: Check for faults tagged in EXTABLE_CLASS_FAULT exception table entries")
    
    was accepted in v4.6, this issue was masked because of the tail-end attempt
    at kernel mode recovery in the #MC handler.
    
    However, uncorrectable errors IN_KERNEL context should always be considered
    unrecoverable and cause a panic.
    Signed-off-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: <stable@vger.kernel.org> # 4.9.x
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: linux-edac <linux-edac@vger.kernel.org>
    Fixes: bf80bbd7 (x86/mce: Add an AMD severities-grading function)
    Link: http://lkml.kernel.org/r/20171106174633.13576-1-bp@alien8.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    d65dfc81
mce-severity.c 10.4 KB