From: Radu Rendec <radu@rendec.net>
To: Borislav Petkov <bp@alien8.de>, Thomas Gleixner <tglx@kernel.org>
Cc: linux-tip-commits@vger.kernel.org,
Fabio Estevam <festevam@nabladev.com>,
Zhipeng Wang <zhipeng.wang_1@nxp.com>,
Frank Li <Frank.Li@nxp.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [tip: irq/drivers] irqchip/imx-irqsteer: Validate IRQ count before creating domain
Date: Sun, 08 Nov 2026 23:12:45 -0500 [thread overview]
Message-ID: <321c9fc07d58b2febeba1d6cb80baf85a4c03814.camel@rendec.net> (raw)
In-Reply-To: <20261109033108.GEavE-fNcWoLB94CXe@fat_crate.local>
On Sun, 2026-11-08 at 19:31 -0800, Borislav Petkov wrote:
> On Sun, Nov 08, 2026 at 09:49:39PM -0000, tip-bot2 for Fabio Estevam wrote:
> > The following commit has been merged into the irq/drivers branch of tip:
> >
> > Commit-ID: f99f3c4acaff0df9393c1e6a3f28b7b974e01d95
> > Gitweb: https://git.kernel.org/tip/f99f3c4acaff0df9393c1e6a3f28b7b974e01d95
> > Author: Fabio Estevam <festevam@nabladev.com>
> > AuthorDate: Wed, 04 Nov 2026 16:37:50 +09:00
> > Committer: Thomas Gleixner <tglx@kernel.org>
> > CommitterDate: Sun, 08 Nov 2026 22:43:43 +01:00
> >
> > irqchip/imx-irqsteer: Validate IRQ count before creating domain
> >
> > The IRQ count is validated after creating the IRQ domain. If it is
> > invalid, probe returns without removing the domain, leaving its host
> > data pointing at devm-managed memory that is freed on probe failure.
> >
> > Validate the count before allocating resources to avoid the leak and
> > dangling pointer.
> >
> > Fixes: 28528fca4908 ("irqchip/imx-irqsteer: Add multi output interrupts support")
> > Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> > Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
> > Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Reviewed-by: Radu Rendec <radu@rendec.net>
> > Link: https://patch.msgid.link/20261104073759.386777-3-Zhipeng.wang_1@oss.nxp.com
> > ---
> > drivers/irqchip/irq-imx-irqsteer.c | 7 ++-----
> > 1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
> > index 1b8d0c8..766756e 100644
> > --- a/drivers/irqchip/irq-imx-irqsteer.c
> > +++ b/drivers/irqchip/irq-imx-irqsteer.c
> > @@ -218,6 +218,8 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
> > */
> > data->irq_count = DIV_ROUND_UP(irqs_num, 64);
> > data->reg_num = irqs_num / 32;
> > + if (!data->irq_count || data->irq_count > CHAN_MAX_OUTPUT_INT)
> > + return -EINVAL;
> >
> > if (IS_ENABLED(CONFIG_PM)) {
> > data->saved_reg = devm_kzalloc(&pdev->dev,
> > @@ -246,11 +248,6 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
> > }
> > irq_domain_set_pm_device(data->domain, &pdev->dev);
> >
> > - if (!data->irq_count || data->irq_count > CHAN_MAX_OUTPUT_INT) {
> > - ret = -EINVAL;
> > - goto out;
> > - }
> > -
> > for (i = 0; i < data->irq_count; i++) {
> > data->irq[i] = irq_of_parse_and_map(np, i);
> > if (!data->irq[i])
>
> I'm guessing it is this one because it removes the "goto out;" around the
> 2xx-ish linenumbers but forgets to remove the out: label itself:
>
> drivers/irqchip/irq-imx-irqsteer.c: In function ‘imx_irqsteer_probe’:
> drivers/irqchip/irq-imx-irqsteer.c:271:1: error: label ‘out’ defined but not used [-Werror=unused-label]
> 271 | out:
> | ^~~
The culprit seems to be 54ac29cd1111 ("irqchip/imx-irqsteer: Let devres
own the clock"). I think Thomas had reworked the patches (particularly
the controversial part about the pm_runtime and clock control
management) before he applied them to the irq/drivers tip branch.
The commit posted to the mailing list removed the clk_disable_unprepare()
at the end of the function, along with the "out" label. The one in the
tip branch does not remove either. I guess the intention was to keep the
call, but the label slipped through.
> cc1: all warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:290: drivers/irqchip/irq-imx-irqsteer.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[3]: *** [scripts/Makefile.build:572: drivers/irqchip] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> An allmodconfig x86_64.
next prev parent reply other threads:[~2026-11-09 4:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:37 [PATCH v7 00/10] irqchip/imx-irqsteer: Allow building as module Zhipeng.wang_1
2026-11-04 7:37 ` [PATCH v7 01/10] irqchip/imx-irqsteer: Call chained_irq_exit() on the handler error path Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 02/10] irqchip/imx-irqsteer: Validate IRQ count before creating domain Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Fabio Estevam
2026-11-09 3:31 ` Borislav Petkov
2026-11-09 4:12 ` Radu Rendec [this message]
2026-11-04 7:37 ` [PATCH v7 03/10] irqchip/imx-irqsteer: Dispose of parent IRQ mappings in remove() Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 04/10] irqchip/imx-irqsteer: Convert to devm_pm_runtime_set_active_enabled() Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 05/10] irqchip/imx-irqsteer: Mask all interrupts in probe() Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 06/10] irqchip/imx-irqsteer: Let devres own the clock Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 07/10] irqchip/imx-irqsteer: Allow building as module Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Jindong Yue
2026-11-04 7:37 ` [PATCH v7 08/10] irqchip/imx-irqsteer: Dispose of child IRQ mappings in remove() Zhipeng.wang_1
2026-11-08 20:24 ` Radu Rendec
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 09/10] genirq/irqdomain: Add devm_irq_domain_create_linear() Zhipeng.wang_1
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
2026-11-04 7:37 ` [PATCH v7 10/10] irqchip/imx-irqsteer: Use devm_irq_domain_create_linear() Zhipeng.wang_1
2026-11-08 20:30 ` Radu Rendec
2026-11-08 21:49 ` [tip: irq/drivers] " tip-bot2 for Zhipeng Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=321c9fc07d58b2febeba1d6cb80baf85a4c03814.camel@rendec.net \
--to=radu@rendec.net \
--cc=Frank.Li@nxp.com \
--cc=bp@alien8.de \
--cc=festevam@nabladev.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=zhipeng.wang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®