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 9238F2857CA for ; Tue, 16 Sep 2025 16:14:30 +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=1758039270; cv=none; b=sLwwd5n4KXRqS8EcJeR1LdJ+B+HemVXTLnopcXcQaGd9cGk4+shWuudcRgMuz2db+ewENaiEi5xp3NFsIluDZRyrB90nglf+SwzjPfPK0zJEvmP2pW8CbrfXTqFnMzvZTE4SA6YcB9bZYK6v/XDas078S7a8UHPMPq+XX5gBl38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758039270; c=relaxed/simple; bh=TV0BJ87RzkiaJ3907qfO0CH7riku3ZR9fbROi6bbmRg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rTsQeTxol67NPFGO6moZNgf1dW5lgEan6vNYyuY/eAhNRkkxj0IT1yzwqb3OnLbz8ipQ/jtgHCbRPBMbPWecTapefWyfCVjBi+goxfNHXzvylSDK9/A4yhR4dTZpicm5gxko7RqqGNmyQuHhJrsjuh0Er7f/+yKqw6vK0bCNnzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e99uM5vw; 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="e99uM5vw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE0A3C4CEF7; Tue, 16 Sep 2025 16:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758039270; bh=TV0BJ87RzkiaJ3907qfO0CH7riku3ZR9fbROi6bbmRg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=e99uM5vwF5JiNUuqKWI/8jUOnWtYjJGgysawn+On0CBL3vd2jDiUjGTsKmzqlYswk UyPhxZqign5NppMteohYflwciu+fd+CBz4NCs5yHOLIkxDTPArUyyHE3ZZ0E60bW6q +E91BsXd1zLTqUWA6xYPyh2ra3nfWGgkjI8VBGtk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53323: ext2/dax: Fix ext2_setsize when len is page aligned Date: Tue, 16 Sep 2025 18:12:08 +0200 Message-ID: <2025091644-CVE-2023-53323-6a1b@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=3813; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lTgXwqk0Vt0F7BxHYr95+RK3kPe1UuN1tpch2VEYYbc=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknexyKnx3I3ZRdt327f2PGEgOF2Tab+n/vMvLQXBT69 0byfrYFHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRyQUM86tqFkt+WCN27Y7k 2SqBfmZRnwNW7gxzJQ+/9m/+viy1zGr2nq+ah8xObA8qAwA= 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: ext2/dax: Fix ext2_setsize when len is page aligned PAGE_ALIGN(x) macro gives the next highest value which is multiple of pagesize. But if x is already page aligned then it simply returns x. So, if x passed is 0 in dax_zero_range() function, that means the length gets passed as 0 to ->iomap_begin(). In ext2 it then calls ext2_get_blocks -> max_blocks as 0 and hits bug_on here in ext2_get_blocks(). BUG_ON(maxblocks == 0); Instead we should be calling dax_truncate_page() here which takes care of it. i.e. it only calls dax_zero_range if the offset is not page/block aligned. This can be easily triggered with following on fsdax mounted pmem device. dd if=/dev/zero of=file count=1 bs=512 truncate -s 0 file [79.525838] EXT2-fs (pmem0): DAX enabled. Warning: EXPERIMENTAL, use at your own risk [79.529376] ext2 filesystem being mounted at /mnt1/test supports timestamps until 2038 (0x7fffffff) [93.793207] ------------[ cut here ]------------ [93.795102] kernel BUG at fs/ext2/inode.c:637! [93.796904] invalid opcode: 0000 [#1] PREEMPT SMP PTI [93.798659] CPU: 0 PID: 1192 Comm: truncate Not tainted 6.3.0-rc2-xfstests-00056-g131086faa369 #139 [93.806459] RIP: 0010:ext2_get_blocks.constprop.0+0x524/0x610 <...> [93.835298] Call Trace: [93.836253] [93.837103] ? lock_acquire+0xf8/0x110 [93.838479] ? d_lookup+0x69/0xd0 [93.839779] ext2_iomap_begin+0xa7/0x1c0 [93.841154] iomap_iter+0xc7/0x150 [93.842425] dax_zero_range+0x6e/0xa0 [93.843813] ext2_setsize+0x176/0x1b0 [93.845164] ext2_setattr+0x151/0x200 [93.846467] notify_change+0x341/0x4e0 [93.847805] ? lock_acquire+0xf8/0x110 [93.849143] ? do_truncate+0x74/0xe0 [93.850452] ? do_truncate+0x84/0xe0 [93.851739] do_truncate+0x84/0xe0 [93.852974] do_sys_ftruncate+0x2b4/0x2f0 [93.854404] do_syscall_64+0x3f/0x90 [93.855789] entry_SYSCALL_64_after_hwframe+0x72/0xdc The Linux kernel CVE team has assigned CVE-2023-53323 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit 2aa3048e03d38d5358be2553d4b638c1a018498c and fixed in 6.1.40 with commit 9e54fd14bd143c261e52fde74355e85e9526c58c Issue introduced in 5.15 with commit 2aa3048e03d38d5358be2553d4b638c1a018498c and fixed in 6.4.5 with commit 5cee8bfb8cbd99c97aff85d2bf066b6a496e13ab Issue introduced in 5.15 with commit 2aa3048e03d38d5358be2553d4b638c1a018498c and fixed in 6.5 with commit fcced95b6ba2a507a83b8b3e0358a8ac16b13e35 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-53323 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/ext2/inode.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/9e54fd14bd143c261e52fde74355e85e9526c58c https://git.kernel.org/stable/c/5cee8bfb8cbd99c97aff85d2bf066b6a496e13ab https://git.kernel.org/stable/c/fcced95b6ba2a507a83b8b3e0358a8ac16b13e35