CVE-2026-143124: ntfs: open the index allocation before reading or writing an index block
In the Linux kernel, the following vulnerability has been resolved:
ntfs: open the index allocation before reading or writing an index block
ntfsibwrite() and ntfsibread() use icx->iani without checking it. ntfsirreparent() only opens the index allocation through ntfsiaadd() when the root is a small index. For a root that is already marked as a large index it calls ntfsibwrite() directly.
The lookup does not open the index allocation either when it ends in the root. If the last entry of the root has no child node, iani is still NULL when the root has to be moved into an index block, and the write dereferences it:
Oops: general protection fault, KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f] RIP: 0010:ntfsinodeattrpwrite+0x52/0x1600 ntfsirmakespace ntfsieadd ntfsindexaddfilename ntfslink ntfslink vfslink
A single byte of an image from mkntfs is enough. In a directory that has one empty index block, clear INDEXENTRYNODE (flags 3 -> 2) of the last entry of the $INDEXROOT and link() a file into the directory.
Commit 9365c4a1357e ("ntfs: fix NULL dereference on index allocation open failure") covers the case where ntfsiaopen() fails in the lookup. Here it was never tried. Open the index allocation on demand in both helpers and fail with -EIO if that does not work.
ntfsiaopen() also succeeds for a directory that has no $INDEXALLOCATION attribute. The inode it returns is then an empty resident stub that does not describe an index allocation, so reject that case too.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 9365c4a1357e