* [PATCH v4 01/11] x86/bugs: Add a separate config for MDS
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 02/11] x86/bugs: Add a separate config for TAA Breno Leitao
` (9 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the MDS CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 9 +++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 007bab9f2a0e..36e871ab1ef9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2650,6 +2650,15 @@ config MITIGATION_SPECTRE_BHI
indirect branches.
See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+config MITIGATION_MDS
+ bool "Mitigate Microarchitectural Data Sampling (MDS) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Microarchitectural Data Sampling (MDS). MDS is
+ a hardware vulnerability which allows unprivileged speculative access
+ to data which is available in various CPU internal buffers.
+ See also <file:Documentation/admin-guide/hw-vuln/mds.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 45675da354f3..dbfc7d5c5f48 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -233,7 +233,8 @@ static void x86_amd_ssb_disable(void)
#define pr_fmt(fmt) "MDS: " fmt
/* Default mitigation for MDS-affected CPUs */
-static enum mds_mitigations mds_mitigation __ro_after_init = MDS_MITIGATION_FULL;
+static enum mds_mitigations mds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_MDS) ? MDS_MITIGATION_FULL : MDS_MITIGATION_OFF;
static bool mds_nosmt __ro_after_init = false;
static const char * const mds_strings[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for MDS
2024-07-29 16:40 ` [PATCH v4 01/11] x86/bugs: Add a separate config for MDS Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 940455681d94a4100f024097737e502e93273f26
Gitweb: https://git.kernel.org/tip/940455681d94a4100f024097737e502e93273f26
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:49 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 10:17:36 +02:00
x86/bugs: Add a separate config for MDS
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the MDS CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-2-leitao@debian.org
---
arch/x86/Kconfig | 9 +++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 007bab9..36e871a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2650,6 +2650,15 @@ config MITIGATION_SPECTRE_BHI
indirect branches.
See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+config MITIGATION_MDS
+ bool "Mitigate Microarchitectural Data Sampling (MDS) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Microarchitectural Data Sampling (MDS). MDS is
+ a hardware vulnerability which allows unprivileged speculative access
+ to data which is available in various CPU internal buffers.
+ See also <file:Documentation/admin-guide/hw-vuln/mds.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 45675da..dbfc7d5 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -233,7 +233,8 @@ static void x86_amd_ssb_disable(void)
#define pr_fmt(fmt) "MDS: " fmt
/* Default mitigation for MDS-affected CPUs */
-static enum mds_mitigations mds_mitigation __ro_after_init = MDS_MITIGATION_FULL;
+static enum mds_mitigations mds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_MDS) ? MDS_MITIGATION_FULL : MDS_MITIGATION_OFF;
static bool mds_nosmt __ro_after_init = false;
static const char * const mds_strings[] = {
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 02/11] x86/bugs: Add a separate config for TAA
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
2024-07-29 16:40 ` [PATCH v4 01/11] x86/bugs: Add a separate config for MDS Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 03/11] x86/bugs: Add a separate config for MMIO Stable Data Breno Leitao
` (8 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the TAA CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 11 +++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 36e871ab1ef9..712a4f8cb7dd 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2659,6 +2659,17 @@ config MITIGATION_MDS
a hardware vulnerability which allows unprivileged speculative access
to data which is available in various CPU internal buffers.
See also <file:Documentation/admin-guide/hw-vuln/mds.rst>
+
+config MITIGATION_TAA
+ bool "Mitigate TSX Asynchronous Abort (TAA) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for TSX Asynchronous Abort (TAA). TAA is a hardware
+ vulnerability that allows unprivileged speculative access to data
+ which is available in various CPU internal buffers by using
+ asynchronous aborts within an Intel TSX transactional region.
+ See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index dbfc7d5c5f48..ab306986762d 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -294,7 +294,8 @@ enum taa_mitigations {
};
/* Default mitigation for TAA-affected CPUs */
-static enum taa_mitigations taa_mitigation __ro_after_init = TAA_MITIGATION_VERW;
+static enum taa_mitigations taa_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_TAA) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF;
static bool taa_nosmt __ro_after_init;
static const char * const taa_strings[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for TAA
2024-07-29 16:40 ` [PATCH v4 02/11] x86/bugs: Add a separate config for TAA Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: b8da0b33d3899e5911aaf0220a317545fe2e3b37
Gitweb: https://git.kernel.org/tip/b8da0b33d3899e5911aaf0220a317545fe2e3b37
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:50 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 10:36:16 +02:00
x86/bugs: Add a separate config for TAA
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the TAA CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-3-leitao@debian.org
---
arch/x86/Kconfig | 11 +++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 36e871a..712a4f8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2659,6 +2659,17 @@ config MITIGATION_MDS
a hardware vulnerability which allows unprivileged speculative access
to data which is available in various CPU internal buffers.
See also <file:Documentation/admin-guide/hw-vuln/mds.rst>
+
+config MITIGATION_TAA
+ bool "Mitigate TSX Asynchronous Abort (TAA) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for TSX Asynchronous Abort (TAA). TAA is a hardware
+ vulnerability that allows unprivileged speculative access to data
+ which is available in various CPU internal buffers by using
+ asynchronous aborts within an Intel TSX transactional region.
+ See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index dbfc7d5..ab30698 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -294,7 +294,8 @@ enum taa_mitigations {
};
/* Default mitigation for TAA-affected CPUs */
-static enum taa_mitigations taa_mitigation __ro_after_init = TAA_MITIGATION_VERW;
+static enum taa_mitigations taa_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_TAA) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF;
static bool taa_nosmt __ro_after_init;
static const char * const taa_strings[] = {
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 03/11] x86/bugs: Add a separate config for MMIO Stable Data
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
2024-07-29 16:40 ` [PATCH v4 01/11] x86/bugs: Add a separate config for MDS Breno Leitao
2024-07-29 16:40 ` [PATCH v4 02/11] x86/bugs: Add a separate config for TAA Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 04/11] x86/bugs: Add a separate config for L1TF Breno Leitao
` (7 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the MMIO Stale data CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 12 ++++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 712a4f8cb7dd..b169677ec4ac 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2670,6 +2670,18 @@ config MITIGATION_TAA
which is available in various CPU internal buffers by using
asynchronous aborts within an Intel TSX transactional region.
See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
+
+config MITIGATION_MMIO_STALE_DATA
+ bool "Mitigate MMIO Stale Data hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for MMIO Stale Data hardware bugs. Processor MMIO
+ Stale Data Vulnerabilities are a class of memory-mapped I/O (MMIO)
+ vulnerabilities that can expose data. The vulnerabilities require the
+ attacker to have access to MMIO.
+ See also
+ <file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index ab306986762d..9b0d058f3fe8 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -393,7 +393,8 @@ enum mmio_mitigations {
};
/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
-static enum mmio_mitigations mmio_mitigation __ro_after_init = MMIO_MITIGATION_VERW;
+static enum mmio_mitigations mmio_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_MMIO_STALE_DATA) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF;
static bool mmio_nosmt __ro_after_init = false;
static const char * const mmio_strings[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for MMIO Stable Data
2024-07-29 16:40 ` [PATCH v4 03/11] x86/bugs: Add a separate config for MMIO Stable Data Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 163f9fe6b625c5f5c4d5b05265b194388182454b
Gitweb: https://git.kernel.org/tip/163f9fe6b625c5f5c4d5b05265b194388182454b
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:51 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 10:56:20 +02:00
x86/bugs: Add a separate config for MMIO Stable Data
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the MMIO Stale data CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-4-leitao@debian.org
---
arch/x86/Kconfig | 12 ++++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 712a4f8..b169677 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2670,6 +2670,18 @@ config MITIGATION_TAA
which is available in various CPU internal buffers by using
asynchronous aborts within an Intel TSX transactional region.
See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
+
+config MITIGATION_MMIO_STALE_DATA
+ bool "Mitigate MMIO Stale Data hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for MMIO Stale Data hardware bugs. Processor MMIO
+ Stale Data Vulnerabilities are a class of memory-mapped I/O (MMIO)
+ vulnerabilities that can expose data. The vulnerabilities require the
+ attacker to have access to MMIO.
+ See also
+ <file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index ab30698..9b0d058 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -393,7 +393,8 @@ enum mmio_mitigations {
};
/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
-static enum mmio_mitigations mmio_mitigation __ro_after_init = MMIO_MITIGATION_VERW;
+static enum mmio_mitigations mmio_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_MMIO_STALE_DATA) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF;
static bool mmio_nosmt __ro_after_init = false;
static const char * const mmio_strings[] = {
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 04/11] x86/bugs: Add a separate config for L1TF
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (2 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 03/11] x86/bugs: Add a separate config for MMIO Stable Data Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 05/11] x86/bugs: Add a separate config for RETBLEED Breno Leitao
` (6 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the L1TF CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b169677ec4ac..290f0865fd85 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2682,6 +2682,16 @@ config MITIGATION_MMIO_STALE_DATA
attacker to have access to MMIO.
See also
<file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
+
+config MITIGATION_L1TF
+ bool "Mitigate L1 Terminal Fault (L1TF) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Mitigate L1 Terminal Fault (L1TF) hardware bug. L1 Terminal Fault is a
+ hardware vulnerability which allows unprivileged speculative access to data
+ available in the Level 1 Data Cache.
+ See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 9b0d058f3fe8..4fde9bd368ad 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2374,7 +2374,8 @@ EXPORT_SYMBOL_GPL(itlb_multihit_kvm_mitigation);
#define pr_fmt(fmt) "L1TF: " fmt
/* Default mitigation for L1TF-affected CPUs */
-enum l1tf_mitigations l1tf_mitigation __ro_after_init = L1TF_MITIGATION_FLUSH;
+enum l1tf_mitigations l1tf_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_L1TF) ? L1TF_MITIGATION_FLUSH : L1TF_MITIGATION_OFF;
#if IS_ENABLED(CONFIG_KVM_INTEL)
EXPORT_SYMBOL_GPL(l1tf_mitigation);
#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for L1TF
2024-07-29 16:40 ` [PATCH v4 04/11] x86/bugs: Add a separate config for L1TF Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 3a4ee4ff819b2bd09f1eca4a90846f2be449bd51
Gitweb: https://git.kernel.org/tip/3a4ee4ff819b2bd09f1eca4a90846f2be449bd51
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:52 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 11:23:17 +02:00
x86/bugs: Add a separate config for L1TF
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the L1TF CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-5-leitao@debian.org
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b169677..290f086 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2682,6 +2682,16 @@ config MITIGATION_MMIO_STALE_DATA
attacker to have access to MMIO.
See also
<file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
+
+config MITIGATION_L1TF
+ bool "Mitigate L1 Terminal Fault (L1TF) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Mitigate L1 Terminal Fault (L1TF) hardware bug. L1 Terminal Fault is a
+ hardware vulnerability which allows unprivileged speculative access to data
+ available in the Level 1 Data Cache.
+ See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 9b0d058..4fde9bd 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2374,7 +2374,8 @@ EXPORT_SYMBOL_GPL(itlb_multihit_kvm_mitigation);
#define pr_fmt(fmt) "L1TF: " fmt
/* Default mitigation for L1TF-affected CPUs */
-enum l1tf_mitigations l1tf_mitigation __ro_after_init = L1TF_MITIGATION_FLUSH;
+enum l1tf_mitigations l1tf_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_L1TF) ? L1TF_MITIGATION_FLUSH : L1TF_MITIGATION_OFF;
#if IS_ENABLED(CONFIG_KVM_INTEL)
EXPORT_SYMBOL_GPL(l1tf_mitigation);
#endif
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 05/11] x86/bugs: Add a separate config for RETBLEED
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (3 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 04/11] x86/bugs: Add a separate config for L1TF Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 06/11] x86/bugs: Add a separate config for Spectre v1 Breno Leitao
` (5 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the RETBLEED CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 13 +++++++++++++
arch/x86/kernel/cpu/bugs.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 290f0865fd85..c9a9f928dddf 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2692,6 +2692,19 @@ config MITIGATION_L1TF
hardware vulnerability which allows unprivileged speculative access to data
available in the Level 1 Data Cache.
See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
+
+config MITIGATION_RETBLEED
+ bool "Mitigate RETBleed hardware bug"
+ depends on (CPU_SUP_INTEL && MITIGATION_SPECTRE_V2) || MITIGATION_UNRET_ENTRY || MITIGATION_IBPB_ENTRY
+ default y
+ help
+ Enable mitigation for RETBleed (Arbitrary Speculative Code Execution
+ with Return Instructions) vulnerability. RETBleed is a speculative
+ execution attack which takes advantage of microarchitectural behavior
+ in many modern microprocessors, similar to Spectre v2. An
+ unprivileged attacker can use these flaws to bypass conventional
+ memory security restrictions to gain read access to privileged memory
+ that would otherwise be inaccessible.
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 4fde9bd368ad..08edca8c2c1f 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -989,7 +989,7 @@ static const char * const retbleed_strings[] = {
static enum retbleed_mitigation retbleed_mitigation __ro_after_init =
RETBLEED_MITIGATION_NONE;
static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init =
- RETBLEED_CMD_AUTO;
+ IS_ENABLED(CONFIG_MITIGATION_RETBLEED) ? RETBLEED_CMD_AUTO : RETBLEED_CMD_OFF;
static int __ro_after_init retbleed_nosmt = false;
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for RETBLEED
2024-07-29 16:40 ` [PATCH v4 05/11] x86/bugs: Add a separate config for RETBLEED Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 894e28857c112c5a31517b3837b507f1dcbe9da5
Gitweb: https://git.kernel.org/tip/894e28857c112c5a31517b3837b507f1dcbe9da5
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:53 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:48:54 +02:00
x86/bugs: Add a separate config for RETBLEED
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the RETBLEED CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-6-leitao@debian.org
---
arch/x86/Kconfig | 13 +++++++++++++
arch/x86/kernel/cpu/bugs.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 290f086..c9a9f92 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2692,6 +2692,19 @@ config MITIGATION_L1TF
hardware vulnerability which allows unprivileged speculative access to data
available in the Level 1 Data Cache.
See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
+
+config MITIGATION_RETBLEED
+ bool "Mitigate RETBleed hardware bug"
+ depends on (CPU_SUP_INTEL && MITIGATION_SPECTRE_V2) || MITIGATION_UNRET_ENTRY || MITIGATION_IBPB_ENTRY
+ default y
+ help
+ Enable mitigation for RETBleed (Arbitrary Speculative Code Execution
+ with Return Instructions) vulnerability. RETBleed is a speculative
+ execution attack which takes advantage of microarchitectural behavior
+ in many modern microprocessors, similar to Spectre v2. An
+ unprivileged attacker can use these flaws to bypass conventional
+ memory security restrictions to gain read access to privileged memory
+ that would otherwise be inaccessible.
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 4fde9bd..08edca8 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -989,7 +989,7 @@ static const char * const retbleed_strings[] = {
static enum retbleed_mitigation retbleed_mitigation __ro_after_init =
RETBLEED_MITIGATION_NONE;
static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init =
- RETBLEED_CMD_AUTO;
+ IS_ENABLED(CONFIG_MITIGATION_RETBLEED) ? RETBLEED_CMD_AUTO : RETBLEED_CMD_OFF;
static int __ro_after_init retbleed_nosmt = false;
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 06/11] x86/bugs: Add a separate config for Spectre v1
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (4 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 05/11] x86/bugs: Add a separate config for RETBLEED Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 07/11] x86/bugs: Add a separate config for SRBDS Breno Leitao
` (4 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the Spectre v1 CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9a9f928dddf..e3c63e5208ab 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2705,6 +2705,16 @@ config MITIGATION_RETBLEED
unprivileged attacker can use these flaws to bypass conventional
memory security restrictions to gain read access to privileged memory
that would otherwise be inaccessible.
+
+config MITIGATION_SPECTRE_V1
+ bool "Mitigate SPECTRE V1 hardware bug"
+ default y
+ help
+ Enable mitigation for Spectre V1 (Bounds Check Bypass). Spectre V1 is a
+ class of side channel attacks that takes advantage of speculative
+ execution that bypasses conditional branch instructions used for
+ memory access bounds check.
+ See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 08edca8c2c1f..ebb6a2f578d1 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -874,7 +874,8 @@ enum spectre_v1_mitigation {
};
static enum spectre_v1_mitigation spectre_v1_mitigation __ro_after_init =
- SPECTRE_V1_MITIGATION_AUTO;
+ IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V1) ?
+ SPECTRE_V1_MITIGATION_AUTO : SPECTRE_V1_MITIGATION_NONE;
static const char * const spectre_v1_strings[] = {
[SPECTRE_V1_MITIGATION_NONE] = "Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers",
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for Spectre v1
2024-07-29 16:40 ` [PATCH v4 06/11] x86/bugs: Add a separate config for Spectre v1 Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: ca01c0d8d03089f81c713aec0c63d359bc0f6796
Gitweb: https://git.kernel.org/tip/ca01c0d8d03089f81c713aec0c63d359bc0f6796
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:54 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:49:28 +02:00
x86/bugs: Add a separate config for Spectre v1
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the Spectre v1 CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-7-leitao@debian.org
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9a9f92..e3c63e5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2705,6 +2705,16 @@ config MITIGATION_RETBLEED
unprivileged attacker can use these flaws to bypass conventional
memory security restrictions to gain read access to privileged memory
that would otherwise be inaccessible.
+
+config MITIGATION_SPECTRE_V1
+ bool "Mitigate SPECTRE V1 hardware bug"
+ default y
+ help
+ Enable mitigation for Spectre V1 (Bounds Check Bypass). Spectre V1 is a
+ class of side channel attacks that takes advantage of speculative
+ execution that bypasses conditional branch instructions used for
+ memory access bounds check.
+ See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 08edca8..ebb6a2f 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -874,7 +874,8 @@ enum spectre_v1_mitigation {
};
static enum spectre_v1_mitigation spectre_v1_mitigation __ro_after_init =
- SPECTRE_V1_MITIGATION_AUTO;
+ IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V1) ?
+ SPECTRE_V1_MITIGATION_AUTO : SPECTRE_V1_MITIGATION_NONE;
static const char * const spectre_v1_strings[] = {
[SPECTRE_V1_MITIGATION_NONE] = "Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers",
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 07/11] x86/bugs: Add a separate config for SRBDS
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (5 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 06/11] x86/bugs: Add a separate config for Spectre v1 Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 08/11] x86/bugs: Add a separate config for Spectre V2 Breno Leitao
` (3 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the SRBDS CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 14 ++++++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e3c63e5208ab..22d324581a60 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2715,6 +2715,20 @@ config MITIGATION_SPECTRE_V1
execution that bypasses conditional branch instructions used for
memory access bounds check.
See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+
+config MITIGATION_SRBDS
+ bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Special Register Buffer Data Sampling (SRBDS).
+ SRBDS is a hardware vulnerability that allows Microarchitectural Data
+ Sampling (MDS) techniques to infer values returned from special
+ register accesses. An unprivileged user can extract values returned
+ from RDRAND and RDSEED executed on another core or sibling thread
+ using MDS techniques.
+ See also
+ <file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index ebb6a2f578d1..8292a96d376c 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -608,7 +608,8 @@ enum srbds_mitigations {
SRBDS_MITIGATION_HYPERVISOR,
};
-static enum srbds_mitigations srbds_mitigation __ro_after_init = SRBDS_MITIGATION_FULL;
+static enum srbds_mitigations srbds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_SRBDS) ? SRBDS_MITIGATION_FULL : SRBDS_MITIGATION_OFF;
static const char * const srbds_strings[] = {
[SRBDS_MITIGATION_OFF] = "Vulnerable",
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for SRBDS
2024-07-29 16:40 ` [PATCH v4 07/11] x86/bugs: Add a separate config for SRBDS Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: a0b02e3fe3661ea20df4d13adfc94b6affdcc466
Gitweb: https://git.kernel.org/tip/a0b02e3fe3661ea20df4d13adfc94b6affdcc466
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:55 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:49:53 +02:00
x86/bugs: Add a separate config for SRBDS
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the SRBDS CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-8-leitao@debian.org
---
arch/x86/Kconfig | 14 ++++++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e3c63e5..22d3245 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2715,6 +2715,20 @@ config MITIGATION_SPECTRE_V1
execution that bypasses conditional branch instructions used for
memory access bounds check.
See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+
+config MITIGATION_SRBDS
+ bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Special Register Buffer Data Sampling (SRBDS).
+ SRBDS is a hardware vulnerability that allows Microarchitectural Data
+ Sampling (MDS) techniques to infer values returned from special
+ register accesses. An unprivileged user can extract values returned
+ from RDRAND and RDSEED executed on another core or sibling thread
+ using MDS techniques.
+ See also
+ <file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index ebb6a2f..8292a96 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -608,7 +608,8 @@ enum srbds_mitigations {
SRBDS_MITIGATION_HYPERVISOR,
};
-static enum srbds_mitigations srbds_mitigation __ro_after_init = SRBDS_MITIGATION_FULL;
+static enum srbds_mitigations srbds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_SRBDS) ? SRBDS_MITIGATION_FULL : SRBDS_MITIGATION_OFF;
static const char * const srbds_strings[] = {
[SRBDS_MITIGATION_OFF] = "Vulnerable",
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 08/11] x86/bugs: Add a separate config for Spectre V2
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (6 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 07/11] x86/bugs: Add a separate config for SRBDS Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 09/11] x86/bugs: Add a separate config for SSB Breno Leitao
` (2 subsequent siblings)
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the Spectre V2 CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 12 ++++++++++++
arch/x86/kernel/cpu/bugs.c | 9 +++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 22d324581a60..33e125a28f79 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2716,6 +2716,18 @@ config MITIGATION_SPECTRE_V1
memory access bounds check.
See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+config MITIGATION_SPECTRE_V2
+ bool "Mitigate SPECTRE V2 hardware bug"
+ default y
+ help
+ Enable mitigation for Spectre V2 (Branch Target Injection). Spectre
+ V2 is a class of side channel attacks that takes advantage of
+ indirect branch predictors inside the processor. In Spectre variant 2
+ attacks, the attacker can steer speculative indirect branches in the
+ victim to gadget code by poisoning the branch target buffer of a CPU
+ used for predicting indirect branch addresses.
+ See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+
config MITIGATION_SRBDS
bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 8292a96d376c..45cbc6f994ca 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1452,17 +1452,18 @@ static void __init spec_v2_print_cond(const char *reason, bool secure)
static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
{
- enum spectre_v2_mitigation_cmd cmd = SPECTRE_V2_CMD_AUTO;
+ enum spectre_v2_mitigation_cmd cmd;
char arg[20];
int ret, i;
+ cmd = IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V2) ? SPECTRE_V2_CMD_AUTO : SPECTRE_V2_CMD_NONE;
if (cmdline_find_option_bool(boot_command_line, "nospectre_v2") ||
cpu_mitigations_off())
return SPECTRE_V2_CMD_NONE;
ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, sizeof(arg));
if (ret < 0)
- return SPECTRE_V2_CMD_AUTO;
+ return cmd;
for (i = 0; i < ARRAY_SIZE(mitigation_options); i++) {
if (!match_option(arg, ret, mitigation_options[i].option))
@@ -1472,8 +1473,8 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
}
if (i >= ARRAY_SIZE(mitigation_options)) {
- pr_err("unknown option (%s). Switching to AUTO select\n", arg);
- return SPECTRE_V2_CMD_AUTO;
+ pr_err("unknown option (%s). Switching to default mode\n", arg);
+ return cmd;
}
if ((cmd == SPECTRE_V2_CMD_RETPOLINE ||
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for Spectre V2
2024-07-29 16:40 ` [PATCH v4 08/11] x86/bugs: Add a separate config for Spectre V2 Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 72c70f480a70695523f984651d5da766b862c712
Gitweb: https://git.kernel.org/tip/72c70f480a70695523f984651d5da766b862c712
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:56 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:51:11 +02:00
x86/bugs: Add a separate config for Spectre V2
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the Spectre V2 CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-9-leitao@debian.org
---
arch/x86/Kconfig | 12 ++++++++++++
arch/x86/kernel/cpu/bugs.c | 9 +++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 22d3245..33e125a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2716,6 +2716,18 @@ config MITIGATION_SPECTRE_V1
memory access bounds check.
See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+config MITIGATION_SPECTRE_V2
+ bool "Mitigate SPECTRE V2 hardware bug"
+ default y
+ help
+ Enable mitigation for Spectre V2 (Branch Target Injection). Spectre
+ V2 is a class of side channel attacks that takes advantage of
+ indirect branch predictors inside the processor. In Spectre variant 2
+ attacks, the attacker can steer speculative indirect branches in the
+ victim to gadget code by poisoning the branch target buffer of a CPU
+ used for predicting indirect branch addresses.
+ See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
+
config MITIGATION_SRBDS
bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 8292a96..45cbc6f 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1452,17 +1452,18 @@ static void __init spec_v2_print_cond(const char *reason, bool secure)
static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
{
- enum spectre_v2_mitigation_cmd cmd = SPECTRE_V2_CMD_AUTO;
+ enum spectre_v2_mitigation_cmd cmd;
char arg[20];
int ret, i;
+ cmd = IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V2) ? SPECTRE_V2_CMD_AUTO : SPECTRE_V2_CMD_NONE;
if (cmdline_find_option_bool(boot_command_line, "nospectre_v2") ||
cpu_mitigations_off())
return SPECTRE_V2_CMD_NONE;
ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, sizeof(arg));
if (ret < 0)
- return SPECTRE_V2_CMD_AUTO;
+ return cmd;
for (i = 0; i < ARRAY_SIZE(mitigation_options); i++) {
if (!match_option(arg, ret, mitigation_options[i].option))
@@ -1472,8 +1473,8 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
}
if (i >= ARRAY_SIZE(mitigation_options)) {
- pr_err("unknown option (%s). Switching to AUTO select\n", arg);
- return SPECTRE_V2_CMD_AUTO;
+ pr_err("unknown option (%s). Switching to default mode\n", arg);
+ return cmd;
}
if ((cmd == SPECTRE_V2_CMD_RETPOLINE ||
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 09/11] x86/bugs: Add a separate config for SSB
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (7 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 08/11] x86/bugs: Add a separate config for Spectre V2 Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option Breno Leitao
2024-07-29 16:40 ` [PATCH v4 11/11] x86/bugs: Add a separate config for GDS Breno Leitao
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the SSB CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 10 ++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 33e125a28f79..2e72a07981b2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2741,6 +2741,16 @@ config MITIGATION_SRBDS
using MDS techniques.
See also
<file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
+
+config MITIGATION_SSB
+ bool "Mitigate Speculative Store Bypass (SSB) hardware bug"
+ default y
+ help
+ Enable mitigation for Speculative Store Bypass (SSB). SSB is a
+ hardware security vulnerability and its exploitation takes advantage
+ of speculative execution in a similar way to the Meltdown and Spectre
+ security vulnerabilities.
+
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 45cbc6f994ca..a7f20ae2fcf4 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2027,10 +2027,12 @@ static const struct {
static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
{
- enum ssb_mitigation_cmd cmd = SPEC_STORE_BYPASS_CMD_AUTO;
+ enum ssb_mitigation_cmd cmd;
char arg[20];
int ret, i;
+ cmd = IS_ENABLED(CONFIG_MITIGATION_SSB) ?
+ SPEC_STORE_BYPASS_CMD_AUTO : SPEC_STORE_BYPASS_CMD_NONE;
if (cmdline_find_option_bool(boot_command_line, "nospec_store_bypass_disable") ||
cpu_mitigations_off()) {
return SPEC_STORE_BYPASS_CMD_NONE;
@@ -2038,7 +2040,7 @@ static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
ret = cmdline_find_option(boot_command_line, "spec_store_bypass_disable",
arg, sizeof(arg));
if (ret < 0)
- return SPEC_STORE_BYPASS_CMD_AUTO;
+ return cmd;
for (i = 0; i < ARRAY_SIZE(ssb_mitigation_options); i++) {
if (!match_option(arg, ret, ssb_mitigation_options[i].option))
@@ -2049,8 +2051,8 @@ static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
}
if (i >= ARRAY_SIZE(ssb_mitigation_options)) {
- pr_err("unknown option (%s). Switching to AUTO select\n", arg);
- return SPEC_STORE_BYPASS_CMD_AUTO;
+ pr_err("unknown option (%s). Switching to default mode\n", arg);
+ return cmd;
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for SSB
2024-07-29 16:40 ` [PATCH v4 09/11] x86/bugs: Add a separate config for SSB Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Breno Leitao, Borislav Petkov (AMD), Josh Poimboeuf, x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: b908cdab061a5ead51d5e1731ca9c1b26699a9bb
Gitweb: https://git.kernel.org/tip/b908cdab061a5ead51d5e1731ca9c1b26699a9bb
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:57 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:51:45 +02:00
x86/bugs: Add a separate config for SSB
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create an entry for the SSB CPU mitigation under
CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
it at compilation time.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-10-leitao@debian.org
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 10 ++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 33e125a..2e72a07 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2741,6 +2741,16 @@ config MITIGATION_SRBDS
using MDS techniques.
See also
<file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
+
+config MITIGATION_SSB
+ bool "Mitigate Speculative Store Bypass (SSB) hardware bug"
+ default y
+ help
+ Enable mitigation for Speculative Store Bypass (SSB). SSB is a
+ hardware security vulnerability and its exploitation takes advantage
+ of speculative execution in a similar way to the Meltdown and Spectre
+ security vulnerabilities.
+
endif
config ARCH_HAS_ADD_PAGES
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 45cbc6f..a7f20ae 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2027,10 +2027,12 @@ static const struct {
static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
{
- enum ssb_mitigation_cmd cmd = SPEC_STORE_BYPASS_CMD_AUTO;
+ enum ssb_mitigation_cmd cmd;
char arg[20];
int ret, i;
+ cmd = IS_ENABLED(CONFIG_MITIGATION_SSB) ?
+ SPEC_STORE_BYPASS_CMD_AUTO : SPEC_STORE_BYPASS_CMD_NONE;
if (cmdline_find_option_bool(boot_command_line, "nospec_store_bypass_disable") ||
cpu_mitigations_off()) {
return SPEC_STORE_BYPASS_CMD_NONE;
@@ -2038,7 +2040,7 @@ static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
ret = cmdline_find_option(boot_command_line, "spec_store_bypass_disable",
arg, sizeof(arg));
if (ret < 0)
- return SPEC_STORE_BYPASS_CMD_AUTO;
+ return cmd;
for (i = 0; i < ARRAY_SIZE(ssb_mitigation_options); i++) {
if (!match_option(arg, ret, ssb_mitigation_options[i].option))
@@ -2049,8 +2051,8 @@ static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
}
if (i >= ARRAY_SIZE(ssb_mitigation_options)) {
- pr_err("unknown option (%s). Switching to AUTO select\n", arg);
- return SPEC_STORE_BYPASS_CMD_AUTO;
+ pr_err("unknown option (%s). Switching to default mode\n", arg);
+ return cmd;
}
}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (8 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 09/11] x86/bugs: Add a separate config for SSB Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-29 17:09 ` Daniel Sneddon
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
2024-07-29 16:40 ` [PATCH v4 11/11] x86/bugs: Add a separate config for GDS Breno Leitao
10 siblings, 2 replies; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel, Daniel Sneddon
Remove the MITIGATION_GDS_FORCE Kconfig option, which aggressively disables
AVX as a mitigation for Gather Data Sampling (GDS) vulnerabilities. This
option is not widely used by distros.
While removing the Kconfig option, retain the runtime configuration
ability through the `gather_data_sampling=force` kernel parameter. This
allows users to still enable this aggressive mitigation if needed,
without baking it into the kernel configuration.
This change simplifies the kernel configuration while maintaining
flexibility for runtime mitigation choices.
Cc: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 19 -------------------
arch/x86/kernel/cpu/bugs.c | 4 ----
2 files changed, 23 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2e72a07981b2..ab5b210c8315 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2610,25 +2610,6 @@ config MITIGATION_SLS
against straight line speculation. The kernel image might be slightly
larger.
-config MITIGATION_GDS_FORCE
- bool "Force GDS Mitigation"
- depends on CPU_SUP_INTEL
- default n
- help
- Gather Data Sampling (GDS) is a hardware vulnerability which allows
- unprivileged speculative access to data which was previously stored in
- vector registers.
-
- This option is equivalent to setting gather_data_sampling=force on the
- command line. The microcode mitigation is used if present, otherwise
- AVX is disabled as a mitigation. On affected systems that are missing
- the microcode any userspace code that unconditionally uses AVX will
- break with this option set.
-
- Setting this option on systems not vulnerable to GDS has no effect.
-
- If in doubt, say N.
-
config MITIGATION_RFDS
bool "RFDS Mitigation"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a7f20ae2fcf4..b2e752eeb098 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -735,11 +735,7 @@ enum gds_mitigations {
GDS_MITIGATION_HYPERVISOR,
};
-#if IS_ENABLED(CONFIG_MITIGATION_GDS_FORCE)
-static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FORCE;
-#else
static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FULL;
-#endif
static const char * const gds_strings[] = {
[GDS_MITIGATION_OFF] = "Vulnerable",
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option
2024-07-29 16:40 ` [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option Breno Leitao
@ 2024-07-29 17:09 ` Daniel Sneddon
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
1 sibling, 0 replies; 24+ messages in thread
From: Daniel Sneddon @ 2024-07-29 17:09 UTC (permalink / raw)
To: Breno Leitao, bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
On 7/29/24 09:40, Breno Leitao wrote:
> Remove the MITIGATION_GDS_FORCE Kconfig option, which aggressively disables
> AVX as a mitigation for Gather Data Sampling (GDS) vulnerabilities. This
> option is not widely used by distros.
>
> While removing the Kconfig option, retain the runtime configuration
> ability through the `gather_data_sampling=force` kernel parameter. This
> allows users to still enable this aggressive mitigation if needed,
> without baking it into the kernel configuration.
>
> This change simplifies the kernel configuration while maintaining
> flexibility for runtime mitigation choices.
>
> Cc: Daniel Sneddon <daniel.sneddon@linux.intel.com>
> Suggested-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Breno Leitao <leitao@debian.org>
LGTM. Feel free to add a Reviewed-by from me.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [tip: x86/bugs] x86/bugs: Remove GDS Force Kconfig option
2024-07-29 16:40 ` [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option Breno Leitao
2024-07-29 17:09 ` Daniel Sneddon
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
1 sibling, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Borislav Petkov, Breno Leitao, Daniel Sneddon, x86, linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 03267a534bb388acdd2ee685101084d144e8384c
Gitweb: https://git.kernel.org/tip/03267a534bb388acdd2ee685101084d144e8384c
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:58 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:53:15 +02:00
x86/bugs: Remove GDS Force Kconfig option
Remove the MITIGATION_GDS_FORCE Kconfig option, which aggressively disables
AVX as a mitigation for Gather Data Sampling (GDS) vulnerabilities. This
option is not widely used by distros.
While removing the Kconfig option, retain the runtime configuration ability
through the `gather_data_sampling=force` kernel parameter. This allows users
to still enable this aggressive mitigation if needed, without baking it into
the kernel configuration.
Simplify the kernel configuration while maintaining flexibility for runtime
mitigation choices.
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Link: https://lore.kernel.org/r/20240729164105.554296-11-leitao@debian.org
---
arch/x86/Kconfig | 19 -------------------
arch/x86/kernel/cpu/bugs.c | 4 ----
2 files changed, 23 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2e72a07..ab5b210 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2610,25 +2610,6 @@ config MITIGATION_SLS
against straight line speculation. The kernel image might be slightly
larger.
-config MITIGATION_GDS_FORCE
- bool "Force GDS Mitigation"
- depends on CPU_SUP_INTEL
- default n
- help
- Gather Data Sampling (GDS) is a hardware vulnerability which allows
- unprivileged speculative access to data which was previously stored in
- vector registers.
-
- This option is equivalent to setting gather_data_sampling=force on the
- command line. The microcode mitigation is used if present, otherwise
- AVX is disabled as a mitigation. On affected systems that are missing
- the microcode any userspace code that unconditionally uses AVX will
- break with this option set.
-
- Setting this option on systems not vulnerable to GDS has no effect.
-
- If in doubt, say N.
-
config MITIGATION_RFDS
bool "RFDS Mitigation"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a7f20ae..b2e752e 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -735,11 +735,7 @@ enum gds_mitigations {
GDS_MITIGATION_HYPERVISOR,
};
-#if IS_ENABLED(CONFIG_MITIGATION_GDS_FORCE)
-static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FORCE;
-#else
static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FULL;
-#endif
static const char * const gds_strings[] = {
[GDS_MITIGATION_OFF] = "Vulnerable",
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 11/11] x86/bugs: Add a separate config for GDS
2024-07-29 16:40 [PATCH v4 00/11] x86/bugs: Separate config for mitigations Breno Leitao
` (9 preceding siblings ...)
2024-07-29 16:40 ` [PATCH v4 10/11] x86/bugs: Remove GDS Force Kconfig option Breno Leitao
@ 2024-07-29 16:40 ` Breno Leitao
2024-07-30 14:15 ` [tip: x86/bugs] " tip-bot2 for Breno Leitao
10 siblings, 1 reply; 24+ messages in thread
From: Breno Leitao @ 2024-07-29 16:40 UTC (permalink / raw)
To: bp, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta
Cc: linux-kernel
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
where some mitigations have entries in Kconfig, and they could be
modified, while others mitigations do not have Kconfig entries, and
could not be controlled at build time.
Create a new kernel config that allows GDS to be completely disabled,
similarly to the "gather_data_sampling=off" or "mitigations=off" kernel
command-line.
Now, there are two options for GDS mitigation:
* CONFIG_MITIGATION_GDS=n -> Mitigation disabled (New)
* CONFIG_MITIGATION_GDS=y -> Mitigation enabled (GDS_MITIGATION_FULL)
Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ab5b210c8315..475bc538615e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2610,6 +2610,16 @@ config MITIGATION_SLS
against straight line speculation. The kernel image might be slightly
larger.
+config MITIGATION_GDS
+ bool "Mitigate Gather Data Sampling"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Gather Data Sampling (GDS). GDS is a hardware
+ vulnerability which allows unprivileged speculative access to data
+ which was previously stored in vector registers. The attacker uses gather
+ instructions to infer the stale vector register data.
+
config MITIGATION_RFDS
bool "RFDS Mitigation"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index b2e752eeb098..189840db2f8d 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -735,7 +735,8 @@ enum gds_mitigations {
GDS_MITIGATION_HYPERVISOR,
};
-static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FULL;
+static enum gds_mitigations gds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_GDS) ? GDS_MITIGATION_FULL : GDS_MITIGATION_OFF;
static const char * const gds_strings[] = {
[GDS_MITIGATION_OFF] = "Vulnerable",
--
2.43.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [tip: x86/bugs] x86/bugs: Add a separate config for GDS
2024-07-29 16:40 ` [PATCH v4 11/11] x86/bugs: Add a separate config for GDS Breno Leitao
@ 2024-07-30 14:15 ` tip-bot2 for Breno Leitao
0 siblings, 0 replies; 24+ messages in thread
From: tip-bot2 for Breno Leitao @ 2024-07-30 14:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Josh Poimboeuf, Breno Leitao, Borislav Petkov (AMD), x86,
linux-kernel
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 225f2bd064c32397acfe3d9dfd9a2b3bc6d64fd7
Gitweb: https://git.kernel.org/tip/225f2bd064c32397acfe3d9dfd9a2b3bc6d64fd7
Author: Breno Leitao <leitao@debian.org>
AuthorDate: Mon, 29 Jul 2024 09:40:59 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 30 Jul 2024 14:54:15 +02:00
x86/bugs: Add a separate config for GDS
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated, where some
mitigations have entries in Kconfig, and they could be modified, while others
mitigations do not have Kconfig entries, and could not be controlled at build
time.
Create a new kernel config that allows GDS to be completely disabled,
similarly to the "gather_data_sampling=off" or "mitigations=off" kernel
command-line.
Now, there are two options for GDS mitigation:
* CONFIG_MITIGATION_GDS=n -> Mitigation disabled (New)
* CONFIG_MITIGATION_GDS=y -> Mitigation enabled (GDS_MITIGATION_FULL)
Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240729164105.554296-12-leitao@debian.org
---
arch/x86/Kconfig | 10 ++++++++++
arch/x86/kernel/cpu/bugs.c | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ab5b210..475bc53 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2610,6 +2610,16 @@ config MITIGATION_SLS
against straight line speculation. The kernel image might be slightly
larger.
+config MITIGATION_GDS
+ bool "Mitigate Gather Data Sampling"
+ depends on CPU_SUP_INTEL
+ default y
+ help
+ Enable mitigation for Gather Data Sampling (GDS). GDS is a hardware
+ vulnerability which allows unprivileged speculative access to data
+ which was previously stored in vector registers. The attacker uses gather
+ instructions to infer the stale vector register data.
+
config MITIGATION_RFDS
bool "RFDS Mitigation"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index b2e752e..189840d 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -735,7 +735,8 @@ enum gds_mitigations {
GDS_MITIGATION_HYPERVISOR,
};
-static enum gds_mitigations gds_mitigation __ro_after_init = GDS_MITIGATION_FULL;
+static enum gds_mitigations gds_mitigation __ro_after_init =
+ IS_ENABLED(CONFIG_MITIGATION_GDS) ? GDS_MITIGATION_FULL : GDS_MITIGATION_OFF;
static const char * const gds_strings[] = {
[GDS_MITIGATION_OFF] = "Vulnerable",
^ permalink raw reply related [flat|nested] 24+ messages in thread