]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Let userspace set nVMX MSR to any _host_ supported value
authorSean Christopherson <seanjc@google.com>
Tue, 7 Jun 2022 21:35:54 +0000 (21:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:20 +0000 (11:17 +0200)
commit1eb8b69e0fef295b85309930696131f4ef89dea3
tree178fb9e3b1f0ba08bb3aaefccf0869c5059c4e27
parent6c261db1868974f33cb93b691e9aa8a3d30ec5a6
KVM: nVMX: Let userspace set nVMX MSR to any _host_ supported value

commit 19f25477081a78db42d1a4466f0695299577aeb7 upstream.

Restrict the nVMX MSRs based on KVM's config, not based on the guest's
current config.  Using the guest's config to audit the new config
prevents userspace from restoring the original config (KVM's config) if
at any point in the past the guest's config was restricted in any way.

Fixes: 651c35318378 ("KVM: nVMX: support restore of VMX capability MSRs")
Cc: stable@vger.kernel.org
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220607213604.3346000-6-seanjc@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