Linux Kernel up to 6.12.58/6.17.8/6.18-rc5 nfsd_set_fh_dentry memory leak

| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 5.5 | $0-$5k | 0.00 |
Summary
A vulnerability was found in Linux Kernel up to 6.12.58/6.17.8/6.18-rc5 and classified as critical. The affected element is the function nfsd_set_fh_dentry. The manipulation results in memory leak.
This vulnerability is reported as CVE-2025-40212. No exploit exists.
It is suggested to upgrade the affected component.
Details
A vulnerability, which was classified as critical, was found in Linux Kernel up to 6.12.58/6.17.8/6.18-rc5. Affected is the function nfsd_set_fh_dentry. The manipulation with an unknown input leads to a memory leak vulnerability. CWE is classifying the issue as CWE-401. The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. This is going to have an impact on availability. CVE summarizes:
In the Linux kernel, the following vulnerability has been resolved: nfsd: fix refcount leak in nfsd_set_fh_dentry() nfsd exports a "pseudo root filesystem" which is used by NFSv4 to find the various exported filesystems using LOOKUP requests from a known root filehandle. NFSv3 uses the MOUNT protocol to find those exported filesystems and so is not given access to the pseudo root filesystem. If a v3 (or v2) client uses a filehandle from that filesystem, nfsd_set_fh_dentry() will report an error, but still stores the export in "struct svc_fh" even though it also drops the reference (exp_put()). This means that when fh_put() is called an extra reference will be dropped which can lead to use-after-free and possible denial of service. Normal NFS usage will not provide a pseudo-root filehandle to a v3 client. This bug can only be triggered by the client synthesising an incorrect filehandle. To fix this we move the assignments to the svc_fh later, after all possible error cases have been detected.
The advisory is shared for download at git.kernel.org. This vulnerability is traded as CVE-2025-40212 since 04/16/2025. There are known technical details, but no exploit is available.
The vulnerability scanner Nessus provides a plugin with the ID 276664 (Linux Distros Unpatched Vulnerability : CVE-2025-40212), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 6.12.59, 6.17.9 or 6.18-rc6 eliminates this vulnerability. Applying the patch b6bc86ce3944b10b9fc181fc00c1a520a20ed965/c83d7365cec5eb5ebeeee2a72e29b4ca58a7e4c2/8a7348a9ed70bda1c1f51d3f1815bcbdf9f3b38c is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.
The vulnerability is also documented in the databases at Tenable (276664) and CERT Bund (WID-SEC-2025-2672). Once again VulDB remains the best source for vulnerability data.
Affected
- Google Container-Optimized OS
- Ubuntu Linux
- SUSE Linux
- Oracle Linux
- SUSE openSUSE
- Open Source Linux Kernel
Product
Type
Vendor
Name
Version
- 6.12.0
- 6.12.1
- 6.12.2
- 6.12.3
- 6.12.4
- 6.12.5
- 6.12.6
- 6.12.7
- 6.12.8
- 6.12.9
- 6.12.10
- 6.12.11
- 6.12.12
- 6.12.13
- 6.12.14
- 6.12.15
- 6.12.16
- 6.12.17
- 6.12.18
- 6.12.19
- 6.12.20
- 6.12.21
- 6.12.22
- 6.12.23
- 6.12.24
- 6.12.25
- 6.12.26
- 6.12.27
- 6.12.28
- 6.12.29
- 6.12.30
- 6.12.31
- 6.12.32
- 6.12.33
- 6.12.34
- 6.12.35
- 6.12.36
- 6.12.37
- 6.12.38
- 6.12.39
- 6.12.40
- 6.12.41
- 6.12.42
- 6.12.43
- 6.12.44
- 6.12.45
- 6.12.46
- 6.12.47
- 6.12.48
- 6.12.49
- 6.12.50
- 6.12.51
- 6.12.52
- 6.12.53
- 6.12.54
- 6.12.55
- 6.12.56
- 6.12.57
- 6.12.58
- 6.17.0
- 6.17.1
- 6.17.2
- 6.17.3
- 6.17.4
- 6.17.5
- 6.17.6
- 6.17.7
- 6.17.8
- 6.18-rc1
- 6.18-rc2
- 6.18-rc3
- 6.18-rc4
- 6.18-rc5
License
Website
- Vendor: https://www.kernel.org/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.7VulDB Meta Temp Score: 5.5
VulDB Base Score: 5.7
VulDB Temp Score: 5.5
VulDB Vector: 🔒
VulDB Reliability: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: Memory leakCWE: CWE-401 / CWE-404
CAPEC: 🔒
ATT&CK: 🔒
Physical: No
Local: No
Remote: Partially
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 276664
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2025-40212
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: Kernel 6.12.59/6.17.9/6.18-rc6
Patch: b6bc86ce3944b10b9fc181fc00c1a520a20ed965/c83d7365cec5eb5ebeeee2a72e29b4ca58a7e4c2/8a7348a9ed70bda1c1f51d3f1815bcbdf9f3b38c
Timeline
04/16/2025 CVE reserved11/24/2025 Advisory disclosed
11/24/2025 VulDB entry created
02/24/2026 VulDB entry last update
Sources
Vendor: kernel.orgAdvisory: git.kernel.org
Status: Confirmed
CVE: CVE-2025-40212 (🔒)
GCVE (CVE): GCVE-0-2025-40212
GCVE (VulDB): GCVE-100-333372
CERT Bund: WID-SEC-2025-2672 - Linux Kernel: Mehrere Schwachstellen ermöglichen Denial of Service
Entry
Created: 11/24/2025 15:04Updated: 02/24/2026 13:54
Changes: 11/24/2025 15:04 (58), 11/25/2025 05:31 (2), 02/24/2026 13:54 (7)
Complete: 🔍
Cache ID: 216::103
Once again VulDB remains the best source for vulnerability data.
No comments yet. Languages: en.
Please log in to comment.