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 2E7C0318BA4 for ; Wed, 18 Mar 2026 17:01:54 +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=1773853315; cv=none; b=tHwUOoBv1nbvx0VdWcUlSbiSgkynnXSknC/39IoGwdLMkvrDwJvF5zsgyUTfT1XWrxPc5mFjCkLNPMo7izLt26kqy2sfdvxOa5cm0icj8c7tfUGjSgx5j2roMlH8YOXH2rkjksg/7IhUV1Mo0Q8WwaoK0YElgLakRmw+6eApD+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773853315; c=relaxed/simple; bh=XEU2fRX1ajIwhuZmde77RuDgPKoz1/TW5G8OzZgDheU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XvDXtp0wlMkS34WZwhf4PUves4FxmZ6JMQT93g1XfR26m1irDJWBm59uOBBL44z10TwouA09+rBAgPlb32QqHGuJ5qnqAPtc/80AYEf3oDeviwgTlW+h7JwIV2ur2MVINP5O4VhfxgG2nYp0O4q1gm8UvE/WI498dTJ/KbwtYjY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fAmeGuNO; 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="fAmeGuNO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A34C19421; Wed, 18 Mar 2026 17:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773853314; bh=XEU2fRX1ajIwhuZmde77RuDgPKoz1/TW5G8OzZgDheU=; h=From:To:Cc:Subject:Date:Reply-To:From; b=fAmeGuNOQE/o/RWx7SytbrprYJMHxidjYU/QM3dCGJCPV664AC9vVFM7hBFo6+r37 wiCfKB90RLAzBd7rbbzIQbHvMyf4L3YDDqRqh4MMUf3uigGCdTVd1ZoNEz/I5D5k2w P0CEBqxHIisb/qnY64TbPlbLS3GbxS/lGiaP9bJU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-23249: xfs: check for deleted cursors when revalidating two btrees Date: Wed, 18 Mar 2026 18:01:44 +0100 Message-ID: <2026031843-CVE-2026-23249-c309@gregkh> X-Mailer: git-send-email 2.53.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=4516; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=AxLa8DtnIRKN8DtYWmor5pHvGO6XKEOjeXxHP7gQ5n4=; b=owGbwMvMwCRo6H6F97bub03G02pJDJm7bpVvYZOy674VJXVon5fwA4kHP9mZL69ljj4gpP13c pnhlx8dHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR8U0M8yNEk3Qc+tJ/HF89 5/3jq/WJUzI/qjEsaN3Yorf3qoist4dAxrzFWis2TpL7BwA= 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: xfs: check for deleted cursors when revalidating two btrees The free space and inode btree repair functions will rebuild both btrees at the same time, after which it needs to evaluate both btrees to confirm that the corruptions are gone. However, Jiaming Zhang ran syzbot and produced a crash in the second xchk_allocbt call. His root-cause analysis is as follows (with minor corrections): In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first for BNOBT, second for CNTBT). The cause of this issue is that the first call nullified the cursor required by the second call. Let's first enter xrep_revalidate_allocbt() via following call chain: xfs_file_ioctl() -> xfs_ioc_scrubv_metadata() -> xfs_scrub_metadata() -> `sc->ops->repair_eval(sc)` -> xrep_revalidate_allocbt() xchk_allocbt() is called twice in this function. In the first call: /* Note that sc->sm->sm_type is XFS_SCRUB_TYPE_BNOPT now */ xchk_allocbt() -> xchk_btree() -> `bs->scrub_rec(bs, recp)` -> xchk_allocbt_rec() -> xchk_allocbt_xref() -> xchk_allocbt_xref_other() since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to &sc->sa.cnt_cur. Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call chain: xfs_alloc_get_rec() -> xfs_btree_get_rec() -> xfs_btree_check_block() -> (XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter is true, return -EFSCORRUPTED. This should be caused by ioctl$XFS_IOC_ERROR_INJECTION I guess. Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this function, *curpp (points to sc->sa.cnt_cur) is nullified. Back to xrep_revalidate_allocbt(), since sc->sa.cnt_cur has been nullified, it then triggered null-ptr-deref via xchk_allocbt() (second call) -> xchk_btree(). So. The bnobt revalidation failed on a cross-reference attempt, so we deleted the cntbt cursor, and then crashed when we tried to revalidate the cntbt. Therefore, check for a null cntbt cursor before that revalidation, and mark the repair incomplete. Also we can ignore the second tree entirely if the first tree was rebuilt but is already corrupt. Apply the same fix to xrep_revalidate_iallocbt because it has the same problem. The Linux kernel CVE team has assigned CVE-2026-23249 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 and fixed in 6.12.75 with commit d69de525bc7ab27713342080bf50826df3f6a68f Issue introduced in 6.8 with commit dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 and fixed in 6.18.16 with commit b04baa848c0543b240b1bd8aecff470382f6f154 Issue introduced in 6.8 with commit dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 and fixed in 6.19.6 with commit 5991e96f2ae82df60a3e4ed00f3432d9f3502a99 Issue introduced in 6.8 with commit dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 and fixed in 7.0-rc1 with commit 55e03b8cbe2783ec9acfb88e8adb946ed504e117 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-2026-23249 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/xfs/scrub/alloc_repair.c fs/xfs/scrub/ialloc_repair.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/d69de525bc7ab27713342080bf50826df3f6a68f https://git.kernel.org/stable/c/b04baa848c0543b240b1bd8aecff470382f6f154 https://git.kernel.org/stable/c/5991e96f2ae82df60a3e4ed00f3432d9f3502a99 https://git.kernel.org/stable/c/55e03b8cbe2783ec9acfb88e8adb946ed504e117