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 xreprevalidateallocbt(), 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 xreprevalidateallocbt() via following call chain:
xfsfileioctl() ->
xfsiocscrubvmetadata() ->
xfsscrubmetadata() ->
sc->ops->repair_eval(sc) ->
xreprevalidate_allocbt()
xchk_allocbt() is called twice in this function. In the first call:
/* Note that sc->sm->smtype is XFSSCRUBTYPEBNOPT now */
xchkallocbt() ->
xchkbtree() ->
bs->scrub_rec(bs, recp) ->
xchkallocbtrec() ->
xchkallocbtxref() ->
xchkallocbtxref_other()
since smtype is XFSSCRUBTYPEBNOBT, pur is set to &sc->sa.cntcur. Kernel called xfsallocgetrec() and returned -EFSCORRUPTED. Call chain:
xfsallocgetrec() -> xfsbtreegetrec() -> xfsbtreecheckblock() -> (XFSISCORRUPT || XFSTESTERROR), the former is false and the latter is true, return -EFSCORRUPTED. This should be caused by ioctl$XFSIOCERRORINJECTION I guess.
Back to xchkallocbtxrefother(), after receiving -EFSCORRUPTED from xfsallocgetrec(), kernel called xchkshouldcheckxref(). In this function, *curpp (points to sc->sa.cntcur) is nullified.
Back to xreprevalidateallocbt(), since sc->sa.cntcur has been nullified, it then triggered null-ptr-deref via xchkallocbt() (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 xreprevalidateiallocbt because it has the same problem.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23249.json"
}