From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55021 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdK1OCL (ORCPT ); Tue, 28 Nov 2017 09:02:11 -0500 Date: Tue, 28 Nov 2017 15:02:16 +0100 From: Greg KH To: Alan Stern Cc: Oliver Neukum , linux-usb@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCHv2] USB: usbfs: Filter flags passed in from user space Message-ID: <20171128140216.GA29213@kroah.com> References: <20171123153952.23003-1-oneukum@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Thu, Nov 23, 2017 at 10:53:13AM -0500, Alan Stern wrote: > On Thu, 23 Nov 2017, Oliver Neukum wrote: > > > USBDEVFS_URB_ISO_ASAP must be accepted only for ISO endpoints. > > Improve sanity checking. > > > > Reported-by: andreyknvl@google.com > > This should be > > Reported-by: Andrey Konovalov > > > Signed-off-by: Oliver Neukum > > CC: stable@vger.kernel.org > > --- > > drivers/usb/core/devio.c | 16 ++++++++++------ > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c > > index 705c573d0257..701ddada389a 100644 > > --- a/drivers/usb/core/devio.c > > +++ b/drivers/usb/core/devio.c > > @@ -1442,14 +1442,18 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb > > int number_of_packets = 0; > > unsigned int stream_id = 0; > > void *buf; > > - > > - if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP | > > - USBDEVFS_URB_SHORT_NOT_OK | > > + unsigned long mask = USBDEVFS_URB_SHORT_NOT_OK | > > USBDEVFS_URB_BULK_CONTINUATION | > > USBDEVFS_URB_NO_FSBR | > > - USBDEVFS_URB_ZERO_PACKET | > > - USBDEVFS_URB_NO_INTERRUPT)) > > - return -EINVAL; > > + USBDEVFS_URB_ZERO_PACKET | > > Extra whitespace at end of line (doesn't checkpatch.pl catch this)? I'll go edit it by hand...