Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:30 +0100
commita5e94d69278bf756435c5114e342a2cac89e7d72 (patch)
tree570fa1c02a8a7ea4877a4cc71ddbd40971fd2dc5
parentdc63ddf5cca3d5e754afe82a198314d64b9d1e1d (diff)
x86/MCE: Initialize mce.bank in the case of a fatal error in
mce_no_way_out() (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch57
-rw-r--r--series.conf1
2 files changed, 58 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch b/patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch
new file mode 100644
index 0000000000..2ca41395f3
--- /dev/null
+++ b/patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch
@@ -0,0 +1,57 @@
+From: Tony Luck <tony.luck@intel.com>
+Date: Thu, 31 Jan 2019 16:33:41 -0800
+Subject: [PATCH] x86/MCE: Initialize mce.bank in the case of a fatal error in
+ mce_no_way_out()
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: d28af26faa0b1daf3c692603d46bc4687c16f19e
+
+commit d28af26faa0b1daf3c692603d46bc4687c16f19e upstream.
+
+Internal injection testing crashed with a console log that said:
+
+ mce: [Hardware Error]: CPU 7: Machine Check Exception: f Bank 0: bd80000000100134
+
+This caused a lot of head scratching because the MCACOD (bits 15:0) of
+that status is a signature from an L1 data cache error. But Linux says
+that it found it in "Bank 0", which on this model CPU only reports L1
+instruction cache errors.
+
+The answer was that Linux doesn't initialize "m->bank" in the case that
+it finds a fatal error in the mce_no_way_out() pre-scan of banks. If
+this was a local machine check, then this partially initialized struct
+mce is being passed to mce_panic().
+
+Fix is simple: just initialize m->bank in the case of a fatal error.
+
+Fixes: 40c36e2741d7 ("x86/mce: Fix incorrect "Machine check from unknown source" message")
+Signed-off-by: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vishal Verma <vishal.l.verma@intel.com>
+Cc: x86-ml <x86@kernel.org>
+Cc: stable@vger.kernel.org # v4.18 Note pre-v5.0 arch/x86/kernel/cpu/mce/core.c was called arch/x86/kernel/cpu/mcheck/mce.c
+Link: https://lkml.kernel.org/r/20190201003341.10638-1-tony.luck@intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ arch/x86/kernel/cpu/mcheck/mce.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
+index 36d2696c9563..84089c2342c0 100644
+--- a/arch/x86/kernel/cpu/mcheck/mce.c
++++ b/arch/x86/kernel/cpu/mcheck/mce.c
+@@ -786,6 +786,7 @@ static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp,
+ quirk_no_way_out(i, m, regs);
+
+ if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) {
++ m->bank = i;
+ mce_read_aux(m, i);
+ *msg = tmp;
+ return 1;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index a552f32d9f..93cdf9e13d 100644
--- a/series.conf
+++ b/series.conf
@@ -1072,6 +1072,7 @@
patches.kernel.org/4.20.8-333-cpu-hotplug-Fix-SMT-disabled-by-BIOS-detection.patch
patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch
patches.kernel.org/4.20.8-335-perf-x86-intel-Delay-memory-deallocation-until.patch
+ patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch
########################################################
# Build fixes that apply to the vanilla kernel too.