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 08F382EBB8A for ; Tue, 30 Dec 2025 12:21:26 +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=1767097287; cv=none; b=ZagDWbXbESqvxh0t7b36v4CB/pj7yi/usb7JV+HApRkToh3ZEGALvUDJ+l6rrfpiLWFxB26QnMeOvSwfkYAj2s2FnE3uAfNEbL1QcHIp/Mx/TQbLnM2MuBR0CmR5oPHV2x0Ci3Sw/6ltriBcfO1GEogfqGfoq/6/Cfs4kPWRWsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767097287; c=relaxed/simple; bh=AYKLClVgVTLxjgs3C2XKTPqP9F2U6ZFShs7dmGPCZDw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HNfOtAJ7jmRWCOLd6ie209uH1TCkx9Q0SKm7WP0LICwNjZwokBRt64WVPw7uvF/Op0OiMbUC+4MtuyUE5YULprl66wzyIvPEaRUSJyQERBN5S9agP/AWDQoEFcJF+qcIaQ4Z5eDlsl7SxZIc2aGg7YQZN+i0YWBWNluwxHOp3ro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QvafU/9l; 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="QvafU/9l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41505C4CEFB; Tue, 30 Dec 2025 12:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767097286; bh=AYKLClVgVTLxjgs3C2XKTPqP9F2U6ZFShs7dmGPCZDw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=QvafU/9lWbWGpXdboNyI2mJOFAaIYSo5qr3ZdmDXqdAFKBMlQ8vS1Bs8q0I5hGQrc AVf8XUxSvYpZg/fzvjDuYFe9rJiGCsptvpuLtVDciOTOlXsXaQDww+VfCkifs2Rj26 EJDuo4FI3Btk+ffRRiZBeAnS92LGNpr+C7cnuPN0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54253: btrfs: set page extent mapped after read_folio in relocate_one_page Date: Tue, 30 Dec 2025 13:20:19 +0100 Message-ID: <2025123055-CVE-2023-54253-18d1@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=4312; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=jDuZWi0ZnOqeZn3oRpR2S+EEzt9/3PBNf2w5jEK2t+k=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnBh7O/J729n/68KyCXpeh7cOc9Hz17wUTtyWmv1Hv/8 8/ftrm1I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbCrM+woFvkgQF3e8SeZ7ai D3ZUmFpMsl60kGGe6sGTdo96Rf/OTDpudK+jh4VjWc1iAA== 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: btrfs: set page extent mapped after read_folio in relocate_one_page One of the CI runs triggered the following panic assertion failed: PagePrivate(page) && page->private, in fs/btrfs/subpage.c:229 ------------[ cut here ]------------ kernel BUG at fs/btrfs/subpage.c:229! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP CPU: 0 PID: 923660 Comm: btrfs Not tainted 6.5.0-rc3+ #1 pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) pc : btrfs_subpage_assert+0xbc/0xf0 lr : btrfs_subpage_assert+0xbc/0xf0 sp : ffff800093213720 x29: ffff800093213720 x28: ffff8000932138b4 x27: 000000000c280000 x26: 00000001b5d00000 x25: 000000000c281000 x24: 000000000c281fff x23: 0000000000001000 x22: 0000000000000000 x21: ffffff42b95bf880 x20: ffff42b9528e0000 x19: 0000000000001000 x18: ffffffffffffffff x17: 667274622f736620 x16: 6e69202c65746176 x15: 0000000000000028 x14: 0000000000000003 x13: 00000000002672d7 x12: 0000000000000000 x11: ffffcd3f0ccd9204 x10: ffffcd3f0554ae50 x9 : ffffcd3f0379528c x8 : ffff800093213428 x7 : 0000000000000000 x6 : ffffcd3f091771e8 x5 : ffff42b97f333948 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff42b9556cde80 x0 : 000000000000004f Call trace: btrfs_subpage_assert+0xbc/0xf0 btrfs_subpage_set_dirty+0x38/0xa0 btrfs_page_set_dirty+0x58/0x88 relocate_one_page+0x204/0x5f0 relocate_file_extent_cluster+0x11c/0x180 relocate_data_extent+0xd0/0xf8 relocate_block_group+0x3d0/0x4e8 btrfs_relocate_block_group+0x2d8/0x490 btrfs_relocate_chunk+0x54/0x1a8 btrfs_balance+0x7f4/0x1150 btrfs_ioctl+0x10f0/0x20b8 __arm64_sys_ioctl+0x120/0x11d8 invoke_syscall.constprop.0+0x80/0xd8 do_el0_svc+0x6c/0x158 el0_svc+0x50/0x1b0 el0t_64_sync_handler+0x120/0x130 el0t_64_sync+0x194/0x198 Code: 91098021 b0007fa0 91346000 97e9c6d2 (d4210000) This is the same problem outlined in 17b17fcd6d44 ("btrfs: set_page_extent_mapped after read_folio in btrfs_cont_expand") , and the fix is the same. I originally looked for the same pattern elsewhere in our code, but mistakenly skipped over this code because I saw the page cache readahead before we set_page_extent_mapped, not realizing that this was only in the !page case, that we can still end up with a !uptodate page and then do the btrfs_read_folio further down. The fix here is the same as the above mentioned patch, move the set_page_extent_mapped call to after the btrfs_read_folio() block to make sure that we have the subpage blocksize stuff setup properly before using the page. The Linux kernel CVE team has assigned CVE-2023-54253 to this issue. Affected and fixed versions =========================== Fixed in 6.1.54 with commit 08daa38ca212d87f77beae839bc9be71079c7abf Fixed in 6.5.4 with commit 9d1e020ed9649cf140fcfafd052cfdcce9e9d67d Fixed in 6.6 with commit e7f1326cc24e22b38afc3acd328480a1183f9e79 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-54253 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/btrfs/relocation.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/08daa38ca212d87f77beae839bc9be71079c7abf https://git.kernel.org/stable/c/9d1e020ed9649cf140fcfafd052cfdcce9e9d67d https://git.kernel.org/stable/c/e7f1326cc24e22b38afc3acd328480a1183f9e79