{"id":"CVE-2026-99996","aliases":["CVE-2026-99996"],"related":[],"kind":"vulnerability","state":"published","title":"ntfs: hold the runlist lock while expanding a non-resident attribute","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: hold the runlist lock while expanding a non-resident attribute\n\nntfs_non_resident_attr_expand() changes ni->runlist.rl while it\nallocates clusters: ntfs_attr_map_whole_runlist(), the compressed\nbranch's ntfs_rl_realloc() and ntfs_runlists_merge() can each kvfree()\nthe old array.  Unless the caller already holds ni->runlist.lock, none\nof this happens under it; only the rollback takes it.  Callers without\nit include the write path, fallocate, ntfs_inode_attr_pwrite() and\nntfs_resident_attr_resize().\n\nThose callers hold mrec_lock, and the write path also inode_lock, but\nthe iomap read side takes neither: FIEMAP, page faults, readahead and\nsplice read reach ntfs_read_iomap_begin_non_resident(), which takes only\nni->runlist.lock.  A FIEMAP running while write(2) extends the same file\ncan walk the array that ntfs_runlists_merge() has just freed:\n\n  BUG: KASAN: slab-use-after-free in ntfs_attr_vcn_to_rl+0x19b/0x200\n\nA reader that finds a vcn unmapped in the stale array also maps it from\ndisk into the runlist the writer is changing, which shows up as \"Run\nlists overlap. Cannot merge!\".\n\nTake ni->runlist.lock for writing around the part of the expansion that\nchanges the runlist and allocated_size, up to and including the mapping\npairs update, as ntfs_non_resident_attr_shrink() does since commit\n91709ba5d6d7 (\"ntfs: protect runlist updates with the runlist lock\"),\nand hold it throughout the rollback, where ntfs_cluster_free() requires\nit.  The lock nests inside mrec_lock, as on the truncate-up path, which\nalready calls this function with the runlist lock held.  Where the\ncaller says it holds the lock (locked_ni == ni), assert that it holds it\nfor writing.\n\nFor an $ATTRIBUTE_LIST whose lock the caller does not hold, drop the\nlock again before the mapping pairs update: that update can resize the\nsame list through ntfs_attrlist_update_locked(), which returns -ENOSPC\nwhen told that the list's lock is held.  Holding it there made punching\nholes into a large fragmented file fail with -ENOSPC.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: hold the runlist lock while expanding a non-resident attribute\n\nntfs_non_resident_attr_expand() changes ni->runlist.rl while it\nallocates clusters: ntfs_attr_map_whole_runlist(), the compressed\nbranch's ntfs_rl_realloc() and ntfs_runlists_merge() can each kvfree()\nthe old array.  Unless the caller already holds ni->runlist.lock, none\nof this happens under it; only the rollback takes it.  Callers without\nit include the write path, fallocate, ntfs_inode_attr_pwrite() and\nntfs_resident_attr_resize().\n\nThose callers hold mrec_lock, and the write path also inode_lock, but\nthe iomap read side takes neither: FIEMAP, page faults, readahead and\nsplice read reach ntfs_read_iomap_begin_non_resident(), which takes only\nni->runlist.lock.  A FIEMAP running while write(2) extends the same file\ncan walk the array that ntfs_runlists_merge() has just freed:\n\n  BUG: KASAN: slab-use-after-free in ntfs_attr_vcn_to_rl+0x19b/0x200\n\nA reader that finds a vcn unmapped in the stale array also maps it from\ndisk into the runlist the writer is changing, which shows up as \"Run\nlists overlap. Cannot merge!\".\n\nTake ni->runlist.lock for writing around the part of the expansion that\nchanges the runlist and allocated_size, up to and including the mapping\npairs update, as ntfs_non_resident_attr_shrink() does since commit\n91709ba5d6d7 (\"ntfs: protect runlist updates with the runlist lock\"),\nand hold it throughout the rollback, where ntfs_cluster_free() requires\nit.  The lock nests inside mrec_lock, as on the truncate-up path, which\nalready calls this function with the runlist lock held.  Where the\ncaller says it holds the lock (locked_ni == ni), assert that it holds it\nfor writing.\n\nFor an $ATTRIBUTE_LIST whose lock the caller does not hold, drop the\nlock again before the mapping pairs update: that update can resize the\nsame list through ntfs_attrlist_update_locked(), which returns -ENOSPC\nwhen told that the list's lock is held.  Holding it there made punching\nholes into a large fragmented file fail with -ENOSPC.","source":"cvelist"}],"published":"2026-11-30T13:18:59.467Z","modified":"2026-12-01T06:17:59.890Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"495e90fa334828d4119061e2726af51d0a0fb4ed","fixed":"bebc7db05867fd84349843df5c650054f580044c","status":"affected"},{"type":"git","introduced":"495e90fa334828d4119061e2726af51d0a0fb4ed","fixed":"768c6f5fab58cefa65509dd34b946fdd1071746e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.1","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.1","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/bebc7db05867fd84349843df5c650054f580044c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/768c6f5fab58cefa65509dd34b946fdd1071746e","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99996","url":"https://www.cve.org/CVERecord?id=CVE-2026-99996","licence":"CVE Terms of Use","modified":"2026-12-01T05:44:35.366Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99996","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99996","licence":"Public domain","modified":"2026-12-01T06:17:59.890Z"}],"updatedAt":"2026-12-01T06:32:27.751Z","epss":{"score":0.00317,"percentile":0.26538,"date":"2026-12-01T12:00:22.000Z"}}