[PING] PCI: Fix procfs PCI config access issues

From: duziming

Date: Sun Apr 26 2026 - 22:23:06 EST



在 2026/4/14 10:45, Ziming Du 写道:
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(-)
Gentle ping on this