Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: scsi: target: iscsi: Reservar un byte terminador para la carga útil de inicio de sesión iscsi_target_check_login_request() rechaza una PDU de inicio de sesión cuyo DataSegmentLength excede MAX_KEY_VALUE_PAIRS, pero la comprobación usa '>' y login->req_buf se asigna con exactamente MAX_KEY_VALUE_PAIRS bytes. Dado que iscsit_get_login_rx() recibe payload_length + padding bytes, donde padding = ((-payload_length) & 3); cualquier payload_length entre 8189 y 8192 llena todo el búfer de 8192 bytes. La escritura se mantiene dentro de los límites, pero no queda ningún byte para un terminador NUL. Posteriormente, el búfer se consume como una cadena C. En la ruta CHAP, chap_check_algorithm() llama a kstrdup(a_str), y extract_param() llama a strstr(in_buf, pattern) seguida de strlen_semi(), ninguna de las cuales recibe una longitud. Además, convert_null_to_semi() reescribe cada NUL incrustado como ';', por lo que incluso una carga útil formada por registros key=value bien formados separados por NUL queda sin terminador. Estas funciones recorren más allá del final del objeto hacia la memoria slab adyacente. Un iniciador no autenticado puede alcanzar esta condición contra un portal configurado para CHAP; cuando no se requiere autenticación, iscsi_login_zero_tsih_s2() reescribe AuthMethod como None y nunca se entra en la ruta CHAP. Se asigna un byte adicional. kzalloc() lo pone en cero y nada escribe en él, ya que cada escritor copia en el desplazamiento 0 un máximo de MAX_KEY_VALUE_PAIRS bytes, por lo que el búfer siempre queda terminado.
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: e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a 5fac79f248c37774d1dd761406f83d25ca6ff8e4 · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a 6ddddcad436d8e6e619204d3c848147ff2f5bf1e · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a b19dc17ed963ac36c0db4b52a1803fb11169f91f · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a 6b589ef9d5f6cdc70d2b4f269ca6cf26b5ebb076 · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a eb9dadf4d552ebe10644871c5189286552aa48f5 · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a 1624bff4c5118ad494d50ad94d44f22064667a7f · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a 3ddf3ea291a0ef2ea93b82e158960ac2cc42302b · e48354ce078c079996f89d715dfa44814b4eba01 y anteriores a f4825922d2fb371e2b969697d792077f1b62b62c
- Linux Afectadas: 3.1 No afectadas: 5.10.270 · 5.15.221 · 6.1.188 · 6.6.157 · 6.12.110 · 6.18.51
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/5fac79f248c37774d1dd761406f83d25ca6ff8e4
- Referencia en git.kernel.orggit.kernel.org/stable/c/6ddddcad436d8e6e619204d3c848147ff2f5bf1e
- Referencia en git.kernel.orggit.kernel.org/stable/c/b19dc17ed963ac36c0db4b52a1803fb11169f91f
- Referencia en git.kernel.orggit.kernel.org/stable/c/6b589ef9d5f6cdc70d2b4f269ca6cf26b5ebb076
- Referencia en git.kernel.orggit.kernel.org/stable/c/eb9dadf4d552ebe10644871c5189286552aa48f5
- Referencia en git.kernel.orggit.kernel.org/stable/c/1624bff4c5118ad494d50ad94d44f22064667a7f
- Referencia en git.kernel.orggit.kernel.org/stable/c/3ddf3ea291a0ef2ea93b82e158960ac2cc42302b
- Referencia en git.kernel.orggit.kernel.org/stable/c/f4825922d2fb371e2b969697d792077f1b62b62c
Ver el texto original en inglés (CVE.org)
scsi: target: iscsi: Reserve a terminator byte for the login payload
In the Linux kernel, the following vulnerability has been resolved: scsi: target: iscsi: Reserve a terminator byte for the login payload iscsi_target_check_login_request() rejects a login PDU whose DataSegmentLength exceeds MAX_KEY_VALUE_PAIRS, but the test is '>' and login->req_buf is allocated with exactly MAX_KEY_VALUE_PAIRS bytes. Since iscsit_get_login_rx() receives payload_length + padding bytes, where padding = ((-payload_length) & 3); any payload_length from 8189 to 8192 fills the whole 8192 byte buffer. The write stays in bounds, but no byte is left for a NUL terminator. The buffer is subsequently consumed as a C string. In the CHAP path chap_check_algorithm() calls kstrdup(a_str), and extract_param() calls strstr(in_buf, pattern) followed by strlen_semi(), none of which take a length. convert_null_to_semi() additionally rewrites every embedded NUL to ';', so even a payload made of well formed NUL separated key=value records is left without a terminator. These walk past the end of the object into adjacent slab memory. It is reachable by an unauthenticated initiator against a portal configured for CHAP; when authentication is not required iscsi_login_zero_tsih_s2() rewrites AuthMethod to None and the CHAP path is never entered. Allocate one extra byte. kzalloc() zeroes it and nothing ever writes to it, as every writer copies to offset 0 for at most MAX_KEY_VALUE_PAIRS bytes, so the buffer is always terminated.