]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Store vmcs.EXIT_QUALIFICATION as an unsigned long, not u32
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 23 Apr 2020 00:11:27 +0000 (17:11 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Apr 2020 16:51:21 +0000 (12:51 -0400)
commit446d35ea5c9b369676d321666cd85d368ee68c81
tree613b3219a2a1e72e80f465991f10ac2b44ea5781
parent314bb12bb8c02c8a4b3a1ecffc9a4c4286314512
KVM: nVMX: Store vmcs.EXIT_QUALIFICATION as an unsigned long, not u32

Use an unsigned long for 'exit_qual' in nested_vmx_reflect_vmexit(), the
EXIT_QUALIFICATION field is naturally sized, not a 32-bit field.

The bug is most easily observed by doing VMXON (or any VMX instruction)
in L2 with a negative displacement, in which case dropping the upper
bits on nested VM-Exit results in L1 calculating the wrong virtual
address for the memory operand, e.g. "vmxon -0x8(%rbp)" yields:

  Unhandled cpu exception 14 #PF at ip 0000000000400553
  rbp=0000000000537000 cr2=0000000100536ff8

Fixes: 84023769b966a ("KVM: nVMX: Move VM-Fail check out of nested_vmx_exit_reflected()")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200423001127.13490-1-sean.j.christopherson@intel.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c