linux-stable/drivers/usb/host
Kees Cook cc5472b517 usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math
[ Upstream commit 0fbd2cda92 ]

Walking the dram->cs array was seen as accesses beyond the first array
item by the compiler. Instead, use the array index directly. This allows
for run-time bounds checking under CONFIG_UBSAN_BOUNDS as well. Seen
with GCC 13 with -fstrict-flex-arrays:

In function 'xhci_mvebu_mbus_config',
    inlined from 'xhci_mvebu_mbus_init_quirk' at ../drivers/usb/host/xhci-mvebu.c:66:2:
../drivers/usb/host/xhci-mvebu.c:37:28: warning: array subscript 0 is outside array bounds of 'const struct mbus_dram_window[0]' [-Warray-bounds=]
   37 |                 writel(((cs->size - 1) & 0xffff0000) | (cs->mbus_attr << 8) |
      |                          ~~^~~~~~

Cc: Mathias Nyman <mathias.nyman@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230204183651.never.663-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 13:50:44 +01:00
..
bcma-hcd.c USB: bcma: Make GPIO explicitly optional 2022-11-08 16:39:56 +01:00
ehci-atmel.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-brcm.c USB: ehci_brcm_hub_control: Improve port index sanitizing 2021-11-17 14:34:18 +01:00
ehci-dbg.c usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers 2022-02-15 15:11:20 +01:00
ehci-exynos.c usb: host: ehci-exynos: switch to using gpiod API 2022-09-30 13:57:10 +02:00
ehci-fsl.c usb: host: ehci-fsl: Fix module alias 2023-01-20 14:45:12 +01:00
ehci-fsl.h
ehci-grlib.c usb: Check !irq instead of irq == NO_IRQ 2022-11-11 10:28:38 +01:00
ehci-hcd.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ehci-hub.c
ehci-mem.c
ehci-mv.c
ehci-npcm7xx.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-omap.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ehci-orion.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-pci.c usb: ehci-pci: Set PROBE_PREFER_ASYNCHRONOUS 2022-11-09 12:36:19 +01:00
ehci-platform.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-ppc-of.c usb: Check !irq instead of irq == NO_IRQ 2022-11-11 10:28:38 +01:00
ehci-ps3.c
ehci-q.c usb: ehci: Use endpoint in URB to get maxpacket 2022-08-31 09:07:53 +02:00
ehci-sched.c usb: host: ehci-sched: Use struct_size() in kzalloc() 2022-01-26 13:50:07 +01:00
ehci-sh.c Revert "usb: host: ehci-sh: propagate errors from platform_get_irq()" 2021-12-21 07:14:05 +01:00
ehci-spear.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-st.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ehci-sysfs.c
ehci-timer.c
ehci-xilinx-of.c usb: host: ehci-xilinx: adding description for return value 2022-05-12 13:58:48 +02:00
ehci.h usb: host: fix a typo in ehci.h 2022-11-29 08:56:09 +01:00
fhci-dbg.c
fhci-hcd.c USB/Thunderbolt driver changes for 6.2-rc1 2022-12-16 03:22:53 -08:00
fhci-hub.c USB: FHCI: Switch to GPIO descriptors 2022-09-01 16:08:29 +02:00
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h USB: FHCI: Switch to GPIO descriptors 2022-09-01 16:08:29 +02:00
fsl-mph-dr-of.c usb: host: fsl-mph-dr-of: reuse device_set_of_node_from_dev 2023-03-10 09:28:56 +01:00
isp116x-hcd.c USB: isp116x: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:43 +01:00
isp116x.h
isp1362-hcd.c USB: isp1362: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:43 +01:00
isp1362.h
Kconfig usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
Makefile usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
max3421-hcd.c usb: max-3421: Fix setting of I/O pins 2023-03-10 09:28:54 +01:00
octeon-hcd.c staging: octeon-usb: move driver out of staging 2022-06-21 16:43:37 +02:00
octeon-hcd.h staging: octeon-usb: move driver out of staging 2022-06-21 16:43:37 +02:00
ohci-at91.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-da8xx.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ohci-dbg.c usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers 2022-02-15 15:11:20 +01:00
ohci-exynos.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-hcd.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ohci-hub.c usb: ohci: disable start-of-frame interrupt in ohci_rh_suspend 2021-10-21 12:48:18 +02:00
ohci-mem.c
ohci-nxp.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ohci-omap.c usb: reduce kernel log spam on driver registration 2022-08-31 09:07:53 +02:00
ohci-pci.c USB: hcd-pci: Drop the unused id parameter from usb_hcd_pci_probe() 2022-09-01 16:08:35 +02:00
ohci-platform.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-ppc-of.c usb: Check !irq instead of irq == NO_IRQ 2022-11-11 10:28:38 +01:00
ohci-ps3.c
ohci-pxa27x.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-q.c
ohci-s3c2410.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-sa1111.c ARM: sa1100/assabet: move dmabounce hack to ohci driver 2022-07-07 18:18:47 +02:00
ohci-sm501.c USB: ohci-sm501: Fix typo in comment 2022-06-21 16:39:39 +02:00
ohci-spear.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-st.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
ohci-tmio.c headers/prep: Fix non-standard header section: drivers/usb/host/ohci-tmio.c 2022-01-05 16:18:11 +01:00
ohci.h
oxu210hp-hcd.c usb: remove third argument of usb_maxpacket() 2022-04-23 10:33:53 +02:00
pci-quirks.c
pci-quirks.h
r8a66597-hcd.c usb: remove third argument of usb_maxpacket() 2022-04-23 10:33:53 +02:00
r8a66597.h
sl811-hcd.c USB: sl811: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:42 +01:00
sl811.h
sl811_cs.c
ssb-hcd.c
u132-hcd.c usb: clean up after dropping driver registration log spam 2022-09-05 13:23:28 +02:00
uhci-debug.c
uhci-grlib.c usb: Check !irq instead of irq == NO_IRQ 2022-11-11 10:28:38 +01:00
uhci-hcd.c USB: uhci: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:42 +01:00
uhci-hcd.h usb/host: fix repeated words in comments 2022-07-27 14:33:33 +02:00
uhci-hub.c
uhci-pci.c USB: hcd-pci: Drop the unused id parameter from usb_hcd_pci_probe() 2022-09-01 16:08:35 +02:00
uhci-platform.c usb: uhci: Use platform_get_irq() to get the interrupt 2021-12-17 16:52:21 +01:00
uhci-q.c
xen-hcd.c xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00
xhci-dbg.c
xhci-dbgcap.c xhci: dbc: Fix memory leak in xhci_alloc_dbc() 2022-09-22 15:52:29 +02:00
xhci-dbgcap.h xhci: dbgtty: use IDR to support several dbc instances. 2022-02-17 16:20:45 +01:00
xhci-dbgtty.c xhci: dbgtty: use IDR to support several dbc instances. 2022-02-17 16:20:45 +01:00
xhci-debugfs.c
xhci-debugfs.h
xhci-ext-caps.c
xhci-ext-caps.h
xhci-histb.c
xhci-hub.c xhci: export two xhci_hub functions for xhci-pci module usage 2022-11-30 12:10:48 +01:00
xhci-mem.c xhci: Remove device endpoints from bandwidth list when freeing the device 2022-10-25 19:53:41 +02:00
xhci-mtk-sch.c usb: xhci-mtk: fix bandwidth release issue 2022-08-19 10:39:08 +02:00
xhci-mtk.c usb: xhci-mtk: fix leakage of shared hcd when fail to set wakeup irq 2022-11-29 08:56:09 +01:00
xhci-mtk.h usb: xhci-mtk: remove bandwidth budget table 2022-05-12 18:35:38 +02:00
xhci-mvebu.c usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math 2023-03-11 13:50:44 +01:00
xhci-mvebu.h Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720" 2022-02-25 19:12:21 +05:30
xhci-pci-renesas.c usb: renesas-xhci: Do not print any log while fw verif success 2022-07-27 14:37:48 +02:00
xhci-pci.c xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables 2023-01-17 16:37:24 +01:00
xhci-pci.h
xhci-plat.c Merge 6.0-rc4 into usb-next 2022-09-05 08:03:23 +02:00
xhci-plat.h Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720" 2022-02-25 19:12:21 +05:30
xhci-rcar.c usb: Drop commas after SoC match table sentinels 2022-03-03 15:45:15 +01:00
xhci-rcar.h
xhci-ring.c usb: xhci: Check endpoint is valid before dereferencing it 2023-01-17 16:37:24 +01:00
xhci-tegra.c usb: xhci: tegra: Fix error check 2022-06-10 11:48:52 +02:00
xhci-trace.c
xhci-trace.h xhci: tracing: Use the new __vstring() helper 2022-07-15 17:44:41 -04:00
xhci.c xhci: Add a flag to disable USB3 lpm on a xhci root port level. 2023-01-17 16:37:24 +01:00
xhci.h xhci: Add a flag to disable USB3 lpm on a xhci root port level. 2023-01-17 16:37:24 +01:00