Skip to content

Commit 2ddcb08

Browse files
committed
x86/bugs: Fix reporting of LFENCE retpoline
JIRA: https://issues.redhat.com/browse/RHEL-119227 commit d1cc1ba Author: David Kaplan <david.kaplan@amd.com> Date: Mon, 15 Sep 2025 08:47:05 -0500 x86/bugs: Fix reporting of LFENCE retpoline The LFENCE retpoline mitigation is not secure but the kernel prints inconsistent messages about this fact. The dmesg log says 'Mitigation: LFENCE', implying the system is mitigated. But sysfs reports 'Vulnerable: LFENCE' implying the system (correctly) is not mitigated. Fix this by printing a consistent 'Vulnerable: LFENCE' string everywhere when this mitigation is selected. Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250915134706.3201818-1-david.kaplan@amd.com Signed-off-by: Waiman Long <longman@redhat.com>
1 parent ac5bd67 commit 2ddcb08

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ static void __init spectre_v2_user_apply_mitigation(void)
20322032
static const char * const spectre_v2_strings[] = {
20332033
[SPECTRE_V2_NONE] = "Vulnerable",
20342034
[SPECTRE_V2_RETPOLINE] = "Mitigation: Retpolines",
2035-
[SPECTRE_V2_LFENCE] = "Mitigation: LFENCE",
2035+
[SPECTRE_V2_LFENCE] = "Vulnerable: LFENCE",
20362036
[SPECTRE_V2_EIBRS] = "Mitigation: Enhanced / Automatic IBRS",
20372037
[SPECTRE_V2_EIBRS_LFENCE] = "Mitigation: Enhanced / Automatic IBRS + LFENCE",
20382038
[SPECTRE_V2_EIBRS_RETPOLINE] = "Mitigation: Enhanced / Automatic IBRS + Retpolines",
@@ -3559,9 +3559,6 @@ static const char *spectre_bhi_state(void)
35593559

35603560
static ssize_t spectre_v2_show_state(char *buf)
35613561
{
3562-
if (spectre_v2_enabled == SPECTRE_V2_LFENCE)
3563-
return sysfs_emit(buf, "Vulnerable: LFENCE\n");
3564-
35653562
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled())
35663563
return sysfs_emit(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
35673564

0 commit comments

Comments
 (0)