diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-30 14:31:24 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-08-27 13:25:37 -0400 |
commit | 4b8ec51eb5e94596b4a3d465b93a3d18375b98b9 (patch) | |
tree | edac3a631c14f123671da2a99c7bc0b70b7e13f9 /arch | |
parent | 6f03dcb145cc383bdbef043039d13fc674c8062e (diff) | |
download | lwn-4b8ec51eb5e94596b4a3d465b93a3d18375b98b9.tar.gz lwn-4b8ec51eb5e94596b4a3d465b93a3d18375b98b9.zip |
kvm: x86: fix kvm_apic_has_events to check for NULL pointer
[ Upstream commit ce40cd3fc7fa40a6119e5fe6c0f2bc0eb4541009 ]
Malicious (or egregiously buggy) userspace can trigger it, but it
should never happen in normal operation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/lapic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 6a11845fd8b9..72051730caf1 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -165,7 +165,7 @@ static inline u16 apic_logical_id(struct kvm_apic_map *map, u32 ldr) static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) { - return vcpu->arch.apic->pending_events; + return kvm_vcpu_has_lapic(vcpu) && vcpu->arch.apic->pending_events; } bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector); |