CVE-2026-99997: ntfs: do not map a vcn as a hole when its runlist lookup failed
In the Linux kernel, the following vulnerability has been resolved:
ntfs: do not map a vcn as a hole when its runlist lookup failed
ntfsattrvcntorl() retries ntfsmaprunlistnolock() for any lcn up to LCNRLNOTMAPPED, which includes LCNENOENT, but turns a failed retry into an error only for LCNRLNOTMAPPED. For LCNENOENT the error is dropped and the read path maps the range as a hole.
An LCNENOENT below allocatedsize comes from a base extent with a highestvcn of 0, which ntfsmappingpairsdecompress() takes to map the whole attribute, so the runlist ends after its last mapping pair. If the pairs end early, the retry finds the same extent and fails with -ENOENT. On a crafted volume with 4 KiB clusters, a 64-cluster file whose mapping pairs stop after 16 clusters reads 48 clusters of zeros, with no error.
The same layout gets a crafted $MFT past the check from "ntfs: fail the mount when $MFT needs its own extent records". With 512-byte clusters and $MFT's mapping pairs ending at vcn 4, an unpatched kernel hangs on the folio lock reading records 0-3. With the check alone, the -EIO is dropped, records 2 and 3 read as zeros and the mount carries on until checkmftmirror() finds the zeroed record 2.
Fail the lookup whenever the retry leaves @vcn unmapped below allocatedsize, -ENOENT included. At or beyond allocatedsize the end of the runlist is still returned as it is.
A failed expansion in ntfsnonresidentattrexpand() or ntfsattrlistrepack() truncates the runlist under the runlist lock but restores allocatedsize only after dropping it. A lookup in between would now fail, so restore allocatedsize before dropping the lock in both, under sizelock, which ntfsattrvcntorl() takes to read it.
The crafted file now fails from vcn 16 on with -EIO, and the crafted volume fails to mount with the check's message.
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
Event History
Frequently Asked Questions
What systems are realistically exposed to this issue?
Linux systems that read or mount attacker-crafted NTFS volumes are exposed. The affected behavior is in the NTFS read and mount paths when runlist mapping pairs end before the declared allocated range.
What does an attacker need to exploit it?
An attacker needs to provide a crafted NTFS volume with truncated mapping pairs. The described examples use a file whose mappings stop after 16 of 64 clusters, or a crafted $MFT whose mappings end early.
What can happen on an unpatched kernel?
File data beyond the truncated mappings can be returned as zero-filled data without an error. A crafted $MFT layout can also cause an unpatched kernel to hang while reading MFT records; in the described 512-byte-cluster case, later records may instead be read as zeros and allow mounting to continue.