]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: yurex: Fix protection fault after device removal
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 23 Apr 2019 18:48:29 +0000 (14:48 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit999238803d9b54e49e16e18963205155a150622e
tree44c9c0e486eb518f59366057fc0f81235d9f3946
parent14603be1174240eef83a5c5ef86ba5472b363e48
USB: yurex: Fix protection fault after device removal

BugLink: https://bugs.launchpad.net/bugs/1838459
commit ef61eb43ada6c1d6b94668f0f514e4c268093ff3 upstream.

The syzkaller USB fuzzer found a general-protection-fault bug in the
yurex driver.  The fault occurs when a device has been unplugged; the
driver's interrupt-URB handler logs an error message referring to the
device by name, after the device has been unregistered and its name
deallocated.

This problem is caused by the fact that the interrupt URB isn't
cancelled until the driver's private data structure is released, which
can happen long after the device is gone.  The cure is to make sure
that the interrupt URB is killed before yurex_disconnect() returns;
this is exactly the sort of thing that usb_poison_urb() was meant for.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: syzbot+2eb9121678bdb36e6d57@syzkaller.appspotmail.com
CC: <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/misc/yurex.c