]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: fix lifetime issues for vmcs02
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jul 2014 10:25:16 +0000 (12:25 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Jul 2014 12:29:49 +0000 (14:29 +0200)
commit6c81c7730754dbff186863feb89bd5552c95e885
treeb994a6b3bec1d29f4a2887e487648eb9124d3172
parent12f0e28bfa810edf6c03c30dfe4c8ca76058972b
KVM: nVMX: fix lifetime issues for vmcs02

free_nested needs the loaded_vmcs to be valid if it is a vmcs02, in
order to detach it from the shadow vmcs.  However, this is not
available anymore after commit a1907ee70545 (KVM: VMX: fix use after
free of vmx->loaded_vmcs, 2014-01-03).

Revert that patch, and fix its problem by forcing a vmcs01 as the
active VMCS before freeing all the nested VMX state.

Reported-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Tested-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c