Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: nfsd: fix refcount leak in nfsd_set_fh_dentry() nfsd exports a "pseudo root… (CVE-2025-40212)
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.
AI Analysis
Technical Summary
The Linux kernel's nfsd exports a pseudo root filesystem used by NFSv4 to locate exported filesystems via LOOKUP requests. NFSv3 clients do not normally access this pseudo root filesystem, but if a v3 or v2 client uses a filehandle from it, nfsd_set_fh_dentry() erroneously stores the export in struct svc_fh despite reporting an error and dropping a reference. This leads to an extra reference drop during fh_put(), causing a use-after-free condition and possible denial of service. The vulnerability is triggered only by crafted invalid filehandles. The patch moves assignments to svc_fh until after all error checks, closing the reference leak.
Potential Impact
Successful exploitation can cause use-after-free in the kernel's NFS daemon, potentially leading to denial of service or other kernel memory corruption impacts. The vulnerability requires a malicious client to supply an invalid filehandle from the pseudo root filesystem to NFSv3 or v2 services, which is not possible through normal NFS usage. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel by adjusting the order of assignments in nfsd_set_fh_dentry() to prevent the reference count leak. Users should apply the official kernel updates that include this patch once available. Patch status is not yet confirmed in this data; check the vendor or Linux kernel advisories for the current remediation guidance.
Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: nfsd: fix refcount leak in nfsd_set_fh_dentry() nfsd exports a "pseudo root… (CVE-2025-40212)
Description
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.
CVSS v3.1
Score 9.8critical
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Linux kernel's nfsd exports a pseudo root filesystem used by NFSv4 to locate exported filesystems via LOOKUP requests. NFSv3 clients do not normally access this pseudo root filesystem, but if a v3 or v2 client uses a filehandle from it, nfsd_set_fh_dentry() erroneously stores the export in struct svc_fh despite reporting an error and dropping a reference. This leads to an extra reference drop during fh_put(), causing a use-after-free condition and possible denial of service. The vulnerability is triggered only by crafted invalid filehandles. The patch moves assignments to svc_fh until after all error checks, closing the reference leak.
Potential Impact
Successful exploitation can cause use-after-free in the kernel's NFS daemon, potentially leading to denial of service or other kernel memory corruption impacts. The vulnerability requires a malicious client to supply an invalid filehandle from the pseudo root filesystem to NFSv3 or v2 services, which is not possible through normal NFS usage. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel by adjusting the order of assignments in nfsd_set_fh_dentry() to prevent the reference count leak. Users should apply the official kernel updates that include this patch once available. Patch status is not yet confirmed in this data; check the vendor or Linux kernel advisories for the current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-cjm8-jghh-jmq3
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40212"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a6b72d59c2644c7f847a28f
Added to database: 07/30/2026, 15:50:45 UTC
Last enriched: 07/30/2026, 16:56:16 UTC
Last updated: 09/12/2026, 10:01:28 UTC
Views: 41
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.