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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241014092955.GA105498@rigel>
Date: Mon, 14 Oct 2024 17:29:55 +0800
From: Kent Gibson <warthog618@...il.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 5/6] gpiolib: switch the line state notifier to atomic

On Mon, Oct 14, 2024 at 11:27:05AM +0200, Bartosz Golaszewski wrote:
> On Mon, Oct 14, 2024 at 11:24 AM Kent Gibson <warthog618@...il.com> wrote:
> >
> > On Mon, Oct 14, 2024 at 09:48:16AM +0200, Bartosz Golaszewski wrote:
> > > On Mon, Oct 14, 2024 at 4:11 AM Kent Gibson <warthog618@...il.com> wrote:
> > > > >
> > > > > +     /*
> > > > > +      * This is called from atomic context (with a spinlock taken by the
> > > > > +      * atomic notifier chain). Any sleeping calls must be done outside of
> > > > > +      * this function in process context of the dedicated workqueue.
> > > > > +      *
> > > > > +      * Let's gather as much info as possible from the descriptor and
> > > > > +      * postpone just the call to pinctrl_gpio_can_use_line() until the work
> > > > > +      * is executed.
> > > > > +      */
> > > > > +
> > > >
> > > > Should be in patch 4?  You aren't otherwise changing that function here.
> > > >
> > >
> > > Until this patch, the comment isn't really true, so I figured it makes
> > > more sense here.
> > >
> >
> > So the validity of the comment depends on how the function is being called?
> > Then perhaps you should reword it as well.
> >
>
> The validity of the comment depends on the type of the notifier used.
> As long as it's a blocking notifier, it's called with a mutex taken -
> it's process context. When we switch to the atomic notifier, this
> function is now called with a spinlock taken, so it's considered
> atomic.
>

Indeed - so the comment is brittle.

Cheers,
Kent.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ