9.4critical
ext4: avoid infinite loops caused by residual data
- Severity
- 9.4critical CVSS:3.1 by Linux
- Exploit likelihood
- 0.76% (higher than 52% of CVEs)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: ext4: avoid infinite loops caused by residual data On the mkdir/mknod path, when mapping logical blocks to physical blocks, if inserting a new extent into the extent tree fails (in this example, because the file system disabled the huge file feature when marking the inode as dirty), ext4_ext_map_blocks() only calls ext4_free_blocks() to reclaim the physical block without deleting the corresponding data in the extent tree. This causes subsequent mkdir operations to reference the previously reclaimed physical block number again, even though this physical block is already being used by the xattr block. Therefore, a situation arises where both the directory and xattr are using the same buffer head block in memory simultaneously. The above causes ext4_xattr_block_set() to enter an infinite loop about "inserted" and cannot release the inode lock, ultimately leading to the 143s blocking problem mentioned in [1]. If the metadata is corrupted, then trying to remove some extent space can do even more harm. Also in case EXT4_GET_BLOCKS_DELALLOC_RESERVE was passed, remove space wrongly update quota information. Jan Kara suggests distinguishing between two cases: 1) The error is ENOSPC or EDQUOT - in this case the filesystem is fully consistent and we must maintain its consistency including all the accounting. However these errors can happen only early before we've inserted the extent into the extent tree. So current code works correctly for this case. 2) Some other error - this means metadata is corrupted. We should strive to do as few modifications as possible to limit damage. So I'd just skip freeing of allocated blocks. [1] INFO: task syz.0.17:5995 blocked for more than 143 seconds. Call Trace: inode_lock_nested include/linux/fs.h:1073 [inline] __start_dirop fs/namei.c:2923 [inline] start_dirop fs/namei.c:2934 [inline]
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 315054f023d28ee64f308adf8b5737831541776b before fb3356d72151b554e2b4bc92b368d4c648cce5d9, from 315054f023d28ee64f308adf8b5737831541776b before 101ddb1c8f4b0a196e5cbbf51edf4bb328838868, from 315054f023d28ee64f308adf8b5737831541776b before c66545e83a802c3851d9be27a41c0479dd29ff0c, from 315054f023d28ee64f308adf8b5737831541776b before ecc50bfca9b5c2ee6aeef998181689b80477367b, from 315054f023d28ee64f308adf8b5737831541776b before 3a7667595bcad84da53fc156a418e110267c3412, from 315054f023d28ee64f308adf8b5737831541776b before 416c86f30f91b4fb2642ef6b102596ca898f41a5, from 315054f023d28ee64f308adf8b5737831541776b before 64f425b06b3bea9abc8977fd3982779b3ad070c9, from 315054f023d28ee64f308adf8b5737831541776b before 5422fe71d26d42af6c454ca9527faaad4e677d6c and 1 more Not affected: before 2.6.22, from 5.10.276 up to 5.10.*, from 5.15.227 up to 5.15.*, from 6.1.168 up to 6.1.*, from 6.6.131 up to 6.6.*, from 6.12.80 up to 6.12.* | CVE List |
| linux linux_kernel | from 2.6.22.1 before 6.1.168, from 6.2 before 6.6.131, from 6.7 before 6.12.80, from 6.13 before 6.18.21, from 6.19 before 6.19.11, 2.6.22, 7.0 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: ext4: avoid infinite loops caused by residual data On the mkdir/mknod path, when mapping logical blocks to physical blocks, if inserting a new extent into the extent tree fails (in this example, because the file system disabled the huge file feature when marking the inode as dirty), ext4_ext_map_blocks() only calls ext4_free_blocks() to reclaim the physical block without deleting the corresponding data in the extent tree. This causes subsequent mkdir operations to reference the previously reclaimed physical block number again, even though this physical block is already being used by the xattr block. Therefore, a situation arises where both the directory and xattr are using the same buffer head block in memory simultaneously. The above causes ext4_xattr_block_set() to enter an infinite loop about "inserted" and cannot release the inode lock, ultimately leading to the 143s blocking problem mentioned in [1]. If the metadata is corrupted, then trying to remove some extent space can do even more harm. Also in case EXT4_GET_BLOCKS_DELALLOC_RESERVE was passed, remove space wrongly update quota information. Jan Kara suggests distinguishing between two cases: 1) The error is ENOSPC or EDQUOT - in this case the filesystem is fully consistent and we must maintain its consistency including all the accounting. However these errors can happen only early before we've inserted the extent into the extent tree. So current code works correctly for this case. 2) Some other error - this means metadata is corrupted. We should strive to do as few modifications as possible to limit damage. So I'd just skip freeing of allocated blocks. [1] INFO: task syz.0.17:5995 blocked for more than 143 seconds. Call Trace: inode_lock_nested include/linux/fs.h:1073 [inline] __start_dirop fs/namei.c:2923 [inline] start_dirop fs/namei.c:2934 [inline]
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ext4: evitar bucles infinitos causados por datos residuales En la ruta mkdir/mknod, al mapear bloques lógicos a bloques físicos, si la inserción de un nuevo extent en el árbol de extents falla (en este ejemplo, porque el sistema de archivos deshabilitó la característica de archivos grandes al marcar el inodo como sucio), ext4_ext_map_blocks() solo llama a ext4_free_blocks() para reclamar el bloque físico sin eliminar los datos correspondientes en el árbol de extents. Esto hace que las operaciones mkdir posteriores referencien de nuevo el número de bloque físico previamente reclamado, aunque este bloque físico ya esté siendo utilizado por el bloque xattr. Por lo tanto, surge una situación en la que tanto el directorio como xattr están utilizando el mismo bloque de cabecera de búfer en memoria simultáneamente. Lo anterior hace que ext4_xattr_block_set() entre en un bucle infinito sobre ’inserted’ y no pueda liberar el bloqueo del inodo, lo que finalmente lleva al problema de bloqueo de 143s mencionado en [1]. Si los metadatos están corruptos, entonces intentar eliminar algo de espacio de extent puede causar aún más daño. También en caso de que se pasara EXT4_GET_BLOCKS_DELALLOC_RESERVE, la eliminación de espacio actualiza erróneamente la información de cuota. Jan Kara sugiere distinguir entre dos casos: 1) El error es ENOSPC o EDQUOT - en este caso el sistema de archivos es totalmente consistente y debemos mantener su consistencia incluyendo toda la contabilidad. Sin embargo, estos errores solo pueden ocurrir temprano antes de haber insertado el extent en el árbol de extents. Por lo tanto, el código actual funciona correctamente para este caso. 2) Algún otro error - esto significa que los metadatos están corruptos. Debemos esforzarnos por hacer la menor cantidad de modificaciones posible para limitar el daño. Así que simplemente omitiría la liberación de bloques asignados. [1] INFO: la tarea syz.0.17:5995 bloqueada durante más de 143 segundos. Traza de Llamada: inode_lock_nested include/linux/fs.h:1073 [inline] __start_dirop fs/namei.c:2923 [inline] start_dirop fs/namei.c:2934 [inline]
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31448 changed 2026-12-01 | CVE Terms of Use |
| NVD | CVE-2026-31448 changed 2026-12-01 | Public domain |