CVE-2026-99996: ntfs: hold the runlist lock while expanding a non-resident attribute
In the Linux kernel, the following vulnerability has been resolved:
ntfs: hold the runlist lock while expanding a non-resident attribute
ntfsnonresidentattrexpand() changes ni->runlist.rl while it allocates clusters: ntfsattrmapwholerunlist(), the compressed branch's ntfsrlrealloc() and ntfsrunlistsmerge() can each kvfree() the old array. Unless the caller already holds ni->runlist.lock, none of this happens under it; only the rollback takes it. Callers without it include the write path, fallocate, ntfsinodeattrpwrite() and ntfsresidentattrresize().
Those callers hold mreclock, and the write path also inodelock, but the iomap read side takes neither: FIEMAP, page faults, readahead and splice read reach ntfsreadiomapbeginnonresident(), which takes only ni->runlist.lock. A FIEMAP running while write(2) extends the same file can walk the array that ntfsrunlistsmerge() has just freed:
BUG: KASAN: slab-use-after-free in ntfsattrvcntorl+0x19b/0x200
A reader that finds a vcn unmapped in the stale array also maps it from disk into the runlist the writer is changing, which shows up as "Run lists overlap. Cannot merge!".
Take ni->runlist.lock for writing around the part of the expansion that changes the runlist and allocatedsize, up to and including the mapping pairs update, as ntfsnonresidentattrshrink() does since commit 91709ba5d6d7 ("ntfs: protect runlist updates with the runlist lock"), and hold it throughout the rollback, where ntfsclusterfree() requires it. The lock nests inside mreclock, as on the truncate-up path, which already calls this function with the runlist lock held. Where the caller says it holds the lock (lockedni == ni), assert that it holds it for writing.
For an $ATTRIBUTELIST whose lock the caller does not hold, drop the lock again before the mapping pairs update: that update can resize the same list through ntfsattrlistupdatelocked(), which returns -ENOSPC when told that the list's lock is held. Holding it there made punching holes into a large fragmented file fail with -ENOSPC.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 91709ba5d6d7
Event History
Frequently Asked Questions
What workload is exposed to this race?
An NTFS file is exposed when one operation expands a non-resident attribute while another concurrently reads its runlist. Relevant read-side activity includes FIEMAP, page faults, readahead, and splice reads; expansion can occur through the write path, fallocate, ntfs_inode_attr_pwrite(), or ntfs_resident_attr_resize().
What does an attacker or triggering process need to do?
The triggering condition requires concurrent access to the same file: one actor must extend it while another invokes a path that reads the runlist. The issue is a use-after-free caused by a reader walking a runlist array after a concurrent expansion path has freed and replaced it.
How might this issue appear on an affected system?
A KASAN-enabled kernel may report a slab use-after-free in ntfs_attr_vcn_to_rl. Systems may also log "Run lists overlap. Cannot merge!" when a reader maps an unmapped VCN from a stale array while the writer is modifying the runlist.
Is there a fix available?
The vulnerability is described as resolved. The provided stable kernel references identify fixes at beb c7db05867fd84349843df5c650054f580044c and 768c6f5fab58cefa65509dd34b946fdd1071746e.