CVE-2023-53606: nfsd: clean up potential nfsd_file refcount leaks in COPY codepath
In the Linux kernel, the following vulnerability has been resolved:
nfsd: clean up potential nfsdfile refcount leaks in COPY codepath
There are two different flavors of the nfsd4copy struct. One is embedded in the compound and is used directly in synchronous copies. The other is dynamically allocated, refcounted and tracked in the client struture. For the embedded one, the cleanup just involves releasing any nfsdfiles held on its behalf. For the async one, the cleanup is a bit more involved, and we need to dequeue it from lists, unhash it, etc.
There is at least one potential refcount leak in this code now. If the kthreadcreate call fails, then both the src and dst nfsdfiles in the original nfsd4copy object are leaked.
The cleanup in this codepath is also sort of weird. In the async copy case, we'll have up to four nfsdfile references (src and dst for both flavors of copy structure). They are both put at the end of nfsd4doasynccopy, even though the ones held on behalf of the embedded one outlive that structure.
Change it so that we always clean up the nfsdfile refs held by the embedded copy structure before nfsd4copy returns. Rework cleanupasynccopy to handle both inter and intra copies. Eliminate nfsd4cleanupintrassc since it now becomes a no-op.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53606?
CVE-2023-53606 has been rated as low in severity due to its specific impact on reference counting in the Linux kernel.
How do I fix CVE-2023-53606?
To fix CVE-2023-53606, update to the latest stable version of the Linux kernel that includes the patch for this vulnerability.
What systems are affected by CVE-2023-53606?
CVE-2023-53606 affects various versions of the Linux kernel that utilize the nfsd service.
What kind of vulnerability is CVE-2023-53606?
CVE-2023-53606 is a reference counting issue that may lead to resource leaks in the nfsd file handling code.
Is CVE-2023-53606 being actively exploited?
As of now, there are no reports of active exploitation related to CVE-2023-53606.