diff options
| author | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2026-05-08 04:35:33 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-06-23 15:19:08 -0500 |
| commit | 802a3b3f470b9bc1148f26e01fc9cbfeb4dfcb57 (patch) | |
| tree | 8f1eda9c8cf2a2e8651d4a873d699b923fed713f /include/linux | |
| parent | 30d01a8c3a13d217921985324ebdce5b404c1ebb (diff) | |
alpha/PCI: Fix __pci_mmap_fits() overflow for zero-length BARs
Currently, __pci_mmap_fits() computes the BAR size using
"pci_resource_len() - 1", which wraps to a large value when the BAR length
is zero, causing the bounds check to incorrectly succeed.
Add an early return for empty resources.
Fixes: 10a0ef39fbd1 ("PCI/alpha: pci sysfs resources")
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://patch.msgid.link/20260508043543.217179-15-kwilczynski@kernel.org
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
