In the Linux kernel, the following vulnerability has been resolved:
netfs: fix reference leak
Commit 20d72b00ca81 ("netfs: Fix the request's work item to not
require a ref") modified netfs_alloc_request() to initialize the
reference counter to 2 instead of 1. The rationale was that the
requet's "work" would release the second reference after completion
(via netfs_{read,write}_collection_worker()). That works most of the
time if all goes well.
However, it leaks this additional reference if the request is released
before the I/O operation has been submitted: the error code path only
decrements the reference counter once and the work item will never be
queued because there will never be a completion.
This has caused outages of our whole server cluster today because
tasks were blocked in netfs_wait_for_outstanding_io(), leading to
deadlocks in Ceph (another bug that I will address soon in another
patch). This was caused by a netfs_pgpriv2_begin_copy_to_cache() call
which failed in fscache_begin_write_operation(). The leaked
netfs_io_request was never completed, leaving `netfs_inode.io_count`
with a positive value forever.
All of this is super-fragile code. Finding out which code paths will
lead to an eventual completion and which do not is hard to see:
- Some functions like netfs_create_write_req() allocate a request, but
will never submit any I/O.
- netfs_unbuffered_read_iter_locked() calls netfs_unbuffered_read()
and then netfs_put_request(); however, netfs_unbuffered_read() can
also fail early before submitting the I/O request, therefore another
netfs_put_request() call must be added there.
A rule of thumb is that functions that return a `netfs_io_request` do
not submit I/O, and all of their callers must be checked.
For my taste, the whole netfs code needs an overhaul to make reference
counting easier to understand and less fragile & obscure. But to fix
this bug here and now and produce a patch that is adequate for a
stable backport, I tried a minimal approach that quickly frees the
request object upon early failure.
I decided against adding a second netfs_put_request() each time
because that would cause code duplication which obscures the code
further. Instead, I added the function netfs_put_failed_request()
which frees such a failed request synchronously under the assumption
that the reference count is exactly 2 (as initially set by
netfs_alloc_request() and never touched), verified by a
WARN_ON_ONCE(). It then deinitializes the request object (without
going through the "cleanup_work" indirection) and frees the allocation
(with RCU protection to protect against concurrent access by
netfs_requests_seq_start()).
All code paths that fail early have been changed to call
netfs_put_failed_request() instead of netfs_put_request().
Additionally, I have added a netfs_put_request() call to
netfs_unbuffered_read() as explained above because the
netfs_put_failed_request() approach does not work there.
Security readout for executives and security teams
Plain-English summary
This Linux kernel bug can leave internal network-filesystem I/O stuck forever after an early failure. The source reports server-cluster outages caused by tasks blocked waiting for outstanding I/O, with Ceph deadlocks observed. It is primarily an availability risk, not documented as data theft or remote code execution.
Executive priority
Handle as a reliability and availability issue for Linux storage or network-filesystem environments. It deserves timely patch planning where affected kernels and relevant workloads exist, but the provided evidence does not support emergency treatment based on active exploitation.
Technical view
CVE-2025-40007 is a netfs reference-count leak introduced after request allocation started with two references. Early failure paths could release only one reference before I/O submission, so completion work never ran and netfs_inode.io_count stayed positive indefinitely. The fix adds failed-request cleanup handling for those paths.
Likely exposure
Exposure is likely limited to Linux systems running affected kernel versions identified by the CVE record and exercising netfs/fscache paths. Ceph was specifically mentioned in the source incident, but the CVE evidence does not define all filesystem users or configurations affected.
Exploitation context
The source bundle does not show CISA KEV listing, public exploitation, exploit code, or an attacker-controlled trigger. The described impact came from operational failure paths that caused deadlock and outages. Treat exploitability as unclear from the provided evidence.
Researcher notes
The important failure condition is an early request-release path before I/O submission. The patch approach uses netfs_put_failed_request() for synchronously freeing failed requests and adds a netfs_put_request() path in netfs_unbuffered_read(). Affected-version metadata is sparse and should be validated against vendor kernel packaging.
Mitigation direction
Review vendor kernel advisories for CVE-2025-40007 applicability.
Update affected Linux kernels to builds containing the linked stable fixes.
Prioritize systems using netfs, fscache, or Ceph-backed workloads.
Monitor for tasks blocked in netfs-related I/O waits.
Avoid inventing compensating controls without vendor guidance.
Validation and detection
Inventory Linux kernel versions across production and storage nodes.
Compare deployed kernels against the CVE affected-version data.
Check whether workloads use netfs, fscache, or Ceph paths.
Review kernel logs for persistent netfs or I/O wait symptoms.
Confirm patched kernels include the referenced stable commits.
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-40007 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.
0CVSS vectors
3Timeline events
0ADP providers
3Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Oct 20, 2025, 15:26 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.