diff options
author | Alexandra Diupina <[email protected]> | 2024-09-03 14:58:23 +0300 |
---|---|---|
committer | Krzysztof Wilczyński <[email protected]> | 2024-09-06 06:36:29 +0000 |
commit | c500a86693a126c9393e602741e348f80f1b0fc5 (patch) | |
tree | 6daa3a78d5d9906b717b477dc83a263a4ed4f233 /scripts/generate_rust_analyzer.py | |
parent | 8400291e289ee6b2bf9779ff1c83a291501f017b (diff) |
PCI: kirin: Fix buffer overflow in kirin_pcie_parse_port()
Within kirin_pcie_parse_port(), the pcie->num_slots is compared to
pcie->gpio_id_reset size (MAX_PCI_SLOTS) which is correct and would lead
to an overflow.
Thus, fix condition to pcie->num_slots + 1 >= MAX_PCI_SLOTS and move
pcie->num_slots increment below the if-statement to avoid out-of-bounds
array access.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: b22dbbb24571 ("PCI: kirin: Support PERST# GPIOs for HiKey970 external PEX 8606 bridge")
Link: https://lore.kernel.org/linux-pci/[email protected]
Signed-off-by: Alexandra Diupina <[email protected]>
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions