Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202007161240.B58F7FE@keescook>
Date: Thu, 16 Jul 2020 12:41:38 -0700
From: Kees Cook <keescook@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Oscar Carter <oscar.carter@....com>,
	Mitchell Blank Jr <mitch@...oth.com>,
	kernel-hardening@...ts.openwall.com,
	Peter Zijlstra <peterz@...radead.org>,
	kgdb-bugreport@...ts.sourceforge.net,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	alsa-devel@...a-project.org, Allen Pais <allen.lkml@...il.com>,
	Christian Gromm <christian.gromm@...rochip.com>,
	Will Deacon <will@...nel.org>, devel@...verdev.osuosl.org,
	Jonathan Corbet <corbet@....net>,
	Daniel Thompson <daniel.thompson@...aro.org>,
	"David S. Miller" <davem@...emloft.net>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Takashi Iwai <tiwai@...e.com>, Julian Wiedmann <jwi@...ux.ibm.com>,
	"Matthew Wilcox (Oracle)" <willy@...radead.org>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	Nishka Dasgupta <nishkadg.linux@...il.com>,
	Jiri Slaby <jslaby@...e.com>, Jakub Kicinski <kuba@...nel.org>,
	Guenter Roeck <linux@...ck-us.net>,
	Wambui Karuga <wambui.karugax@...il.com>,
	Vasily Gorbik <gor@...ux.ibm.com>, linux-s390@...r.kernel.org,
	linux-kernel@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
	linux-input@...r.kernel.org, Ursula Braun <ubraun@...ux.ibm.com>,
	Stephen Boyd <swboyd@...omium.org>,
	Chris Packham <chris.packham@...iedtelesis.co.nz>,
	Harald Freudenberger <freude@...ux.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Jaroslav Kysela <perex@...ex.cz>, Felipe Balbi <balbi@...nel.org>,
	Kyungtae Kim <kt0755@...il.com>, netdev@...r.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Douglas Anderson <dianders@...omium.org>,
	Kevin Curtis <kevin.curtis@...site.co.uk>,
	linux-usb@...r.kernel.org,
	Jason Wessel <jason.wessel@...driver.com>,
	Romain Perier <romain.perier@...il.com>,
	Karsten Graul <kgraul@...ux.ibm.com>
Subject: Re: [PATCH 1/3] usb: gadget: udc: Avoid tasklet passing a global

On Thu, Jul 16, 2020 at 09:28:23AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jul 15, 2020 at 08:08:45PM -0700, Kees Cook wrote:
> > There's no reason for the tasklet callback to set an argument since it
> > always uses a global. Instead, use the global directly, in preparation
> > for converting the tasklet subsystem to modern callback conventions.
> > 
> > Signed-off-by: Kees Cook <keescook@...omium.org>
> > ---
> >  drivers/usb/gadget/udc/snps_udc_core.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c
> > index 3fcded31405a..afdd28f332ce 100644
> > --- a/drivers/usb/gadget/udc/snps_udc_core.c
> > +++ b/drivers/usb/gadget/udc/snps_udc_core.c
> > @@ -96,9 +96,7 @@ static int stop_pollstall_timer;
> >  static DECLARE_COMPLETION(on_pollstall_exit);
> >  
> >  /* tasklet for usb disconnect */
> > -static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect,
> > -		(unsigned long) &udc);
> > -
> > +static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0);
> >  
> >  /* endpoint names used for print */
> >  static const char ep0_string[] = "ep0in";
> > @@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev)
> >  /* Tasklet for disconnect to be outside of interrupt context */
> >  static void udc_tasklet_disconnect(unsigned long par)
> >  {
> > -	struct udc *dev = (struct udc *)(*((struct udc **) par));
> > +	struct udc *dev = udc;
> >  	u32 tmp;
> >  
> >  	DBG(dev, "Tasklet disconnect\n");
> 
> Feel free to just take this in your tree, no need to wait for the USB
> stuff to land.
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Okay, thanks! I'll carry this series for v5.9, unless I hear otherwise
from Thomas. :)

-- 
Kees Cook

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.