mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: maz@kernel.org, oupton@kernel.org, kvmarm@lists.linux.dev,
	Stefan Teodorescu <fane@google.com>,
	stable@vger.kernel.org, Damiano Melotti <melotti@google.com>
Subject: [PATCH 2/4] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries
Date: Fri,  4 Dec 2026 18:57:38 +0100	[thread overview]
Message-ID: <20261204175740.2153746-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20261204175740.2153746-1-pbonzini@redhat.com>

From: Marc Zyngier <maz@kernel.org>

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 282e4bafb084..0bb7a37f2b83 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1922,7 +1922,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.56.1



  parent reply	other threads:[~2026-12-04 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 17:57 [PATCH 0/4] Fixes for various kvm-arm vulnerabilities Paolo Bonzini
2026-12-04 17:57 ` [PATCH 1/4] KVM: arm64: vgic-its: Bound PINTID during ITE table restore Paolo Bonzini
2026-12-05 22:44   ` Thomas Gleixner
2026-12-04 17:57 ` Paolo Bonzini [this message]
2026-12-04 17:57 ` [PATCH 3/4] KVM: arm64: vgic-its: Add signal checks in scan_its_table() Paolo Bonzini
2026-12-04 17:57 ` [PATCH 4/4] KVM: arm64: vgic: Linearise AP list pruning process Paolo Bonzini

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=20261204175740.2153746-3-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=fane@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=melotti@google.com \
    --cc=oupton@kernel.org \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®