]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/bugs: Report correct retbleed mitigation status
authorDavid Kaplan <david.kaplan@amd.com>
Mon, 15 Sep 2025 13:47:06 +0000 (08:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Nov 2025 13:15:21 +0000 (22:15 +0900)
[ Upstream commit 930f2361fe542a00de9ce6070b1b6edb976f1165 ]

On Intel CPUs, the default retbleed mitigation is IBRS/eIBRS but this
requires that a similar spectre_v2 mitigation is applied.  If the user
selects a different spectre_v2 mitigation (like spectre_v2=retpoline) a
warning is printed but sysfs will still report 'Mitigation: IBRS' or
'Mitigation: Enhanced IBRS'.  This is incorrect because retbleed is not
mitigated, and IBRS is not actually set.

Fix this by choosing RETBLEED_MITIGATION_NONE in this scenario so the
kernel correctly reports the system as vulnerable to retbleed.

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: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/bugs.c

index f3cb559a598df56deed7aea07ae7a4193ba45a07..0c16457e0654322507af35c12869e832b9441d54 100644 (file)
@@ -1186,8 +1186,10 @@ do_cmd_auto:
                        retbleed_mitigation = RETBLEED_MITIGATION_EIBRS;
                        break;
                default:
-                       if (retbleed_mitigation != RETBLEED_MITIGATION_STUFF)
+                       if (retbleed_mitigation != RETBLEED_MITIGATION_STUFF) {
                                pr_err(RETBLEED_INTEL_MSG);
+                               retbleed_mitigation = RETBLEED_MITIGATION_NONE;
+                       }
                }
        }