Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ABF52798F8 for ; Sat, 4 Oct 2025 15:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759593269; cv=none; b=unN4+Sm7M7HbZnsdjprfUn8jHdpOJGk5K6M6/lUkYMiqcaWVxUgpBjNfOl8QO2KNQFAqWW9Dn+1SjTgoNjqqlz5zVW8vGXk/B1Lj1ivRWhEPj/gFotM2Sdb/aHo9qSavzVx3tNZcLpZpH7x+ucoWA4IquzjzfbPCIlhL+Q72lh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759593269; c=relaxed/simple; bh=YTkROZG/RNZpbICoIVJEMCsn2e2FR+1BG+ygu/CtLrs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=g4eA0EJoHwWO899xSu/tNHMlNiSsFSrW+uLgq6d3blroiAqcpAX/1wQeendmdHBeF5euHg/7A9y7blQYQhKMu38kO1ww2mKyrZewTUbudhgE4A8Z7EoPhPxMx5w/NkKM0tEC4CFdL5px1My/rAf+t6oaGPFtGijHfRqRPaFsmr4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BYHNplOd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BYHNplOd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48103C4CEF1; Sat, 4 Oct 2025 15:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759593268; bh=YTkROZG/RNZpbICoIVJEMCsn2e2FR+1BG+ygu/CtLrs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BYHNplOdh/Rst4gtf3W0DKXmnnjCMypjrgp8xruWyj5bq7MijD+EN8Lt0ntf3QxK6 OX/YVduomF0YIFGq4h/pYfdETu+UIvgOgb6lOU5OqbxUviY6oFHopiu+Ldo6ktEaaL IzxCIwYHgZyXyw2pKeXNwWCQ+586Vg/tG+xzkzBM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53606: nfsd: clean up potential nfsd_file refcount leaks in COPY codepath Date: Sat, 4 Oct 2025 17:52:00 +0200 Message-ID: <2025100432-CVE-2023-53606-8c1a@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3216; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GqkQuOyUHEmapNE4LeATC9/851IqTcMg0dMQpmKx/78=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPnVpObXHTiz76X79P6Y+89UWbWXoTFNcErdE9fM/lW NRXjd+vO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiwgUM8wM0J7V5zL355Fvk 67dF6h9uXN8SFcQwVy43evm6y2/7/+kp5+eX7ptlIa+sDgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: nfsd: clean up potential nfsd_file refcount leaks in COPY codepath There are two different flavors of the nfsd4_copy 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 nfsd_files 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 kthread_create call fails, then both the src and dst nfsd_files in the original nfsd4_copy object are leaked. The cleanup in this codepath is also sort of weird. In the async copy case, we'll have up to four nfsd_file references (src and dst for both flavors of copy structure). They are both put at the end of nfsd4_do_async_copy, even though the ones held on behalf of the embedded one outlive that structure. Change it so that we always clean up the nfsd_file refs held by the embedded copy structure before nfsd4_copy returns. Rework cleanup_async_copy to handle both inter and intra copies. Eliminate nfsd4_cleanup_intra_ssc since it now becomes a no-op. The Linux kernel CVE team has assigned CVE-2023-53606 to this issue. Affected and fixed versions =========================== Fixed in 5.10.220 with commit fd63299db8090307eae66f2aef17c8f00aafa0a9 Fixed in 5.15.154 with commit b3169b6ffe036b549c296a9e71591d29a1fb3209 Fixed in 6.1.16 with commit 75b8c681c563ef7e85da6862354efc18d2a08b1b Fixed in 6.2.3 with commit 8f565846fbe8182961498d4cbe618b15076a683b Fixed in 6.3 with commit 6ba434cb1a8d403ea9aad1b667c3ea3ad8b3191f Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-53606 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/nfsd/nfs4proc.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/fd63299db8090307eae66f2aef17c8f00aafa0a9 https://git.kernel.org/stable/c/b3169b6ffe036b549c296a9e71591d29a1fb3209 https://git.kernel.org/stable/c/75b8c681c563ef7e85da6862354efc18d2a08b1b https://git.kernel.org/stable/c/8f565846fbe8182961498d4cbe618b15076a683b https://git.kernel.org/stable/c/6ba434cb1a8d403ea9aad1b667c3ea3ad8b3191f