Commit d6407613 authored by M. Vefa Bicakci's avatar M. Vefa Bicakci Committed by Greg Kroah-Hartman

Revert "usbip: Implement a match function to fix usbip"

This commit reverts commit 7a2f2974 ("usbip: Implement a match
function to fix usbip").

In summary, commit d5643d22 ("USB: Fix device driver race")
inadvertently broke usbip functionality, which I resolved in an incorrect
manner by introducing a match function to usbip, usbip_match(), that
unconditionally returns true.

However, the usbip_match function, as is, causes usbip to take over
virtual devices used by syzkaller for USB fuzzing, which is a regression
reported by Andrey Konovalov.

Furthermore, in conjunction with the fix of another bug, handled by another
patch titled "usbcore/driver: Fix specific driver selection" in this patch
set, the usbip_match function causes unexpected USB subsystem behaviour
when the usbip_host driver is loaded. The unexpected behaviour can be
qualified as follows:
- If commit 41160802ab8e ("USB: Simplify USB ID table match") is included
  in the kernel, then all USB devices are bound to the usbip_host
  driver, which appears to the user as if all USB devices were
  disconnected.
- If the same commit (41160802ab8e) is not in the kernel (as is the case
  with v5.8.10) then all USB devices are re-probed and re-bound to their
  original device drivers, which appears to the user as a disconnection
  and re-connection of USB devices.

Please note that this commit will make usbip non-operational again,
until yet another patch in this patch set is merged, titled
"usbcore/driver: Accommodate usbip".

Cc: <stable@vger.kernel.org> # 5.8: 41160802ab8e: USB: Simplify USB ID table match
Cc: <stable@vger.kernel.org> # 5.8
Cc: Bastien Nocera <hadess@hadess.net>
Cc: Valentina Manea <valentina.manea.m@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <syzkaller@googlegroups.com>
Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarM. Vefa Bicakci <m.v.b@runbox.com>
Link: https://lore.kernel.org/r/20200922110703.720960-2-m.v.b@runbox.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b405533
...@@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_device *udev) ...@@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_device *udev)
return; return;
} }
static bool usbip_match(struct usb_device *udev)
{
return true;
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* These functions need usb_port_suspend and usb_port_resume, /* These functions need usb_port_suspend and usb_port_resume,
...@@ -491,7 +486,6 @@ struct usb_device_driver stub_driver = { ...@@ -491,7 +486,6 @@ struct usb_device_driver stub_driver = {
.name = "usbip-host", .name = "usbip-host",
.probe = stub_probe, .probe = stub_probe,
.disconnect = stub_disconnect, .disconnect = stub_disconnect,
.match = usbip_match,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = stub_suspend, .suspend = stub_suspend,
.resume = stub_resume, .resume = stub_resume,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment