]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
KVM: SVM: load control fields from VMCB12 before checking them
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 31 Mar 2021 10:24:43 +0000 (06:24 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:49 +0000 (15:42 -0500)
commit22fc9cfb23b93b309eba91c87ed55a447f7645c4
tree6b83ef443e16d365fc77759d43157550c636c5fd
parentd57196429d6c69b327100112af0baf3b5611139d
KVM: SVM: load control fields from VMCB12 before checking them

BugLink: https://bugs.launchpad.net/bugs/1923069
commit a58d9166a756a0f4a6618e4f593232593d6df134 upstream.

Avoid races between check and use of the nested VMCB controls.  This
for example ensures that the VMRUN intercept is always reflected to the
nested hypervisor, instead of being processed by the host.  Without this
patch, it is possible to end up with svm->nested.hsave pointing to
the MSR permission bitmap for nested guests.

This bug is CVE-2021-29657.

Reported-by: Felix Wilhelm <fwilhelm@google.com>
Cc: stable@vger.kernel.org
Fixes: 2fcf4876ada ("KVM: nSVM: implement on demand allocation of the nested state")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/kvm/svm/nested.c