android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michal Pecio fd8bfaeba4 usb: xhci: Fix NULL pointer dereference on certain command aborts
[ Upstream commit 1e0a19912adb68a4b2b74fd77001c96cd83eb073 ]

If a command is queued to the final usable TRB of a ring segment, the
enqueue pointer is advanced to the subsequent link TRB and no further.
If the command is later aborted, when the abort completion is handled
the dequeue pointer is advanced to the first TRB of the next segment.

If no further commands are queued, xhci_handle_stopped_cmd_ring() sees
the ring pointers unequal and assumes that there is a pending command,
so it calls xhci_mod_cmd_timer() which crashes if cur_cmd was NULL.

Don't attempt timer setup if cur_cmd is NULL. The subsequent doorbell
ring likely is unnecessary too, but it's harmless. Leave it alone.

This is probably Bug 219532, but no confirmation has been received.

The issue has been independently reproduced and confirmed fixed using
a USB MCU programmed to NAK the Status stage of SET_ADDRESS forever.
Everything continued working normally after several prevented crashes.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=219532
Fixes: c311e391a7 ("xhci: rework command timeout and cancellation,")
CC: [email protected]
Signed-off-by: Michal Pecio <[email protected]>
Signed-off-by: Mathias Nyman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2025-03-13 12:43:05 +01:00
..
atm usb: atm: cxacru: fix endpoint checking in cxacru_bind() 2024-07-05 09:08:30 +02:00
c67x00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-03-01 13:13:36 +01:00
chipidea usb: chipidea: udc: handle USB Error Interrupt if IOC not set 2024-12-14 19:44:54 +01:00
class USB: usblp: return error when setting unsupported protocol 2025-02-01 18:18:47 +01:00
common
core usb: xhci: Add timeout argument in address_device USB HCD callback 2025-03-13 12:43:05 +01:00
dwc2 usb: dwc2: gadget: Don't write invalid mapped sg entries into dma_desc with iommu enabled 2025-01-09 13:23:26 +01:00
dwc3 usb: dwc3: gadget: Fix checking for number of TRBs left 2024-12-14 19:44:39 +01:00
early
gadget usb: gadget: f_tcm: Don't free command immediately 2025-03-13 12:43:01 +01:00
host usb: xhci: Fix NULL pointer dereference on certain command aborts 2025-03-13 12:43:05 +01: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: sunxi: Fix accessing an released usb phy 2024-11-17 14:58:52 +01:00
phy usb: phy: Fix API devm_usb_put_phy() can not release the phy 2024-11-08 16:20:53 +01:00
renesas_usbhs
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-03-01 13:13:36 +01:00
serial USB: serial: quatech2: fix null-ptr-deref in qt2_process_read_urb() 2025-02-01 18:18:53 +01:00
storage usb-storage: Add max sectors quirk for Nokia 208 2025-02-01 18:18:46 +01:00
typec usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE 2025-03-13 12:43:01 +01:00
usbip usbip: Don't submit special requests twice 2024-09-12 11:03:50 +02:00
Kconfig
Makefile
usb-skeleton.c