lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANeGvZUneWgQYAciHhx9yu--vQ88xOvH+Zhyw2LKQMjiwHNwng@mail.gmail.com>
Date: Tue, 4 Feb 2025 19:44:31 -0500
From: Jiasheng Jiang <jiashengjiangcool@...il.com>
To: Matti Vaittinen <mazziesaccount@...il.com>
Cc: broonie@...nel.org, gregkh@...uxfoundation.org, rafael@...nel.org, 
	dakr@...nel.org, linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] regmap-irq: Add missing kfree()

Hi Matti,

On Tue, Feb 4, 2025 at 3:34 AM Matti Vaittinen <mazziesaccount@...il.com> wrote:
>
> Thanks Jiang!
>
> On 02/02/2025 22:05, Jiasheng Jiang wrote:
> > Add kfree() for "d->main_status_buf" in the error-handling path to prevent
> > a memory leak.
> >
> > Fixes: a2d21848d921 ("regmap: regmap-irq: Add main status register support")
> > Cc: <stable@...r.kernel.org>
> > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
>
> This looks valid to me.
>
> I still wonder if you could fix also the missing freeing from the
> regmap_del_irq_chip()? (AFAICS, the freeing is missing from that as well).

Thanks for your help.
I have submitted a v2 to fix it.

-Jiasheng

>
> > ---
> >   drivers/base/regmap/regmap-irq.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
> > index 0bcd81389a29..b73ab3cda781 100644
> > --- a/drivers/base/regmap/regmap-irq.c
> > +++ b/drivers/base/regmap/regmap-irq.c
> > @@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
> >       kfree(d->wake_buf);
> >       kfree(d->mask_buf_def);
> >       kfree(d->mask_buf);
> > +     kfree(d->main_status_buf);
> >       kfree(d->status_buf);
> >       kfree(d->status_reg_buf);
> >       if (d->config_buf) {
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ