lkml.org 
[lkml]   [2019]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.3 137/148] KVM: nVMX: Fix consistency check on injected exception error code
    Date
    From: Sean Christopherson <sean.j.christopherson@intel.com>

    [ Upstream commit 567926cca99ba1750be8aae9c4178796bf9bb90b ]

    Current versions of Intel's SDM incorrectly state that "bits 31:15 of
    the VM-Entry exception error-code field" must be zero. In reality, bits
    31:16 must be zero, i.e. error codes are 16-bit values.

    The bogus error code check manifests as an unexpected VM-Entry failure
    due to an invalid code field (error number 7) in L1, e.g. when injecting
    a #GP with error_code=0x9f00.

    Nadav previously reported the bug[*], both to KVM and Intel, and fixed
    the associated kvm-unit-test.

    [*] https://patchwork.kernel.org/patch/11124749/

    Reported-by: Nadav Amit <namit@vmware.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
    Reviewed-by: Jim Mattson <jmattson@google.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/x86/kvm/vmx/nested.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
    index a3cba321b5c5d..61aa9421e27af 100644
    --- a/arch/x86/kvm/vmx/nested.c
    +++ b/arch/x86/kvm/vmx/nested.c
    @@ -2584,7 +2584,7 @@ static int nested_check_vm_entry_controls(struct kvm_vcpu *vcpu,

    /* VM-entry exception error code */
    if (has_error_code &&
    - vmcs12->vm_entry_exception_error_code & GENMASK(31, 15))
    + vmcs12->vm_entry_exception_error_code & GENMASK(31, 16))
    return -EINVAL;

    /* VM-entry interruption-info field: reserved bits */
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-10-10 11:00    [W:5.165 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site