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-next>] [day] [month] [year] [list]
Date: Mon, 5 Feb 2024 20:22:23 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Kent Gibson <warthog618@...il.com>, 
	Alex Elder <elder@...aro.org>, Geert Uytterhoeven <geert+renesas@...der.be>, 
	"Paul E . McKenney" <paulmck@...nel.org>, Wolfram Sang <wsa@...-dreams.de>, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, 
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 17/23] gpio: reduce the functionality of validate_desc()

On Mon, Feb 5, 2024 at 2:47 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Mon, Feb 05, 2024 at 10:34:12AM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > Checking desc->gdev->chip for NULL without holding it in place with some
> > serializing mechanism is pointless. Remove this check. Also don't check
> > desc->gdev for NULL as it can never happen. We'll be protecting
> > gdev->chip with SRCU soon but we will provide a dedicated, automatic
> > class for that.
>
> ...
>
> >  void gpiod_free(struct gpio_desc *desc)
> >  {
> > -     /*
> > -      * We must not use VALIDATE_DESC_VOID() as the underlying gdev->chip
> > -      * may already be NULL but we still want to put the references.
> > -      */
> > -     if (!desc)
> > -             return;
> > +     VALIDATE_DESC_VOID(desc);
>
> IIRC we (used to) have two cases like this (you added one in some code like
> last year).
>

None of the consumer-facing functions does it anymore. Not sure about
this, maybe it was removed earlier.

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ