From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796467293; b=jOfTJt7vto4vV/Q2PHT9xZlgsDeZoCVm89Gi1XyC/vOBCBNqytz6KBP8+SfrrsZUMcDk 5I8g/vOuf68rgUCpcELaZZOOGUvnF7OsL4vMKgCscJFooMoxN19JowuuGrUWHe1NGnuWh VV9O48SdyoNHQ6YrEZfQhQ56y6lIqcOumuffCsBbrBSGMa8jrTzfuCYDehJpVx/eO632E ehoBijpeoO02BMuW4FAShXxvu/HKHwxigrg8+WE1yE4NEttrvaJVcZYy23vxtgBByleab NUnDK91/otq5xGexqdFYeoTzH/DXjUsfTmCY7a7aOhI5jXJyW9Lcay82X2XQWk2BlYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796467293; h=Received:DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To: X-SA-Exim-Mail-From:X-SA-Exim-Scanned; bh=92GDP0wlrSCSGBhpKz4by/VASJN7Sb3CC2MRCcPix+c=; b=wW/g/ECT8nAnML9eS3miuoCa/Ye70JsyRdquJYQRJWSbWPrj5omtRB6bOz8DOANksAY8 4gjX4Ho7cZWyx4xxyismwr6N96WgJfII1pnBn0gIRk79FifqURuWs3X/hNm2t8yPVoBbc oLT4IW8/iyxf0u/UKLyKYAc/oBImSYnjyhvi0s1+Uk/bGTDJcN8XfPq9QtEGOfeQbRBY8 IbkqdrY7c7Ddgu7kHnv7F2Ly/x9q4uX3qfLW77uUNJsxBqtNMpm1se7R85B3lxIhuQA60 QbuU+bbJhdtmXAjHC+LQKK1ShkZUEHQybAILFfIHHmKkB5LovZVGwD7XLM/ZyqJjKKA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gOUIanR6; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17CEA606A6A4; Sat, 5 Dec 2026 10:41:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gOUIanR6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D2F1F00A25; Sat, 5 Dec 2026 10:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796467293; bh=92GDP0wlrSCSGBhpKz4by/VASJN7Sb3CC2MRCcPix+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gOUIanR6pEEuQsmQvzxUCKmmVVFcmSHziu2ZHZjRIe9pUxURNwM9JWkPQSwL/foEu KTki2Lv8F/AJJEgcwNuTE76EcuUYIuhc4nQyRyi6RMC3FenfEHKNH6/JuNRUDOF1BB 94F40CfHGE0qloWXq0XmyTUNKQ/VndS/wOEBzG/gcqXmahI2FI1AiVf0Um5if6Zm+x X1DAQHfSwYhfS8qO6ti7QQPyU1r4NfNQE/UiTijLnonG3XSIxcQjwPS5HfvgzbwVwz XKY1VZqxVc2wsl88YMS8JHD/xQWlj7WOmgwNopR2zHS8N5Vm6zaruMbaVPfCYqQwgb Er2v2hs8dZxVQ== 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 1xZnCt-00000007USd-0v4R; Sat, 05 Dec 2026 10:41:31 +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.18.y 3/5] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries Date: Sat, 5 Dec 2026 10:41:25 +0000 Message-ID: <20261205104127.1431965-4-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261205104127.1431965-1-maz@kernel.org> References: <20261205104127.1431965-1-maz@kernel.org> X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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 9fb9c06b9242e..5ee061bb4ba5d 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.47.3