Re: [PATCH] PCI/proc: Warn on writes to kernel-exclusive config space regions
Krzysztof WilczyĆski <[email protected]> Sat, 1 Aug 2026 13:06:07 +0900
| Newsgroups | org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <20260801040548.GC3183355@rocinante> |
Hello,
> Currently, a driver can claim a region of a device's config space as
> exclusive using pci_request_config_region_exclusive(), after which a
> write to that region originating from user space is expected to emit a
> warning and taint the kernel. The check is advisory only, as the write
> itself is still allowed to proceed.
>
> Since commit 278294798ac9 ("PCI: Allow drivers to request exclusive
> config regions"), the sysfs config space attribute performs this check
> in pci_write_config(), but the procfs interface was never updated. A
> write performed through /proc/bus/pci/BB/DD.F therefore bypasses the
> detection entirely, even though both interfaces offer the same level
> of access.
>
> Thus, add the same resource_is_exclusive() check to proc_bus_pci_write().
Applied to the procfs branch.
Thank you!
Krzysztof