CVE-2026-89681 PUBLISHED

nfsd: fix layout fence worker double-reference race

Assigner: Linux
Reserved: 11.09.2026 Published: 11.09.2026 Updated: 13.09.2026

In the Linux kernel, the following vulnerability has been resolved:

nfsd: fix layout fence worker double-reference race

The workqueue core clears WORK_STRUCT_PENDING before the callback is invoked, so delayed_work_pending() in lm_breaker_timedout() can return false while the fence worker is already running. This lets the breaker take a duplicate sc_count reference and schedule a new worker that coalesces with the in-progress one. The extra reference is never put, leaking the layout stateid.

Replace the racy delayed_work_pending() check with an ls_fence_inflight boolean set atomically with refcount_inc_not_zero() under ls_lock, and cleared under ls_lock before the final nfs4_put_stid() on the dispose path; the retry path intentionally retains it. Remove the self-rearm mod_delayed_work() at the top of the worker.

Metrics

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 flaw is in nfsd pNFS SCSI layout fencing (nfsd4_layout_lm_breaker_timedout → nfsd4_layout_fence_worker in fs/nfsd/nfs4layouts.c), reached over NFSv4.1 COMPOUND on TCP/2049: LAYOUTGET installs an FL_LAYOUT lease, then a conflicting OPEN/WRITE hits nfsd_open_break_lease → time_out_leases after recall timeout. AC:L - The attacker controls both sides of the delayed_work_pending race: one client holds a SCSI layout and ignores CB_LAYOUTRECALL so the fence worker runs, while other attacker connections spam OPEN/WRITE so concurrent nfsd threads call lm_breaker_timedout while WORK_STRUCT_PENDING is already clear; the sequence is retryable. PR:N - Typical nfsd exports accept AUTH_SYS/AUTH_NULL with no cryptographic RPC authentication; EXCHANGE_ID, CREATE_SESSION, OPEN, and LAYOUTGET succeed for any host permitted by the export, so a remote NFSv4.1 client needs no kernel-verified credentials or local account on the server. UI:N - The attacker is the NFS client and sends LAYOUTGET plus conflicting OPEN/WRITE compounds against an already-running pNFS SCSI export; no victim user must mount a filesystem, open a file, or take any other action on the host. S:U - Impact is kernel nfsd layout-stateid and nfs4_client lifetime on the NFS server host and does not cross a VM, hypervisor, sandbox, or IOMMU security boundary. C:H - The unmatched sc_count leaves the nfs4_layout_stateid on nfs4_file.fi_lo_states without pinning nfs4_client; after that client is expired, a later LAYOUTGET walks the list and nfsd4_run_cb dereferences freed cb_clp, a use-after-free that can be reused for arbitrary kernel reads. I:H - The same use-after-free of nfs4_client (cl_cb_session, cl_callback_wq, and nfsd4_callback_ops) from nfsd4_recall_file_layout → nfsd4_run_cb enables heap spraying and function-pointer hijack of the CB_LAYOUTRECALL work path. A:H - Each won race permanently leaks a layout stateid (and can pin nfs4_client via cl_lo_states); repeating LAYOUTGET/fence races exhausts nfsd state and kernel memory, and the later nfs4_client use-after-free oopses or panics the nfsd thread.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from f52792f484ba2316853736856dde19b7e7458861 to a278d361e0e8f242211891193d56483a7a9f47a8 (excl.)
  • affected from f52792f484ba2316853736856dde19b7e7458861 to 8580571227451384399b3fa53fcde19848c48e5a (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 7.1 is affected
  • unaffected from 0 to 7.1 (excl.)
  • unaffected from 7.2.4 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References