]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kvm: nVMX: VMWRITE checks VMCS-link pointer before VMCS field
authorJim Mattson <jmattson@google.com>
Fri, 6 Dec 2019 23:46:35 +0000 (15:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:25 +0000 (16:45 +0100)
commit75ef7bf39e8cbc9cfec47af09799abcb14f8c85a
tree066c7a58ad1496cbf01a0977a4cf8b60b4f2d639
parentef4676680b04de58d54a62e96b3d529f14667bdf
kvm: nVMX: VMWRITE checks VMCS-link pointer before VMCS field

commit dd2d6042b7f4a5440705b4ffc6c4c2dba81a43b7 upstream.

According to the SDM, a VMWRITE in VMX non-root operation with an
invalid VMCS-link pointer results in VMfailInvalid before the validity
of the VMCS field in the secondary source operand is checked.

For consistency, modify both handle_vmwrite and handle_vmread, even
though there was no problem with the latter.

Fixes: 6d894f498f5d1 ("KVM: nVMX: vmread/vmwrite: Use shadow vmcs12 if running L2")
Signed-off-by: Jim Mattson <jmattson@google.com>
Cc: Liran Alon <liran.alon@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Peter Shier <pshier@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Jon Cargille <jcargill@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx/nested.c