Skip to content

Commit c029cf2

Browse files
committed
x86/vmscape: Warn when STIBP is disabled with SMT
JIRA: https://issues.redhat.com/browse/RHEL-114277 CVE: CVE-2025-40300 commit b7cc988 Author: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Date: Thu, 14 Aug 2025 10:20:43 -0700 x86/vmscape: Warn when STIBP is disabled with SMT Cross-thread attacks are generally harder as they require the victim to be co-located on a core. However, with VMSCAPE the adversary targets belong to the same guest execution, that are more likely to get co-located. In particular, a thread that is currently executing userspace hypervisor (after the IBPB) may still be targeted by a guest execution from a sibling thread. Issue a warning about the potential risk, except when: - SMT is disabled - STIBP is enabled system-wide - Intel eIBRS is enabled (which implies STIBP protection) Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 8eb19bb commit c029cf2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,28 @@ void cpu_bugs_smt_update(void)
32163216
break;
32173217
}
32183218

3219+
switch (vmscape_mitigation) {
3220+
case VMSCAPE_MITIGATION_NONE:
3221+
case VMSCAPE_MITIGATION_AUTO:
3222+
break;
3223+
case VMSCAPE_MITIGATION_IBPB_ON_VMEXIT:
3224+
case VMSCAPE_MITIGATION_IBPB_EXIT_TO_USER:
3225+
/*
3226+
* Hypervisors can be attacked across-threads, warn for SMT when
3227+
* STIBP is not already enabled system-wide.
3228+
*
3229+
* Intel eIBRS (!AUTOIBRS) implies STIBP on.
3230+
*/
3231+
if (!sched_smt_active() ||
3232+
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
3233+
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED ||
3234+
(spectre_v2_in_eibrs_mode(spectre_v2_enabled) &&
3235+
!boot_cpu_has(X86_FEATURE_AUTOIBRS)))
3236+
break;
3237+
pr_warn_once(VMSCAPE_MSG_SMT);
3238+
break;
3239+
}
3240+
32193241
mutex_unlock(&spec_ctrl_mutex);
32203242
}
32213243

0 commit comments

Comments
 (0)