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: <CAEnQdOqoCuiN67oWisJs7RYandhHxcvbPXXxHKmPaoS5=puPyw@mail.gmail.com>
Date: Thu, 17 Apr 2025 18:17:20 +0800
From: henry martin <bsdhenrymartin@...il.com>
To: Stefan Wahren <wahrenst@....net>
Cc: mturquette@...libre.com, sboyd@...nel.org, florian.fainelli@...adcom.com, 
	bcm-kernel-feedback-list@...adcom.com, popcornmix@...il.com, 
	mripard@...nel.org, u.kleine-koenig@...libre.com, linux-clk@...r.kernel.org, 
	linux-rpi-kernel@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, nathan@...nel.org, 
	dave.stevenson@...pberrypi.com
Subject: Re: [PATCH v2] clk: bcm: rpi: Add NULL check in raspberrypi_clk_register()

> Just a note, please don't send new patch versions as a reply to older
> ones. This makes them harder to find.

Noted, thanks for the review! I'll make sure to send new patch versions as
separate emails in the future.

Regards,
Henry

Stefan Wahren <wahrenst@....net> 于2025年4月17日周四 18:09写道:
>
> Am 02.04.25 um 04:05 schrieb Henry Martin:
> > devm_kasprintf() returns NULL when memory allocation fails. Currently,
> > raspberrypi_clk_register() does not check for this case, which results
> > in a NULL pointer dereference.
> >
> > Add NULL check after devm_kasprintf() to prevent this issue.
> >
> > Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks")
> > Signed-off-by: Henry Martin <bsdhenrymartin@...il.com>
> > Reviewed-by: Dave Stevenson <dave.stevenson@...pberrypi.com>
> Reviewed-by: Stefan Wahren <wahrenst@....net>
>
> Just a note, please don't send new patch versions as a reply to older
> ones. This makes them harder to find.
>
> Thanks
> > ---
> > V1 -> V2: Correct the commit hash in the Fixes: tag.
> >
> >   drivers/clk/bcm/clk-raspberrypi.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> > index 0e1fe3759530..720acc10f8aa 100644
> > --- a/drivers/clk/bcm/clk-raspberrypi.c
> > +++ b/drivers/clk/bcm/clk-raspberrypi.c
> > @@ -286,6 +286,8 @@ static struct clk_hw *raspberrypi_clk_register(struct raspberrypi_clk *rpi,
> >       init.name = devm_kasprintf(rpi->dev, GFP_KERNEL,
> >                                  "fw-clk-%s",
> >                                  rpi_firmware_clk_names[id]);
> > +     if (!init.name)
> > +             return ERR_PTR(-ENOMEM);
> >       init.ops = &raspberrypi_firmware_clk_ops;
> >       init.flags = CLK_GET_RATE_NOCACHE;
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ