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 9C01363CB for ; Tue, 9 Dec 2025 01:33:50 +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=1765244030; cv=none; b=mD4zyYh2mD07GM0HccMwRCjARl+GCe1OxSVgIQD2rkR6azpwfPXMrKFrB/diDkAR1TyFmFBeSD4RARVNCtCnu0ZdcBU/7iGLYfrKzWdtbdlZiSNZspXw4PuthxUDqWp+nUawSg6z1I4cg7LTtwABdD66UCTV/9HcgYJIvyLyJ9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765244030; c=relaxed/simple; bh=oxA4FL4jYD6PcanzjFD3elBXJbOsv35FL5zAgevAlRU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CZidzw/uvbihSzA/tXz5iF8mPrsm94rHX6uZM+kNrawswMB2JBOpVRF2qyObMTg7zec3vo1/9dPbAsbK1gFUcfcJS898D3bteJYqHDMoUKleAB/Tbw1XHRk6PGhEAcDzaRo3UkRJ/N5gdLDSWLqQOOR8GxZl0LwkMKRSAosa+G8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nh4drCBN; 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="nh4drCBN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 385D6C4CEF1; Tue, 9 Dec 2025 01:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765244030; bh=oxA4FL4jYD6PcanzjFD3elBXJbOsv35FL5zAgevAlRU=; h=From:To:Cc:Subject:Date:Reply-To:From; b=nh4drCBNg4zYRxj83pgMvcZsu4daNFqfyZ0ULuAhdv1xKn68VlfE3pOYrcolvMsXr ZhvL7lkrNzREPfgq4lL5wAuWHaYMIASI9esP1CFXCb882jw8c7iIcbAyfvi0wilXC0 QzSN2uIWxOa4245vyt8iDx6ladhdA6glUqvkFaQg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53865: btrfs: fix warning when putting transaction with qgroups enabled after abort Date: Tue, 9 Dec 2025 10:31:49 +0900 Message-ID: <2025120906-CVE-2023-53865-b26b@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=5854; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ee5dEfK9mQTUL2PzRv2ImzMepY5KkMGAn8qP5pr/vm8=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1beq5ke9OMvkcieZR3PRjZNH5M4XHgguPT9Xpmaeb xXPtANfO2JYGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi65oYZizSXenRfeq53YMp 87June7he2WXzjBPrSqZ2Ubh/P21bppeITxTLq1VcEgFAA== 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: fix warning when putting transaction with qgroups enabled after abort If we have a transaction abort with qgroups enabled we get a warning triggered when doing the final put on the transaction, like this: [552.6789] ------------[ cut here ]------------ [552.6815] WARNING: CPU: 4 PID: 81745 at fs/btrfs/transaction.c:144 btrfs_put_transaction+0x123/0x130 [btrfs] [552.6817] Modules linked in: btrfs blake2b_generic xor (...) [552.6819] CPU: 4 PID: 81745 Comm: btrfs-transacti Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [552.6819] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [552.6819] RIP: 0010:btrfs_put_transaction+0x123/0x130 [btrfs] [552.6821] Code: bd a0 01 00 (...) [552.6821] RSP: 0018:ffffa168c0527e28 EFLAGS: 00010286 [552.6821] RAX: ffff936042caed00 RBX: ffff93604a3eb448 RCX: 0000000000000000 [552.6821] RDX: ffff93606421b028 RSI: ffffffff92ff0878 RDI: ffff93606421b010 [552.6821] RBP: ffff93606421b000 R08: 0000000000000000 R09: ffffa168c0d07c20 [552.6821] R10: 0000000000000000 R11: ffff93608dc52950 R12: ffffa168c0527e70 [552.6821] R13: ffff93606421b000 R14: ffff93604a3eb420 R15: ffff93606421b028 [552.6821] FS: 0000000000000000(0000) GS:ffff93675fb00000(0000) knlGS:0000000000000000 [552.6821] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [552.6821] CR2: 0000558ad262b000 CR3: 000000014feda005 CR4: 0000000000370ee0 [552.6822] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [552.6822] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [552.6822] Call Trace: [552.6822] [552.6822] ? __warn+0x80/0x130 [552.6822] ? btrfs_put_transaction+0x123/0x130 [btrfs] [552.6824] ? report_bug+0x1f4/0x200 [552.6824] ? handle_bug+0x42/0x70 [552.6824] ? exc_invalid_op+0x14/0x70 [552.6824] ? asm_exc_invalid_op+0x16/0x20 [552.6824] ? btrfs_put_transaction+0x123/0x130 [btrfs] [552.6826] btrfs_cleanup_transaction+0xe7/0x5e0 [btrfs] [552.6828] ? _raw_spin_unlock_irqrestore+0x23/0x40 [552.6828] ? try_to_wake_up+0x94/0x5e0 [552.6828] ? __pfx_process_timeout+0x10/0x10 [552.6828] transaction_kthread+0x103/0x1d0 [btrfs] [552.6830] ? __pfx_transaction_kthread+0x10/0x10 [btrfs] [552.6832] kthread+0xee/0x120 [552.6832] ? __pfx_kthread+0x10/0x10 [552.6832] ret_from_fork+0x29/0x50 [552.6832] [552.6832] ---[ end trace 0000000000000000 ]--- This corresponds to this line of code: void btrfs_put_transaction(struct btrfs_transaction *transaction) { (...) WARN_ON(!RB_EMPTY_ROOT( &transaction->delayed_refs.dirty_extent_root)); (...) } The warning happens because btrfs_qgroup_destroy_extent_records(), called in the transaction abort path, we free all entries from the rbtree "dirty_extent_root" with rbtree_postorder_for_each_entry_safe(), but we don't actually empty the rbtree - it's still pointing to nodes that were freed. So set the rbtree's root node to NULL to avoid this warning (assign RB_ROOT). The Linux kernel CVE team has assigned CVE-2023-53865 to this issue. Affected and fixed versions =========================== Issue introduced in 5.4.23 with commit 40ea30638d20c92b44107247415842b72c460459 and fixed in 5.4.251 with commit ae91ab710d8e309f6c9eba07ce0d9d0b5d9040f0 Issue introduced in 5.6 with commit 81f7eb00ff5bb8326e82503a32809421d14abb8a and fixed in 5.10.188 with commit d2c667cc18314c9bad3ec86ae071c0342132aa09 Issue introduced in 5.6 with commit 81f7eb00ff5bb8326e82503a32809421d14abb8a and fixed in 5.15.123 with commit c9060caab4135dd660c4676d1ea33a6e0d3fc09d Issue introduced in 5.6 with commit 81f7eb00ff5bb8326e82503a32809421d14abb8a and fixed in 6.1.42 with commit 89e994688e965813ec0a09fb30b87fb8cee06474 Issue introduced in 5.6 with commit 81f7eb00ff5bb8326e82503a32809421d14abb8a and fixed in 6.4.7 with commit 62dd82bc7a90b5052c062a0ad5be6d8a479a3cfb Issue introduced in 5.6 with commit 81f7eb00ff5bb8326e82503a32809421d14abb8a and fixed in 6.5 with commit aa84ce8a78a1a5c10cdf9c7a5fb0c999fbc2c8d6 Issue introduced in 5.5.7 with commit 4e2e49d4211db43e0ec932579dab6a969e7e8df1 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-53865 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/qgroup.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/ae91ab710d8e309f6c9eba07ce0d9d0b5d9040f0 https://git.kernel.org/stable/c/d2c667cc18314c9bad3ec86ae071c0342132aa09 https://git.kernel.org/stable/c/c9060caab4135dd660c4676d1ea33a6e0d3fc09d https://git.kernel.org/stable/c/89e994688e965813ec0a09fb30b87fb8cee06474 https://git.kernel.org/stable/c/62dd82bc7a90b5052c062a0ad5be6d8a479a3cfb https://git.kernel.org/stable/c/aa84ce8a78a1a5c10cdf9c7a5fb0c999fbc2c8d6