CVE-2025-37988: fix a couple of races in MNT_TREE_BENEATH handling by do_move_mount()
In the Linux kernel, the following vulnerability has been resolved:
fix a couple of races in MNT_TREE_BENEATH handling by do_move_mount()
Normally do_lock_mount(path, _) is locking a mountpoint pinned by
*path and at the time when matching unlock_mount() unlocks that
location it is still pinned by the same thing.
Unfortunately, for 'beneath' case it's no longer that simple -
the object being locked is not the one *path points to. It's the
mountpoint of path->mnt. The thing is, without sufficient locking
->mnt_parent may change under us and none of the locks are held
at that point. The rules are
* mount_lock stabilizes m->mnt_parent for any mount m.
* namespace_sem stabilizes m->mnt_parent, provided that
m is mounted.
* if either of the above holds and refcount of m is positive,
we are guaranteed the same for refcount of m->mnt_parent.
namespace_sem nests inside inode_lock(), so do_lock_mount() has
to take inode_lock() before grabbing namespace_sem. It does
recheck that path->mnt is still mounted in the same place after
getting namespace_sem, and it does take care to pin the dentry.
It is needed, since otherwise we might end up with racing mount --move
(or umount) happening while we were getting locks; in that case
dentry would no longer be a mountpoint and could've been evicted
on memory pressure along with its inode - not something you want
when grabbing lock on that inode.
However, pinning a dentry is not enough - the matching mount is
also pinned only by the fact that path->mnt is mounted on top it
and at that point we are not holding any locks whatsoever, so
the same kind of races could end up with all references to
that mount gone just as we are about to enter inode_lock().
If that happens, we are left with filesystem being shut down while
we are holding a dentry reference on it; results are not pretty.
What we need to do is grab both dentry and mount at the same time;
that makes inode_lock() safe *and* avoids the problem with fs getting
shut down under us. After taking namespace_sem we verify that
path->mnt is still mounted (which stabilizes its ->mnt_parent) and
check that it's still mounted at the same place. From that point
on to the matching namespace_unlock() we are guaranteed that
mount/dentry pair we'd grabbed are also pinned by being the mountpoint
of path->mnt, so we can quietly drop both the dentry reference (as
the current code does) and mnt one - it's OK to do under namespace_sem,
since we are not dropping the final refs.
That solves the problem on do_lock_mount() side; unlock_mount()
also has one, since dentry is guaranteed to stay pinned only until
the namespace_unlock(). That's easy to fix - just have inode_unlock()
done earlier, while it's still pinned by mp->m_dentry.
Security readout for executives and security teams
Plain-English summary
A race condition in Linux mount handling can leave the kernel using mount or filesystem objects while they are being moved, unmounted, or shut down. A locally authenticated, low-privileged attacker may be able to trigger serious confidentiality, integrity, and availability impacts. The supplied evidence does not establish remote or active exploitation.
Executive priority
Treat this as a high-priority local privilege boundary risk, especially on systems shared with less-trusted users. Patch through supported distribution channels and confirm the updated kernel is running. Emergency internet-facing remediation is not indicated by the supplied evidence because the attack vector is local and active exploitation is unconfirmed.
Technical view
The flaw affects do_move_mount() processing for MNT_TREE_BENEATH. Insufficient synchronization and reference pinning can allow mnt_parent, mount, dentry, or inode lifetime changes between locking operations. The fix pins the mount and dentry together, revalidates placement under namespace_sem, and performs inode_unlock() while the dentry remains pinned.
Likely exposure
Exposure is limited to affected Linux kernels and requires local, low-privileged access without user interaction. The supplied record identifies releases including 6.5, 6.6.89, 6.12.26, 6.14.5, and 6.15 as affected, but distribution backports may alter status. Confirm each deployed vendor kernel independently.
Exploitation context
The CVSS 3.1 score is 7.8 with local access, low complexity, low privileges, and potential high impact across confidentiality, integrity, and availability. The record is not listed in CISA KEV, and the supplied sources provide no evidence of active exploitation or a public exploit.
Researcher notes
The source describes two lifetime races rather than a demonstrated exploitation primitive. One concerns failure to pin the matching parent mount alongside its dentry; another concerns unlocking the inode after namespace protection ends. Exact vulnerable-to-fixed release boundaries and distribution-specific backports are not fully established by the bundle, so commit-level or vendor-package verification is necessary.
Mitigation direction
Install a vendor-supported kernel update containing the referenced fix or an equivalent backport.
Reboot affected systems so the corrected kernel becomes active.
If an update is unavailable, obtain interim mitigation guidance from the Linux distribution vendor.
Prioritize systems where less-trusted users can access affected mount functionality.
Validation and detection
Inventory running kernel releases and complete distribution package versions.
Check each package against its vendor's CVE advisory and backport status.
Confirm the installed source or package changelog contains the referenced fix or equivalent changes.
After rebooting, verify the active kernel matches the remediated package.
Reassess exposure whenever kernel packages or affected-version data change.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-37988 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.