HIGH Introduced in 5.15
ntfs3 InodeInit Race
CVE-2026-98539
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: fs/ntfs3: use d_instantiate_new() in ntfs_create_inode() and murder syzbot's "WARNING in do_new_mount" saga ntfs_create_inode() creates a new inode via ntfs_new_inode(). It hashes it with insert_inode_locked() and so it's marked as I_NEW until unlock_new_inode(). ntfs 3 calls d_instantiate() in between though... Since the dentry was already hashed by the lookup before the create any path walk finds it without touching the parent's i_rwsem and so can lock the inode. If the inode is a directory unlock_new_inode() calls lockdep_annotate_inode_mutex_key() and marks i_rwsem with the i_mutex_dir_key class. That resets the count and the owner of a lock somebody else may already hold by now... syzbot has been spamming us with the same godforsaken bug "WARNING in do_new_mount" since 2023. I can't take it anymore so I went looking. Afaict, syzbot's executor chdirs into a freshly mounted ntfs3 image, creates a directory and then mounts some pseudofs on it. Everytime the mkdir() takes longer than syzbot waits mount() runs concurrently: mkdir("./sys") mount(NULL, "./sys", "sysfs") ntfs_create_inode() d_instantiate() user_path_at() finds the dentry do_lock_mount() inode_lock(inode) namespace_lock() unlock_new_inode() lockdep_annotate_inode_mutex_key() init_rwsem(&inode->i_rwsem) unlock_mount() inode_unlock(inode) The mount side then releases a lock that according to the rwsem nobody holds: DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && ...): count = 0x0, magic = 0xffff888043a854e8, owner = 0x0, curr 0xffff888000244880, list empty WARNING: CPU: 0 PID: 5346 at kernel/locking/rwsem.c:1368 __up_write Call Trace: inode_unlock include/linux/fs.h:877 [inline] unlock_mount fs/namespace.c:2892 [inline] do_new_mount_fc fs/namespace.c:3828 [inline] do_new_mount+0x777/0xa40 fs/namespace.c:3887 On PREEMPT_RT the same thing shows up as DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) WARNING: kernel/locking/rtmutex_common.h:193 at rt_mutex_slowunlock The up_write() underflows the reset count. A following inode_lock() on that directory then never returns. A path walk into the new directory racing with the mkdir() corrupts the lock the same way via inode_lock_shared() in lookup_slow(). Switch to d_instantiate_new() and drop the trailing unlock_new_inode(). All error paths bail out before that point with I_NEW still set and keep using discard_new_inode(). May we never see this fscking bug report again.
02KernelScan AI Analysis
Risk summary
A race condition in the NTFS3 filesystem allows a local attacker to corrupt kernel locking primitives by racing directory creation with a mount operation on the same path. This can lead to kernel memory corruption, privilege escalation, and system hangs. Systems with NTFS3 support that allow mounting attacker-controlled NTFS3 images (via physical media or privileged loopback mounts) are at risk.
Vulnerability analysis
During inode creation in the NTFS3 filesystem, the dentry is made visible to other threads via d_instantiate() before the inode's lock (i_rwsem) is fully initialized by unlock_new_inode(). This creates a race window where a concurrent path walk (e.g., from a mount operation) can acquire the inode lock, only to have the lock reinitialized underneath it when unlock_new_inode() runs. The subsequent unlock by the racing thread corrupts the lock state, causing reference count underflows and permanent hangs on future lock attempts. The fix replaces the separate d_instantiate() and unlock_new_inode() calls with the atomic d_instantiate_new() helper, which ensures the inode is fully initialized and unlocked before the dentry becomes visible, eliminating the race window. A local user who can mount an NTFS3 filesystem (via physical media insertion on an exposed port, or via loopback mount with root privileges) and create directories can trigger this vulnerability.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.15 | 6.1.193 | b4f6bbac3be8 |
| 6.12 | 5.15 | 6.12.112 | 6fda7121cb6a |
| 6.18 | 5.15 | 6.18.55 | 37ec7353f4ac |
| 6.6 | 5.15 | 6.6.163 | e093dc24ee8e |
| 7.2 | 5.15 | 7.2.9 | 1ae2a242c15b |
| mainline | 5.15 | 7.3 | 1abd643f3783 |
| cip/6.12 | 5.15 | 6.12.112-cip33 | 6fda7121cb6a |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |