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 92BFE31B110 for ; Wed, 24 Dec 2025 10:59:55 +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=1766573995; cv=none; b=g/5ARV/Nj0OfvOhmpIsMPKglj9P8tcdbRTikj6coblap875BKvfzKXqStb4PhFAf2pdJ5mFYPNSdZkVsA6mJGPFyzEzjCLx9rSP/5NZe3cX3AlA7gQ5yPGE9HHGDlD+gsQMg/dAGPF4eTd0syNoasQXVFgn/k1POQIG8yjT41hE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766573995; c=relaxed/simple; bh=Sh43b5mRDNJzupmOWwjJom+vcQw1iYtir2R/KS0kq/o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rvrp6QZ5w4vNHY5YRqMeDG/7Zsd+Eh++4R04su/ZuxrrrcwU/idr8Pv6CvRFxbgMBx09WcYCqkzLVX2GPUfAPxFg2Kz2+40uE1cS1W6d8MUFxkT1DRjJ1Q+VGcss7Ezqru0cJB5SA16lvRw0TYNslm7/ixVTWrJlWe6wlMyK9Pg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ggVtCTKC; 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="ggVtCTKC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF0F2C4CEFB; Wed, 24 Dec 2025 10:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766573995; bh=Sh43b5mRDNJzupmOWwjJom+vcQw1iYtir2R/KS0kq/o=; h=From:To:Cc:Subject:Date:Reply-To:From; b=ggVtCTKC++Sc/R7kbIkFzZCYCFN11/p7oZksgZ13Xej61UvnTX67o15aBQdBcXFTM 6hof0vPJ4H0fM4RAJb7ZPpIR1jbCFFo6Tqno0DyTnfKLRnEBQRErjY8ANvNIk76MLW 7M71d39iWz7GJnodKf3dhwKAcFrbP3SbLFbN95b0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54023: btrfs: fix race between balance and cancel/pause Date: Wed, 24 Dec 2025 11:57:07 +0100 Message-ID: <2025122434-CVE-2023-54023-1300@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=3336; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+sIV9rVKzGD593NHgpLTv8aWjQU0oF6X7BMjEfsAtHM=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnexx65m/R5sx3Rdjk/hUnu2iFx/5q0mz4TX98JWRZ97 lRRn1BLRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzE7SHDPMX1lxplu//rim6d Na3geNuViWZLrzAsmN5VtVT6i6yK+bQJUe8vhu8wnRBzBAA= 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 race between balance and cancel/pause Syzbot reported a panic that looks like this: assertion failed: fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED, in fs/btrfs/ioctl.c:465 ------------[ cut here ]------------ kernel BUG at fs/btrfs/messages.c:259! RIP: 0010:btrfs_assertfail+0x2c/0x30 fs/btrfs/messages.c:259 Call Trace: btrfs_exclop_balance fs/btrfs/ioctl.c:465 [inline] btrfs_ioctl_balance fs/btrfs/ioctl.c:3564 [inline] btrfs_ioctl+0x531e/0x5b30 fs/btrfs/ioctl.c:4632 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The reproducer is running a balance and a cancel or pause in parallel. The way balance finishes is a bit wonky, if we were paused we need to save the balance_ctl in the fs_info, but clear it otherwise and cleanup. However we rely on the return values being specific errors, or having a cancel request or no pause request. If balance completes and returns 0, but we have a pause or cancel request we won't do the appropriate cleanup, and then the next time we try to start a balance we'll trip this ASSERT. The error handling is just wrong here, we always want to clean up, unless we got -ECANCELLED and we set the appropriate pause flag in the exclusive op. With this patch the reproducer ran for an hour without tripping, previously it would trip in less than a few minutes. The Linux kernel CVE team has assigned CVE-2023-54023 to this issue. Affected and fixed versions =========================== Fixed in 6.1.42 with commit ddf7e8984c83aee9122552529f4e77291903f8d9 Fixed in 6.4.7 with commit 72efe5d44821e38540888a5fe3ff3d0faab6acad Fixed in 6.5 with commit b19c98f237cd76981aaded52c258ce93f7daa8cb 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-54023 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/volumes.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/ddf7e8984c83aee9122552529f4e77291903f8d9 https://git.kernel.org/stable/c/72efe5d44821e38540888a5fe3ff3d0faab6acad https://git.kernel.org/stable/c/b19c98f237cd76981aaded52c258ce93f7daa8cb