Skip to content

Commit b442509

Browse files
committed
x86: KVM: SVM: always update the x2avic msr interception
jira LE-1907 cve CVE-2023-5090 Rebuild_History Non-Buildable kernel-4.18.0-553.8.1.el8_10 commit-author Maxim Levitsky <[email protected]> commit b65235f The following problem exists since x2avic was enabled in the KVM: svm_set_x2apic_msr_interception is called to enable the interception of the x2apic msrs. In particular it is called at the moment the guest resets its apic. Assuming that the guest's apic was in x2apic mode, the reset will bring it back to the xapic mode. The svm_set_x2apic_msr_interception however has an erroneous check for '!apic_x2apic_mode()' which prevents it from doing anything in this case. As a result of this, all x2apic msrs are left unintercepted, and that exposes the bare metal x2apic (if enabled) to the guest. Oops. Remove the erroneous '!apic_x2apic_mode()' check to fix that. This fixes CVE-2023-5090 Fixes: 4d1d794 ("KVM: SVM: Introduce logic to (de)activate x2AVIC mode") Cc: [email protected] Signed-off-by: Maxim Levitsky <[email protected]> Reviewed-by: Suravee Suthikulpanit <[email protected]> Tested-by: Suravee Suthikulpanit <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> (cherry picked from commit b65235f) Signed-off-by: Jonathan Maple <[email protected]>
1 parent e81c0db commit b442509

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,7 @@ void svm_set_x2apic_msr_interception(struct vcpu_svm *svm, bool intercept)
779779
if (intercept == svm->x2avic_msrs_intercepted)
780780
return;
781781

782-
if (!x2avic_enabled ||
783-
!apic_x2apic_mode(svm->vcpu.arch.apic))
782+
if (!x2avic_enabled)
784783
return;
785784

786785
for (i = 0; i < MAX_DIRECT_ACCESS_MSRS; i++) {

0 commit comments

Comments
 (0)