Commit 79a43134 authored by Jan Kiszka's avatar Jan Kiszka Committed by Greg Kroah-Hartman

KVM: nVMX: Clear pending KVM_REQ_GET_VMCS12_PAGES when leaving nested

commit cf64527b upstream.

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: default avatarJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: default avatarLiran Alon <liran.alon@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 7f7f1ba3 ("KVM: x86: do not load vmcs12 pages while still in SMM")
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 93e7720c
...@@ -212,6 +212,8 @@ static void free_nested(struct kvm_vcpu *vcpu) ...@@ -212,6 +212,8 @@ static void free_nested(struct kvm_vcpu *vcpu)
if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon)
return; return;
kvm_clear_request(KVM_REQ_GET_VMCS12_PAGES, vcpu);
vmx->nested.vmxon = false; vmx->nested.vmxon = false;
vmx->nested.smm.vmxon = false; vmx->nested.smm.vmxon = false;
free_vpid(vmx->nested.vpid02); free_vpid(vmx->nested.vpid02);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment