mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
The function documentation of usb_set_configuration says that its
callers should hold the device lock. This lock is held for all
callsites except tweak_set_configuration_cmd. The code path can be
executed for example when attaching a remote USB device.
The solution is to surround the call by the device lock.
This bug was found using my experimental own-developed static analysis
tool, which reported the missing lock on v5.17.2. I manually verified
this bug report by doing code review as well. I runtime checked that
the required lock is not held. I compiled and runtime tested this on
x86_64 with a USB mouse. After applying this patch, my analyser no
longer reports this potential bug.
Fixes:
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| stub_dev.c | ||
| stub_main.c | ||
| stub_rx.c | ||
| stub_tx.c | ||
| stub.h | ||
| usbip_common.c | ||
| usbip_common.h | ||
| usbip_event.c | ||
| vhci_hcd.c | ||
| vhci_rx.c | ||
| vhci_sysfs.c | ||
| vhci_tx.c | ||
| vhci.h | ||
| vudc_dev.c | ||
| vudc_main.c | ||
| vudc_rx.c | ||
| vudc_sysfs.c | ||
| vudc_transfer.c | ||
| vudc_tx.c | ||
| vudc.h | ||