Skip to content

Commit d640761

Browse files
m-v-bgregkh
authored andcommitted
Revert "usbip: Implement a match function to fix usbip"
This commit reverts commit 7a2f297 ("usbip: Implement a match function to fix usbip"). In summary, commit d5643d2 ("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: <[email protected]> # 5.8: 41160802ab8e: USB: Simplify USB ID table match Cc: <[email protected]> # 5.8 Cc: Bastien Nocera <[email protected]> Cc: Valentina Manea <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Alan Stern <[email protected]> Cc: <[email protected]> Reported-by: Andrey Konovalov <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Acked-by: Shuah Khan <[email protected]> Signed-off-by: M. Vefa Bicakci <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2b40553 commit d640761

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/usb/usbip/stub_dev.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_device *udev)
461461
return;
462462
}
463463

464-
static bool usbip_match(struct usb_device *udev)
465-
{
466-
return true;
467-
}
468-
469464
#ifdef CONFIG_PM
470465

471466
/* These functions need usb_port_suspend and usb_port_resume,
@@ -491,7 +486,6 @@ struct usb_device_driver stub_driver = {
491486
.name = "usbip-host",
492487
.probe = stub_probe,
493488
.disconnect = stub_disconnect,
494-
.match = usbip_match,
495489
#ifdef CONFIG_PM
496490
.suspend = stub_suspend,
497491
.resume = stub_resume,

0 commit comments

Comments
 (0)