CVE-2026-23249

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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

21 May 2026, 18:34

Type Values Removed Values Added
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
References () https://git.kernel.org/stable/c/55e03b8cbe2783ec9acfb88e8adb946ed504e117 - () https://git.kernel.org/stable/c/55e03b8cbe2783ec9acfb88e8adb946ed504e117 - Patch
References () https://git.kernel.org/stable/c/5991e96f2ae82df60a3e4ed00f3432d9f3502a99 - () https://git.kernel.org/stable/c/5991e96f2ae82df60a3e4ed00f3432d9f3502a99 - Patch
References () https://git.kernel.org/stable/c/b04baa848c0543b240b1bd8aecff470382f6f154 - () https://git.kernel.org/stable/c/b04baa848c0543b240b1bd8aecff470382f6f154 - Patch
References () https://git.kernel.org/stable/c/d69de525bc7ab27713342080bf50826df3f6a68f - () https://git.kernel.org/stable/c/d69de525bc7ab27713342080bf50826df3f6a68f - Patch
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: xfs: verificar cursores eliminados al revalidar dos btrees Las funciones de reparación de btree de espacio libre e inodo reconstruirán ambos btrees al mismo tiempo, después de lo cual necesita evaluar ambos btrees para confirmar que las corrupciones han desaparecido. Sin embargo, Jiaming Zhang ejecutó syzbot y produjo un fallo en la segunda llamada a xchk_allocbt. Su análisis de causa raíz es el siguiente (con correcciones menores): En xrep_revalidate_allocbt(), se llama a xchk_allocbt() dos veces (primero para BNOBT, segundo para CNTBT). La causa de este problema es que la primera llamada anuló el cursor requerido por la segunda llamada. Primero entremos en xrep_revalidate_allocbt() a través de la siguiente cadena de llamadas: xfs_file_ioctl() -> xfs_ioc_scrubv_metadata() -> xfs_scrub_metadata() -> 'sc->ops->repair_eval(sc)' -> xrep_revalidate_allocbt() Se llama a xchk_allocbt() dos veces en esta función. En la primera llamada: /* Tenga en cuenta que sc->sm->sm_type es XFS_SCRUB_TYPE_BNOPT ahora */ xchk_allocbt() -> xchk_btree() -> 'bs->scrub_rec(bs, recp)' -> xchk_allocbt_rec() -> xchk_allocbt_xref() -> xchk_allocbt_xref_other() dado que sm_type es XFS_SCRUB_TYPE_BNOBT, pur se establece en &sc->sa.cnt_cur. El kernel llamó a xfs_alloc_get_rec() y devolvió -EFSCORRUPTED. Cadena de llamadas: xfs_alloc_get_rec() -> xfs_btree_get_rec() -> xfs_btree_check_block() -> (XFS_IS_CORRUPT || XFS_TEST_ERROR), el primero es falso y el segundo es verdadero, devuelve -EFSCORRUPTED. Esto debería ser causado por ioctl$XFS_IOC_ERROR_INJECTION, supongo. Volviendo a xchk_allocbt_xref_other(), después de recibir -EFSCORRUPTED de xfs_alloc_get_rec(), el kernel llamó a xchk_should_check_xref(). En esta función, *curpp (que apunta a sc->sa.cnt_cur) es anulado. Volviendo a xrep_revalidate_allocbt(), dado que sc->sa.cnt_cur ha sido anulado, entonces activó una desreferencia de puntero nulo a través de xchk_allocbt() (segunda llamada) -> xchk_btree(). Así que. La revalidación de bnobt falló en un intento de referencia cruzada, por lo que eliminamos el cursor cntbt, y luego fallamos cuando intentamos revalidar el cntbt. Por lo tanto, verifique si hay un cursor cntbt nulo antes de esa revalidación, y marque la reparación como incompleta. También podemos ignorar el segundo árbol por completo si el primer árbol fue reconstruido pero ya está corrupto. Aplique la misma corrección a xrep_revalidate_iallocbt porque tiene el mismo problema.
First Time Linux linux Kernel
Linux
CWE CWE-476

18 Mar 2026, 18:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-03-18 18:16

Updated : 2026-05-21 18:34


NVD link : CVE-2026-23249

Mitre link : CVE-2026-23249

CVE.ORG link : CVE-2026-23249


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-476

NULL Pointer Dereference