ZeroHour

CVE-2026-89676

large

Use-after-free in Linux kernel nfsd async NFSv4.2 COPY stateid handling

CVSS 3.1
9.8 critical
EPSS
Published
()
Modified
AI analysis

A use-after-free in the Linux kernel's nfsd (NFS server) leaves a stale entry in the s2s_cp_stateids IDR pointing at transient per-request COMPOUND buffer memory whenever an async NFSv4.2 COPY is issued. For the lifetime of the background copy, kernel walkers such as the nfsd laundromat or manage_cpntf_state() dereference this dangling pointer, and if the reused bytes happen to resemble an expired NFS4_COPYNOTIFY_STID they execute refcount_dec(), idr_remove() and kfree() on attacker-influenced garbage, corrupting kernel memory. Because nfsd processes requests over the network and the bug is reachable through the COPY code path, a remote attacker who can reach an NFSv4.2 export can plausibly trigger kernel memory corruption leading to a crash or privilege escalation on the NFS server. The fix reorders the code to duplicate the copy fields onto the stable async_copy structure before registering the stateid. No public proof of concept exists and the flaw is not listed in CISA's KEV, so exploitation is not known to be occurring.

What to do: Patch to a kernel release containing the fix that duplicates copy fields before calling nfs4_init_copy_state(), prioritizing any host running nfsd. Until patched, firewall TCP/2049 and related NFS ports so only trusted client networks can reach the server, and verify exports are not exposed to untrusted segments. Watch for nfsd laundromat panics or oopses referencing s2s_cp_stateids/idr_remove as signs of attempted triggering.

Affected
Linux kernel (nfsd, NFSv4.2 async COPY / server-to-server copy)
Estimated exposure
large≈100,000+ internet-exposed NFS servers, plus a larger unknown population of internal enterprise NFS deployments — Public internet scans (Shodan/Censys) consistently show on the order of 10^5 hosts with TCP/2049 (nfsd) open, with many more NFS servers reachable only inside corporate networks; only the subset running vulnerable kernels with NFSv4.2 COPY…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: nfsd: fix stale s2s_cp_stateids IDR entry for async COPY For an async COPY, nfsd4_copy() called nfs4_init_copy_state() before dup_copy_fields(), so the s2s_cp_stateids IDR was pointed at &u->copy->cp_stateid -- memory in the per-rqstp COMPOUND buffer that is reused by the next request. dup_copy_fields() copies only the value into async_copy, so the IDR slot dangled at the transient buffer for the whole background copy. Any IDR walker then dereferences reused request memory: the laundromat reads cs_type from it and, if the bytes look like an expired NFS4_COPYNOTIFY_STID, follows into refcount_dec()/idr_remove()/kfree() on garbage; manage_cpntf_state() has the same exposure via idr_find(). Duplicate the fields first, then register the stateid on the stable async_copy. result->cb_stateid is unchanged.

Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.