[PATCH 0/4] PCI: Fix procfs PCI config access issues
From: Ziming Du
Date: Mon Apr 13 2026 - 22:23:57 EST
Hi,
As suggested by Bjorn, this series aligns the implementation of procfs with
the sysfs counterpart and fixes procfs PCI configuration access issues.
The first two patches refactor proc_bus_pci_{write,read}() to align
with pci_write_config() and pci_read_config() respectively:
- Rename variables (pos->off, cnt->count/size) for consistency
- Remove rebundant bounds check
The last two patches fix potential overflow issues:
- Prevent overflow when offset exceeds reasonable range
- Fix implicit 64-bit to 32-bit truncation in read path
Link: https://lore.kernel.org/all/20260303193253.GA3817951@bhelgaas/
Ziming Du (4):
PCI: Align proc_bus_pci_write() with pci_write_config()
PCI: Align proc_bus_pci_read() with pci_read_config()
PCI: Prevent overflow in proc_bus_pci_write()
PCI: Prevent overflow in proc_bus_pci_read()
drivers/pci/proc.c | 115 ++++++++++++++++++++++-----------------------
1 file changed, 57 insertions(+), 58 deletions(-)
--
2.43.0