coreboot/src/include/device
Martin Roth 22e16db4c5 acpi/soundwire.[ch]: Fix dpn entry array overrun
In soundwire.h, SOUNDWIRE_DPN MIN  & MAX are set to 1 and 14. When
creating the dpn array, the length was set to MAX - MIN or 13, numbered
0 to 12.

When accessing the array, the code was bailing out if a value greater
than MAX was trying to be accessed, so the array was able to be overrun
by two structure lengths.

Fix this problem by:
1) Not subtracting the MIN value when creating the array, which does
waste a little space. If anyone wants to refactor the code to fix that,
please feel free.
2) Breaking out of the loop when the port is equal to the MAX port
number instead of just when it's greater than the max port number.

Reported-by: Coverity (CID:1429766 & CID:1429771)
Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I0841bb8c9869fe9f53958f05614848785a98b766
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77777
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
2023-09-13 15:26:01 +00:00
..
dram device/dram: add DDR4 RCD I2C access functions 2023-08-21 14:43:08 +00:00
azalia.h
azalia_device.h device/azalia_device: Drop unused function parameter 2021-11-11 22:45:04 +00:00
cardbus.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
device.h include/device/device: drop unused alignment defines 2023-08-15 14:43:38 +00:00
gpio.h
i2c.h
i2c_bus.h device/i2c_bus: Add routines to read and write multiple bytes 2022-09-04 14:55:59 +00:00
i2c_simple.h include/device/i2c_simple: add i2c_2ba_read_bytes function 2022-04-27 16:07:29 +00:00
mdio.h device/mdio: Provide helper functions for read and write 2022-11-24 05:58:28 +00:00
mmio.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
path.h cpu/x86/mp_init.c: Keep track of initial lapic ID inside device_path 2023-04-06 15:13:28 +00:00
pci.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
pci_def.h cpu/x86/smm: Add PCI resource store functionality 2023-03-05 15:31:07 +00:00
pci_ehci.h
pci_ids.h drivers/wifi: Add PCI ID for Misty Peak WLAN module 2023-09-05 09:37:16 +00:00
pci_mmio_cfg.h pci_mmio_cfg: Rename pcicfg to pci_map_bus 2021-11-29 03:20:54 +00:00
pci_ops.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
pci_rom.h device/pci_rom: Add simple pci_rom_free() 2023-06-02 21:48:58 +00:00
pci_type.h soc/intel/*: drop UART pad configuration from common code 2021-03-12 08:48:03 +00:00
pciexp.h device/pciexp: add pcie_find_dsn() 2022-11-20 17:37:09 +00:00
pcix.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
pnp.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
pnp_def.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
pnp_ops.h
pnp_type.h
resource.h include/device/resource: drop unused IORESOURCE_* definitions 2023-08-10 21:48:46 +00:00
smbus.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
smbus_def.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
smbus_host.h
soundwire.h acpi/soundwire.[ch]: Fix dpn entry array overrun 2023-09-13 15:26:01 +00:00
spi.h
usbc_mux.h ec/google/chromeec: Split wait-loop for DP and HPD flags 2023-07-15 12:47:51 +00:00
xhci.h device/xhci: Add struct for capability registers 2023-03-07 17:11:58 +00:00