linux-stable/drivers/usb
Michal Pecio 2e3ec80ea7 xhci: handle isoc Babble and Buffer Overrun events properly
[ Upstream commit 7c4650ded4 ]

xHCI 4.9 explicitly forbids assuming that the xHC has released its
ownership of a multi-TRB TD when it reports an error on one of the
early TRBs. Yet the driver makes such assumption and releases the TD,
allowing the remaining TRBs to be freed or overwritten by new TDs.

The xHC should also report completion of the final TRB due to its IOC
flag being set by us, regardless of prior errors. This event cannot
be recognized if the TD has already been freed earlier, resulting in
"Transfer event TRB DMA ptr not part of current TD" error message.

Fix this by reusing the logic for processing isoc Transaction Errors.
This also handles hosts which fail to report the final completion.

Fix transfer length reporting on Babble errors. They may be caused by
device malfunction, no guarantee that the buffer has been filled.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240125152737.2983959-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-15 10:48:20 -04:00
..
atm
c67x00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-03-01 13:26:34 +01:00
chipidea usb: chipidea: wait controller resume finished for wakeup irq 2024-01-25 15:27:40 -08:00
class usb: cdc-acm: return correct error code on unsupported break 2024-01-25 15:27:47 -08:00
common usb: ulpi: Fix debugfs directory leak 2024-02-23 09:12:34 +01:00
core USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT 2024-02-23 09:12:34 +01:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:32:12 +01:00
dwc3 usb: dwc3: gadget: Don't disconnect if not started 2024-03-01 13:26:33 +01:00
early
gadget usb: gadget: Properly configure the device for remote wakeup 2024-03-06 14:45:05 +00:00
host xhci: handle isoc Babble and Buffer Overrun events properly 2024-03-15 10:48:20 -04:00
image
isp1760
misc usb: misc: onboard_hub: add support for Microchip USB2412 USB 2.0 hub 2023-10-25 12:03:08 +02:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 15:27:40 -08:00
mtu3
musb usb: musb: Modify the "HWVers" register address 2023-10-19 23:08:55 +02:00
phy usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() 2024-01-25 15:27:39 -08:00
renesas_usbhs
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-03-01 13:26:34 +01:00
serial USB: serial: cp210x: add ID for IMST iM871A-USB 2024-02-16 19:06:30 +01:00
storage scsi: sd: usb_storage: uas: Access media prior to querying device properties 2024-03-06 14:45:04 +00:00
typec usb: ucsi_acpi: Quirk to ack a connector change ack cmd 2024-03-01 13:26:27 +01:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 11:52:10 +01:00
Kconfig
Makefile
usb-skeleton.c