Skip to contentSkip to conversation

x86/bugs: Some SRSO fixes

PATCH Applied Borislav Petkov 5 participants 14 messages Aug 9, 2023 – Aug 10, 2023

Subsystems (3)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

cover x86/bugs: Some SRSO fixes

From: "Borislav Petkov (AMD)" <[email protected]>

Hi all,

those are the leftover smaller fixes which can go after the release date. I'll queue them next week.

Thx.

Borislav Petkov (AMD) (3):
Documentation/hw-vuln: Unify filename specification in index driver core: cpu: Unify redundant silly stubs Documentation/srso: Document IBPB aspect and fix formatting

 Documentation/admin-guide/hw-vuln/index.rst | 12 +--
 Documentation/admin-guide/hw-vuln/srso.rst  | 71 ++++++++++-------
 drivers/base/cpu.c                          | 86 +++++----------------
 3 files changed, 68 insertions(+), 101 deletions(-)
Signature · 1 line
2.41.0
author maintainer
#1 lore raw

PATCH 1/3 Documentation/hw-vuln: Unify filename specification in index

From: "Borislav Petkov (AMD)" <[email protected]>

Most of the index.rst files in Documentation/ refer to other rst files without their file extension in the name. Do that here too.

No functional changes.

---
 Documentation/admin-guide/hw-vuln/index.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/admin-guide/hw-vuln/index.rst +6 -6
index a7d37e124831..aeee8bff5f82 100644
@@ -13,11 +13,11 @@ are configurable at compile, boot or run time.
    l1tf
    mds
    tsx_async_abort
-   multihit.rst
-   special-register-buffer-data-sampling.rst
-   core-scheduling.rst
-   l1d_flush.rst
-   processor_mmio_stale_data.rst
-   cross-thread-rsb.rst
+   multihit
+   special-register-buffer-data-sampling
+   core-scheduling
+   l1d_flush
+   processor_mmio_stale_data
+   cross-thread-rsb
    srso
    gather_data_sampling.rst
Signature · 1 line
2.41.0
reviewer
#2 lore raw

Re: [PATCH 1/3] Documentation/hw-vuln: Unify filename specification in index

Quoted 25 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Most of the index.rst files in Documentation/ refer to other rst files without their file extension in the name. Do that here too.

No functional changes.

---
 Documentation/admin-guide/hw-vuln/index.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/admin-guide/hw-vuln/index.rst +0 -4
index a7d37e124831..aeee8bff5f82 100644
@@ -13,11 +13,11 @@ are configurable at compile, boot or run time.
    l1tf
    mds
    tsx_async_abort
-   multihit.rst
-   special-register-buffer-data-sampling.rst
-   core-scheduling.rst
-   l1d_flush.rst

Documentation/admin-guide/hw-vuln/index.rst are configurable at compile, boot or run time. · line 23

Quoted 10 lines
Documentation/admin-guide/hw-vuln/index.rst +6 -2
-   processor_mmio_stale_data.rst
-   cross-thread-rsb.rst
+   multihit
+   special-register-buffer-data-sampling
+   core-scheduling
+   l1d_flush
+   processor_mmio_stale_data
+   cross-thread-rsb
    srso
    gather_data_sampling.rst

While at it could you please also change this? Else, I will send another patch.

author maintainer
#3 lore raw

Re: [PATCH 1/3] Documentation/hw-vuln: Unify filename specification in index

Quoted 1 line · Pawan Gupta

While at it could you please also change this?

Yes, I can.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw

[tip: x86/bugs] Documentation/hw-vuln: Unify filename specification in index

In reply to Borislav Petkov
The following commit has been merged into the x86/bugs branch of tip:

The following commit has been merged into the x86/bugs branch of tip:

Commit-ID:     182ac87070e26d32a01445cec7ca7afa07411468
Gitweb:        https://git.kernel.org/tip/182ac87070e26d32a01445cec7ca7afa07411468
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Sat, 29 Jul 2023 16:53:02 +02:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Thu, 10 Aug 2023 10:48:12 +02:00

Documentation/hw-vuln: Unify filename specification in index

Most of the index.rst files in Documentation/ refer to other rst files without their file extension in the name. Do that here too.

No functional changes.

---
 Documentation/admin-guide/hw-vuln/index.rst | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/admin-guide/hw-vuln/index.rst +7 -7
index a7d37e1..de99caa 100644
@@ -13,11 +13,11 @@ are configurable at compile, boot or run time.
    l1tf
    mds
    tsx_async_abort
-   multihit.rst
-   special-register-buffer-data-sampling.rst
-   core-scheduling.rst
-   l1d_flush.rst
-   processor_mmio_stale_data.rst
-   cross-thread-rsb.rst
+   multihit
+   special-register-buffer-data-sampling
+   core-scheduling
+   l1d_flush
+   processor_mmio_stale_data
+   cross-thread-rsb
    srso
-   gather_data_sampling.rst
+   gather_data_sampling
author maintainer
#5 lore raw

PATCH 2/3 driver core: cpu: Unify redundant silly stubs

In reply to Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Make them all a weak function, aliasing to a single function which issues the "Not affected" string.

No functional changes.

---
 drivers/base/cpu.c | 86 ++++++++++------------------------------------
 1 file changed, 18 insertions(+), 68 deletions(-)
drivers/base/cpu.c +18 -68
index 52df435eecf8..971771347aa6 100644
@@ -509,79 +509,29 @@ static void __init cpu_dev_register_generic(void)
 }
 
 #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
-
-ssize_t __weak cpu_show_meltdown(struct device *dev,
-				 struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v1(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v2(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_store_bypass(struct device *dev,
-					  struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_l1tf(struct device *dev,
-			     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_mds(struct device *dev,
-			    struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_tsx_async_abort(struct device *dev,
-					struct device_attribute *attr,
-					char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_itlb_multihit(struct device *dev,
-				      struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_srbds(struct device *dev,
+ssize_t cpu_show_not_affected(struct device *dev,
 			      struct device_attribute *attr, char *buf)
 {
 	return sysfs_emit(buf, "Not affected\n");
 }
 
-ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
-					struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_retbleed(struct device *dev,
-				 struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_rstack_overflow(struct device *dev,
-					     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
+#define CPU_VULN_FALLBACK(func)						\
+	ssize_t cpu_show_##func(struct device *,			\
+				  struct device_attribute *, char *)	\
+		 __attribute__((weak, alias("cpu_show_not_affected")))
+
+CPU_VULN_FALLBACK(meltdown);
+CPU_VULN_FALLBACK(spectre_v1);
+CPU_VULN_FALLBACK(spectre_v2);
+CPU_VULN_FALLBACK(spec_store_bypass);
+CPU_VULN_FALLBACK(l1tf);
+CPU_VULN_FALLBACK(mds);
+CPU_VULN_FALLBACK(tsx_async_abort);
+CPU_VULN_FALLBACK(itlb_multihit);
+CPU_VULN_FALLBACK(srbds);
+CPU_VULN_FALLBACK(mmio_stale_data);
+CPU_VULN_FALLBACK(retbleed);
+CPU_VULN_FALLBACK(spec_rstack_overflow);
 
 ssize_t __weak cpu_show_gds(struct device *dev,
 			    struct device_attribute *attr, char *buf)
Signature · 1 line
2.41.0
reviewer
#7 lore raw

Re: [PATCH 2/3] driver core: cpu: Unify redundant silly stubs

In reply to Borislav Petkov
Quoted 86 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Make them all a weak function, aliasing to a single function which issues the "Not affected" string.

No functional changes.

---
 drivers/base/cpu.c | 86 ++++++++++------------------------------------
 1 file changed, 18 insertions(+), 68 deletions(-)
drivers/base/cpu.c +1 -59
index 52df435eecf8..971771347aa6 100644
@@ -509,79 +509,29 @@ static void __init cpu_dev_register_generic(void)
 }
 
 #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
-
-ssize_t __weak cpu_show_meltdown(struct device *dev,
-				 struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v1(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v2(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_store_bypass(struct device *dev,
-					  struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_l1tf(struct device *dev,
-			     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_mds(struct device *dev,
-			    struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_tsx_async_abort(struct device *dev,
-					struct device_attribute *attr,
-					char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_itlb_multihit(struct device *dev,
-				      struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_srbds(struct device *dev,
+ssize_t cpu_show_not_affected(struct device *dev,
 			      struct device_attribute *attr, char *buf)
 {
 	return sysfs_emit(buf, "Not affected\n");
 }
 
-ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
-					struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_retbleed(struct device *dev,
-				 struct device_attribute *attr, char *buf)

drivers/base/cpu.c static void __init cpu_dev_register_generic(void) · line 518

Quoted 10 lines
drivers/base/cpu.c +1 -9
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_rstack_overflow(struct device *dev,
-					     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
+#define CPU_VULN_FALLBACK(func)						\

Nit, its not actually a vulnerability fallback, does CPU_SHOW_VULN_FALLBACK() sound better?

Quoted 9 lines
drivers/base/cpu.c +9 -0
+	ssize_t cpu_show_##func(struct device *,			\
+				  struct device_attribute *, char *)	\
+		 __attribute__((weak, alias("cpu_show_not_affected")))
+
+CPU_VULN_FALLBACK(meltdown);
+CPU_VULN_FALLBACK(spectre_v1);
+CPU_VULN_FALLBACK(spectre_v2);
+CPU_VULN_FALLBACK(spec_store_bypass);
+CPU_VULN_FALLBACK(l1tf);

drivers/base/cpu.c static void __init cpu_dev_register_generic(void) · line 537

Quoted 10 lines
drivers/base/cpu.c +7 -0
+CPU_VULN_FALLBACK(mds);
+CPU_VULN_FALLBACK(tsx_async_abort);
+CPU_VULN_FALLBACK(itlb_multihit);
+CPU_VULN_FALLBACK(srbds);
+CPU_VULN_FALLBACK(mmio_stale_data);
+CPU_VULN_FALLBACK(retbleed);
+CPU_VULN_FALLBACK(spec_rstack_overflow);
 
 ssize_t __weak cpu_show_gds(struct device *dev,
 			    struct device_attribute *attr, char *buf)

Do you want me to send a separate patch for this?

author maintainer
#8 lore raw

Re: [PATCH 2/3] driver core: cpu: Unify redundant silly stubs

Quoted 1 line · Pawan Gupta

Do you want me to send a separate patch for this?

No need - I'll fix it up.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#9 lore raw

[tip: x86/bugs] driver core: cpu: Unify redundant silly stubs

In reply to Borislav Petkov
The following commit has been merged into the x86/bugs branch of tip:

The following commit has been merged into the x86/bugs branch of tip:

Commit-ID:     0fddfe338210aa018137c03030c581f5ea4be282
Gitweb:        https://git.kernel.org/tip/0fddfe338210aa018137c03030c581f5ea4be282
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Sat, 29 Jul 2023 17:20:33 +02:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Thu, 10 Aug 2023 11:03:04 +02:00

driver core: cpu: Unify redundant silly stubs

Make them all a weak function, aliasing to a single function which issues the "Not affected" string.

No functional changes.

---
 drivers/base/cpu.c | 87 +++++++++------------------------------------
 1 file changed, 19 insertions(+), 68 deletions(-)
drivers/base/cpu.c +19 -68
index 52df435..054c81b 100644
@@ -509,79 +509,30 @@ static void __init cpu_dev_register_generic(void)
 }
 
 #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
-
-ssize_t __weak cpu_show_meltdown(struct device *dev,
-				 struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v1(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v2(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_store_bypass(struct device *dev,
-					  struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_l1tf(struct device *dev,
-			     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_mds(struct device *dev,
-			    struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_tsx_async_abort(struct device *dev,
-					struct device_attribute *attr,
-					char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_itlb_multihit(struct device *dev,
-				      struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_srbds(struct device *dev,
+ssize_t cpu_show_not_affected(struct device *dev,
 			      struct device_attribute *attr, char *buf)
 {
 	return sysfs_emit(buf, "Not affected\n");
 }
 
-ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
-					struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_retbleed(struct device *dev,
-				 struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spec_rstack_overflow(struct device *dev,
-					     struct device_attribute *attr, char *buf)
-{
-	return sysfs_emit(buf, "Not affected\n");
-}
+#define CPU_SHOW_VULN_FALLBACK(func)					\
+	ssize_t cpu_show_##func(struct device *,			\
+				  struct device_attribute *, char *)	\
+		 __attribute__((weak, alias("cpu_show_not_affected")))
+
+CPU_SHOW_VULN_FALLBACK(meltdown);
+CPU_SHOW_VULN_FALLBACK(spectre_v1);
+CPU_SHOW_VULN_FALLBACK(spectre_v2);
+CPU_SHOW_VULN_FALLBACK(spec_store_bypass);
+CPU_SHOW_VULN_FALLBACK(l1tf);
+CPU_SHOW_VULN_FALLBACK(mds);
+CPU_SHOW_VULN_FALLBACK(tsx_async_abort);
+CPU_SHOW_VULN_FALLBACK(itlb_multihit);
+CPU_SHOW_VULN_FALLBACK(srbds);
+CPU_SHOW_VULN_FALLBACK(mmio_stale_data);
+CPU_SHOW_VULN_FALLBACK(retbleed);
+CPU_SHOW_VULN_FALLBACK(spec_rstack_overflow);
+CPU_SHOW_VULN_FALLBACK(gather_data_sampling);
 
 ssize_t __weak cpu_show_gds(struct device *dev,
 			    struct device_attribute *attr, char *buf)
author maintainer
#10 lore raw

PATCH 3/3 Documentation/srso: Document IBPB aspect and fix formatting

In reply to Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Add a note about the dependency of the User->User mitigation on the previous Spectre v2 IBPB selection.

Make the layout moar pretty.

---
 Documentation/admin-guide/hw-vuln/srso.rst | 71 ++++++++++++++--------
 1 file changed, 44 insertions(+), 27 deletions(-)
Documentation/admin-guide/hw-vuln/srso.rst +44 -27
index 32eb5e6db272..af59a9395662 100644
@@ -42,42 +42,59 @@ The sysfs file showing SRSO mitigation status is:
 
 The possible values in this file are:
 
- - 'Not affected'               The processor is not vulnerable
+ * 'Not affected':
 
- - 'Vulnerable: no microcode'   The processor is vulnerable, no
-                                microcode extending IBPB functionality
-                                to address the vulnerability has been
-                                applied.
+   The processor is not vulnerable
 
- - 'Mitigation: microcode'      Extended IBPB functionality microcode
-                                patch has been applied. It does not
-                                address User->Kernel and Guest->Host
-                                transitions protection but it does
-                                address User->User and VM->VM attack
-                                vectors.
+ * 'Vulnerable: no microcode':
 
-                                (spec_rstack_overflow=microcode)
+   The processor is vulnerable, no microcode extending IBPB
+   functionality to address the vulnerability has been applied.
 
- - 'Mitigation: safe RET'       Software-only mitigation. It complements
-                                the extended IBPB microcode patch
-                                functionality by addressing User->Kernel 
-                                and Guest->Host transitions protection.
+ * 'Mitigation: microcode':
 
-                                Selected by default or by
-                                spec_rstack_overflow=safe-ret
+   Extended IBPB functionality microcode patch has been applied. It does
+   not address User->Kernel and Guest->Host transitions protection but it
+   does address User->User and VM->VM attack vectors.
 
- - 'Mitigation: IBPB'           Similar protection as "safe RET" above
-                                but employs an IBPB barrier on privilege
-                                domain crossings (User->Kernel,
-                                Guest->Host).
+   Note that User->User mitigation is controlled by how the IBPB aspect in
+   the Spectre v2 mitigation is selected:
 
-                                (spec_rstack_overflow=ibpb)
+    * conditional IBPB:
+
+      where each process can select whether it needs an IBPB issued
+      around it PR_SPEC_DISABLE/_ENABLE etc, see :doc:`spectre`
+
+    * strict:
+
+      i.e., always on - by supplying spectre_v2_user=on on the kernel
+      command line
+
+   (spec_rstack_overflow=microcode)
+
+ * 'Mitigation: safe RET':
+
+   Software-only mitigation. It complements the extended IBPB microcode
+   patch functionality by addressing User->Kernel and Guest->Host
+   transitions protection.
+
+   Selected by default or by spec_rstack_overflow=safe-ret
+
+ * 'Mitigation: IBPB':
+
+   Similar protection as "safe RET" above but employs an IBPB barrier on
+   privilege domain crossings (User->Kernel, Guest->Host).
+
+  (spec_rstack_overflow=ibpb)
+
+ * 'Mitigation: IBPB on VMEXIT':
+
+   Mitigation addressing the cloud provider scenario - the Guest->Host
+   transitions only.
+
+   (spec_rstack_overflow=ibpb-vmexit)
 
- - 'Mitigation: IBPB on VMEXIT' Mitigation addressing the cloud provider
-                                scenario - the Guest->Host transitions
-                                only.
 
-                                (spec_rstack_overflow=ibpb-vmexit)
 
 In order to exploit vulnerability, an attacker needs to:
 
Signature · 1 line
2.41.0
reviewer
#11 lore raw

Re: [PATCH 3/3] Documentation/srso: Document IBPB aspect and fix formatting

Quoted 26 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Add a note about the dependency of the User->User mitigation on the previous Spectre v2 IBPB selection.

Make the layout moar pretty.

---
 Documentation/admin-guide/hw-vuln/srso.rst | 71 ++++++++++++++--------
 1 file changed, 44 insertions(+), 27 deletions(-)
Documentation/admin-guide/hw-vuln/srso.rst +1 -4
index 32eb5e6db272..af59a9395662 100644
@@ -42,42 +42,59 @@ The sysfs file showing SRSO mitigation status is:
 
 The possible values in this file are:
 
- - 'Not affected'               The processor is not vulnerable
+ * 'Not affected':
 
- - 'Vulnerable: no microcode'   The processor is vulnerable, no
-                                microcode extending IBPB functionality
-                                to address the vulnerability has been

Documentation/admin-guide/hw-vuln/srso.rst The sysfs file showing SRSO mitigation status is: · line 49

Quoted 10 lines
Documentation/admin-guide/hw-vuln/srso.rst +2 -7
-                                applied.
+   The processor is not vulnerable
 
- - 'Mitigation: microcode'      Extended IBPB functionality microcode
-                                patch has been applied. It does not
-                                address User->Kernel and Guest->Host
-                                transitions protection but it does
-                                address User->User and VM->VM attack
-                                vectors.
+ * 'Vulnerable: no microcode':

All other mitigations capitalizes the first letter, to be consistent s/no microcode/No microcode/

Documentation/admin-guide/hw-vuln/srso.rst The sysfs file showing SRSO mitigation status is: · line 54

Quoted 9 lines
Documentation/admin-guide/hw-vuln/srso.rst +3 -5
-                                (spec_rstack_overflow=microcode)
+   The processor is vulnerable, no microcode extending IBPB
+   functionality to address the vulnerability has been applied.
 
- - 'Mitigation: safe RET'       Software-only mitigation. It complements
-                                the extended IBPB microcode patch
-                                functionality by addressing User->Kernel 
-                                and Guest->Host transitions protection.
+ * 'Mitigation: microcode':

Ditto.

#12 lore raw

[tip: x86/bugs] Documentation/srso: Document IBPB aspect and fix formatting

In reply to Borislav Petkov
The following commit has been merged into the x86/bugs branch of tip:

The following commit has been merged into the x86/bugs branch of tip:

Commit-ID:     09f9f37c324d90102e8574856ab168c34de1916d
Gitweb:        https://git.kernel.org/tip/09f9f37c324d90102e8574856ab168c34de1916d
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Wed, 02 Aug 2023 20:07:32 +02:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Thu, 10 Aug 2023 11:03:12 +02:00

Documentation/srso: Document IBPB aspect and fix formatting

Add a note about the dependency of the User->User mitigation on the previous Spectre v2 IBPB selection.

Make the layout moar pretty.

---
 Documentation/admin-guide/hw-vuln/srso.rst | 71 +++++++++++++--------
 1 file changed, 44 insertions(+), 27 deletions(-)
Documentation/admin-guide/hw-vuln/srso.rst +44 -27
index 32eb5e6..af59a93 100644
@@ -42,42 +42,59 @@ The sysfs file showing SRSO mitigation status is:
 
 The possible values in this file are:
 
- - 'Not affected'               The processor is not vulnerable
+ * 'Not affected':
 
- - 'Vulnerable: no microcode'   The processor is vulnerable, no
-                                microcode extending IBPB functionality
-                                to address the vulnerability has been
-                                applied.
+   The processor is not vulnerable
 
- - 'Mitigation: microcode'      Extended IBPB functionality microcode
-                                patch has been applied. It does not
-                                address User->Kernel and Guest->Host
-                                transitions protection but it does
-                                address User->User and VM->VM attack
-                                vectors.
+ * 'Vulnerable: no microcode':
 
-                                (spec_rstack_overflow=microcode)
+   The processor is vulnerable, no microcode extending IBPB
+   functionality to address the vulnerability has been applied.
 
- - 'Mitigation: safe RET'       Software-only mitigation. It complements
-                                the extended IBPB microcode patch
-                                functionality by addressing User->Kernel 
-                                and Guest->Host transitions protection.
+ * 'Mitigation: microcode':
 
-                                Selected by default or by
-                                spec_rstack_overflow=safe-ret
+   Extended IBPB functionality microcode patch has been applied. It does
+   not address User->Kernel and Guest->Host transitions protection but it
+   does address User->User and VM->VM attack vectors.
 
- - 'Mitigation: IBPB'           Similar protection as "safe RET" above
-                                but employs an IBPB barrier on privilege
-                                domain crossings (User->Kernel,
-                                Guest->Host).
+   Note that User->User mitigation is controlled by how the IBPB aspect in
+   the Spectre v2 mitigation is selected:
 
-                                (spec_rstack_overflow=ibpb)
+    * conditional IBPB:
+
+      where each process can select whether it needs an IBPB issued
+      around it PR_SPEC_DISABLE/_ENABLE etc, see :doc:`spectre`
+
+    * strict:
+
+      i.e., always on - by supplying spectre_v2_user=on on the kernel
+      command line
+
+   (spec_rstack_overflow=microcode)
+
+ * 'Mitigation: safe RET':
+
+   Software-only mitigation. It complements the extended IBPB microcode
+   patch functionality by addressing User->Kernel and Guest->Host
+   transitions protection.
+
+   Selected by default or by spec_rstack_overflow=safe-ret
+
+ * 'Mitigation: IBPB':
+
+   Similar protection as "safe RET" above but employs an IBPB barrier on
+   privilege domain crossings (User->Kernel, Guest->Host).
+
+  (spec_rstack_overflow=ibpb)
+
+ * 'Mitigation: IBPB on VMEXIT':
+
+   Mitigation addressing the cloud provider scenario - the Guest->Host
+   transitions only.
+
+   (spec_rstack_overflow=ibpb-vmexit)
 
- - 'Mitigation: IBPB on VMEXIT' Mitigation addressing the cloud provider
-                                scenario - the Guest->Host transitions
-                                only.
 
-                                (spec_rstack_overflow=ibpb-vmexit)
 
 In order to exploit vulnerability, an attacker needs to:
 
maintainer Reviewed-by on the v1 series
#13 lore raw
In reply to Borislav Petkov
Quoted 14 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Hi all,

those are the leftover smaller fixes which can go after the release date. I'll queue them next week.

Thx.

Borislav Petkov (AMD) (3):
Documentation/hw-vuln: Unify filename specification in index driver core: cpu: Unify redundant silly stubs Documentation/srso: Document IBPB aspect and fix formatting

Quoted 8 lines
 Documentation/admin-guide/hw-vuln/index.rst | 12 +--
 Documentation/admin-guide/hw-vuln/srso.rst  | 71 ++++++++++-------
 drivers/base/cpu.c                          | 86 +++++----------------
 3 files changed, 68 insertions(+), 101 deletions(-)
Signature · 1 line
2.41.0