Where
AND
-Infinity
0
Severity
5.5
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H/E:U

In the Linux kernel, the following vulnerability has been resolved:

KVM: x86: check for nEPT/nNPT in slow flush hypercalls

Checking isguestmode(vcpu) is incorrect, because translatenestedgpa() is only valid if an L2 guest is running with nested EPT/NPT enabled. Instead use the same condition as translatenestedgpa() itself.

1 / 2
Source: MITRE
First published (updated )
Severity
4

In the Linux kernel, the following vulnerability has been resolved:

KVM: x86: Load DR6 with guest value only before entering .vcpurun() loop

Move the conditional loading of hardware DR6 with the guest's DR6 value out of the core .vcpurun() loop to fix a bug where KVM can load hardware with a stale vcpu->arch.dr6.

When the guest accesses a DR and host userspace isn't debugging the guest, KVM disables DR interception and loads the guest's values into hardware on VM-Enter and saves them on VM-Exit. This allows the guest to access DRs at will, e.g. so that a sequence of DR accesses to configure a breakpoint only generates one VM-Exit.

For DR0-DR3, the logic/behavior is identical between VMX and SVM, and also identical between KVMDEBUGREGBPENABLED (userspace debugging the guest) and KVMDEBUGREGWONTEXIT (guest using DRs), and so KVM handles loading DR0-DR3 in common code, outside of the core kvmx86ops.vcpurun() loop.

But for DR6, the guest's value doesn't need to be loaded into hardware for KVMDEBUGREGBPENABLED, and SVM provides a dedicated VMCB field whereas VMX requires software to manually load the guest value, and so loading the guest's value into DR6 is handled by {svm,vmx}vcpurun(), i.e. is done inside the core run loop.

Unfortunately, saving the guest values on VM-Exit is initiated by common x86, again outside of the core run loop. If the guest modifies DR6 (in hardware, when DR interception is disabled), and then the next VM-Exit is a fastpath VM-Exit, KVM will reload hardware DR6 with vcpu->arch.dr6 and clobber the guest's actual value.

The bug shows up primarily with nested VMX because KVM handles the VMX preemption timer in the fastpath, and the window between hardware DR6 being modified (in guest context) and DR6 being read by guest software is orders of magnitude larger in a nested setup. E.g. in non-nested, the VMX preemption timer would need to fire precisely between #DB injection and the #DB handler's read of DR6, whereas with a KVM-on-KVM setup, the window where hardware DR6 is "dirty" extends all the way from L1 writing DR6 to VMRESUME (in L1).

L1's view: ========== <L1 disables DR interception> CPU 0/KVM-7289 [023] d.... 2925.640961: kvmentry: vcpu 0 A: L1 Writes DR6 CPU 0/KVM-7289 [023] d.... 2925.640963: <hack>: Set DRs, DR6 = 0xffff0ff1

B: CPU 0/KVM-7289 [023] d.... 2925.640967: kvmexit: vcpu 0 reason EXTERNALINTERRUPT intrinfo 0x800000ec

D: L1 reads DR6, arch.dr6 = 0 CPU 0/KVM-7289 [023] d.... 2925.640969: <hack>: Sync DRs, DR6 = 0xffff0ff0

CPU 0/KVM-7289 [023] d.... 2925.640976: kvmentry: vcpu 0 L2 reads DR6, L1 disables DR interception CPU 0/KVM-7289 [023] d.... 2925.640980: kvmexit: vcpu 0 reason DRACCESS info1 0x0000000000000216 CPU 0/KVM-7289 [023] d.... 2925.640983: kvmentry: vcpu 0

CPU 0/KVM-7289 [023] d.... 2925.640983: <hack>: Set DRs, DR6 = 0xffff0ff0

L2 detects failure CPU 0/KVM-7289 [023] d.... 2925.640987: kvmexit: vcpu 0 reason HLT L1 reads DR6 (confirms failure) CPU 0/KVM-7289 [023] d.... 2925.640990: <hack>: Sync DRs, DR6 = 0xffff0ff0

L0's view: ========== L2 reads DR6, arch.dr6 = 0 CPU 23/KVM-5046 [001] d.... 3410.005610: kvmexit: vcpu 23 reason DRACCESS info1 0x0000000000000216 CPU 23/KVM-5046 [001] ..... 3410.005610: kvmnestedvmexit: vcpu 23 reason DRACCESS info1 0x0000000000000216

L2 => L1 nested VM-Exit CPU 23/KVM-5046 [001] ..... 3410.005610: kvmnestedvmexitinject: reason: DRACCESS extinf1: 0x0000000000000216

CPU 23/KVM-5046 [001] d.... 3410.005610: kvmentry: vcpu 23 CPU 23/KVM-5046 [001] d.... 3410.005611: kvmexit: vcpu 23 reason VMREAD CPU 23/KVM-5046 [001] d.... 3410.005611: kvmentry: vcpu 23 CPU 23/KVM-5046 [001] d.... 3410. ---truncated---

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203