In the Linux kernel, the following vulnerability has been resolved:
NFSD: Prevent client use-after-free during close_lru reaping
An nfs4_openowner left on nn->close_lru after its final CLOSE keeps
its last closed stateid in oo_last_closed_stid, holding only a raw
pointer to its nfs4_client. The laundromat reaps timed-out entries,
drops nn->client_lock, and calls nfs4_put_stid(), which dereferences
the client through cl_lock. Nothing pins the client across that
window, so a concurrent force_expire_client() can free it and
nfs4_put_stid() reads freed memory. __destroy_client() hits the same
race, walking clp->cl_openowners without cl_lock.
Pin the client with cl_rpc_users before dropping client_lock, and
skip clients already expiring. __destroy_client() then cleans up its
own close_lru entries through release_last_closed_stateid(), so
teardown no longer races the laundromat.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8
AV:N - nfsd is the in-kernel NFS server. A remote NFSv4.0 client reaches the UAF over TCP/UDP 2049: CLOSE places the openowner on nn->close_lru, and SETCLIENTID_CONFIRM (ALLOWED_WITHOUT_FH) calls expire_client() while nfs4_laundromat() drops client_lock and nfs4_put_stid() uses the unpinned nfs4_client.
AC:L - The attacker drives both sides: OPEN/CLOSE compounds fill close_lru so the laundromat drops client_lock once per nfs4_put_stid(), and concurrent SETCLIENTID_CONFIRM with matching AUTH_SYS creds replaces the client via expire_client(). FATTR4_LEASE_TIME times the window; flooding close_lru widens it; the race is retryable.
PR:N - Typical nfsd deployments use AUTH_SYS/AUTH_NULL, so RPC uids are self-asserted. SETCLIENTID and SETCLIENTID_CONFIRM are ALLOWED_WITHOUT_FH; any host allowed by the export can OPEN/CLOSE and replace the client with no local account or capability on the NFS server.
UI:N - The attacker issues the NFSv4.0 compounds (SETCLIENTID, OPEN, CLOSE, RENEW, SETCLIENTID_CONFIRM) itself. No administrator or other user on the victim server must mount a filesystem, write nfsdfs ctl, or otherwise interact.
S:U - The use-after-free is of the nfsd nfs4_client object (client_slab) in the NFS server kernel. Impact stays in that kernel security authority and does not cross a VM, IOMMU, or sandbox boundary.
C:H - After free_client() kmem_cache_free()s the nfs4_client, nfs4_put_stid() still reads cl_lock and cl_stateids. Reclaiming the mergeable client_slab object via further SETCLIENTID discloses kernel heap; a UAF is C:H.
I:H - nfs4_put_stid() then takes cl_lock and idr_remove()s from cl_stateids on the freed nfs4_client, a slab UAF write concurrent with __destroy_client(). Heap reuse enables arbitrary write and control-flow hijack; a UAF is I:H.
A:H - Use-after-free of nfs4_client in nfs4_put_stid() (spin_lock of freed cl_lock) oopses or panics the nfsd laundromat worker even without a full exploit, denying service of the NFS server host.
| Attack Vector |
Network |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:N - nfsd is the in-kernel NFS server. A remote NFSv4.0 client reaches the UAF over TCP/UDP 2049: CLOSE places the openowner on nn->close_lru, and SETCLIENTID_CONFIRM (ALLOWED_WITHOUT_FH) calls expire_client() while nfs4_laundromat() drops client_lock and nfs4_put_stid() uses the unpinned nfs4_client.
AC:L - The attacker drives both sides: OPEN/CLOSE compounds fill close_lru so the laundromat drops client_lock once per nfs4_put_stid(), and concurrent SETCLIENTID_CONFIRM with matching AUTH_SYS creds replaces the client via expire_client(). FATTR4_LEASE_TIME times the window; flooding close_lru widens it; the race is retryable.
PR:N - Typical nfsd deployments use AUTH_SYS/AUTH_NULL, so RPC uids are self-asserted. SETCLIENTID and SETCLIENTID_CONFIRM are ALLOWED_WITHOUT_FH; any host allowed by the export can OPEN/CLOSE and replace the client with no local account or capability on the NFS server.
UI:N - The attacker issues the NFSv4.0 compounds (SETCLIENTID, OPEN, CLOSE, RENEW, SETCLIENTID_CONFIRM) itself. No administrator or other user on the victim server must mount a filesystem, write nfsdfs ctl, or otherwise interact.
S:U - The use-after-free is of the nfsd nfs4_client object (client_slab) in the NFS server kernel. Impact stays in that kernel security authority and does not cross a VM, IOMMU, or sandbox boundary.
C:H - After free_client() kmem_cache_free()s the nfs4_client, nfs4_put_stid() still reads cl_lock and cl_stateids. Reclaiming the mergeable client_slab object via further SETCLIENTID discloses kernel heap; a UAF is C:H.
I:H - nfs4_put_stid() then takes cl_lock and idr_remove()s from cl_stateids on the freed nfs4_client, a slab UAF write concurrent with __destroy_client(). Heap reuse enables arbitrary write and control-flow hijack; a UAF is I:H.
A:H - Use-after-free of nfs4_client in nfs4_put_stid() (spin_lock of freed cl_lock) oopses or panics the nfsd laundromat worker even without a full exploit, denying service of the NFS server host.
CVSS 3.1