linux/drivers/usb/host
Mathias Nyman d4a6106354 xhci: fix bounce buffer usage for non-sg list case
xhci driver may in some special cases need to copy small amounts
of payload data to a bounce buffer in order to meet the boundary
and alignment restrictions set by the xHCI specification.

In the majority of these cases the data is in a sg list, and
driver incorrectly assumed data is always in urb->sg when using
the bounce buffer.

If data instead is contiguous, and in urb->transfer_buffer, we may still
need to bounce buffer a small part if data starts very close (less than
packet size) to a 64k boundary.

Check if sg list is used before copying data to/from it.

Fixes: f9c589e142 ("xhci: TD-fragment, align the unsplittable case with a bounce buffer")
Cc: stable@vger.kernel.org
Reported-by: Andreas Hartmann <andihartmann@01019freenet.de>
Tested-by: Andreas Hartmann <andihartmann@01019freenet.de>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210203113702.436762-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-03 13:14:45 +01:00
..
bcma-hcd.c USB: bcma: use module_bcma_driver to simplify the code 2020-09-22 10:37:13 +02:00
ehci-atmel.c
ehci-brcm.c
ehci-dbg.c
ehci-exynos.c
ehci-fsl.c usb: hosts: Remove in_interrupt() from comments 2020-10-28 12:32:12 +01:00
ehci-fsl.h
ehci-grlib.c
ehci-hcd.c ehci: fix EHCI host controller initialization sequence 2021-01-12 17:16:37 +01:00
ehci-hub.c USB: ehci: fix an interrupt calltrace error 2021-01-12 17:24:27 +01:00
ehci-mem.c
ehci-mv.c
ehci-npcm7xx.c usb/host: ehci-npcm7xx: Use pm_ptr() macro 2020-09-04 16:54:47 +02:00
ehci-omap.c usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe 2020-12-09 14:33:45 +01:00
ehci-orion.c
ehci-pci.c
ehci-platform.c usb: host: ehci-platform: Add workaround for brcm, xgs-iproc-ehci 2020-09-14 16:45:28 +02:00
ehci-pmcmsp.c USB: host: ehci-pmcmsp: Cleanup usb_hcd_msp_remove() 2020-10-28 12:32:26 +01:00
ehci-ppc-of.c
ehci-ps3.c powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
ehci-q.c
ehci-sched.c usb: host: ehci-sched: add comment about find_tt() not returning error 2020-10-28 12:21:38 +01:00
ehci-sh.c
ehci-spear.c usb/host: ehci-spear: Use pm_ptr() macro 2020-09-04 16:54:45 +02:00
ehci-st.c
ehci-sysfs.c
ehci-tegra.c usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() 2020-10-28 13:23:07 +01:00
ehci-timer.c
ehci-xilinx-of.c
ehci.h
fhci-dbg.c
fhci-hcd.c
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c USB/Thunderbolt patches for 5.9-rc1 2020-08-05 12:13:10 -07:00
fhci-tds.c
fhci.h
fotg210-hcd.c usb: fotg210-hcd: remove casting dma_alloc_coherent 2020-12-09 15:25:19 +01:00
fotg210.h
fsl-mph-dr-of.c usb: host: fsl-mph-dr-of: check return of dma_set_mask() 2020-10-28 13:19:31 +01:00
isp116x-hcd.c usb: Fix fall-through warnings for Clang 2020-11-23 17:46:01 +01:00
isp116x.h
isp1362-hcd.c
isp1362.h USB: host: isp1362: delete isp1362_show_regs() 2020-10-28 13:08:22 +01:00
Kconfig usb: host: ehci-mxc: Remove the driver 2020-11-14 00:28:16 +01:00
Makefile usb: host: ehci-mxc: Remove the driver 2020-11-14 00:28:16 +01:00
max3421-hcd.c usb: Fix fall-through warnings for Clang 2020-11-23 17:46:01 +01:00
ohci-at91.c usb: hosts: Remove in_interrupt() from comments 2020-10-28 12:32:12 +01:00
ohci-da8xx.c
ohci-dbg.c
ohci-exynos.c usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe() 2020-08-27 09:25:58 +02:00
ohci-hcd.c usb: fix a few cases of -Wfallthrough 2020-11-13 15:20:52 +01:00
ohci-hub.c usb: fix a few cases of -Wfallthrough 2020-11-13 15:20:52 +01:00
ohci-mem.c
ohci-nxp.c
ohci-omap.c Merge 5.10-rc7 into usb-next 2020-12-07 10:20:51 +01:00
ohci-pci.c
ohci-platform.c
ohci-ppc-of.c
ohci-ps3.c powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
ohci-pxa27x.c usb: hosts: Remove in_interrupt() from comments 2020-10-28 12:32:12 +01:00
ohci-q.c
ohci-s3c2410.c usb: hosts: Remove in_interrupt() from comments 2020-10-28 12:32:12 +01:00
ohci-sa1111.c
ohci-sm501.c
ohci-spear.c
ohci-st.c
ohci-tmio.c
ohci.h
oxu210hp-hcd.c usb: oxu210hp-hcd: Fix memory leak in oxu_create 2020-12-09 15:25:21 +01:00
pci-quirks.c usb: pci-quirks: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
pci-quirks.h
r8a66597-hcd.c
r8a66597.h
sl811_cs.c
sl811-hcd.c usb: host: sl811: Switch to use platform_get_mem_or_io() 2020-12-10 16:31:46 +01:00
sl811.h
ssb-hcd.c
u132-hcd.c USB: host: u123-hcd: remove trailing semicolon in macro definition 2020-12-09 15:24:42 +01:00
uhci-debug.c
uhci-grlib.c
uhci-hcd.c
uhci-hcd.h
uhci-hub.c
uhci-pci.c
uhci-platform.c
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
xhci-dbgcap.h
xhci-dbgtty.c usb: xhci: convert tasklets to use new tasklet_setup() API 2020-08-18 13:00:01 +02:00
xhci-debugfs.c usb: xhci: add debugfs support for ep with stream 2020-09-20 16:18:00 +02:00
xhci-debugfs.h usb: xhci: add debugfs support for ep with stream 2020-09-20 16:18:00 +02:00
xhci-ext-caps.c
xhci-ext-caps.h
xhci-histb.c xhci: hisilicon: fix refercence leak in xhci_histb_probe 2020-11-13 14:32:43 +01:00
xhci-hub.c xhci: Give USB2 ports time to enter U3 in bus suspend 2020-12-09 14:32:03 +01:00
xhci-mem.c Merge 5.10-rc2 into usb-next 2020-11-02 10:04:07 +01:00
xhci-mtk-sch.c usb: xhci-mtk: break loop when find the endpoint to drop 2021-02-02 19:46:32 +01:00
xhci-mtk.c usb: xhci-mtk: fix unreleased bandwidth data 2021-01-26 15:54:04 +01:00
xhci-mtk.h usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints 2021-02-01 14:10:36 +01:00
xhci-mvebu.c usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-03 11:26:47 +01:00
xhci-mvebu.h usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-03 11:26:47 +01:00
xhci-pci-renesas.c usb: renesas-xhci: remove version check 2020-08-18 11:55:23 +02:00
xhci-pci.c xhci-pci: Allow host runtime PM as default for Intel Maple Ridge xHCI 2020-12-09 14:32:03 +01:00
xhci-pci.h
xhci-plat.c usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-03 11:26:47 +01:00
xhci-plat.h usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-03 11:26:47 +01:00
xhci-rcar.c usb: xhci-rcar: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
xhci-rcar.h
xhci-ring.c xhci: fix bounce buffer usage for non-sg list case 2021-02-03 13:14:45 +01:00
xhci-tegra.c xhci: tegra: Delay for disabling LFPS detector 2021-01-15 17:27:31 +01:00
xhci-trace.c
xhci-trace.h
xhci.c usb: xhci-mtk: fix unreleased bandwidth data 2021-01-26 15:54:04 +01:00
xhci.h usb: xhci-mtk: fix unreleased bandwidth data 2021-01-26 15:54:04 +01:00