]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: usbdevfs: sanitize flags more
authorOliver Neukum <oneukum@suse.com>
Wed, 5 Sep 2018 10:07:02 +0000 (12:07 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:18 +0000 (19:51 -0600)
commit07cfc3a21904c16dd5c4b5a3b8a0713427ac9a8c
tree9ba87e6322be2a3b512e7cce8e66e643e5e92981
parentd4ab42651a8e12e6b76558d981cf1a58db218c47
USB: usbdevfs: sanitize flags more

BugLink: https://bugs.launchpad.net/bugs/1836287
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/core/devio.c