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 F39AB288510 for ; Tue, 16 Sep 2025 08:12:16 +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=1758010337; cv=none; b=M8IUSEC4gTBAFajt0lYKq+rPIlawVMsguYQllLUHy2p9lmCh2o13jSclKKx85F3UF9VqcKU9+H9nAdO/GGfrXR2Y00u705VaHH6pHQBPwHvCyzCXLoPyVL9c/Wzz006pMzSI6bWKvE7tCRKFK77KE5xYY/irqq1jOywY1onSKfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758010337; c=relaxed/simple; bh=eapRpWb7DGm31m4205C+UBxrZu7EgXEWHXbBS5L+prg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LMz3TPMcVl8sFzfPSuj8lvT2OApinU3ybrR/52F6TbVGIMXbThvVb7FLIco1MmW90MfJQjmt9Vs0W3Q7mARkvQiMlqTwUNo1YFwsPwZVNX9W5WY/qwkrd1vXLqNwkBL5F35aRtzo48v9hh769I/CSGQu6nR9yZt2Q/Qw3XYfRrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Se936pwl; 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="Se936pwl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BA78C4CEF7; Tue, 16 Sep 2025 08:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758010336; bh=eapRpWb7DGm31m4205C+UBxrZu7EgXEWHXbBS5L+prg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Se936pwlTlbs0PRQFJwCtA0dTDh5xIopSp2Mj09s9Xf2euqis15LQrBUHgyxfPinv I6TmUvFcEwmTghewHiuBoLRkxu/5yXGkI8EIzE2L4EJ4eReMR6hnwJykX9GDeeFTnR dwqS/nTu7bLBhLXSex3uf2msBQ5/gYi+v331Vp+A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53270: ext4: fix i_disksize exceeding i_size problem in paritally written case Date: Tue, 16 Sep 2025 10:07:08 +0200 Message-ID: <2025091603-CVE-2023-53270-4af2@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=3862; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2t7clRA5zKR6cVQu/rrGoe4RWuAocljUd97snTP5oE8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknpZaXnhX1XDHlPMt/7VKWfKMPuqoNtt3Hwi/W7NJw2 sOZKWnXEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPZ28awYDKHi+3aq6pxNaHF y+y6u5JLtE7sZ1iwz6T5O7ts7KmYvSEv5K6eDz/mLvQKAA== 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: ext4: fix i_disksize exceeding i_size problem in paritally written case It is possible for i_disksize can exceed i_size, triggering a warning. generic_perform_write copied = iov_iter_copy_from_user_atomic(len) // copied < len ext4_da_write_end | ext4_update_i_disksize | new_i_size = pos + copied; | WRITE_ONCE(EXT4_I(inode)->i_disksize, newsize) // update i_disksize | generic_write_end | copied = block_write_end(copied, len) // copied = 0 | if (unlikely(copied < len)) | if (!PageUptodate(page)) | copied = 0; | if (pos + copied > inode->i_size) // return false if (unlikely(copied == 0)) goto again; if (unlikely(iov_iter_fault_in_readable(i, bytes))) { status = -EFAULT; break; } We get i_disksize greater than i_size here, which could trigger WARNING check 'i_size_read(inode) < EXT4_I(inode)->i_disksize' while doing dio: ext4_dio_write_iter iomap_dio_rw __iomap_dio_rw // return err, length is not aligned to 512 ext4_handle_inode_extension WARN_ON_ONCE(i_size_read(inode) < EXT4_I(inode)->i_disksize) // Oops WARNING: CPU: 2 PID: 2609 at fs/ext4/file.c:319 CPU: 2 PID: 2609 Comm: aa Not tainted 6.3.0-rc2 RIP: 0010:ext4_file_write_iter+0xbc7 Call Trace: vfs_write+0x3b1 ksys_write+0x77 do_syscall_64+0x39 Fix it by updating 'copied' value before updating i_disksize just like ext4_write_inline_data_end() does. A reproducer can be found in the buganizer link below. The Linux kernel CVE team has assigned CVE-2023-53270 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.27 with commit 64769240bd07f446f83660bb143bb609d8ab4910 and fixed in 5.15.111 with commit 18eb23891aeae3229baf8c7c23b76be3364e1967 Issue introduced in 2.6.27 with commit 64769240bd07f446f83660bb143bb609d8ab4910 and fixed in 6.1.28 with commit d30090eb546d993ea3f3023452540c476ea614a5 Issue introduced in 2.6.27 with commit 64769240bd07f446f83660bb143bb609d8ab4910 and fixed in 6.2.15 with commit 3ecea2fee14227712694c8b54ad99d471e61de92 Issue introduced in 2.6.27 with commit 64769240bd07f446f83660bb143bb609d8ab4910 and fixed in 6.3.2 with commit 53877ed201baa6b58f7ce9df92664a839113c30e Issue introduced in 2.6.27 with commit 64769240bd07f446f83660bb143bb609d8ab4910 and fixed in 6.4 with commit 1dedde690303c05ef732b7c5c8356fdf60a4ade3 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-53270 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/ext4/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/18eb23891aeae3229baf8c7c23b76be3364e1967 https://git.kernel.org/stable/c/d30090eb546d993ea3f3023452540c476ea614a5 https://git.kernel.org/stable/c/3ecea2fee14227712694c8b54ad99d471e61de92 https://git.kernel.org/stable/c/53877ed201baa6b58f7ce9df92664a839113c30e https://git.kernel.org/stable/c/1dedde690303c05ef732b7c5c8356fdf60a4ade3