Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-89675

nfsd: fix UAF in async copy cancel and shutdown
Back to all
CVE

CVE-2026-89675

nfsd: fix UAF in async copy cancel and shutdown

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

nfsd: fix UAF in async copy cancel and shutdown

An async copy could be freed or used after free while a teardown caller

(OFFLOADCANCEL, nfsd4shutdowncopy, nfsd4cancelcopyby_sb) raced the

copy kthread:

  • findasynccopy() bumped copy->refcount but left the copy on

    clp->asynccopies, so the reaper's cleanupasync_copy() could run

    releasecopyfiles() concurrently with a cancel/shutdown caller. Both

    put and NULL nfsrc/nfdst without a common lock, double-putting the

    nfsd_file and freeing it early.

  • nfsd4doasynccopy() set NFSD4COPYFSTOPPED before its final uses

    of the copy (nfsdupdatecmtimeattr() on copy->nfdst,

    nfsd4sendcboffload()). nfsd4stop_copy() treats a set STOPPED bit

    as "kthread done, skip kthread_stop()", so a teardown caller ran

    releasecopyfiles() -- which puts and NULLs nf_dst -- while the

    kthread still dereferenced it (NULL/UAF).

  • copy->copy_task was never pinned. The one-shot kthread self-reaps on

    return, so kthreadstop()'s gettask_struct() could touch a freed

    task_struct.

  • cocb is embedded in the copy, but nfsd4sendcboffload() held a

    reference only on the client, so a concurrent teardown could free

    the copy while the CB_OFFLOAD callback was in flight.

Fix the teardown lifetime as a whole:

  • findasynccopy() unlinks the copy (clear cpclp, listdel_init)

    under async_lock; the cancel, shutdown, and sb-cancel paths drop the

    list-membership reference via nfs4putcopy() after nfsd4stopcopy().

    Drop the now-redundant listdel fixup from cleanupasync_copy().

  • Because unlinking hides the copy from the reaper, its

    cleanupasynccopy() can no longer remove the copy's s2scpstateids

    entry; the cancel/shutdown/sb-cancel paths now call

    nfs4freecopystate() themselves (while cpclp is still valid) so

    the entry does not dangle at freed memory for the laundromat and

    managecpntfstate() to dereference.

  • Give the kthread its own reference, taken in nfsd4_copy() before

    wakeupprocess() and dropped at the end of nfsd4doasync_copy();

    call wakeupprocess() before list_add().

  • Pin the taskstruct with gettaskstruct() in nfsd4copy(), released

    in nfs4putcopy(), so kthread_stop() is safe whenever the kthread

    exits. Set NFSD4COPYFSTOPPED only in nfsd4stop_copy(), which now

    always kthreadstop()s before releasecopy_files(); completion is

    still reported via NFSD4COPYF_COMPLETED, so

    nfsd4hasactiveasynccopies() is unaffected. Each teardown caller

    removes the copy from clp->asynccopies first, so kthreadstop() runs

    exactly once.

  • Take a copy reference in nfsd4sendcb_offload(), dropped in

    nfsd4cboffload_release(). The kthread still holds its own reference

    there, so the refcount_inc() cannot race the final free.

  • Read cpclp with smpload_acquire() to pair with the unordered

    setbit()/clearbit() writers (Documentation/atomic_bitops.rst).

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
9.8
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
C
H
U
-

Related Resources

No items found.

References

https://git.kernel.org/stable/c/62c0f6eaf050bb9284c1f9cac6ed1770092e6b95, https://git.kernel.org/stable/c/9031493ef7369d5c59c4bacc96f0c85965f09a98, https://git.kernel.org/stable/c/a385cf5e016b748babf94cc664e43a26e17db117, https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/89xxx/CVE-2026-89675.json, https://nvd.nist.gov/vuln/detail/CVE-2026-89675, https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Severity

9.8

CVSS Score
0
10

Basic Information

Base CVSS
9.8
EPSS Probability
0.00649%
EPSS Percentile
0.49542%
Introduced Version
e0639dc5805a9d4faaa2c07ad98fa853b9529dd3,4.20.0,6.19.0,0
Fix Available
62c0f6eaf050bb9284c1f9cac6ed1770092e6b95,6.18.51,7.2.4,6.12.0-211.64.1.el10_2

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading