KVM: vmx: use local variable for current_vmptr when emulating VMPTRST
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 19 Jul 2018 17:31:00 +0000 (10:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:26:27 +0000 (09:26 +0200)
commit10ca6b3f92d3907a4b25ab198c7b5c84aefa3bc7
tree8831dbd3d8bb49c55c549278e849f2a04eee645a
parent123534dbd49094b9f68e53fffd8cbd8a9f9f976e
KVM: vmx: use local variable for current_vmptr when emulating VMPTRST

[ Upstream commit 0a06d4256674c4e041945b52044941995fee237d ]

Do not expose the address of vmx->nested.current_vmptr to
kvm_write_guest_virt_system() as the resulting __copy_to_user()
call will trigger a WARN when CONFIG_HARDENED_USERCOPY is
enabled.

Opportunistically clean up variable names in handle_vmptrst()
to improve readability, e.g. vmcs_gva is misleading as the
memory operand of VMPTRST is plain memory, not a VMCS.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Tested-by: Peter Shier <pshier@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c