# CVE-2026-99170: namespace: a mount that copy\_tree() leaves out can't take over a lock

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 3, 2026-11-26)
- **Published:** 2026-10-28T10:35:25.923Z
- **Modified:** 2026-10-31T13:17:58.570Z

## Who should check

- Anyone running Linux \>= c62a4766937edec2962d52e583276b459b739f2d, \< bd71d33923b9d6216bcee44331dd37142b0a8441; \>= c62a4766937edec2962d52e583276b459b739f2d, \< 69fbe94f80bc423613fa18dae6656757423732a2
- Anyone running Linux 7.1

## 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---

## Affected and fixed versions

- Linux: \>= c62a4766937edec2962d52e583276b459b739f2d, \< bd71d33923b9d6216bcee44331dd37142b0a8441; \>= c62a4766937edec2962d52e583276b459b739f2d, \< 69fbe94f80bc423613fa18dae6656757423732a2 (cvelist)
- Linux: 7.1 (cvelist)

## Mitigation

- Upgrade Linux to 69fbe94f80bc423613fa18dae6656757423732a2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-99170. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-99170.md
Affected: Linux >= c62a4766937edec2962d52e583276b459b739f2d, < bd71d33923b9d6216bcee44331dd37142b0a8441; >= c62a4766937edec2962d52e583276b459b739f2d, < 69fbe94f80bc423613fa18dae6656757423732a2; Linux 7.1
Fixed in: Linux 69fbe94f80bc423613fa18dae6656757423732a2

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-99170 being exploited?

There is no confirmed exploitation: CVE-2026-99170 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-99170?

High: CVSS 8.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-99170?

Linux \>= c62a4766937edec2962d52e583276b459b739f2d, \< bd71d33923b9d6216bcee44331dd37142b0a8441; \>= c62a4766937edec2962d52e583276b459b739f2d, \< 69fbe94f80bc423613fa18dae6656757423732a2; Linux 7.1.

### Is there a fix for CVE-2026-99170?

Yes. Fixed in Linux 69fbe94f80bc423613fa18dae6656757423732a2. Upgrade Linux to 69fbe94f80bc423613fa18dae6656757423732a2 or later.

### How do I check if I'm affected by CVE-2026-99170?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/bd71d33923b9d6216bcee44331dd37142b0a8441>
- other: <https://git.kernel.org/stable/c/69fbe94f80bc423613fa18dae6656757423732a2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-99170>

HTML: <https://flawdb.com/CVE-2026-99170> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-99170>
