FAILED: patch "[PATCH] x86/bugs: Add "unknown" reporting for MMIO Stale Data" failed to apply to 4.9-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7df548840c496b0141fb2404b889c346380c2b22 Mon Sep 17 00:00:00 2001
From: Pawan Gupta <[email protected]>
Date: Wed, 3 Aug 2022 14:41:32 -0700
Subject: [PATCH] x86/bugs: Add "unknown" reporting for MMIO Stale Data
Older Intel CPUs that are not in the affected processor list for MMIO Stale Data vulnerabilities currently report "Not affected" in sysfs, which may not be correct. Vulnerability status for these older CPUs is unknown.
Add known-not-affected CPUs to the whitelist. Report "unknown" mitigation status for CPUs that are not in blacklist, whitelist and also don't enumerate MSR ARCH_CAPABILITIES bits that reflect hardware immunity to MMIO Stale Data vulnerabilities.
Mitigation is not deployed when the status is unknown.
[ bp: Massage, fixup. ]
Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst +14 -0
@@ -230,6 +230,20 @@ The possible values in this file are: * - 'Mitigation: Clear CPU buffers' - The processor is vulnerable and the CPU buffer clearing mitigation is enabled. + * - 'Unknown: No mitigations' + - The processor vulnerability status is unknown because it is + out of Servicing period. Mitigation is not attempted. + +Definitions: +------------ + +Servicing period: The process of providing functional and security updates to +Intel processors or platforms, utilizing the Intel Platform Update (IPU) +process or other similar mechanisms. + +End of Servicing Updates (ESU): ESU is the date at which Intel will no +longer provide Servicing, such as through IPU or other similar update +processes. ESU dates will typically be aligned to end of quarter. If the processor is vulnerable then the following information is appended to the above information:
arch/x86/include/asm/cpufeatures.h +3 -2
@@ -457,7 +457,8 @@#define X86_BUG_ITLB_MULTIHIT X86_BUG(23)/* CPU may incur MCE during certain page attribute changes */ #define X86_BUG_SRBDS X86_BUG(24)/* CPU may leak RNG bits if not mitigated */ #define X86_BUG_MMIO_STALE_DATA X86_BUG(25)/* CPU is affected by Processor MMIO Stale Data vulnerabilities */ -#define X86_BUG_RETBLEED X86_BUG(26)/* CPU is affected by RETBleed */ -#define X86_BUG_EIBRS_PBRSB X86_BUG(27)/* EIBRS is vulnerable to Post Barrier RSB Predictions */ +#define X86_BUG_MMIO_UNKNOWN X86_BUG(26)/* CPU is too old and its MMIO Stale Data status is unknown */ +#define X86_BUG_RETBLEED X86_BUG(27)/* CPU is affected by RETBleed */ +#define X86_BUG_EIBRS_PBRSB X86_BUG(28)/* EIBRS is vulnerable to Post Barrier RSB Predictions */ #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/kernel/cpu/bugs.c +12 -2
@@ -433,7 +433,8 @@ static void __init mmio_select_mitigation(void)u64 ia32_cap;if (!boot_cpu_has_bug (X86_BUG_MMIO_STALE_DATA ) || -cpu_mitigations_off ()) { +boot_cpu_has_bug (X86_BUG_MMIO_UNKNOWN ) || +cpu_mitigations_off ()) { mmio_mitigation =MMIO_MITIGATION_OFF ;return ; }
@@ -538,6 +539,8 @@ out:pr_info ("TAA: %s\n" , taa_strings[taa_mitigation]);if (boot_cpu_has_bug (X86_BUG_MMIO_STALE_DATA ))pr_info ("MMIO Stale Data: %s\n" , mmio_strings[mmio_mitigation]); +else if (boot_cpu_has_bug (X86_BUG_MMIO_UNKNOWN )) +pr_info ("MMIO Stale Data: Unknown: No mitigations\n" ); }static void __init md_clear_select_mitigation (void )
@@ -2275,6 +2278,9 @@ static ssize_t tsx_async_abort_show_state(char *buf)static ssize_t mmio_stale_data_show_state (char *buf) { +if (boot_cpu_has_bug (X86_BUG_MMIO_UNKNOWN )) +return sysfs_emit (buf,"Unknown: No mitigations\n" ); +if (mmio_mitigation ==MMIO_MITIGATION_OFF )return sysfs_emit (buf,"%s\n" , mmio_strings[mmio_mitigation]);
@@ -2421,6 +2427,7 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attrreturn srbds_show_state (buf);case X86_BUG_MMIO_STALE_DATA : +case X86_BUG_MMIO_UNKNOWN :return mmio_stale_data_show_state (buf);case X86_BUG_RETBLEED :
@@ -2480,7 +2487,10 @@ ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *ssize_t cpu_show_mmio_stale_data (struct device *dev,struct device_attribute *attr,char *buf) { -return cpu_show_common (dev, attr, buf,X86_BUG_MMIO_STALE_DATA ); +if (boot_cpu_has_bug (X86_BUG_MMIO_UNKNOWN )) +return cpu_show_common (dev, attr, buf,X86_BUG_MMIO_UNKNOWN ); +else +return cpu_show_common (dev, attr, buf,X86_BUG_MMIO_STALE_DATA ); }ssize_t cpu_show_retbleed (struct device *dev,struct device_attribute *attr,char *buf)
arch/x86/kernel/cpu/common.c +27 -15
77 lines not on this page · raw message