diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2024-02-21 09:27:31 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-01 13:06:11 +0100 |
commit | c2462b26faab4d40a78fc2862387bd615e0b7c25 (patch) | |
tree | 1269417622fc1115b1537d9240129e880e5ce09f /virt | |
parent | 343be31cc008a2f267863011934fb0aac6a9c8e2 (diff) | |
download | linux-stable-c2462b26faab4d40a78fc2862387bd615e0b7c25.tar.gz linux-stable-c2462b26faab4d40a78fc2862387bd615e0b7c25.tar.bz2 linux-stable-c2462b26faab4d40a78fc2862387bd615e0b7c25.zip |
KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
commit 8d3a7dfb801d157ac423261d7cd62c33e95375f8 upstream.
vgic_get_irq() may not return a valid descriptor if there is no ITS that
holds a valid translation for the specified INTID. If that is the case,
it is safe to silently ignore it and continue processing the LPI pending
table.
Cc: stable@vger.kernel.org
Fixes: 33d3bc9556a7 ("KVM: arm64: vgic-its: Read initial LPI pending table")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic/vgic-its.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index cb36774a750c..30d1809f720b 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -469,6 +469,9 @@ static int its_sync_lpi_pending_table(struct kvm_vcpu *vcpu) } irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]); + if (!irq) + continue; + spin_lock_irqsave(&irq->irq_lock, flags); irq->pending_latch = pendmask & (1U << bit_nr); vgic_queue_irq_unlock(vcpu->kvm, irq, flags); |