Commit f080fd10 authored by Oliver Upton's avatar Oliver Upton Committed by sanglipeng1
Browse files

KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()

stable inclusion
from stable-v5.10.211
commit 6e5069b40fb4f595d515bce475d6d7ee60ec145f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAF2J4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6e5069b40fb4f595d515bce475d6d7ee60ec145f



--------------------------------

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: 33d3bc95 ("KVM: arm64: vgic-its: Read initial LPI pending table")
Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng1 <sanglipeng1@jd.com>
parent ee98fce7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -462,6 +462,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);