USB: usbdevfs: sanitize flags more
authorOliver Neukum <oneukum@suse.com>
Wed, 5 Sep 2018 10:07:02 +0000 (12:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:01:50 +0000 (17:01 -0700)
commita2ecf4329fe1c334b7341c20beb90ba02bf9e76c
tree186750c24418159810e671feca5d2906d3cc8958
parent143c0f1ce18d33915dff42c4f2fe3b45b02578e1
USB: usbdevfs: sanitize flags more

commit 7a68d9fb851012829c29e770621905529bd9490b upstream.

Requesting a ZERO_PACKET or not is sensible only for output.
In the input direction the device decides.
Likewise accepting short packets makes sense only for input.

This allows operation with panic_on_warn without opening up
a local DOS.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: syzbot+843efa30c8821bd69f53@syzkaller.appspotmail.com
Fixes: 0cb54a3e47cb ("USB: debugging code shouldn't alter control flow")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c