Ad

CVE-2026-99170

HIGH CVSS 3.1: 8,8 EPSS 0.17%
Обновлено 31 октября 2026
Linux
Параметр Значение
CVSS 8,8 (HIGH)
Уязвимые версии 7.1 — 7.3
Устранено в версии 7.2.13
Поставщик Linux
Публичный эксплойт Нет

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. Замок перемещается от старого покрытия к новому креплению, которое берет на себя работу по сокрытию того, что под ним, и старое покрытие может быть демонтировано. Это работает до тех пор, пока новая гора остается.

Но абонент выбирает новое монтирование и copy_tree() оставляет монтирование файла пространства имен монтирования из каждой копии, сделанной без CL_COPY_MNT_NS_FILE, вместе со всем установленным на нем, и никогда не смотрит на MNT_LOCKED. unshare(CLONE_NEWNS) и распространение монтирования делает такие копии. Таким образом, задача, которая является корнем в собственном пространстве имен пользователей, избавляется от закрытой крышки на файле без гонки и без прикосновения к файловой системе под ним. Он делает ребенка с собственным пространством имен mount, связывает /proc/<pid>/ns/mnt под обложкой с MOVE_MOUNT_BENEATH, который передает блокировку этому соединению и вызывает unshare(CLONE_NEWNS).

Пространство имен нового монтирования не содержит ничего в файле. Это обычный способ маскировки одного файла, привязки /dev/null или пустого файла. copy_tree() уже отказывается оставлять заблокированное несвязанное крепление с -EPERM, так как commit df7342b24018 ("mount: Don't позволяет копировать MNT_UNBINDABLE|MNT_LOCKED mounts"). Сделайте то же самое для заблокированного монтирования файла пространства имен монтирования.

Это также охватывает дерево, скопированное с CL_COPY_MNT_NS_FILE и прикрепленное к пространству имен монтирования другого пространства имен пользователей, где lock_mnt_tree () блокирует его. Обратите внимание, что с тех пор unshare(CLONE_NEWNS) и clone(CLONE_NEWNS) не работают с EPERM из такого пространства имен. Гора не может быть оставлена и не может быть размонтирована.

И откажитесь от перемещения монтирования файла пространства имен под заблокированным монтированием в первую очередь. В противном случае задача заканчивается монтированием, которое она не может размонтировать, и unshare(), который не удается навсегда. Крис также нашел второе крепление, которое уходит само по себе, клон автомонтируемого крепления, которое shrink_submounts() взял вместе со своим родителем.

Commit f78ddcc87224 ("namespace: never expire a locked mount") took care of that one. Репродуктор Криса прилагается. 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---

Показать оригинальное описание (EN)

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

Характеристики атаки

Способ атаки
Локальный
Нужен локальный доступ
Сложность
Низкая
Легко эксплуатировать
Нужны права
Низкие
Нужны базовые права
Участие пользователя
Не требуется
Не нужно действие пользователя

Последствия

Конфиденциальность
Высокое
Полная утечка данных
Целостность
Высокое
Полная модификация данных
Доступность
Высокое
Полный отказ в обслуживании

Строка CVSS v3.1

Уязвимые продукты 2

Конфигурация От (включительно) До (исключительно)
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
7.1 7.2.13
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
7.1 7.3