Re: [PATCH 0/4] PCI: Fix procfs PCI config access issues

From: duziming

Date: Tue Jul 28 2026 - 21:56:32 EST



在 2026/7/29 7:19, Krzysztof Wilczyński 写道:
Hello,

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(-)
These changes here are worth doing, so I wonder if you have some time to
pick this up? If not, then I am happy to pick this up and send a v2?

Thank you!

Krzysztof

Hi Krzysztof,

Thanks for taking a look!

I have time to take care of this and will address the feedback and send out v2 soon.

Best regards,

Ziming