[PATCH RFC 01/38] PCI/proc: don't truncate the position of config space accesses
Linus Torvalds
torvalds at linux-foundation.org
Mon Nov 2 09:58:51 PST 2026
On Mon, 2 Nov 2026 at 06:22, Christian Brauner <brauner at kernel.org> wrote:
>
> proc_bus_pci_write() truncates the file position to an int. A pwrite()
> at an offset like 0xfffff000 turns it negative [..]
I think this would actually be better with rw_verify_area() just
checking a per-file maxbytes.
We already have that logic for lseek and friends - using that fairly
hacky combination of s_maxbytes and !unsigned_offsets().
We should combine s_maxbytes and unsigned_offsets() at file open time
into f_maxbytes and check that not just at lseek but in
rw_verify_area.
And then things like proc_bus_pci could set it's size limit in one single place.
Hmm?
Linus
More information about the linux-um
mailing list