PT-2026-61381 · Linux · Linux
CVE-2026-64064
·
Published
2026-07-19
·
Updated
2026-07-19
None
No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix netfs invalidate folio() to clear dirty bit if all changes gone
If a streaming write is made, this will leave the relevant modified folio
in a not-uptodate, but dirty state with a netfs folio struct hung off of
folio->private indicating the dirty range. Subsequently truncating the
file such that the dirty data in the folio is removed, but the first part
of the folio theoretically remains will cause the netfs folio struct to be
discarded... but will leave the dirty flag set.
If the folio is then read via mmap(), netfs read folio() will see that the
page is dirty and jump to netfs read gaps() to fill in the missing bits.
netfs read gaps(), however, expects there to be a netfs folio struct
present and can oops because truncate removed it.
Fix this by calling folio cancel dirty() in netfs invalidate folio() in the
event that all the dirty data in the folio is erased (as nfs does).
Also add some tracepoints to log modifications to a dirty page.
This can be reproduced with something like:
dd if=/dev/zero of=/xfstest.test/foo bs=1M count=1
umount /xfstest.test
mount /xfstest.test
xfs io -c "w 0xbbbf 0xf96c"
-c "truncate 0xbbbf"
-c "mmap -r 0xb000 0x11000"
-c "mr 0xb000 0x11000"
/xfstest.test/foo
with fscaching disabled (otherwise streaming writes are suppressed) and a
change to netfs perform write() to disallow streaming writes if the fd is
open O RDWR:
if (//(file->f mode & FMODE READ) || <--- comment this out
netfs is cache enabled(ctx)) {It should be reproducible even without this change, but if prevents the
above trivial xfs io command from reproducing it.
Note that the initial dd is important: the file must start out sufficiently
large that the zero-point logic doesn't just clear the gaps because it
knows there's nothing in the file to read yet. Unmounting and mounting is
needed to clear the pagecache (there are other ways to do that that may
also work).
This was initially reproduced with the generic/522 xfstest on some patches
that remove the FMODE READ restriction.
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Linux