KVM: SVM: Set/clear CR8 write interception when AVIC is (de)activated
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3bbf3565f48ce3999b5a12cde946f81bd4475312 · < 87d0f901a9bd8ae6be57249c737f20ac0cace93d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: SVM: Set/clear CR8 write interception when AVIC is (de)activated
Explicitly set/clear CR8 write interception when AVIC is (de)activated to fix a bug where KVM leaves the interception enabled after AVIC is activated. E.g. if KVM emulates INIT=>WFS while AVIC is deactivated, CR8 will remain intercepted in perpetuity.
On its own, the dangling CR8 intercept is "just" a performance issue, but combined with the TPR sync bug fixed by commit d02e48830e3f ("KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active"), the danging intercept is fatal to Windows guests as the TPR seen by hardware gets wildly out of sync with reality.
Note, VMX isn't affected by the bug as TPR_THRESHOLD is explicitly ignored when Virtual Interrupt Delivery is enabled, i.e. when APICv is active in KVM's world. I.e. there's no need to trigger update_cr8_intercept(), this is firmly an SVM implementation flaw/detail.
WARN if KVM gets a CR8 write #VMEXIT while AVIC is active, as KVM should never enter the guest with AVIC enabled and CR8 writes intercepted.
[Squash fix to avic_deactivate_vmcb. - Paolo]
From the CVE record · Linux
Linux kernel KVM SVM can leave CR8 write interception enabled after AVIC is activated, such as when it emulates INIT=>WFS while AVIC is deactivated. This causes a performance issue and, when combined with the described TPR synchronization bug, can cause Windows guests to fail. The input does not establish an attacker path, authentication requirement, or user-interaction requirement.
Engineers running Linux kernel KVM SVM should check their deployments; affected versions are not specified.