From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EBC4606A32F for ; Sat, 5 Dec 2026 10:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EYjUT+oN; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ThUQk0wm DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=FGDr2YIix0TavCco1RwbOkjejL/le/NQGgp0Ceh7slY=; b=EYjUT+oNd4p5Ny G/FFLnaGixkVJKe3zIoN7gSYyTRIbDF0WRqq/zdTfO2OhnYDjRQQjWBB0X+bqh+8ipc2S6JJTpYFW uU16SN9kJQvD3wFrCOlRR+Cg5uNzIar103VS7IofxGMkCUe8u+yn3CVC3bD7d44Y3PIbT9dD9uLYc XDVzMlsoe87w4RnNStaeAzodd9d+ThbOvkG46NYyWUPYF+rq+c6hAJz9PS0ytQOsZMXHvepIRwdtw y08EPUx5QFZGjJcu2vaiblODuHYu6l9L8tnCCMVVURRzQEjQWbp55/q3l/wPvd8+mUQ5CpwCg45Up iJKf87pRb22f8uol2C1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZnDW-00000002IFE-3God; Sat, 05 Dec 2026 10:42:10 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZnD0-00000002Hsw-45vq for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2026 10:41:39 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B8FBA44645; Sat, 5 Dec 2026 10:41:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B5121F00A1A; Sat, 5 Dec 2026 10:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796467298; bh=FGDr2YIix0TavCco1RwbOkjejL/le/NQGgp0Ceh7slY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ThUQk0wm9NNvDaCjZO/3u3DOZi6UiFbx4E8G/u6FoVD4t3otP/OlBVYK7OJxodSVp QwEa8KoRfbmSEMq+voTsDaGqMFI562WPHHyXfS2VCIyztp1WgqeVoaMBm39+kETITW r/9Kt/4hYLNocO1fOot7p7jifI4sK+Xi3tOh4KteepJJVKCPwtKiQfsyjL/4eHcoTx /dAttxJNKQhSvKljVAi9tAwdGfauNamaCHqX31H2ZOr1ecDnMVlh/emYkL0MH9eYVX qezXn/7HLX4Bnez7x4qCyJyd2RHe8ta0vOe8j8DY4thlMI1A+4pCl+MrcrF20BUaAE yZNOx+dItLC9g== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xZnCy-00000007UT8-39km; Sat, 05 Dec 2026 10:41:36 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Steffen Eiden , Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Fuad Tabba , Paolo Bonzini , stable@vger.kernel.org, Stefan Teodorescu , Damiano Melotti Subject: [PATCH 6.12.y 3/5] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries Date: Sat, 5 Dec 2026 10:41:29 +0000 Message-ID: <20261205104132.1432014-4-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261205104132.1432014-1-maz@kernel.org> References: <20261205104132.1432014-1-maz@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com, fuad.tabba@linux.dev, pbonzini@redhat.com, stable@vger.kernel.org, fane@google.com, melotti@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Signed-off-by: Damiano Melotti Signed-off-by: Marc Zyngier --- 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 a14ce3c422b7e..06c57aaa40cd6 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1925,7 +1925,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