HIGH Introduced in 4.11
dcache Mountpoint Race
CVE-2026-98984
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: dcache: don't put a mountpoint on a dentry that's being removed rmdir(), unlink() and rename() call dont_mount() on the victim and then detach_mounts() with the victim's inode locked. do_lock_mount() takes the inode lock of the mountpoint and checks cant_mount() so a mount can't show up after detach_mounts(). But attach_recursive_mnt() makes a second mountpoint for the root of the source mount so that the mounts already located at the destination can be put on top of it. No inode is locked for that one and d_set_mounted() only refuses a dentry that is unlinked. Between detach_mounts() and d_delete() the victim is still hashed: rmrace: b passed dont_mount() and detach_mounts(), sleeping T2: move_mount(S, /tmp/plcant/x, BENEATH) = 0 errno 0 () T1: rmdir(/tmp/plcant/d/b) = 0 errno 0 109 107 0:61 /d/b//deleted /tmp/plcant/x rw,relatime - tmpfs tmpfs rw 108 109 0:63 / /tmp/plcant/x rw,relatime - tmpfs T rw A bind mount of the directory that's being removed is moved beneath an existing mount while the rmdir() is located between the two calls. The mount ends up on the removed directory and nothing will ever detach it. Check cant_mount() in d_set_mounted() as well. dont_mount() raises the flag under d_lock before detach_mounts() runs so either the mountpoint is set first and detach_mounts() finds the mount or the flag is seen and the mount is refused.
02KernelScan AI Analysis
Risk summary
A local unprivileged user can exploit a race between directory removal (rmdir/unlink/rename) and a concurrent move_mount operation to leave a mount pinned on a deleted dentry. This results in a use-after-free-like condition where the mount is never detached, potentially leading to memory corruption, privilege escalation, or denial of service. The vulnerability is reachable from any process that can create directories and invoke move_mount (CAP_SYS_ADMIN in a user namespace), making it exploitable in containerized and multi-tenant environments.
Vulnerability analysis
The vulnerability occurs when a directory is being removed (via rmdir, unlink, or rename) while a concurrent move_mount operation attempts to move a bind mount of that directory beneath another mount. The removal path marks the dentry with dont_mount() and calls detach_mounts() while holding the inode lock, but there is a window between detach_mounts() and d_delete() where the dentry is still hashed and accessible. During this window, attach_recursive_mnt() can create a second mountpoint for the source mount's root without holding the victim's inode lock, and d_set_mounted() only checked for d_unlinked(), not the cant_mount() flag set by dont_mount(). This allows a mount to be attached to a dentry that is in the process of being deleted, leaving it permanently pinned with no cleanup path. The fix adds a cant_mount() check in d_set_mounted() so that dentries marked for removal are rejected early, closing the race window. The bug is triggered locally by an unprivileged user with access to user namespaces (CAP_SYS_ADMIN in userns), requiring precise timing between two threads — one removing a directory, another moving a mount — making exploitation non-trivial but feasible with heap grooming or scheduler manipulation.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 4.1 | 4.1.40 | 4.2 | 25e3ce3e2ebd |
| 4.10 | 4.10.3 | 4.11 | 5e6bfd9f249f |
| 4.4 | 4.4.54 | 4.5 | 982d231ad863 |
| 4.9 | 4.9.15 | 4.10 | 96ca40461d8b |
| 5.10 | 4.11 | 5.10.273 | 793cb67b0f52 |
| 5.15 | 4.11 | 5.15.224 | 390ddcea2a8a |
| 6.1 | 4.11 | 6.1.191 | 30a162502241 |
| 6.12 | 4.11 | 6.12.113 | — |
| 6.18 | 4.11 | 6.18.57 | — |
| 6.6 | 4.11 | 6.6.160 | 75f4197f1e11 |
| 7.2 | 4.11 | 7.2.11 | — |
| mainline | 4.11 | 7.3 | — |
| cip/6.12 | 4.11 | 6.12.114-cip34 | 793cb67b0f52 |
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.114-cip34 |
| 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) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip137-rt51) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip116) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |