summaryrefslogtreecommitdiffstats
path: root/lib/logic_pio.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2021-02-02 17:07:46 +0000
committerBjorn Helgaas <bhelgaas@google.com>2021-02-17 17:25:31 -0600
commitf8ee579d53aca887d93f5f411462f25c085a5106 (patch)
tree425c91abdb0bf4d44413f7d1635a6e72aebc2363 /lib/logic_pio.c
parent508d392ae0bb3729d4c18628e021968a1b11b32c (diff)
downloadlinux-f8ee579d53aca887d93f5f411462f25c085a5106.tar.gz
linux-f8ee579d53aca887d93f5f411462f25c085a5106.tar.bz2
linux-f8ee579d53aca887d93f5f411462f25c085a5106.zip
PCI: pci-bridge-emul: Fix array overruns, improve safety
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>
Diffstat (limited to 'lib/logic_pio.c')
0 files changed, 0 insertions, 0 deletions