In the Linux kernel, the following vulnerability has been resolved:
NFSD: Prevent client use-after-free during admin state revocation
A stateid holds only a bare pointer to its nfs4_client; a stateid
reference does not pin it. The client survives only because
__destroy_client() drains its stateids before free_client() runs.
nfsd4_revoke_states() drops nn->client_lock across revoke_one_stid(),
which dereferences the client to revoke a stateid and read
clp->cl_minorversion. A teardown racing the dropped lock can free
the client first.
Pinning cl_rpc_users under client_lock blocks the DESTROY_CLIENTID and
EXCHANGE_ID teardown, which refuses while cl_rpc_users is non-zero.
force_expire_client() ignores it: once its wait for cl_rpc_users to
reach zero has passed, a later pin goes unnoticed.
Under client_lock, skip a client whose cl_time is already zero --
force_expire_client() clears it there before waiting -- otherwise pin
cl_rpc_users before dropping the lock. The walk then either sees the
expiry and skips, or pins in time for that wait to cover the revoke.
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 - The UAF is in nfsd nfsd4_revoke_states(). A remote NFSv4 peer reaches the racing expire_client() over TCP/2049 via EXCHANGE_ID/CREATE_SESSION, SETCLIENTID_CONFIRM, or DESTROY_CLIENTID (ALLOWED_WITHOUT_FH), which free nfs4_client while the revoke walk still dereferences it.
AC:L - The attacker controls the teardown side: they hold many stateids so the revoke walk drops client_lock once per stid, and concurrently retry EXCHANGE_ID/CREATE_SESSION or SETCLIENTID_CONFIRM so mark_client_expired_locked() succeeds while cl_rpc_users is unpinned.
PR:N - EXCHANGE_ID, CREATE_SESSION, SETCLIENTID, SETCLIENTID_CONFIRM, and DESTROY_CLIENTID are ALLOWED_WITHOUT_FH with no export check. Typical AUTH_SYS/AUTH_NULL nfsd deployments do not verify RPC credentials, so any host that can reach TCP/2049 can establish state and trigger expire.
UI:N - The attacker drives the NFS compounds that create state and expire the client. Administrative unlock_filesystem/unexport is a server operational condition (unexport or response to a misbehaving client), not a required victim user action.
S:U - The freed object is struct nfs4_client in the NFS server kernel. Impact remains in that kernel security authority; there is no VM, IOMMU, or sandbox boundary crossing.
C:H - revoke_one_stid() and the subsequent clp->cl_minorversion read dereference nfs4_client after free_client() kmem_cache_free's the mergeable client_slab object (KMEM_CACHE flags 0). Reclaim via EXCHANGE_ID discloses kernel memory; a UAF is C:H.
I:H - revoke_one_stid() takes cl_lock and nfs4_put_stid() does refcount_dec_and_lock/idr_remove on the freed client's cl_lock/cl_stateids, concurrent with __destroy_client(), a slab UAF write primitive for heap corruption and control-flow hijacking.
A:H - Use-after-free of nfs4_client in the nfsd revoke path oopses or panics the NFS server even without full exploitation, fully denying service of the 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 - The UAF is in nfsd nfsd4_revoke_states(). A remote NFSv4 peer reaches the racing expire_client() over TCP/2049 via EXCHANGE_ID/CREATE_SESSION, SETCLIENTID_CONFIRM, or DESTROY_CLIENTID (ALLOWED_WITHOUT_FH), which free nfs4_client while the revoke walk still dereferences it.
AC:L - The attacker controls the teardown side: they hold many stateids so the revoke walk drops client_lock once per stid, and concurrently retry EXCHANGE_ID/CREATE_SESSION or SETCLIENTID_CONFIRM so mark_client_expired_locked() succeeds while cl_rpc_users is unpinned.
PR:N - EXCHANGE_ID, CREATE_SESSION, SETCLIENTID, SETCLIENTID_CONFIRM, and DESTROY_CLIENTID are ALLOWED_WITHOUT_FH with no export check. Typical AUTH_SYS/AUTH_NULL nfsd deployments do not verify RPC credentials, so any host that can reach TCP/2049 can establish state and trigger expire.
UI:N - The attacker drives the NFS compounds that create state and expire the client. Administrative unlock_filesystem/unexport is a server operational condition (unexport or response to a misbehaving client), not a required victim user action.
S:U - The freed object is struct nfs4_client in the NFS server kernel. Impact remains in that kernel security authority; there is no VM, IOMMU, or sandbox boundary crossing.
C:H - revoke_one_stid() and the subsequent clp->cl_minorversion read dereference nfs4_client after free_client() kmem_cache_free's the mergeable client_slab object (KMEM_CACHE flags 0). Reclaim via EXCHANGE_ID discloses kernel memory; a UAF is C:H.
I:H - revoke_one_stid() takes cl_lock and nfs4_put_stid() does refcount_dec_and_lock/idr_remove on the freed client's cl_lock/cl_stateids, concurrent with __destroy_client(), a slab UAF write primitive for heap corruption and control-flow hijacking.
A:H - Use-after-free of nfs4_client in the nfsd revoke path oopses or panics the NFS server even without full exploitation, fully denying service of the host.
CVSS 3.1