CVE-2026-98978: namespace: never expire a locked mount
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
namespace: never expire a locked mount
Locked mounts are special. They protect the underlying files and directories from being revealed. do_umount() refuses to unmount locked mounts but shrink_submounts() doesn't.
A shrinkable mount can become locked once the owner of a user namespace puts it beneath a locked mount with MOVE_MOUNT_BENEATH. The locked property now moves to the mount at the bottom making it possible to unmount the top mount.
So umount() of an unlocked ancestor now expires the bottom mount first and the covered directory is revealed:
move_mount(c -> x/hidden, MOVE_MOUNT_BENEATH) = 0
the cover after the lock moved: umount2(x/hidden) = 0 the holder of the lock: umount2(x/hidden) = EINVAL the root of the copy, busy: umount2(x) = EBUSY
reads x/hidden/secret: "covered-by-root"
So leave a locked mount alone as it dies together with its parent. A plain umount() of an unlocked mount with a locked one below it is EBUSY from now on. It's the same for any other locked child. A lazy umount still takes the whole tree.
mark_mounts_for_expiry() never sees a locked mount. lock_mnt_tree() leaves a mount on an expiry list alone and nothing else puts a locked one on such a list. Add an assert for this.
The Linux kernel CVE team has assigned CVE-2026-98978 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.12 with commit 5ff9d8a65ce80efb509ce4e8051394e9ed2cd942 and fixed in 6.18.57 with commit 6b8dc3713a76346d212abab46cbfc8d7070f534c Issue introduced in 3.12 with commit 5ff9d8a65ce80efb509ce4e8051394e9ed2cd942 and fixed in 7.2.11 with commit d23265a12e4991ce7aedce670c0b6b598cadb644 Issue introduced in 3.12 with commit 5ff9d8a65ce80efb509ce4e8051394e9ed2cd942 and fixed in 7.3 with commit f78ddcc872248c7aa1d7e904928441a0be4c6d5d
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98978
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/namespace.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/6b8dc3713a76346d212abab46cbfc8d7070f534c https://git.kernel.org/stable/c/d23265a12e4991ce7aedce670c0b6b598cadb644 https://git.kernel.org/stable/c/f78ddcc872248c7aa1d7e904928441a0be4c6d5d