{"cve":"CVE-2026-99170","nvd":{"published":"2026-10-28T11:17:37.520","modified":"2026-10-28T11:17:37.520","status":"Received","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnamespace: a mount that copy_tree() leaves out can't take over a lock\n\nSince commit c62a4766937e (\"move_mount: transfer MNT_LOCKED\") a mount\ncan be moved beneath a locked mount. The lock moves from the old cover\nto the new mount which takes over the job of hiding what's under it and\nthe old cover can be unmounted. That works as long as the new mount\nstays. But the caller picks the new mount and copy_tree() leaves a\nmount of a mount namespace file out of every copy made without\nCL_COPY_MNT_NS_FILE, together with everything mounted on it, and never\nlooks at MNT_LOCKED. unshare(CLONE_NEWNS) and mount propagation make\nsuch copies.\n\nSo a task that is root in its own user namespace gets rid of a locked\ncover on a file without a race and without touching the filesystem\nbelow it. It makes a child with a mount namespace of its own, binds the\nchild's /proc/<pid>/ns/mnt beneath the cover with MOVE_MOUNT_BENEATH,\nwhich hands the lock to that bind, and calls unshare(CLONE_NEWNS). The\nnew mount namespace has nothing on the file. That's the usual way to\nmask a single file, a bind of /dev/null or of an empty file. With a\nbind of an ordinary file the file stays covered.\n\ncopy_tree() already refuses to leave out a locked unbindable mount with\n-EPERM since commit df7342b24018 (\"mount: Don't allow copying\nMNT_UNBINDABLE|MNT_LOCKED mounts\"). Do the same for a locked mount of a\nmount namespace file. That also covers a tree copied with\nCL_COPY_MNT_NS_FILE and attached into a mount namespace of another user\nnamespace where lock_mnt_tree() locks it. Note that unshare(CLONE_NEWNS)\nand clone(CLONE_NEWNS) fail with EPERM from such a mount namespace from\nthen on. The mount can't be left out and it can't be unmounted.\n\nAnd refuse to move a mount of a mount namespace file beneath a locked\nmount in the first place. Otherwise the task ends up with a mount it\ncan't unmount and an unshare() that fails for good.\n\nChris also found a second mount that goes away by itself, a clone of an\nautomounted mount that shrink_submounts() took along with its parent.\nCommit f78ddcc87224 (\"namespace: never expire a locked mount\") took\ncare of that one.\n\nChris's reproducer is appended. Mode nsfile reads SECRET after the\nunshare() on 7.3-rc7, with this patch the move_mount() fails with\nEINVAL and the file stays covered. nsfile-control uses an ordinary file\nand reads MASK both ways.\n\n  // SPDX-License-Identifier: GPL-2.0\n  /*\n   * Get rid of a locked cover with MOVE_MOUNT_BENEATH.\n   *\n   * The \"admin\" (root) makes a tmpfs W:\n   *     W/D         file, holds SECRET, covered by a bind of a file with MASK\n   *     W/Dd/inner  file, holds SECRET, Dd is covered by a bind of a directory\n   *                 whose \"inner\" holds MASK\n   *     W/own       directory of uid 1000 with the file \"mine\" and the\n   *                 directory \"minedir\", whose \"inner\" holds MINE\n   *     W/dbg       debugfs, mode 755. dbg/tracing is an automount point\n   * The \"attacker\" is uid 1000. It enters a new user namespace with a new mount\n   * namespace, so W and both covers are locked there.\n   *\n   * usage: prog MODE\n   *   plain      put a bind of own/mine beneath the cover of D, unmount the cover\n   *   nsfile     put a bind of the mount namespace file of a child beneath the\n   *              cover of D, then unshare(CLONE_NEWNS)\n   *   nsfile-control    the same with a bind of own/mine\n   *   shrink     put a bind of the automounted tracefs beneath the cover of Dd,\n   *              unmount the cover, put a tmpfs beneath W, call umount(W), which fails\n   *   shrink-control    the same with a bind of own/minedir\n   * The environment variable AUTOMOUNT_DIR names another automount point for \"shrink\".\n   */\n  #define _GNU_SOURCE\n  #include <errno.h>\n  #include <fcntl.h>\n  #include <grp.h>\n  #include <sched.h>\n  #include <signal.h>\n  #include <stdio.h>\n  #include <stdlib.h>\n  #include <string.h>\n  #include <unistd.h>\n \n---truncated---","cvss_v4":null,"cvss_v3":null,"cwes":[],"references":["https://git.kernel.org/stable/c/69fbe94f80bc423613fa18dae6656757423732a2","https://git.kernel.org/stable/c/bd71d33923b9d6216bcee44331dd37142b0a8441"],"products":[],"source":"nvd","synced_at":"2026-10-28T11:37:51.394563875+00:00"},"epss":null,"kev":null,"osv":[],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}