Re: [PATCH net] net: pse-pd: fix out-of-bounds bitmap access in pse_isr() on 32-bit

From: Kory Maincent

Date: Wed Apr 15 2026 - 04:27:17 EST


On Tue, 14 Apr 2026 20:47:06 +0200
Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

> Hi Kory,
>
> On Tue, Apr 14, 2026 at 05:13:30PM +0200, Kory Maincent wrote:
> > @@ -1340,6 +1341,11 @@ int devm_pse_irq_helper(struct pse_controller_dev
> > *pcdev, int irq, if (!h->notifs)
> > return -ENOMEM;
> >
> > + h->notifs_mask = devm_kcalloc(dev, BITS_TO_LONGS(pcdev->nr_lines),
> > + sizeof(*h->notifs_mask),
> > GFP_KERNEL);
>
> May be better devm_bitmap_zalloc() instead of devm_kcalloc()?

Oh didn't know this one. Yes that's better. I will send v2 with it.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com