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=1796467288; b=nF+TYTk9FS0z6pjdv2L6Ftlm/fpGrAO49P50FN5+to5H+UegINT7WjdXN+vm3xeXYNQL ED36pWRuBFaRYXvYOnF/k7saU44VIeywwFkpF6TJpy637ach38yAxPDUKzJpFvnwDFXxr rQ7BFkueJmjwoqXeH8deG8iJZoyVDEVZ9Vy0I3iYm2qwZyzzzm3ORtmXOhSZLf6rzH8JK QmJzAZ2EycShT5cvJdCoBw1zsEzm7z4wrYxYjNu8uxgxme9xtv7b9PYPeBjeVlG/DCHmB DBnfm4kLX3rYDLVcA871Ct+fONaR0a+d2gQAkgsfslYivBa58jXlbu1l+x4s0i5eS5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796467288; 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=+YQ2gN46L/Dpon+EWPwibJJFqs2go2f7r4JBiESAa48=; b=CkQ8yLBKJM0GE8LgBMgEHhBy/z4x1124XEXxubs3iVoepKI0QhOMykL1ZDle1phB8y+v e4i7IkuQmGEJ/UEwaaySHzu/M4RfJgdI4+6fTreWy7HeyIYT56itlInJSS14Tx/fEfMWa RZFdsCICrfOKbgNRBvP0WQnC0Lg/uPyoElX6jCZ3LqYeNANHM0RoukaGG/pYVya3Cl960 8O/vGLpFDVbUM88oI3k7sbc+Fy/0ps5bg+MovLD0Nd/2J9VW6VzFxzSTDMQBkk+haCjB2 hT4qykUx4n0cvjPk1uV4FKFw7gZw22oqODqTJfzHcnA5nDCsg5eUm+lxI9IZMLehPUg== 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=lMH6E9TZ; 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 640B6606A334; Sat, 5 Dec 2026 10:41:28 +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=lMH6E9TZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CAB11F0092B; Sat, 5 Dec 2026 10:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796467288; bh=+YQ2gN46L/Dpon+EWPwibJJFqs2go2f7r4JBiESAa48=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lMH6E9TZEQZdJOeKURVLlrWr84hrworzp3DlIy8ZKVNQi2FfZAqwXYKlzn4gtLiOp Q1e8vqOq1pTDNcRBF2cEbVc16NQAdD+0W9jY6y7JXTirx1+70AMEL9LpiHNsaHMEg4 c/SVT7My4njvb3NT73IoHu4tcC5gNKIFH0LgxJNxp8IgW6mxT0dFYYcPsZYDeKtlsj 1O0Y8xW88PHgBXNbAF2+SpvH3llzUphl1XNzQAyi7ijMnCvp16bematlPci9+nDkRa BB9ifNNKm9r4RRTrE1bcqQCbxAajMR3F5J8/iipv+ZxGTPmttvDin5YNhop9c/TlPi sCzYmxtu7tp7g== 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 1xZnCo-00000007USJ-1sd0; Sat, 05 Dec 2026 10:41:26 +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 7.3.y 3/5] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries Date: Sat, 5 Dec 2026 10:41:15 +0000 Message-ID: <20261205104117.1431915-4-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261205104117.1431915-1-maz@kernel.org> References: <20261205104117.1431915-1-maz@kernel.org> X-Mailing-List: kvm@vger.kernel.org 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 011415f59b34e..eec653f6859b8 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