summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx/vmx.c
diff options
context:
space:
mode:
authorEugene Korenevsky2019-06-05 23:19:16 +0200
committerPaolo Bonzini2019-06-18 11:43:45 +0200
commitfdb28619a8f033c13f5d9b9e8b5536bb6e68a2c3 (patch)
tree42bd37018ff4798e0e89ea671e899e7c98c1f5fe /arch/x86/kvm/vmx/vmx.c
parentkvm: vmx: fix limit checking in get_vmx_mem_address() (diff)
downloadkernel-qcow2-linux-fdb28619a8f033c13f5d9b9e8b5536bb6e68a2c3.tar.gz
kernel-qcow2-linux-fdb28619a8f033c13f5d9b9e8b5536bb6e68a2c3.tar.xz
kernel-qcow2-linux-fdb28619a8f033c13f5d9b9e8b5536bb6e68a2c3.zip
kvm: vmx: segment limit check: use access length
There is an imperfection in get_vmx_mem_address(): access length is ignored when checking the limit. To fix this, pass access length as a function argument. The access length is usually obvious since it is used by callers after get_vmx_mem_address() call, but for vmread/vmwrite it depends on the state of 64-bit mode. Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/vmx.c')
-rw-r--r--arch/x86/kvm/vmx/vmx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index f91323d527be..cccf73a91e88 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5345,7 +5345,8 @@ static int handle_invpcid(struct kvm_vcpu *vcpu)
* is read even if it isn't needed (e.g., for type==all)
*/
if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),
- vmx_instruction_info, false, &gva))
+ vmx_instruction_info, false,
+ sizeof(operand), &gva))
return 1;
if (kvm_read_guest_virt(vcpu, gva, &operand, sizeof(operand), &e)) {