]> xenbits.xensource.com Git - xen.git/commitdiff
x86/spec-ctrl: Fix BTC/SRSO mitigations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 26 Mar 2024 22:47:25 +0000 (22:47 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 Apr 2024 16:16:31 +0000 (17:16 +0100)
We were looking for SCF_entry_ibpb in the wrong variable in the top-of-stack
block, and xen_spec_ctrl won't have had bit 5 set because Xen doesn't
understand SPEC_CTRL_RRSBA_DIS_U yet.

This is XSA-455 / CVE-2024-31142.

Fixes: 53a570b28569 ("x86/spec-ctrl: Support IBPB-on-entry")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/entry.S
xen/include/asm-x86/spec_ctrl_asm.h

index ad5ca50c12e208e0793e8e7e2e29a433cd2b1d2d..d1ca530315fea7fdf6c87ad69fd58b5af9360362 100644 (file)
@@ -101,7 +101,7 @@ __UNLIKELY_END(nsvm_hap)
         /* SPEC_CTRL_ENTRY_FROM_SVM    Req: %rsp=regs/cpuinfo, %rdx=0 Clob: acd */
 
         .macro svm_vmexit_cond_ibpb
-            testb  $SCF_entry_ibpb, CPUINFO_xen_spec_ctrl(%rsp)
+            testb  $SCF_entry_ibpb, CPUINFO_spec_ctrl_flags(%rsp)
             jz     .L_skip_ibpb
 
             mov    $MSR_PRED_CMD, %ecx
index 9650a3aca7c330603f84429d73ba1fbb733dcb23..9704a22d5baf780718a1c0dcaa7509c746321a92 100644 (file)
         jz     .L\@_skip
         testb  $3, UREGS_cs(%rsp)
     .else
-        testb  $SCF_entry_ibpb, CPUINFO_xen_spec_ctrl(%rsp)
+        testb  $SCF_entry_ibpb, CPUINFO_spec_ctrl_flags(%rsp)
     .endif
     jz     .L\@_skip