[PATCH 3.16 107/157] USB: yurex: Fix protection fault after device removal
From: Ben Hutchings
Date: Sat Aug 10 2019 - 16:50:44 EST
3.16.72-rc1 review patch. If anyone has any objections, please let me know.
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
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
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@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
drivers/usb/misc/yurex.c | 1 +
1 file changed, 1 insertion(+)
@@ -332,6 +332,7 @@ static void yurex_disconnect(struct usb_
/* prevent more I/O from starting */
dev->interface = NULL;