From nobody Sat Jul 25 01:25:19 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 521EB433020; Tue, 21 Jul 2026 08:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784621259; cv=none; b=FG/hedsssPPEG89g7h9/i8+r3uA4ah/zEVdZFmzqxZ9EavlOTM4F5OWxu5HscaRT91RiUEJSAZZfNMoG3+h4UbxDKzl61DKhcuaVzlY5G2yPwHsfOddcCmG1d3rde/7qoI5Gg1tnl2UlBk+Sy86YEV4Kx/+HeXaCpmqGfwEl5k8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784621259; c=relaxed/simple; bh=yLJvKNgnFvJtPrJRoLEQ6I2iQDfA5nNEU8AJvSBTrH4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=hJi/Em+dUslWO3hMqt1K/TGV4B3g/MsGLF6999FhBoq3bNPMJk18HMJhcjpth6iO/AOFKtBoX627DAXs15XXZ2RYSBjPCTCmJE+3+53mm9WzfhNayys0YH9T9QaokgkGecCYTEhoRsaikSgkTb5TCrOehGZhNSp74VxRfixfhiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=w6ZQgOV7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=emfjuki3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="w6ZQgOV7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="emfjuki3" Date: Tue, 21 Jul 2026 08:07:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784621256; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJLhnbCf93Ng6dKv8mqXHZKfwjZTJrV93N3kJEkQVVI=; b=w6ZQgOV7Y4XZM756d4DGKwoRIQVPI/FBmgKt4epRS69hwMn4U+xZVRTHsmwZq9efqCehyP 3tDJsuGS08G9RMvaVCl5c+vtt3+e3xxURySnCFJPexpcXjFmQSWdqWrmZlBnrYIJTQoqQm NSTmRl4gPK73sotZfzMnmUnyN4FymZLilSCp6kjoMheQBhmNampNT4ui5ZDNwqkXvTqUSe epEGqzK3jBoMZJ3O+/ZSh0G6aTCM1GzWZZJeSuAnrBUOQinXft/qeCjT18JDFWHpR4yiLu 6A+DG//CRKrT9hqpUdjFhUIzsGdFIe5mi3gDbc/Db77jeUFnoTliAu/n20TWLg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784621256; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJLhnbCf93Ng6dKv8mqXHZKfwjZTJrV93N3kJEkQVVI=; b=emfjuki3EvqciQwR/9PCmVT4kjI6T1PmsEROz+SiJyQNl59kwtQRZS6vZ163zBKtIAjRxH s4II/5jOD1NgTrCQ== From: "tip-bot2 for Kemeng Shi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/drivers] irqchip/gic-v3-its: Prevent leak in its_vpe_irq_domain_alloc() Cc: Kemeng Shi , Thomas Gleixner , Marc Zyngier , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260721063241.52549-2-shikemeng@huaweicloud.com> References: <20260721063241.52549-2-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178462125505.2943223.11592471746836196971.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/drivers branch of tip: Commit-ID: 325ff3e78c64cd619d52b99f7c8b09a3f31e1495 Gitweb: https://git.kernel.org/tip/325ff3e78c64cd619d52b99f7c8b09a3f= 31e1495 Author: Kemeng Shi AuthorDate: Tue, 21 Jul 2026 14:32:40 +08:00 Committer: Thomas Gleixner CommitterDate: Tue, 21 Jul 2026 10:03:48 +02:00 irqchip/gic-v3-its: Prevent leak in its_vpe_irq_domain_alloc() When its_irq_gic_domain_alloc() fails, the following its_vpe_irq_domain_free() fails to invoke its_vep_teardown() for the corresponding interrupt, which leaks the resource. Invoke its_vpe_teardown() in the error handling path to avoid the leak. [ tglx: Massaged change log ] Fixes: 7d75bbb4bc1ad ("irqchip/gic-v3-its: Add VPE irq domain allocation/te= ardown") Signed-off-by: Kemeng Shi Signed-off-by: Thomas Gleixner Acked-by: Marc Zyngier Link: https://patch.msgid.link/20260721063241.52549-2-shikemeng@huaweicloud= .com --- drivers/irqchip/irq-gic-v3-its.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 78c34e6..07e3a08 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4594,6 +4594,13 @@ static int its_vpe_init(struct its_vpe *vpe) =20 static void its_vpe_teardown(struct its_vpe *vpe) { + /* + * If vpt_page is NULL, then its_vpe_init() has failed, and + * there is nothing to do as no resource has been allocated. + */ + if (vpe->vpt_page =3D=3D NULL) + return; + its_vpe_db_proxy_unmap(vpe); its_vpe_id_free(vpe->vpe_id); its_free_pending_table(vpe->vpt_page); @@ -4674,8 +4681,10 @@ static int its_vpe_irq_domain_alloc(struct irq_domai= n *domain, unsigned int virq irqd_set_resend_when_in_progress(irq_get_irq_data(virq + i)); } =20 - if (err) + if (err) { + its_vpe_teardown(vm->vpes[i]); its_vpe_irq_domain_free(domain, virq, i); + } =20 return err; }