CVE-2026-99170
published high CVSS 3.1 · 8.8namespace: a mount that copy_tree() leaves out can't take over a lock
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxc62a4766937edec2962d52e583276b459b739f2d to < bd71d33923b9d6216bcee44331dd37142b0a8441 · c62a4766937edec2962d52e583276b459b739f2d to < 69fbe94f80bc423613fa18dae6656757423732a2 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux7.1 (affected) · 0 to < 7.1 (unaffected · semver) · 7.2.13 through 7.2.* (unaffected · semver) · 7.3 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: namespace: a mount that copy_tree() leaves out can't take over a lock Since commit c62a4766937e ("move_mount: transfer MNT_LOCKED") a mount can be moved beneath a locked mount. The lock moves from the old cover to the new mount which takes over the job of hiding what's under it and the old cover can be unmounted. That works as long as the new mount stays. But the caller picks the new mount and copy_tree() leaves a mount of a mount namespace file out of every copy made without CL_COPY_MNT_NS_FILE, together with everything mounted on it, and never looks at MNT_LOCKED. unshare(CLONE_NEWNS) and mount propagation make such copies. So a task that is root in its own user namespace gets rid of a locked cover on a file without a race and without touching the filesystem below it. It makes a child with a mount namespace of its own, binds the child's /proc/<pid>/ns/mnt beneath the cover with MOVE_MOUNT_BENEATH, which hands the lock to that bind, and calls unshare(CLONE_NEWNS). The new mount namespace has nothing on the file. That's the usual way to mask a single file, a bind of /dev/null or of an empty file. With a bind of an ordinary file the file stays covered. copy_tree() already refuses to leave out a locked unbindable mount with -EPERM since commit df7342b24018 ("mount: Don't allow copying MNT_UNBINDABLE|MNT_LOCKED mounts"). Do the same for a locked mount of a mount namespace file. That also covers a tree copied with CL_COPY_MNT_NS_FILE and attached into a mount namespace of another user namespace where lock_mnt_tree() locks it. Note that unshare(CLONE_NEWNS) and clone(CLONE_NEWNS) fail with EPERM from such a mount namespace from then on. The mount can't be left out and it can't be unmounted. And refuse to move a mount of a mount namespace file beneath a locked mount in the first place. Otherwise the task ends up with a mount it can't unmount and an unshare() that fails for good. Chris also found a second mount that goes away by itself, a clone of an automounted mount that shrink_submounts() took along with its parent. Commit f78ddcc87224 ("namespace: never expire a locked mount") took care of that one. Chris's reproducer is appended. Mode nsfile reads SECRET after the unshare() on 7.3-rc7, with this patch the move_mount() fails with EINVAL and the file stays covered. nsfile-control uses an ordinary file and reads MASK both ways. // SPDX-License-Identifier: GPL-2.0 /* * Get rid of a locked cover with MOVE_MOUNT_BENEATH. * * The "admin" (root) makes a tmpfs W: * W/D file, holds SECRET, covered by a bind of a file with MASK * W/Dd/inner file, holds SECRET, Dd is covered by a bind of a directory * whose "inner" holds MASK * W/own directory of uid 1000 with the file "mine" and the * directory "minedir", whose "inner" holds MINE * W/dbg debugfs, mode 755. dbg/tracing is an automount point * The "attacker" is uid 1000. It enters a new user namespace with a new mount * namespace, so W and both covers are locked there. * * usage: prog MODE * plain put a bind of own/mine beneath the cover of D, unmount the cover * nsfile put a bind of the mount namespace file of a child beneath the * cover of D, then unshare(CLONE_NEWNS) * nsfile-control the same with a bind of own/mine * shrink put a bind of the automounted tracefs beneath the cover of Dd, * unmount the cover, put a tmpfs beneath W, call umount(W), which fails * shrink-control the same with a bind of own/minedir * The environment variable AUTOMOUNT_DIR names another automount point for "shrink". */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <grp.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> ---truncated---
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- Scenarios
- en: AV:L - Local move_mount(2) reaches do_move_mount()->can_move_mount_beneath(), and unshare(2) reaches copy_mnt_ns()->copy_tree(), the two functions patched; no network input reaches either path. AC:L - Given an inherited locked file cover, the attacker creates its own child namespace, clones /proc/<pid>/ns/mnt, moves it beneath the cover, and calls unshare(CLONE_NEWNS). The sequence deterministically makes copy_tree() omit the locked replacement and requires no race. PR:L - open_tree(OPEN_TREE_CLONE) and move_mount() require may_mount(), which checks CAP_SYS_ADMIN in the mount namespace's owning user namespace; an ordinary user obtains it with unshare(CLONE_NEWUSER|CLONE_NEWNS), and ptrace_may_access() permits its own child namespace file. UI:N - The attacker independently forks the child and invokes open_tree(), move_mount(MOVE_MOUNT_BENEATH), unshare(), and the final file access after entering the sandbox; no victim action is induced. S:C - lock_mnt_tree() applies MNT_LOCKED when copying a mount tree into a less-privileged user namespace specifically to conceal parent resources; defeating that lock exposes a file across the parent-imposed mount-namespace sandbox boundary. C:H - Vulnerable copy_tree() skips the mount-namespace-file mount and everything mounted above it, so path lookup reaches the complete underlying file. In a same-identity sandbox where the locked cover is the access-control boundary, the attacker can read an arbitrarily large sensitive file. I:H - After copy_tree() removes the cover, open(O_WRONLY|O_TRUNC) reaches do_open()->handle_truncate()->do_truncate(); where underlying DAC permits the sandbox identity, the attacker can replace or erase the entire file that MNT_LOCKED was intended to protect. A:H - The same exposed-file primitive can truncate a covered executable, configuration, or database through handle_truncate(), causing complete and persistent loss of the dependent service when that file is availability-critical.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | c62a4766937edec2962d52e583276b459b739f2d to < bd71d33923b9d6216bcee44331dd37142b0a8441 (affected · git)c62a4766937edec2962d52e583276b459b739f2d to < 69fbe94f80bc423613fa18dae6656757423732a2 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 7.1 (affected)0 to < 7.1 (unaffected · semver)7.2.13 through 7.2.* (unaffected · semver)7.3 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
namespace: a mount that copy_tree() leaves out can't take over a lock
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 875e735603605d6f8dbb8f0c9d644343496e0c5ebd65db229dcb8b8ba7f97ce1
- Ingested
- 31 Oct 2026, 12:46:07 UTC
- Source record
- Official CVE record