Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: fs/ntfs3: validate ef->size covers the record's name and value Cuando un registro EA tiene un ef->size distinto de cero, ntfs_read_ea() solo verifica que el registro quepa en el búfer restante (ea_size > bytes), pero no que ef->size sea lo suficientemente grande para contener los propios name_len + 1 + elength del registro. Una imagen especialmente manipulada puede superar la validación con, por ejemplo, ef->size = 24 pero elength = 0xffff. ntfs_get_ea() confía entonces en elength y lo copia desde el registro de tamaño insuficiente, leyendo más allá de la asignación kmalloc(info->size) y filtrando memoria del heap al espacio de usuario mediante getxattr(): BUG: KASAN: slab-out-of-bounds in ntfs_get_ea (fs/ntfs3/xattr.c:302) Read of size 65535 at addr ffff888100794550 by task exploit __asan_memcpy (mm/kasan/shadow.c:105) ntfs_get_ea (fs/ntfs3/xattr.c:302) ntfs_getxattr (fs/ntfs3/xattr.c:848) __vfs_getxattr (fs/xattr.c:441) vfs_getxattr (fs/xattr.c:474) do_getxattr (fs/xattr.c:800) path_getxattrat (fs/xattr.c:868) do_syscall_64 (arch/x86/entry/syscall_64.c:94) The buggy address is located 80 bytes inside of allocated 84-byte region in cache kmalloc-96 Se calcula el tamaño que necesita el registro y se exige que ef->size lo cubra.
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: 333feb7ba84f69f9b423422417aaac54fd9e7c84 y anteriores a b27e68ad818a4ca2cef8f35f97e75d756714c818 · 000a9a72efa4a9df289bab9c9e8ba1639c72e0d6 y anteriores a 28a924c7e67e6d71abeb04860b61166fecb027fc · 0e8235d28f3a0e9eda9f02ff67ee566d5f42b66b y anteriores a d585ed08308909c7e6fefb4e8a258aeb29b19ff9 · 0e8235d28f3a0e9eda9f02ff67ee566d5f42b66b y anteriores a 077df8464cf24f8ffc82fb6efec2ae600686e699 · 0e8235d28f3a0e9eda9f02ff67ee566d5f42b66b y anteriores a aab1880058ac767d3ea9388a9a7221c776c22c44 · 0e8235d28f3a0e9eda9f02ff67ee566d5f42b66b y anteriores a c8a109c9e23a2c7fd548473dde728b2cb8188146 · 0e8235d28f3a0e9eda9f02ff67ee566d5f42b66b y anteriores a c22f91d82cb9a29d22bdffdce6c803467984ad0c · 5.15.121 y anteriores a 5.15.221 · 6.1.40 y anteriores a 6.1.188
- Linux Afectadas: 6.2 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/b27e68ad818a4ca2cef8f35f97e75d756714c818
- Referencia en git.kernel.orggit.kernel.org/stable/c/28a924c7e67e6d71abeb04860b61166fecb027fc
- Referencia en git.kernel.orggit.kernel.org/stable/c/d585ed08308909c7e6fefb4e8a258aeb29b19ff9
- Referencia en git.kernel.orggit.kernel.org/stable/c/077df8464cf24f8ffc82fb6efec2ae600686e699
- Referencia en git.kernel.orggit.kernel.org/stable/c/aab1880058ac767d3ea9388a9a7221c776c22c44
- Referencia en git.kernel.orggit.kernel.org/stable/c/c8a109c9e23a2c7fd548473dde728b2cb8188146
- Referencia en git.kernel.orggit.kernel.org/stable/c/c22f91d82cb9a29d22bdffdce6c803467984ad0c
Ver el texto original en inglés (CVE.org)
fs/ntfs3: validate ef->size covers the record's name and value
In the Linux kernel, the following vulnerability has been resolved: fs/ntfs3: validate ef->size covers the record's name and value When an EA record has a non-zero ef->size, ntfs_read_ea() only checks that the record fits in the remaining buffer (ea_size > bytes), not that ef->size is large enough to hold the record's own name_len + 1 + elength. A crafted image can pass validation with, e.g., ef->size = 24 but elength = 0xffff. ntfs_get_ea() then trusts elength and copies it out of the undersized record, reading past the kmalloc(info->size) allocation and leaking heap memory to userspace via getxattr(): BUG: KASAN: slab-out-of-bounds in ntfs_get_ea (fs/ntfs3/xattr.c:302) Read of size 65535 at addr ffff888100794550 by task exploit __asan_memcpy (mm/kasan/shadow.c:105) ntfs_get_ea (fs/ntfs3/xattr.c:302) ntfs_getxattr (fs/ntfs3/xattr.c:848) __vfs_getxattr (fs/xattr.c:441) vfs_getxattr (fs/xattr.c:474) do_getxattr (fs/xattr.c:800) path_getxattrat (fs/xattr.c:868) do_syscall_64 (arch/x86/entry/syscall_64.c:94) The buggy address is located 80 bytes inside of allocated 84-byte region in cache kmalloc-96 Compute the size the record needs and require ef->size to cover it.