linux/drivers/usb
Michal Pecio 2aa7bcfdbb 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>
History 2024-03-15 10:48:20 -04:00
..
atm usb: atm: cxacru: Fix typo in comment 2021-05-21 20:05:40 +02:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-03-01 13:21:49 +01:00
chipidea usb: chipidea: wait controller resume finished for wakeup irq 2024-01-25 14:52:47 -08:00
class usb: cdc-acm: return correct error code on unsupported break 2024-01-25 14:52:52 -08:00
common usb: common: usb-conn-gpio: Prevent bailing out if initial role is none 2023-08-16 18:21:59 +02:00
core USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT 2024-02-23 08:55:04 +01:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:31:25 +01:00
dwc3 usb: dwc3: gadget: Don't disconnect if not started 2024-03-01 13:21:49 +01:00
early usb: early: xhci-dbc: Fix a potential out-of-bound memory access 2023-03-10 09:39:39 +01:00
gadget usb: gadget: ncm: Avoid dropping datagrams of properly parsed NTBs 2024-03-01 13:21:50 +01:00
host xhci: handle isoc Babble and Buffer Overrun events properly 2024-03-15 10:48:20 -04:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1760: Fix out-of-bounds array access 2022-06-09 10:22:27 +02:00
misc USB: sisusbvga: Add endpoint checks 2023-05-30 13:55:31 +01:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 14:52:47 -08:00
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-11 23:00:33 +09:00
musb usb: musb: Modify the "HWVers" register address 2023-10-19 23:05:35 +02:00
phy usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() 2024-01-25 14:52:47 -08:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-08-25 11:40:33 +02:00
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-03-01 13:21:50 +01:00
serial USB: serial: cp210x: add ID for IMST iM871A-USB 2024-02-23 08:55:00 +01:00
storage usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-11-08 17:26:49 +01:00
typec usb: ucsi_acpi: Fix command completion handling 2024-02-23 08:55:04 +01:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 11:08:26 +01:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile usb: host: remove line for obsolete config USB_HWA_HCD 2021-08-18 15:32:19 +02:00
usb-skeleton.c USB: usb-skeleton: drop redundant in-urb check 2019-10-10 12:41:19 +02:00