]> git.baikalelectronics.ru Git - kernel.git/commit
usbip: prevent bind loops on devices attached to vhci_hcd
authorShuah Khan <shuahkh@osg.samsung.com>
Wed, 17 Jan 2018 19:07:30 +0000 (12:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2018 14:34:37 +0000 (15:34 +0100)
commitebd056ad75f62b895efce95d1d37480d18ef6477
treee2ee1552dd7ab77b6701bac39f4aac2628a152fc
parente84993f79e9c9ac27123ff577dd8cc9912c68bfc
usbip: prevent bind loops on devices attached to vhci_hcd

usbip host binds to devices attached to vhci_hcd on the same server
when user does attach over localhost or specifies the server as the
remote.

usbip attach -r localhost -b busid
or
usbip attach -r servername (or server IP)

Unbind followed by bind works, however device is left in a bad state with
accesses via the attached busid result in errors and system hangs during
shutdown.

Fix it to check and bail out if the device is already attached to vhci_hcd.

Cc: stable@vger.kernel.org
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/usb/usbip/src/usbip_bind.c