]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Bug the VM if an accelerated x2APIC trap occurs on a "bad" reg
authorSean Christopherson <seanjc@google.com>
Thu, 4 Aug 2022 23:50:28 +0000 (23:50 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Aug 2022 19:08:23 +0000 (15:08 -0400)
commit1e847eb32a95cdfb8f19f7c7de0b13325226fd9e
tree0911e4769add9407e27308d71fd6cc4f8c549b15
parent3b130114ac9eb0542fa754de3174c44d9dc31f61
KVM: x86: Bug the VM if an accelerated x2APIC trap occurs on a "bad" reg

Bug the VM if retrieving the x2APIC MSR/register while processing an
accelerated vAPIC trap VM-Exit fails.  In theory it's impossible for the
lookup to fail as hardware has already validated the register, but bugs
happen, and not checking the result of kvm_lapic_msr_read() would result
in consuming the uninitialized "val" if a KVM or hardware bug occurs.

Fixes: 5e850f11b9e3 ("KVM: x86: Do not block APIC write for non ICR registers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220804235028.1766253-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c