USB: devio: fix issue with log flooding
authorOliver Neukum <oneukum@suse.de>
Fri, 1 Aug 2014 07:55:20 +0000 (09:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2014 23:01:46 +0000 (16:01 -0700)
usbfs allows user space to pass down an URB which sets URB_SHORT_NOT_OK
for output URBs. That causes usbcore to log messages without limit
for a nonsensical disallowed combination. The fix is to silently drop
the attribute in usbfs.
The problem is reported to exist since 3.14
https://www.virtualbox.org/ticket/13085

Signed-off-by: Oliver Neukum <oneukum@suse.de>
CC: stable@vger.kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c

index 257876ea03a1a9102ac89d0282fb03affe813103..0b59731c302133aea9db105b2ee2d87a82dd137c 100644 (file)
@@ -1509,7 +1509,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
        u = (is_in ? URB_DIR_IN : URB_DIR_OUT);
        if (uurb->flags & USBDEVFS_URB_ISO_ASAP)
                u |= URB_ISO_ASAP;
-       if (uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
+       if (uurb->flags & USBDEVFS_URB_SHORT_NOT_OK && is_in)
                u |= URB_SHORT_NOT_OK;
        if (uurb->flags & USBDEVFS_URB_NO_FSBR)
                u |= URB_NO_FSBR;