KernelScan.io

CRITICAL Introduced in 4.9

nfsd BlockedLock UAF

CVE-2026-90036

CVSS 9.8 / 10.0 NVD

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

KernelScan AI8.1HIGH

01

In the Linux kernel, the following vulnerability has been resolved: NFSD: Prevent client use-after-free during blocked-lock reaping A bare lock owner -- its only remaining reference a blocked lock on nn->blocked_locks_lru -- holds a raw pointer to its nfs4_client but no reference keeping the client alive. When the per-net laundromat reaps such a lock, freeing the nbl drops the owner reference held through flc_owner, and the final nfs4_put_stateowner() takes the client's cl_lock. Because the laundromat detaches the nbl first, __destroy_client() no longer finds it, so a concurrent force_expire_client() can free the client before nfs4_put_stateowner() runs, dereferencing cl_lock in freed memory. Pin the client with cl_rpc_users before dropping nn->blocked_locks_lock, and skip clients already expiring, whose blocked locks __destroy_client() frees while holding an owner reference. Take nn->client_lock outside nn->blocked_locks_lock. Every other site holds nn->blocked_locks_lock as a leaf, acquiring no further lock, so placing nn->client_lock outside it cannot form a lock-order cycle.

02

Engine v0.6.0

Risk summary

A remote NFS client can trigger a use-after-free in the kernel NFS server by creating blocked file locks that expire on the server's LRU list. If the server's laundromat reaps an expired lock at the same moment the associated client is being forcibly expired, the kernel dereferences freed client memory, leading to a crash or potential code execution. Any device running an NFSv4 server exposed to network clients is affected.

Affectedfs/nfsd/nfs4state.c (nfsd)

Vulnerability analysis

The NFS server keeps expired blocked file locks on a list and reaps them periodically. Each blocked lock knows which client created it, but does not keep that client alive. When the server removes a lock from the list and frees it, the cleanup touches the client object. A concurrent path that destroys clients can free that same client first because the lock was already removed from the list, so the cleanup ends up accessing freed memory. The fix makes the server hold a reference to the client before releasing the internal list lock, skips locks for clients already being torn down, and reorders lock acquisition to avoid cycles. Any remote NFS client that can send lock requests to the server can trigger this race; no special credentials are required beyond reaching the NFS service.

03

BranchIntroducedFixed inPatch commit
6.124.96.12.1117081224a59a0
7.24.97.2.56fedb2eaff77
mainline4.97.3-rc19026932ac8be
6.184.96.18.51cd489b035873