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: <20140924144845.GB17997@saruman>
Date:	Wed, 24 Sep 2014 09:48:45 -0500
From:	Felipe Balbi <balbi@...com>
To:	Michal Sojka <sojka@...ica.cz>
CC:	Felipe Balbi <balbi@...com>, <linux-usb@...r.kernel.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Bryan Wu <cooloney@...il.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 v5 1/3] usb: gadget: Refactor request completion

Hi,

On Tue, Sep 23, 2014 at 10:09:22AM +0200, Michal Sojka wrote:
> >> +/**
> >> + * usb_gadget_giveback_request - give the request back to the gadget layer
> >> + * Context: in_interrupt()
> >> + *
> >> + * This is called by device controller drivers in order to return the
> >> + * completed request back to the gadget layer.
> >> + */
> >> +void usb_gadget_giveback_request(struct usb_ep *ep,
> >> +		struct usb_request *req)
> >> +{
> >> +	if (likely(req->complete))
> >> +		req->complete(ep, req);
> >> +	else
> >> +		pr_err("%s : req->complete must not be NULL\n", __func__);
> >
> > let it Oops. We require ->complete to be valid, if there's any gadget
> > driver not setting ->complete, it deserves to oops so we can the
> > error.
> 
> The Oops was there before, but I removed it because greg k-h didn't want
> it. See http://marc.info/?l=linux-usb&m=140917381611947&w=2. Do you
> still want the oops here?

you don't need a BUG_ON(), just call req->complete() directly without
any checks, if it's not valid, it _will_ oops. ->complete() is mandatory
and anybody sending requests without complete deserve to oops.

-- 
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