]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SVM: relax conditions for allowing MSR_IA32_SPEC_CTRL accesses
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Feb 2020 15:10:52 +0000 (16:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:44:59 +0000 (14:44 +0100)
commit88464279c03ce05b56abeed7c38c4064dd054ab9
treed1b75af5a032f0ee0ebad76a858e26eebfdac667
parentc1f49fb15943656d5e1a3bd696853ab3a954babb
KVM: SVM: relax conditions for allowing MSR_IA32_SPEC_CTRL accesses

[ Upstream commit df7e8818926eb4712b67421442acf7d568fe2645 ]

Userspace that does not know about the AMD_IBRS bit might still
allow the guest to protect itself with MSR_IA32_SPEC_CTRL using
the Intel SPEC_CTRL bit.  However, svm.c disallows this and will
cause a #GP in the guest when writing to the MSR.  Fix this by
loosening the test and allowing the Intel CPUID bit, and in fact
allow the AMD_STIBP bit as well since it allows writing to
MSR_IA32_SPEC_CTRL too.

Reported-by: Zhiyi Guo <zhguo@redhat.com>
Analyzed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/svm.c