summaryrefslogtreecommitdiff
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2019-04-23 21:48:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 08:20:46 +0300
commit5696fa3f42168ee33256c0b0b72ca963d224327f (patch)
treea5cdc7f0f5673740ce5a6a280b613675578af1bc /drivers/usb/misc
parentbfa5aa541c1ed6ec031551c1b7817410b2f09b41 (diff)
downloadlinux-5696fa3f42168ee33256c0b0b72ca963d224327f.tar.xz
USB: yurex: Fix protection fault after device removal
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>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/yurex.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 4f48f5730e12..8ee98bc6c468 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -318,6 +318,7 @@ static void yurex_disconnect(struct usb_interface *interface)
usb_deregister_dev(interface, &yurex_class);
/* prevent more I/O from starting */
+ usb_poison_urb(dev->urb);
mutex_lock(&dev->io_mutex);
dev->interface = NULL;
mutex_unlock(&dev->io_mutex);