Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7560e333 authored by Jan Kiszka's avatar Jan Kiszka Committed by Greg Kroah-Hartman
Browse files

KVM: nVMX: Clear pending KVM_REQ_GET_VMCS12_PAGES when leaving nested



commit cf64527bb33f6cec2ed50f89182fc4688d0056b6 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 967bc679
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8490,6 +8490,8 @@ static void free_nested(struct vcpu_vmx *vmx)
	if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon)
		return;

	kvm_clear_request(KVM_REQ_GET_VMCS12_PAGES, &vmx->vcpu);

	hrtimer_cancel(&vmx->nested.preemption_timer);
	vmx->nested.vmxon = false;
	vmx->nested.smm.vmxon = false;