Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.linux.dev, kvm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Steffen Eiden <seiden@linux.ibm.com>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oupton@kernel.org>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Paolo Bonzini <pbonzini@redhat.com>,
	stable@vger.kernel.org, Stefan Teodorescu <fane@google.com>,
	Damiano Melotti <melotti@google.com>
Subject: [PATCH 6.6.y 3/5] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries
Date: Sat,  5 Dec 2026 10:41:36 +0000	[thread overview]
Message-ID: <20261205104138.1432063-4-maz@kernel.org> (raw)
In-Reply-To: <20261205104138.1432063-1-maz@kernel.org>

commit 6ddf1c750857c66c25bf1e7d13b29bcfd06634f5 upstream.

Do not blindly trust the vINTID field coming from KVM, and reject
anything that is out of the boundaries that the hardware ITS is
configured to support. These LPIs can still be injected as purely
virtual interrupt.

Fixes: d011e4e654d7f ("irqchip/gic-v3-its: Add VLPI map/unmap operations")
Reported-by: Stefan Teodorescu <fane@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Damiano Melotti <melotti@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/irqchip/irq-gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 0794bb3e89a94..8a786d95547b3 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1934,7 +1934,8 @@ static int its_vlpi_map(struct irq_data *d, struct its_cmd_info *info)
 	struct its_device *its_dev = irq_data_get_irq_chip_data(d);
 	u32 event = its_get_event_id(d);
 
-	if (!info->map)
+	if (!info->map || info->map->vintid < 8192 ||
+	    info->map->vintid >= BIT_ULL(LPI_NRBITS))
 		return -EINVAL;
 
 	if (!its_dev->event_map.vm) {
-- 
2.47.3



  parent reply	other threads:[~2026-12-05 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 10:41 [PATCH 6.6.y 0/5] KVM/arm64 stable fixes Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.6.y 1/5] KVM: arm64: vgic-its: Stop the VM when handling MOVALL Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.6.y 2/5] KVM: arm64: vgic-its: Bound PINTID during ITE table restore Marc Zyngier
2026-12-05 10:41 ` Marc Zyngier [this message]
2026-12-05 10:41 ` [PATCH 6.6.y 4/5] KVM: arm64: vgic-its: Add signal checks in scan_its_table() Marc Zyngier
2026-12-05 10:41 ` [PATCH 6.6.y 5/5] KVM: arm64: vgic: Linearise AP list pruning process Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205104138.1432063-4-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=fane@google.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=melotti@google.com \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seiden@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox