CVE-2026-22980: nfsd: provide locking for v4_end_grace
In the Linux kernel, the following vulnerability has been resolved:
nfsd: provide locking for v4endgrace
Writing to v4endgrace can race with server shutdown and result in memory being accessed after it was freed - reclaimstrhashtbl in particularly.
We cannot hold nfsdmutex across the nfsd4endgrace() call as that is held while clienttrackingop->init() is called and that can wait for an upcall to nfsdcltrack which can write to v4endgrace, resulting in a deadlock.
nfsd4endgrace() is also called by the landromat work queue and this doesn't require locking as server shutdown will stop the work and wait for it before freeing anything that nfsd4endgrace() might access.
However, we must be sure that writing to v4endgrace doesn't restart the work item after shutdown has already waited for it. For this we add a new flag protected with nn->clientlock. It is set only while it is safe to make client tracking calls, and v4endgrace only schedules work while the flag is set with the spinlock held.
So this patch adds a nfsdnet field "clienttrackingactive" which is set as described. Another field "graceendforced", is set when v4endgrace is written. After this is set, and providing clienttrackingactive is set, the laundromat is scheduled. This "graceendforced" field bypasses other checks for whether the grace period has finished.
This resolves a race which can result in use-after-free.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-22980?
CVE-2026-22980 has been classified with a high severity due to potential memory access issues that could lead to system instability.
How do I fix CVE-2026-22980?
To address CVE-2026-22980, ensure that you update your Linux kernel to the latest stable version where this vulnerability is patched.
Which Linux kernel versions are affected by CVE-2026-22980?
CVE-2026-22980 affects specific versions of the Linux kernel that have not implemented the proper locking for v4_end_grace.
What could happen if CVE-2026-22980 is exploited?
Exploitation of CVE-2026-22980 could potentially lead to memory corruption issues, resulting in crashes or unexpected behavior in the affected system.
Is there a workaround for CVE-2026-22980 until I can update my kernel?
Currently, no specific workarounds are recommended for CVE-2026-22980; updating the kernel is the best course of action.