Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: nvmet-tcp: corregir escritura fuera de límites al recibir una PDU demasiado larga nvmet_tcp_try_recv_pdu() lee un encabezado de PDU en la unión fija de 128 bytes queue->pdu y luego calcula la longitud restante de la carga útil como queue->left = hdr->hlen - queue->offset + hdgst; y lee esa cantidad adicional de bytes en &queue->pdu + queue->offset, sin limitar nunca el resultado respecto de sizeof(queue->pdu). Una struct nvme_tcp_icreq_pdu mide en sí 128 bytes, exactamente el tamaño de la unión. Una vez negociado un resumen de encabezado (hdgst = 4), un segundo ICReq supera la comprobación hlen == nvmet_tcp_pdu_size() pero produce queue->left = 128 - 8 + 4 = 124, por lo que los bytes 8..132 se escriben en el búfer de 128 bytes, 4 bytes más allá de su final, sobre queue->hdr_digest y queue->data_digest. Esos bytes los controla el atacante (un ICReq no lleva resumen), y el ICReq duplicado solo se rechaza después, tras el desbordamiento. De este modo, un host remoto no autenticado puede corromper la memoria del kernel adyacente al búfer de recepción. Se rechaza cualquier PDU cuya longitud declarada implique leer más allá del final de queue->pdu antes de la segunda recepción.
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: 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a a3f0bcfbaf3312a5754d1ce020a07d394669eb25 · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a 4f84d42c53c49557fb1ef285c683b0a81b576c74 · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a 58dc6035b79c4c73c0cbf9ec9f68a7f117b2b3e6 · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a cf5f39d2b58f97e0cd1829c4a6aeef17f1607cca · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a 3a385e0c39efbe34db8edd95900c123113ae3450 · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a dbc4acbdb3ca8c81441368ad7409b8f77d4de8f6 · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a d95d342bc0ea82dc79e6362b2f1f997431750e4c · 872d26a391da92ed8f0c0f5cb5fef428067b7f30 y anteriores a 14cc5a7e77731497d5bea70f3bb05df7eda982e4
- Linux Afectadas: 5.0 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/a3f0bcfbaf3312a5754d1ce020a07d394669eb25
- Referencia en git.kernel.orggit.kernel.org/stable/c/4f84d42c53c49557fb1ef285c683b0a81b576c74
- Referencia en git.kernel.orggit.kernel.org/stable/c/58dc6035b79c4c73c0cbf9ec9f68a7f117b2b3e6
- Referencia en git.kernel.orggit.kernel.org/stable/c/cf5f39d2b58f97e0cd1829c4a6aeef17f1607cca
- Referencia en git.kernel.orggit.kernel.org/stable/c/3a385e0c39efbe34db8edd95900c123113ae3450
- Referencia en git.kernel.orggit.kernel.org/stable/c/dbc4acbdb3ca8c81441368ad7409b8f77d4de8f6
- Referencia en git.kernel.orggit.kernel.org/stable/c/d95d342bc0ea82dc79e6362b2f1f997431750e4c
- Referencia en git.kernel.orggit.kernel.org/stable/c/14cc5a7e77731497d5bea70f3bb05df7eda982e4
Ver el texto original en inglés (CVE.org)
nvmet-tcp: fix out-of-bounds write when receiving an over-long PDU
In the Linux kernel, the following vulnerability has been resolved: nvmet-tcp: fix out-of-bounds write when receiving an over-long PDU nvmet_tcp_try_recv_pdu() reads a PDU header into the fixed 128-byte queue->pdu union, then computes the remaining payload length as queue->left = hdr->hlen - queue->offset + hdgst; and reads that many more bytes into &queue->pdu + queue->offset, without ever bounding the result against sizeof(queue->pdu). A struct nvme_tcp_icreq_pdu is itself 128 bytes, exactly the size of the union. Once a header digest has been negotiated (hdgst = 4), a second ICReq passes the hlen == nvmet_tcp_pdu_size() check but yields queue->left = 128 - 8 + 4 = 124, so bytes 8..132 are written into the 128-byte buffer -- 4 bytes past its end, over queue->hdr_digest and queue->data_digest. Those bytes are attacker-controlled (an ICReq carries no digest), and the duplicate ICReq is only rejected later, after the overflow. A remote unauthenticated host can thus corrupt kernel memory adjacent to the receive buffer. Reject any PDU whose declared length would read past the end of queue->pdu before the second recv.