]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usbip: vudc synchronize sysfs code paths
authorShuah Khan <skhan@linuxfoundation.org>
Tue, 30 Mar 2021 01:36:50 +0000 (19:36 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:47:14 +0000 (08:47 +0200)
commite8e4a8282b1a2ebb71cd633446aa572c462863a9
tree1639b50bdbf3c22000069db83f7b849c09baa7e0
parent4f72d804791d3744f51eb8c7b6abdee34f6e2404
usbip: vudc synchronize sysfs code paths

commit bd8b82042269a95db48074b8bb400678dbac1815 upstream.

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 protect sysfs paths in vudc.

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/caabcf3fc87bdae970509b5ff32d05bb7ce2fb15.1616807117.git.skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/vudc_dev.c
drivers/usb/usbip/vudc_sysfs.c