Skip to main content
EPSS 0.4%top 66%

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)

0
Medium
Published: 11/24/2025 (11/24/2025, 13:16:00 UTC)
Source: GCVE Database
Product: linux-hwe-edge

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected software

Affected versions
<6.17.0-1007.7~24.04.1<6.17.0-1008.8~24.04.1<6.17.0-1008.8<6.17.0-1011.11

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/30/2026, 16:56:16 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses