]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/kvm/nVMX: don't skip emulated instruction twice when vmptr address is not backed
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 9 Jan 2019 17:22:56 +0000 (18:22 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 11 Jan 2019 17:41:53 +0000 (18:41 +0100)
Since commit 8d771a98c687e ("KVM: nVMX: call kvm_skip_emulated_instruction
in nested_vmx_{fail,succeed}") nested_vmx_failValid() results in
kvm_skip_emulated_instruction() so doing it again in handle_vmptrld() when
vmptr address is not backed is wrong, we end up advancing RIP twice.

Fixes: 47446972942bd ("kvm: nVMX: Set VM instruction error for VMPTRLD of unbacked page")
Reported-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx/nested.c

index 3170e291215d01e32cb216650760655944d2ad9c..2616bd2c7f2c78b25339eff719d37a22b9070404 100644 (file)
@@ -4540,9 +4540,8 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)
                         * given physical address won't match the required
                         * VMCS12_REVISION identifier.
                         */
-                       nested_vmx_failValid(vcpu,
+                       return nested_vmx_failValid(vcpu,
                                VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
-                       return kvm_skip_emulated_instruction(vcpu);
                }
                new_vmcs12 = kmap(page);
                if (new_vmcs12->hdr.revision_id != VMCS12_REVISION ||