Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: ext4: fix out-of-bounds read in ext4_read_inline_dir() ext4_read_inline_dir() puede leer un encabezado dirent más allá del final de su búfer inline, provocando una lectura slab-out-of-bounds durante getdents64(): BUG: KASAN: slab-out-of-bounds in __ext4_check_dir_entry Read of size 2 at addr ffff88800f3dd23c by task exploit/148 ... __ext4_check_dir_entry ext4_read_inline_dir iterate_dir La carga útil dirent reside en un búfer de exactamente inline_size bytes: dir_buf = kmalloc(inline_size, GFP_NOFS); pero la iteración se ejecuta en un espacio de posiciones extra_offset bytes más grande (extra_size = extra_offset + inline_size), de modo que las entradas sintéticas "." y ".." quedan en sus desplazamientos de directorio de bloque. Un dirent se forma en "dir_buf + pos - extra_offset", pero el argumento de longitud de ext4_check_dir_entry() usa el valor mayor extra_size. Por lo tanto, se acepta una posición cuyo encabezado dirent se extendería más allá de extra_size, y la comprobación de rec_len del bucle de reescaneo y ext4_check_dir_entry() desreferencian de->rec_len antes de que la entrada sea rechazada. Se rechaza una posición cuyo encabezado dirent de tamaño mínimo no cabría dentro de extra_size antes de formar de, tanto en el bucle de reescaneo como en el principal, y se pasa inline_size en lugar de extra_size a ext4_check_dir_entry() para que la verificación de longitud coincida con el búfer físico.
Qué hacer
Revisa si usas el producto afectado y en qué versión, y aplica la actualización o la mitigación que indique el aviso del fabricante. CISA no ha confirmado que se esté explotando; si eso cambia, esta ficha pasa a «explotada» y te avisamos en el boletín.
Versiones afectadas
- Linux Afectadas: c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a d1e7c186555ad65554fd2f2b02f5a539aa35ae48 · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a 5fd20d4e50dd6e460b3ea8e4396f8553d4526f8f · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a 1a1dea633b724a1c042dbcdb1fed27f410916688 · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a b060861f662d4826dc700a1c3584243bb3474cfe · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a 6702c7da86d8cdb88d0fc57166286e115ffeb8c0 · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a 36bf17bb90cdf7a623499b624b05acde4d2feef5 · c4d8b0235aa98f8c26bf94d308be3fdd24154572 y anteriores a 9333cc809f0a89e001b814155a6cb8903a6274df
- Linux Afectadas: 3.10 No afectadas: 5.15.221 · 6.1.188 · 6.6.157 · 6.12.110 · 6.18.52 · 7.2.6
Según el registro de la vulnerabilidad en CVE.org, tal como lo publicó el fabricante. Confirma tu versión exacta en el aviso del fabricante.
Referencias
- Referencia en git.kernel.orggit.kernel.org/stable/c/d1e7c186555ad65554fd2f2b02f5a539aa35ae48
- Referencia en git.kernel.orggit.kernel.org/stable/c/5fd20d4e50dd6e460b3ea8e4396f8553d4526f8f
- Referencia en git.kernel.orggit.kernel.org/stable/c/1a1dea633b724a1c042dbcdb1fed27f410916688
- Referencia en git.kernel.orggit.kernel.org/stable/c/b060861f662d4826dc700a1c3584243bb3474cfe
- Referencia en git.kernel.orggit.kernel.org/stable/c/6702c7da86d8cdb88d0fc57166286e115ffeb8c0
- Referencia en git.kernel.orggit.kernel.org/stable/c/36bf17bb90cdf7a623499b624b05acde4d2feef5
- Referencia en git.kernel.orggit.kernel.org/stable/c/9333cc809f0a89e001b814155a6cb8903a6274df
Ver el texto original en inglés (CVE.org)
ext4: fix out-of-bounds read in ext4_read_inline_dir()
In the Linux kernel, the following vulnerability has been resolved: ext4: fix out-of-bounds read in ext4_read_inline_dir() ext4_read_inline_dir() can read a dirent header past the end of its inline buffer, triggering a slab-out-of-bounds read during getdents64(): BUG: KASAN: slab-out-of-bounds in __ext4_check_dir_entry Read of size 2 at addr ffff88800f3dd23c by task exploit/148 ... __ext4_check_dir_entry ext4_read_inline_dir iterate_dir The dirent payload lives in a buffer of exactly inline_size bytes: dir_buf = kmalloc(inline_size, GFP_NOFS); but iteration runs in a position space extra_offset bytes larger (extra_size = extra_offset + inline_size) so the synthetic "." and ".." land at their block-dir offsets. A dirent is formed at "dir_buf + pos - extra_offset", yet the ext4_check_dir_entry() length argument uses the larger extra_size. A position whose dirent header would extend past extra_size is therefore accepted, and the rescan loop's rec_len probe and ext4_check_dir_entry() dereference de->rec_len before the entry is rejected. Reject a position whose minimum-size dirent header would not fit within extra_size before forming de, in both the rescan and main loops, and pass inline_size rather than extra_size to ext4_check_dir_entry() so the length check matches the physical buffer.