CVE-2026-23249

Source
https://cve.org/CVERecord?id=CVE-2026-23249
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23249.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-23249
Downstream
Published
2026-03-18T17:01:40.653Z
Modified
2026-04-02T13:12:17.524394Z
Summary
xfs: check for deleted cursors when revalidating two btrees
Details

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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23249.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
dbfbf3bdf639a20da7d5fb390cd2e197d25aa418
Fixed
d69de525bc7ab27713342080bf50826df3f6a68f
Fixed
b04baa848c0543b240b1bd8aecff470382f6f154
Fixed
5991e96f2ae82df60a3e4ed00f3432d9f3502a99
Fixed
55e03b8cbe2783ec9acfb88e8adb946ed504e117

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23249.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.8.0
Fixed
6.12.75
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.16
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
6.19.6

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23249.json"