]> git.baikalelectronics.ru Git - kernel.git/commit
usbip: synchronize event handler with sysfs code paths
authorShuah Khan <skhan@linuxfoundation.org>
Tue, 30 Mar 2021 01:36:51 +0000 (19:36 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 07:05:42 +0000 (09:05 +0200)
commit956dcb09d5422e4387d3da8a0591aeccb2339ca7
treebfefeb5a04b0982e41c3c8aa9893a130cf4f5025
parentd3ce20d506c85c8c58b1c73f6e40da753a7ec32c
usbip: synchronize event handler with sysfs code paths

Fuzzing uncovered race condition between sysfs code paths in usbip
drivers. Device connect/disconnect code paths initiated through
sysfs interface are prone to races if disconnect happens during
connect and vice versa.

Use sysfs_lock to synchronize event handler with sysfs paths
in usbip drivers.

Cc: stable@vger.kernel.org
Reported-and-tested-by: syzbot+a93fba6d384346a761e3@syzkaller.appspotmail.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/c5c8723d3f29dfe3d759cfaafa7dd16b0dfe2918.1616807117.git.skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/usbip_event.c