CVE-2025-21737: ceph: fix memory leak in ceph_mds_auth_match()
In the Linux kernel, the following vulnerability has been resolved:
ceph: fix memory leak in ceph_mds_auth_match()
We now free the temporary target path substring allocation on every
possible branch, instead of omitting the default branch. In some
cases, a memory leak occured, which could rapidly crash the system
(depending on how many file accesses were attempted).
This was detected in production because it caused a continuous memory
growth, eventually triggering kernel OOM and completely hard-locking
the kernel.
Relevant kmemleak stacktrace:
unreferenced object 0xffff888131e69900 (size 128):
comm "git", pid 66104, jiffies 4295435999
hex dump (first 32 bytes):
76 6f 6c 75 6d 65 73 2f 63 6f 6e 74 61 69 6e 65 volumes/containe
72 73 2f 67 69 74 65 61 2f 67 69 74 65 61 2f 67 rs/gitea/gitea/g
backtrace (crc 2f3bb450):
[<ffffffffaa68fb49>] __kmalloc_noprof+0x359/0x510
[<ffffffffc32bf1df>] ceph_mds_check_access+0x5bf/0x14e0 [ceph]
[<ffffffffc3235722>] ceph_open+0x312/0xd80 [ceph]
[<ffffffffaa7dd786>] do_dentry_open+0x456/0x1120
[<ffffffffaa7e3729>] vfs_open+0x79/0x360
[<ffffffffaa832875>] path_openat+0x1de5/0x4390
[<ffffffffaa834fcc>] do_filp_open+0x19c/0x3c0
[<ffffffffaa7e44a1>] do_sys_openat2+0x141/0x180
[<ffffffffaa7e4945>] __x64_sys_open+0xe5/0x1a0
[<ffffffffac2cc2f7>] do_syscall_64+0xb7/0x210
[<ffffffffac400130>] entry_SYSCALL_64_after_hwframe+0x77/0x7f
It can be triggered by mouting a subdirectory of a CephFS filesystem,
and then trying to access files on this subdirectory with an auth token
using a path-scoped capability:
$ ceph auth get client.services
[client.services]
key = REDACTED
caps mds = "allow rw fsname=cephfs path=/volumes/"
caps mon = "allow r fsname=cephfs"
caps osd = "allow rw tag cephfs data=cephfs"
$ cat /proc/self/mounts
services@[REDACTED].cephfs=/volumes/containers /ceph/containers ceph rw,noatime,name=services,secret=<hidden>,ms_mode=prefer-crc,mount_timeout=300,acl,mon_addr=[REDACTED]:3300,recover_session=clean 0 0
$ seq 1 1000000 | xargs -P32 --replace={} touch /ceph/containers/file-{} && \
seq 1 1000000 | xargs -P32 --replace={} cat /ceph/containers/file-{}
[ idryomov: combine if statements, rename rc to path_matched and make
it a bool, formatting ]
Security readout for executives and security teams
Plain-English summary
A Linux kernel CephFS client bug can leak memory during certain authorized file-access checks. On affected systems, repeated normal-looking file access can grow kernel memory until the host reaches OOM and may hard-lock. This is primarily an availability risk, not a data theft or integrity issue.
Executive priority
Treat this as a targeted availability issue. It should be prioritized for storage, CI, application, or platform hosts relying on CephFS, because a local low-privilege condition can crash important systems. It is less urgent for hosts not using CephFS.
Technical view
CVE-2025-21737 is a CWE-401 memory leak in ceph_mds_auth_match()/ceph_mds_check_access(). The leak occurs when a temporary target path substring is not freed on every branch. The provided trigger condition involves CephFS subdirectory mounts and path-scoped MDS capabilities. CVSS 3.1 is 5.5, AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
Likely exposure
Exposure is likely limited to Linux hosts using the kernel CephFS client, especially subdirectory mounts with path-scoped MDS auth capabilities. The source lists Linux kernel versions including 6.10, 6.12.14, 6.13.3, and 6.14 as affected context; downstream distro status needs vendor confirmation.
Exploitation context
The bundle says the issue was detected in production through continuous memory growth, OOM, and kernel hard-lock. It is not listed in KEV, and no cited source states active exploitation. Triggering requires local access and relevant CephFS authentication and mount conditions.
Researcher notes
Evidence supports a kernel memory leak fixed in stable commits, with production impact described by the CVE text. The source bundle does not provide distro-specific fixed versions, exploit-in-the-wild evidence, or broader affected product claims. Avoid extrapolating beyond CephFS client conditions.
Mitigation direction
Apply a vendor kernel update containing the referenced stable Ceph fixes.
Check Linux distribution advisories for exact fixed package versions.
Prioritize hosts mounting CephFS subdirectories with path-scoped MDS capabilities.
Monitor affected hosts for kernel memory growth, OOM events, and hard-lock symptoms.
Restrict unnecessary CephFS access while patching high-risk systems.
Validation and detection
Inventory Linux hosts using the in-kernel CephFS client.
Identify CephFS subdirectory mounts and path-scoped MDS capabilities.
Confirm kernel packages include one of the referenced stable fixes.
Review kernel logs for OOM or CephFS-linked memory growth.
Validate patched hosts with normal CephFS access and memory monitoring.
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.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
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.
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.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.