diff options
| author | Shuah Khan <skhan@linuxfoundation.org> | 2021-03-29 19:36:50 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-05 09:05:42 +0200 |
| commit | bd8b82042269a95db48074b8bb400678dbac1815 (patch) | |
| tree | 43af66f344afc0a2222eaad8cf7b1b99642e3f9b /drivers/usb/usbip/vudc_dev.c | |
| parent | 9dbf34a834563dada91366c2ac266f32ff34641a (diff) | |
| download | lwn-bd8b82042269a95db48074b8bb400678dbac1815.tar.gz lwn-bd8b82042269a95db48074b8bb400678dbac1815.zip | |
usbip: vudc synchronize 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 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>
Diffstat (limited to 'drivers/usb/usbip/vudc_dev.c')
| -rw-r--r-- | drivers/usb/usbip/vudc_dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c index c8eeabdd9b56..2bc428f2e261 100644 --- a/drivers/usb/usbip/vudc_dev.c +++ b/drivers/usb/usbip/vudc_dev.c @@ -572,6 +572,7 @@ static int init_vudc_hw(struct vudc *udc) init_waitqueue_head(&udc->tx_waitq); spin_lock_init(&ud->lock); + mutex_init(&ud->sysfs_lock); ud->status = SDEV_ST_AVAILABLE; ud->side = USBIP_VUDC; |
