linux-stable/drivers/usb/host
Prashanth K 4a49d24fde usb: xhci: Add error handling in xhci_map_urb_for_dma
[ Upstream commit be95cc6d71 ]

Currently xhci_map_urb_for_dma() creates a temporary buffer and copies
the SG list to the new linear buffer. But if the kzalloc_node() fails,
then the following sg_pcopy_to_buffer() can lead to crash since it
tries to memcpy to NULL pointer.

So return -ENOMEM if kzalloc returns null pointer.

Cc: stable@vger.kernel.org # 5.11
Fixes: 2017a1e584 ("usb: xhci: Use temporary buffer to consolidate SG")
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240229141438.619372-10-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:18:37 +02:00
..
bcma-hcd.c USB: bcma: Make GPIO explicitly optional 2022-11-26 09:24:44 +01:00
ehci-atmel.c
ehci-brcm.c USB: ehci_brcm_hub_control: Improve port index sanitizing 2022-01-27 11:04:26 +01:00
ehci-dbg.c
ehci-exynos.c
ehci-fsl.c usb: host: ehci-fsl: Fix module alias 2023-01-24 07:22:46 +01:00
ehci-fsl.h
ehci-grlib.c
ehci-hcd.c usb: ehci: add workaround for chipidea PORTSC.PEC bug 2023-09-23 11:09:59 +02:00
ehci-hub.c usb: ehci: add workaround for chipidea PORTSC.PEC bug 2023-09-23 11:09:59 +02:00
ehci-mem.c
ehci-mv.c USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable() 2021-07-21 10:04:41 +02:00
ehci-npcm7xx.c
ehci-omap.c
ehci-orion.c usb: ehci-orion: Handle errors of clk_prepare_enable() in probe 2021-08-26 13:09:34 +02:00
ehci-pci.c usb: ehci: add pci device support for Aspeed platforms 2022-04-13 20:59:04 +02:00
ehci-platform.c usb: ehci: handshake CMD_RUN instead of STS_HALT 2021-11-12 15:05:47 +01:00
ehci-ppc-of.c usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe 2022-08-17 14:23:41 +02:00
ehci-ps3.c
ehci-q.c
ehci-sched.c
ehci-sh.c
ehci-spear.c
ehci-st.c
ehci-sysfs.c
ehci-timer.c
ehci-xilinx-of.c
ehci.h usb: ehci: add workaround for chipidea PORTSC.PEC bug 2023-09-23 11:09:59 +02:00
fhci-dbg.c
fhci-hcd.c
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h
fotg210-hcd.c usb: fotg210-hcd: delete an incorrect bounds test 2024-01-05 15:13:37 +01:00
fotg210.h usb: host: fotg210: fix the actual_length of an iso packet 2021-07-21 10:03:42 +02:00
fsl-mph-dr-of.c
isp116x-hcd.c USB: isp116x: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:36 +01:00
isp116x.h
isp1362-hcd.c USB: isp1362: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:36 +01:00
isp1362.h
Kconfig usb: host: remove dead EHCI support for on-chip PMC MSP71xx USB controller 2021-08-18 15:32:19 +02:00
Makefile
max3421-hcd.c usb: max-3421: Fix setting of I/O pins 2023-03-10 09:39:41 +01:00
ohci-at91.c usb: ohci-at91: Fix the unhandle interrupt when resume 2023-08-03 10:22:42 +02:00
ohci-da8xx.c
ohci-dbg.c
ohci-exynos.c
ohci-hcd.c
ohci-hub.c
ohci-mem.c
ohci-nxp.c usb: ohci-nxp: Fix refcount leak in ohci_hcd_nxp_probe 2022-08-17 14:23:41 +02:00
ohci-omap.c ARM: omap1: move omap15xx local bus handling to usb.c 2021-10-05 15:39:50 +02:00
ohci-pci.c
ohci-platform.c
ohci-ppc-of.c usb: host: ohci-ppc-of: Fix refcount leak bug 2022-08-25 11:40:33 +02:00
ohci-ps3.c
ohci-pxa27x.c
ohci-q.c
ohci-s3c2410.c
ohci-sa1111.c
ohci-sm501.c
ohci-spear.c usb: host: ohci-spear: simplify calling usb_add_hcd() 2021-07-21 10:05:05 +02:00
ohci-st.c
ohci-tmio.c usb: host: ohci-tmio: check return value after calling platform_get_resource() 2021-11-25 09:48:28 +01:00
ohci.h
oxu210hp-hcd.c drivers: usb: host: Fix deadlock in oxu_bus_suspend() 2022-06-14 18:36:21 +02:00
pci-quirks.c
pci-quirks.h
r8a66597-hcd.c
r8a66597.h
sl811-hcd.c USB: sl811: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:35 +01:00
sl811.h
sl811_cs.c
ssb-hcd.c
u132-hcd.c usb: host: u132-hcd: remove redundant continue statements 2021-06-17 15:31:50 +02:00
uhci-debug.c
uhci-grlib.c
uhci-hcd.c USB: uhci: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:35 +01:00
uhci-hcd.h
uhci-hub.c
uhci-pci.c USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value 2023-05-24 17:36:52 +01:00
uhci-platform.c usb: uhci: add aspeed ast2600 uhci support 2022-01-27 11:04:34 +01:00
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c xhci: dbc: Fix memory leak in xhci_alloc_dbc() 2022-10-26 12:34:19 +02:00
xhci-dbgcap.h xhci: dbc: Rename xhci_dbc_init and xhci_dbc_exit 2022-07-29 17:25:27 +02:00
xhci-dbgtty.c xhci: dbc: create and remove dbc structure in dbgtty driver. 2022-07-29 17:25:26 +02:00
xhci-debugfs.c xhci: fix debugfs register accesses while suspended 2023-05-11 23:00:16 +09:00
xhci-debugfs.h
xhci-ext-caps.c
xhci-ext-caps.h
xhci-histb.c
xhci-hub.c xhci: track port suspend state correctly in unsuccessful resume cases 2024-03-01 13:21:57 +01:00
xhci-mem.c xhci: move port specific items such as state completions to port structure 2024-03-01 13:21:57 +01:00
xhci-mtk-sch.c usb: xhci-mtk: fix bandwidth release issue 2022-09-08 12:28:07 +02:00
xhci-mtk.c usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer 2024-01-25 14:52:52 -08:00
xhci-mtk.h usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer 2024-01-25 14:52:52 -08:00
xhci-mvebu.c usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math 2023-03-11 13:57:37 +01:00
xhci-mvebu.h
xhci-pci-renesas.c USB/Thunderbolt patches for 5.15-rc1 2021-09-01 09:59:34 -07:00
xhci-pci.c Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" 2023-12-13 18:36:48 +01:00
xhci-pci.h usb: renesas-xhci: Remove renesas_xhci_pci_exit() 2021-07-21 10:05:59 +02:00
xhci-plat.c usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK 2024-02-23 08:55:00 +01:00
xhci-plat.h
xhci-rcar.c usb: host: xhci-rcar: remove leftover quirk handling 2023-05-11 23:00:31 +09:00
xhci-rcar.h
xhci-ring.c xhci: handle isoc Babble and Buffer Overrun events properly 2024-03-15 10:48:20 -04:00
xhci-tegra.c Revert "usb: xhci: tegra: Fix error check" 2023-08-03 10:22:42 +02:00
xhci-trace.c
xhci-trace.h xhci: fix even more unsafe memory usage in xhci tracing 2021-08-26 13:06:02 +02:00
xhci.c usb: xhci: Add error handling in xhci_map_urb_for_dma 2024-04-10 16:18:37 +02:00
xhci.h xhci: process isoc TD properly when there was a transaction error mid TD. 2024-03-15 10:48:20 -04:00