mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
KVM: VMX: Always signal #GP on WRMSR to MSR_IA32_CR_PAT with bad value
[ Upstream commitd28f4290b5] The behavior of WRMSR is in no way dependent on whether or not KVM consumes the value. Fixes:4566654bb9("KVM: vmx: Inject #GP on invalid PAT CR") Cc: stable@vger.kernel.org Cc: Nadav Amit <nadav.amit@gmail.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
74fd8aae19
commit
74ce13331d
@@ -4265,9 +4265,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
||||
MSR_TYPE_W);
|
||||
break;
|
||||
case MSR_IA32_CR_PAT:
|
||||
if (!kvm_pat_valid(data))
|
||||
return 1;
|
||||
|
||||
if (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_PAT) {
|
||||
if (!kvm_pat_valid(data))
|
||||
return 1;
|
||||
vmcs_write64(GUEST_IA32_PAT, data);
|
||||
vcpu->arch.pat = data;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user