From: Radu Rendec <radu@rendec.net>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Cc: Daniel Palmer <daniel@thingy.jp>,
Thomas Gleixner <tglx@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] irqchip/mst-intc: reject ranges beyond saved state capacity
Date: Sat, 25 Jul 2026 11:36:44 -0400 [thread overview]
Message-ID: <d5d3706f14b8d1c6dfc0854b2ab7d5499c48ceca.camel@rendec.net> (raw)
In-Reply-To: <20260722041443.10020-1-pengpeng@iscas.ac.cn>
On Wed, 2026-07-22 at 12:14 +0800, Pengpeng Hou wrote:
> The inclusive Device Tree IRQ range determines nr_irqs. Suspend and
> resume then use nr_irqs to walk the fixed saved_status array, which has
> MST_INTC_MAX_IRQS entries. A descending range underflows the unsigned
> subtraction, while a range wider than 64 entries exceeds that array.
>
> Reject both forms before deriving nr_irqs.
>
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> drivers/irqchip/irq-mst-intc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c
> index b5335f6fd6d6..1475335d668d 100644
> --- a/drivers/irqchip/irq-mst-intc.c
> +++ b/drivers/irqchip/irq-mst-intc.c
> @@ -263,6 +263,10 @@ static int __init mst_intc_of_init(struct device_node *dn,
> of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end))
> return -EINVAL;
>
> + if (irq_end < irq_start ||
> + irq_end - irq_start >= MST_INTC_MAX_IRQS)
> + return -EINVAL;
> +
> cd = kzalloc_obj(*cd);
> if (!cd)
> return -ENOMEM;
Reviewed-by: Radu Rendec <radu@rendec.net>
next prev parent reply other threads:[~2026-07-25 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 4:14 [PATCH] irqchip/mst-intc: reject ranges beyond saved state capacity Pengpeng Hou
2026-07-25 15:36 ` Radu Rendec [this message]
2026-08-20 8:17 ` Thomas Gleixner
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=d5d3706f14b8d1c6dfc0854b2ab7d5499c48ceca.camel@rendec.net \
--to=radu@rendec.net \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel@thingy.jp \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark-pk.tsai@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=pengpeng@iscas.ac.cn \
--cc=tglx@kernel.org \
/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