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: <20140929140550.GF32403@saruman>
Date:	Mon, 29 Sep 2014 09:05:50 -0500
From:	Felipe Balbi <balbi@...com>
To:	Robert Baldyga <r.baldyga@...sung.com>
CC:	Michal Sojka <sojka@...ica.cz>, <linux-usb@...r.kernel.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Bryan Wu <cooloney@...il.com>, Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Linux LED Subsystem <linux-leds@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <michal.vokac@...ap.cz>
Subject: Re: [PATCH v6 2/4] usb: gadget: Refactor request completion

Hi,

On Mon, Sep 29, 2014 at 10:50:02AM +0200, Robert Baldyga wrote:
> > diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
> > index 7324308..dd18ea3 100644
> > --- a/drivers/usb/gadget/udc/fsl_qe_udc.c
> > +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
> > @@ -118,10 +118,7 @@ static void done(struct qe_ep *ep, struct qe_req *req, int status)
> >  	ep->stopped = 1;
> >  	spin_unlock(&udc->lock);
> >  
> > -	/* this complete() should a func implemented by gadget layer,
> > -	 * eg fsg->bulk_in_complete() */
> > -	if (req->req.complete)
> > -		req->req.complete(&ep->ep, &req->req);
> > +	usb_gadget_giveback_request(&ep->ep, &req->req);
> 
> It looks like you have omitted if() statement. Are you sure that request
> has set complete() callback?

complete is mandatory. If a request comes without a complete, it
deserves to oops.

> Maybe it's worth to add this if inside usb_gadget_giveback_request()
> function?

nope, we want those cases to oops so we catch the broken gadget driver.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ