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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJe_ZhcuTX282zkkoa8ihnmNBpiXHWE7sTw2K+uB5OVkVU=P+Q@mail.gmail.com>
Date:   Wed, 8 Feb 2023 11:58:18 -0600
From:   Jassi Brar <jaswinder.singh@...aro.org>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     jassisinghbrar@...il.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, error27@...il.com,
        stern@...land.harvard.edu
Subject: Re: [PATCH] usb: gadget: udc: max3420_udc: fix serialized access

On Wed, 8 Feb 2023 at 11:23, Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Wed, Feb 08, 2023 at 10:34:18AM -0600, jassisinghbrar@...il.com wrote:
> > From: Jassi Brar <jaswinder.singh@...aro.org>
> >
> >  The mutex 'spi_bus_mutex' should be used, instead of the spin-lock,
> > while changing the state of the kernel-thread.
>
> You forgot to say why this is the case.
>
It was 'inherited' (my fault) from  drivers/usb/host/max3421-hcd.c
which has the same issue.
OK, I will also add to the log why that is a bad idea.

> > Also changing the
> > usb-gadget state need not be protected by a spin-lock.
>
> Why not?  Why isn't this a separate change?
>
Because other low-level spi changes are protected by spin-lock and it
seems ok to not to have to worry about such a race.
I don't have the h/w anymore to actually test it, so it is just a
patch from looking.
I just got lazy to break it into two patches, will do that.

> >  This should fix the Smatch static checker warning
> >     warn: sleeping in atomic context
> >
> > Fixes: 48ba02b2e2b1 ("usb: gadget: add udc driver for max3420")
> > Signed-off-by: Jassi Brar <jaswinder.singh@...aro.org>
> > ---
> >  drivers/usb/gadget/udc/max3420_udc.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
>
> You forgot a "Reported-by:" line, right?
>
Yes, I forgot.

thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ