Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: nVMX: Clear pending KVM_REQ_GET_VMCS12_PAGES when leaving nested

Letting this pend may cause nested_get_vmcs12_pages to run against an
invalid state, corrupting the effective vmcs of L1.

This was triggerable in QEMU after a guest corruption in L2, followed by
a L1 reset.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 7f7f1ba33cf2 ("KVM: x86: do not load vmcs12 pages while still in SMM")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Jan Kiszka and committed by
Paolo Bonzini
cf64527b 30cd8604

+2
+2
arch/x86/kvm/vmx/nested.c
··· 220 220 if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) 221 221 return; 222 222 223 + kvm_clear_request(KVM_REQ_GET_VMCS12_PAGES, vcpu); 224 + 223 225 vmx->nested.vmxon = false; 224 226 vmx->nested.smm.vmxon = false; 225 227 free_vpid(vmx->nested.vpid02);