android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Weitao Wang ef49d17eac usb: xhci: Fix slot_id resource race conflict
commit 2eb03376151bb8585caa23ed2673583107bb5193 upstream.

xHC controller may immediately reuse a slot_id after it's disabled,
giving it to a new enumerating device before the xhci driver freed
all resources related to the disabled device.

In such a scenario, device-A with slot_id equal to 1 is disconnecting
while device-B is enumerating, device-B will fail to enumerate in the
follow sequence.

1.[device-A] send disable slot command
2.[device-B] send enable slot command
3.[device-A] disable slot command completed and wakeup waiting thread
4.[device-B] enable slot command completed with slot_id equal to 1 and
	     wakeup waiting thread
5.[device-B] driver checks that slot_id is still in use (by device-A) in
	     xhci_alloc_virt_device, and fail to enumerate due to this
	     conflict
6.[device-A] xhci->devs[slot_id] set to NULL in xhci_free_virt_device

To fix driver's slot_id resources conflict, clear xhci->devs[slot_id] and
xhci->dcbba->dev_context_ptrs[slot_id] pointers in the interrupt context
when disable slot command completes successfully. Simultaneously, adjust
function xhci_free_virt_device to accurately handle device release.

[minor smatch warning and commit message fix -Mathias]

Cc: [email protected]
Fixes: 7faac1953ed1 ("xhci: avoid race between disable slot command and host runtime suspend")
Signed-off-by: Weitao Wang <[email protected]>
Signed-off-by: Mathias Nyman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2025-08-28 16:21:37 +02:00
..
atm usb: atm: cxacru: Merge cxacru_upload_firmware() into cxacru_heavy_init() 2025-08-28 16:21:30 +02:00
c67x00
cdns3 usb: cdns3: Fix deadlock when using NCM gadget 2025-05-02 07:39:27 +02:00
chipidea usb: chipidea: udc: fix sleeping function called from invalid context 2025-08-28 16:21:22 +02:00
class cdc-acm: fix race between initial clearing halt and open 2025-08-28 16:21:34 +02:00
common
core usb: hub: Don't try to recover devices lost during warm reset. 2025-08-28 16:21:34 +02:00
dwc2 usb: dwc2: gadget: remove of_node reference upon udc_stop 2025-03-13 12:43:14 +01:00
dwc3 usb: dwc3: Ignore late xferNotReady event to prevent halt timeout 2025-08-28 16:21:32 +02:00
early usb: early: xhci-dbc: Fix early_ioremap leak 2025-08-28 16:21:19 +02:00
gadget usb: gadget: udc: renesas_usb3: fix device leak at unbind 2025-08-28 16:21:30 +02:00
host usb: xhci: Fix slot_id resource race conflict 2025-08-28 16:21:37 +02:00
image
isp1760
misc USB: chaoskey: Fix possible deadlock chaoskey_list_lock 2024-12-14 19:44:34 +01:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 14:34:30 -08:00
mtu3
musb usb: musb: omap2430: fix device leak at unbind 2025-08-28 16:21:35 +02:00
phy usb: phy: mxs: disconnect line when USB charger is attached 2025-08-28 16:21:18 +02:00
renesas_usbhs usb: renesas_usbhs: Reorder clock handling and power management in probe 2025-06-27 11:02:48 +01:00
roles usb: roles: set switch registered flag early on 2025-03-13 12:43:14 +01:00
serial USB: serial: option: add Foxconn T99W709 2025-08-28 16:21:23 +02:00
storage USB: storage: Ignore driver CD mode for Realtek multi-mode Wi-Fi dongles 2025-08-28 16:21:32 +02:00
typec usb: typec: fusb302: cache PD RX state 2025-08-28 16:21:34 +02:00
usbip usbip: Don't submit special requests twice 2024-09-12 11:03:50 +02:00
Kconfig
Makefile
usb-skeleton.c