lkml.org 
[lkml]   [2019]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.2 327/413] KVM: VMX: Always signal #GP on WRMSR to MSR_IA32_CR_PAT with bad value
    Date
    From: Sean Christopherson <sean.j.christopherson@intel.com>

    commit d28f4290b53a157191ed9991ad05dffe9e8c0c89 upstream.

    The behavior of WRMSR is in no way dependent on whether or not KVM
    consumes the value.

    Fixes: 4566654bb9be9 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/x86/kvm/vmx/vmx.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    --- a/arch/x86/kvm/vmx/vmx.c
    +++ b/arch/x86/kvm/vmx/vmx.c
    @@ -1896,9 +1896,10 @@ static int vmx_set_msr(struct kvm_vcpu *
    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;

    \
     
     \ /
      Last update: 2019-07-24 21:42    [W:5.404 / U:0.352 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site