]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
authorOliver Upton <oliver.upton@linux.dev>
Wed, 21 Feb 2024 09:27:31 +0000 (09:27 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 21 Feb 2024 10:06:41 +0000 (10:06 +0000)
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>
arch/arm64/kvm/vgic/vgic-its.c

index e2764d0ffa9f32094c57580ed5d987f99b5d2ade..082448de27ed9d77791b462e3596335e2c47c0de 100644 (file)
@@ -468,6 +468,9 @@ static int its_sync_lpi_pending_table(struct kvm_vcpu *vcpu)
                }
 
                irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]);
+               if (!irq)
+                       continue;
+
                raw_spin_lock_irqsave(&irq->irq_lock, flags);
                irq->pending_latch = pendmask & (1U << bit_nr);
                vgic_queue_irq_unlock(vcpu->kvm, irq, flags);