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 818832D877F for ; Sat, 6 Dec 2025 21:53:24 +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=1765058004; cv=none; b=Ka/y7BkvR6WSypzBPbQh2LlxWyyMGvsk/ZsoJ8aBJHcIRrXgfE0jwGrA8MZcgqIJyNimTqledcYmfnXS3/3AuEBcF8xFmJpRg8tgpPItmogE87y2XX5VUwOO45/6+9hQCVytX/Afm7Dy5rTxHFlboKuZiE0PnbSX9EaavcFCls4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765058004; c=relaxed/simple; bh=2gPWcqKDPm3WDOhPthbdIZloHxSeCt1amVpc1QufIjc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lneLJ/4XHQ4M5wOvXHd4s1g05h1DPER4Viyb08UeTMGfQwDHIO35PkXuRBAHaDhmRg79GpZ2hQgRcfVZm0moROUUXD+vKK2GepQi0g0LAt/4o5p6/ywpL2fXyjmUpu5Jq0n9b4J/H5Wz90CyqTFvUKZmGV41nYYx23Z8Zo6BWjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JzZkXNqQ; 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="JzZkXNqQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD5ACC4CEF5; Sat, 6 Dec 2025 21:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765058004; bh=2gPWcqKDPm3WDOhPthbdIZloHxSeCt1amVpc1QufIjc=; h=From:To:Cc:Subject:Date:Reply-To:From; b=JzZkXNqQj0cYebKXgJBwCTqitF/SFEa23lQaPDPeUdniXwid3T6m+A2eVQX6vqApc O7XTMigXkvuSA+SdMVNnvLSiykwc5GS6W8aKIO76SYq1gZ7DQuA0fZL8OwCKiORMZo x44VkLD9kKbD2P8WlAFT1/kLYlOirG9AMQ43348g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40273: NFSD: free copynotify stateid in nfs4_free_ol_stateid() Date: Sun, 7 Dec 2025 06:52:20 +0900 Message-ID: <2025120716-CVE-2025-40273-3765@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6756; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=T9IYuaZI4lV7snjyQmw3DugmhN2BnEp8pBfxqeegB8U=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkmSyf8f8UfxyFZvuRUa/wD7X02tfmeEvomMdst5bYJt SmVHznfEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNZxskwP3NamfPqZy/ne6Vw VN3cUW7WGzKpgWHBkeQNSyQunl00m1NOav80p7W3vMzkAQ== 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: free copynotify stateid in nfs4_free_ol_stateid() Typically copynotify stateid is freed either when parent's stateid is being close/freed or in nfsd4_laundromat if the stateid hasn't been used in a lease period. However, in case when the server got an OPEN (which created a parent stateid), followed by a COPY_NOTIFY using that stateid, followed by a client reboot. New client instance while doing CREATE_SESSION would force expire previous state of this client. It leads to the open state being freed thru release_openowner-> nfs4_free_ol_stateid() and it finds that it still has copynotify stateid associated with it. We currently print a warning and is triggerred WARNING: CPU: 1 PID: 8858 at fs/nfsd/nfs4state.c:1550 nfs4_free_ol_stateid+0xb0/0x100 [nfsd] This patch, instead, frees the associated copynotify stateid here. If the parent stateid is freed (without freeing the copynotify stateids associated with it), it leads to the list corruption when laundromat ends up freeing the copynotify state later. [ 1626.839430] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP [ 1626.842828] Modules linked in: nfnetlink_queue nfnetlink_log bluetooth cfg80211 rpcrdma rdma_cm iw_cm ib_cm ib_core nfsd nfs_acl lockd grace nfs_localio ext4 crc16 mbcache jbd2 overlay uinput snd_seq_dummy snd_hrtimer qrtr rfkill vfat fat uvcvideo snd_hda_codec_generic videobuf2_vmalloc videobuf2_memops snd_hda_intel uvc snd_intel_dspcfg videobuf2_v4l2 videobuf2_common snd_hda_codec snd_hda_core videodev snd_hwdep snd_seq mc snd_seq_device snd_pcm snd_timer snd soundcore sg loop auth_rpcgss vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vmw_vmci vsock xfs 8021q garp stp llc mrp nvme ghash_ce e1000e nvme_core sr_mod nvme_keyring nvme_auth cdrom vmwgfx drm_ttm_helper ttm sunrpc dm_mirror dm_region_hash dm_log iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi fuse dm_multipath dm_mod nfnetlink [ 1626.855594] CPU: 2 UID: 0 PID: 199 Comm: kworker/u24:33 Kdump: loaded Tainted: G B W 6.17.0-rc7+ #22 PREEMPT(voluntary) [ 1626.857075] Tainted: [B]=BAD_PAGE, [W]=WARN [ 1626.857573] Hardware name: VMware, Inc. VMware20,1/VBSA, BIOS VMW201.00V.24006586.BA64.2406042154 06/04/2024 [ 1626.858724] Workqueue: nfsd4 laundromat_main [nfsd] [ 1626.859304] pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) [ 1626.860010] pc : __list_del_entry_valid_or_report+0x148/0x200 [ 1626.860601] lr : __list_del_entry_valid_or_report+0x148/0x200 [ 1626.861182] sp : ffff8000881d7a40 [ 1626.861521] x29: ffff8000881d7a40 x28: 0000000000000018 x27: ffff0000c2a98200 [ 1626.862260] x26: 0000000000000600 x25: 0000000000000000 x24: ffff8000881d7b20 [ 1626.862986] x23: ffff0000c2a981e8 x22: 1fffe00012410e7d x21: ffff0000920873e8 [ 1626.863701] x20: ffff0000920873e8 x19: ffff000086f22998 x18: 0000000000000000 [ 1626.864421] x17: 20747562202c3839 x16: 3932326636383030 x15: 3030666666662065 [ 1626.865092] x14: 6220646c756f6873 x13: 0000000000000001 x12: ffff60004fd9e4a3 [ 1626.865713] x11: 1fffe0004fd9e4a2 x10: ffff60004fd9e4a2 x9 : dfff800000000000 [ 1626.866320] x8 : 00009fffb0261b5e x7 : ffff00027ecf2513 x6 : 0000000000000001 [ 1626.866938] x5 : ffff00027ecf2510 x4 : ffff60004fd9e4a3 x3 : 0000000000000000 [ 1626.867553] x2 : 0000000000000000 x1 : ffff000096069640 x0 : 000000000000006d [ 1626.868167] Call trace: [ 1626.868382] __list_del_entry_valid_or_report+0x148/0x200 (P) [ 1626.868876] _free_cpntf_state_locked+0xd0/0x268 [nfsd] [ 1626.869368] nfs4_laundromat+0x6f8/0x1058 [nfsd] [ 1626.869813] laundromat_main+0x24/0x60 [nfsd] [ 1626.870231] process_one_work+0x584/0x1050 [ 1626.870595] worker_thread+0x4c4/0xc60 [ 1626.870893] kthread+0x2f8/0x398 [ 1626.871146] ret_from_fork+0x10/0x20 [ 1626.871422] Code: aa1303e1 aa1403e3 910e8000 97bc55d7 (d4210000) [ 1626.871892] SMP: stopping secondary CPUs The Linux kernel CVE team has assigned CVE-2025-40273 to this issue. Affected and fixed versions =========================== Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 5.10.247 with commit 935a2dc8928670bb2c37e21025331e61ec48ccf4 Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 5.15.197 with commit b114996a095da39e38410a0328d4a8aca8c36088 Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 6.1.159 with commit 839f56f626723f36904764858467e7a3881b975d Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 6.6.117 with commit 29fbb3ad4018ca2b0988fbac76f4c694cc6d7e66 Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 6.12.59 with commit d7be15a634aa3874827d0d3ea47452ee878b8df7 Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 6.17.9 with commit f67ad9b33b0e6f00d2acc67cbf9cfa5c756be5fb Issue introduced in 5.6 with commit 624322f1adc58acd0b69f77a6ddc764207e97241 and fixed in 6.18 with commit 4aa17144d5abc3c756883e3a010246f0dba8b468 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-2025-40273 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/nfs4state.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/935a2dc8928670bb2c37e21025331e61ec48ccf4 https://git.kernel.org/stable/c/b114996a095da39e38410a0328d4a8aca8c36088 https://git.kernel.org/stable/c/839f56f626723f36904764858467e7a3881b975d https://git.kernel.org/stable/c/29fbb3ad4018ca2b0988fbac76f4c694cc6d7e66 https://git.kernel.org/stable/c/d7be15a634aa3874827d0d3ea47452ee878b8df7 https://git.kernel.org/stable/c/f67ad9b33b0e6f00d2acc67cbf9cfa5c756be5fb https://git.kernel.org/stable/c/4aa17144d5abc3c756883e3a010246f0dba8b468