kvm: x86: reads of restricted pv msrs should also result in #GP
authorOliver Upton <oupton@google.com>
Tue, 27 Oct 2020 23:10:41 +0000 (16:10 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 8 Nov 2020 09:41:29 +0000 (04:41 -0500)
commit1930e5ddcead2c23567131e62c86b15efce054be
tree954daddba1b077e9b5162462926e964019227d23
parentcc4cb017678aa66d3fb4501b2f7424ed28fc7f4d
kvm: x86: reads of restricted pv msrs should also result in #GP

commit 66570e966dd9 ("kvm: x86: only provide PV features if enabled in
guest's CPUID") only protects against disallowed guest writes to KVM
paravirtual msrs, leaving msr reads unchecked. Fix this by enforcing
KVM_CPUID_FEATURES for msr reads as well.

Fixes: 66570e966dd9 ("kvm: x86: only provide PV features if enabled in guest's CPUID")
Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Message-Id: <20201027231044.655110-4-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c