From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 44AC22BDC0E; Sat, 12 Sep 2026 07:51:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789199499; cv=none; b=EoeiSnaZmN8gUxYXTitkqEaNirVS1m+3CT2rjjMC/a5Db0j+5pmTRMvHuxbCerfIEX3wBWJwiwe5aAB6BI/3CeMUc6abrWH39KZEkd4KCLHlOOxi4b1uhzN95JgG7uZxZyjCgGnuzHP8Y1+fi2qEaHT9iEl9dAkvuHC3lKinVGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789199499; c=relaxed/simple; bh=zu40juC+hpNT85Kqs+2rW9vQQCWp9amwqdpPhHgrpyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CaJUVI1ZUmZqYeEieR800V9gs51cyjj2pvNysJnUOOTcw+zYq6c9vr0jjzeyXIvkY1UuypJG8qZDmMT4JVLJSXL9j8DJCSOaGYH18kMEqr46BMzJLm8iO8JtDUnDsa7qPoO0tM2oHTUkeraJ7tX00ABh6k3P8kLkumjXkd/XryY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mOME416G; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="mOME416G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F18E81F000FF; Sat, 12 Sep 2026 07:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789199498; bh=8SledkcFJgm4CAJNTPX+ZGn4RPMU/Mo0bkoidm4L0o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mOME416GIkNoTvYxU4sDKYWjtSuXNvGcb+T5qFQi2T9O8pneuM9G4RL1T94VSbD3N v/Ag3LEKbDUOvR2XFfl1w9PzKQ2JI2kTH9oQ2BNOvjO3rTxh4TLZn+WscTCXmQBbQ+ 4bxkHzqeqIlXAZsES6VIx1SfaowTFqhTUC/lG1DI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kemeng Shi , Thomas Gleixner , Marc Zyngier , Sasha Levin Subject: [PATCH 7.2 0554/1815] irqchip/gic-v3-its: Prevent leak in its_vpe_irq_domain_alloc() Date: Sat, 12 Sep 2026 08:38:24 +0200 Message-ID: <20260912065701.889319134@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kemeng Shi [ Upstream commit 325ff3e78c64cd619d52b99f7c8b09a3f31e1495 ] 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/teardown") 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 Signed-off-by: Sasha Levin --- 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 439dad40cef4f..274b9761c0eec 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4592,6 +4592,13 @@ static int its_vpe_init(struct its_vpe *vpe) 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 == NULL) + return; + its_vpe_db_proxy_unmap(vpe); its_vpe_id_free(vpe->vpe_id); its_free_pending_table(vpe->vpt_page); @@ -4672,8 +4679,10 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq irqd_set_resend_when_in_progress(irq_get_irq_data(virq + i)); } - if (err) + if (err) { + its_vpe_teardown(vm->vpes[i]); its_vpe_irq_domain_free(domain, virq, i); + } return err; } -- 2.53.0