]> git.baikalelectronics.ru Git - uboot.git/commit
pci: Add checks to prevent config space overflow
authorPali Rohár <pali@kernel.org>
Sun, 3 Jul 2022 10:48:06 +0000 (12:48 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 26 Aug 2022 18:59:21 +0000 (14:59 -0400)
commit4434781df58887c54b1b245f4445c18e9f03051f
tree7752efadcb1fe9b198d522a8ed27e452827f9af6
parent02ead250ae5efa8895594c6fd5f2b752116bb850
pci: Add checks to prevent config space overflow

PCIe config space has address range 0-4095. So do not allow reading from
addresses outside of this range. Lot of U-Boot drivers do not expect that
passed value is not in this range. PCI DM read function is extended to
fill read value to all ones or zeros when it fails as U-Boot callers
ignores return value.

Calling U-Boot command 'pci display.b 0.0.0 0 0x2000' now stops printing
config space at the end (before 0x1000 address).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
cmd/pci.c
drivers/pci/pci-uclass.c