HIGH Introduced in 3.19
namespace UnmountedTree UAF
CVE-2026-98992
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: namespace: don't copy an unmounted mount tree may_copy_tree() accepts a mount whose root is an nsfs or pidfs file before it checks whether that mount is mounted. This exception exists for nsfs and pidfs mounts. They are part of no mount namespace so neither check_mnt() nor is_mounted() would let them through and bind-mounting a nsfsfd or a pidfd wouldn't work. Problem is that exception also admits a bind mount of such a file when it was lazily unmounted and is only kept alive by a file descriptor: mount --bind /proc/self/ns/net /tmp/x exec 3< /tmp/x umount -l /tmp/x mount --rbind /proc/self/fd/3 /tmp/y With MS_REC or AT_RECURSIVE copy_tree() doesn't stop at the unmounted mount. It copies every mount that stayed attached to it as well. So if you have a bunch of overmounts over the nsfsfd or the pidfd the whole unmounted stack is copied. That's a bug. So refuse to walk an unmounted tree. Copying its root alone stays possible. So a bind mount of a namespace that is gone can still be recreated from a file descriptor on the old one. The file descriptor pins that mount and its root and __has_locked_children() only reads the direct children which don't leave the parent's list without namespace_sem. The internal mounts carry MNT_NS_INTERNAL instead of NULL and are still walked. Copying an unmounted tree recursively fails with EINVAL.
02KernelScan AI Analysis
Risk summary
A local attacker with CAP_SYS_ADMIN (obtainable in a user namespace) can trigger a use-after-free in the mount namespace code by lazily unmounting an nsfs or pidfs bind mount and then performing a recursive bind mount of the file descriptor. This copies the entire unmounted mount tree, including overmounts, leading to kernel memory corruption that can be exploited for privilege escalation or denial of service.
Vulnerability analysis
The mount namespace code allows bind-mounting namespace files (nsfs/pidfs) even though they belong to no mount namespace. However, this exception incorrectly also permits recursive bind mounts of such files after they have been lazily unmounted and are only kept alive by an open file descriptor. When a recursive copy is performed, the kernel walks the entire unmounted mount tree — including any overmounts stacked on top — and duplicates it, creating references to mount structures that have already been marked for teardown. This results in a use-after-free condition where freed mount objects remain accessible. The fix adds a check that refuses recursive copies of unmounted trees (those with no mnt_ns), while still allowing non-recursive bind mounts of the namespace file descriptor itself. The vulnerability is reachable by any local user who can create a user namespace (granting CAP_SYS_ADMIN) and issue mount syscalls, making it a practical container escape and local privilege escalation vector.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 3.19 | 5.10.273 | 94d05b62dc7a |
| 5.15 | 3.19 | 5.15.224 | 07c6a8f004bc |
| 6.1 | 3.19 | 6.1.191 | 31cf15729827 |
| 6.12 | 3.19 | 6.12.113 | 7e037b1fd339 |
| 6.18 | 3.19 | 6.18.57 | b47b40c4f058 |
| 6.6 | 3.19 | 6.6.160 | 86a2d56b1960 |
| 7.2 | 3.19 | 7.2.11 | 8d3527457e18 |
| mainline | 3.19 | 7.3 | 8bacbf6be959 |
| cip/6.12 | 3.19 | 6.12.114-cip34 | 7e037b1fd339 |
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) |