summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/pci-aardvark.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2021-11-25 01:26:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 09:23:30 +0100
commite3c51ac70aae138fb4143ec610429f423b738aed (patch)
tree4551a0fe40c103b7e023f23979fcbdbf1630d548 /drivers/pci/controller/pci-aardvark.c
parentea6eef03dafbc9754d26c6b21e4e35d070b651e6 (diff)
PCI: pci-bridge-emul: Fix array overruns, improve safety
commit f8ee579d53aca887d93f5f411462f25c085a5106 upstream. We allow up to PCI_EXP_SLTSTA2 registers to be accessed, but the pcie_cap_regs_behavior[] array only covers up to PCI_EXP_RTSTA. Expand this array to avoid walking off the end of it. Do the same for pci_regs_behavior for consistency[], and add a BUILD_BUG_ON() to also check the bridge->conf structure size. Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Link: https://lore.kernel.org/r/E1l6z9W-0006Re-MQ@rmk-PC.armlinux.org.uk Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci/controller/pci-aardvark.c')
0 files changed, 0 insertions, 0 deletions