CRITICAL Introduced in 5.6
nfsd CopyNotify UAF
CVE-2026-89669
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.5HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: nfsd: initialize copy-notify stateid before publishing it nfsd4_copy_notify() finished initializing the cpntf state after nfs4_alloc_init_cpntf_state() had already linked it into the s2s_cp_stateids IDR and the parent's sc_cp_list, with cs_count == 1 (the membership reference) and none held for the caller. A racing OFFLOAD_CANCEL (crafted cl_id == nn->s2s_cp_cl_id plus the guessable so_id) could reach manage_cpntf_state() and free the entry, turning the caller's subsequent cpn_cnr_stateid read and cp_p_stateid/cp_p_clid writes into use-after-free. The owning clientid was also only recorded after publication, so it could not gate an ownership check in that window. Record cp_p_stateid and cp_p_clid inside nfs4_alloc_init_cpntf_state() before nfs4_init_cp_state() publishes the entry, and return it with an extra reference. The caller reads the stateid under that reference and drops it with nfs4_put_cpntf_state(); on a late error the laundromat reaps the entry.
02KernelScan AI Analysis
Risk summary
An NFS client can exploit a race in the NFS server's copy-notify state handling to trigger a use-after-free, potentially achieving kernel memory corruption or denial of service. Any system exporting NFSv4.2 shares to clients over the network is at risk. The attack requires sending concurrent crafted COPY_NOTIFY and OFFLOAD_CANCEL operations during a narrow initialization window.
Vulnerability analysis
The NFS server's copy-notify handling publishes a state tracking entry into global lookup tables before it is fully initialized and without holding a reference for the caller. A concurrent OFFLOAD_CANCEL request with a crafted client identifier and a guessable state identifier can find and free that entry during the initialization window, causing the original request to read and write freed memory. The fix moves all initialization before the entry is published and hands the caller an extra reference so the entry cannot be freed while it is still in use. This is reachable by any NFS client that can send NFSv4.2 operations to an exporting server over the network; no special server-side privileges are required beyond being an authorized client.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.6 | 6.1.188 | 4415a692346a |
| 6.6 | 5.6 | 6.6.157 | 9caad13b7cfe |
| 6.18 | 5.6 | 6.18.50 | a4d7fedcaaf3 |
| 7.2 | 5.6 | 7.2.4 | 4cdef96892f4 |
| mainline | 5.6 | 7.3-rc1 | 129643893b79 |
| 5.15 | 5.6 | 5.15.221 | d18d36395d97 |
| 5.10 | 5.6 | 5.10.270 | 863b6e995665 |
| 6.12 | 5.6 | 6.12.109 | e08a3dcaca05 |
| cip/6.12 | 5.6 | 6.12.111-cip32 | e08a3dcaca05 |