CVE-2025-21710

In the Linux kernel, the following vulnerability has been resolved: tcp: correct handling of extreme memory squeeze Testing with iperf3 using the "pasta" protocol splicer has revealed a problem in the way tcp handles window advertising in extreme memory squeeze situations. Under memory pressure, a socket endpoint may temporarily advertise a zero-sized window, but this is not stored as part of the socket data. The reasoning behind this is that it is considered a temporary setting which shouldn't influence any further calculations. However, if we happen to stall at an unfortunate value of the current window size, the algorithm selecting a new value will consistently fail to advertise a non-zero window once we have freed up enough memory. This means that this side's notion of the current window size is different from the one last advertised to the peer, causing the latter to not send any data to resolve the sitution. The problem occurs on the iperf3 server side, and the socket in question is a completely regular socket with the default settings for the fedora40 kernel. We do not use SO_PEEK or SO_RCVBUF on the socket. The following excerpt of a logging session, with own comments added, shows more in detail what is happening: // tcp_v4_rcv(->) // tcp_rcv_established(->) [5201<->39222]: ==== Activating log @ net/ipv4/tcp_input.c/tcp_data_queue()/5257 ==== [5201<->39222]: tcp_data_queue(->) [5201<->39222]: DROPPING skb [265600160..265665640], reason: SKB_DROP_REASON_PROTO_MEM [rcv_nxt 265600160, rcv_wnd 262144, snt_ack 265469200, win_now 131184] [copied_seq 259909392->260034360 (124968), unread 5565800, qlen 85, ofoq 0] [OFO queue: gap: 65480, len: 0] [5201<->39222]: tcp_data_queue(<-) [5201<->39222]: __tcp_transmit_skb(->) [tp->rcv_wup: 265469200, tp->rcv_wnd: 262144, tp->rcv_nxt 265600160] [5201<->39222]: tcp_select_window(->) [5201<->39222]: (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_NOMEM) ? --> TRUE [tp->rcv_wup: 265469200, tp->rcv_wnd: 262144, tp->rcv_nxt 265600160] returning 0 [5201<->39222]: tcp_select_window(<-) [5201<->39222]: ADVERTISING WIN 0, ACK_SEQ: 265600160 [5201<->39222]: [__tcp_transmit_skb(<-) [5201<->39222]: tcp_rcv_established(<-) [5201<->39222]: tcp_v4_rcv(<-) // Receive queue is at 85 buffers and we are out of memory. // We drop the incoming buffer, although it is in sequence, and decide // to send an advertisement with a window of zero. // We don't update tp->rcv_wnd and tp->rcv_wup accordingly, which means // we unconditionally shrink the window. [5201<->39222]: tcp_recvmsg_locked(->) [5201<->39222]: __tcp_cleanup_rbuf(->) tp->rcv_wup: 265469200, tp->rcv_wnd: 262144, tp->rcv_nxt 265600160 [5201<->39222]: [new_win = 0, win_now = 131184, 2 * win_now = 262368] [5201<->39222]: [new_win >= (2 * win_now) ? --> time_to_ack = 0] [5201<->39222]: NOT calling tcp_send_ack() [tp->rcv_wup: 265469200, tp->rcv_wnd: 262144, tp->rcv_nxt 265600160] [5201<->39222]: __tcp_cleanup_rbuf(<-) [rcv_nxt 265600160, rcv_wnd 262144, snt_ack 265469200, win_now 131184] [copied_seq 260040464->260040464 (0), unread 5559696, qlen 85, ofoq 0] returning 6104 bytes [5201<->39222]: tcp_recvmsg_locked(<-) // After each read, the algorithm for calculating the new receive // window in __tcp_cleanup_rbuf() finds it is too small to advertise // or to update tp->rcv_wnd. // Meanwhile, the peer thinks the window is zero, and will not send // any more data to trigger an update from the interrupt mode side. [5201<->39222]: tcp_recvmsg_locked(->) [5201<->39222]: __tcp_cleanup_rbuf(->) tp->rcv_wup: 265469200, tp->rcv_wnd: 262144, tp->rcv_nxt 265600160 [5201<->39222]: [new_win = 262144, win_now = 131184, 2 * win_n ---truncated---
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

16 Dec 2025, 16:58

Type Values Removed Values Added
First Time Linux
Linux linux Kernel
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CWE CWE-667
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: tcp: gestión correcta de la compresión extrema de memoria Las pruebas con iperf3 utilizando el empalmador de protocolo "pasta" han revelado un problema en la forma en que tcp gestiona la publicidad de ventanas en situaciones de compresión extrema de memoria. Bajo presión de memoria, un endpoint de socket puede anunciar temporalmente una ventana de tamaño cero, pero esto no se almacena como parte de los datos del socket. El razonamiento detrás de esto es que se considera una configuración temporal que no debería influir en ningún cálculo posterior. Sin embargo, si nos quedamos en un valor desafortunado del tamaño de ventana actual, el algoritmo que selecciona un nuevo valor fallará constantemente en anunciar una ventana distinta de cero una vez que hayamos liberado suficiente memoria. Esto significa que la noción de este lado del tamaño de ventana actual es diferente de la última anunciada al par, lo que hace que este último no envíe ningún dato para resolver la situación. El problema ocurre en el lado del servidor iperf3, y el socket en cuestión es un socket completamente normal con la configuración predeterminada para el kernel fedora40. No utilizamos SO_PEEK o SO_RCVBUF en el socket. El siguiente extracto de una sesión de registro, con comentarios propios agregados, muestra con más detalle lo que está sucediendo: // tcp_v4_rcv(-&gt;) // tcp_rcv_established(-&gt;) [5201&lt;-&gt;39222]: ==== Activating log @ net/ipv4/tcp_input.c/tcp_data_queue()/5257 ==== [5201&lt;-&gt;39222]: tcp_data_queue(-&gt;) [5201&lt;-&gt;39222]: DROPPING skb [265600160..265665640], reason: SKB_DROP_REASON_PROTO_MEM [rcv_nxt 265600160, rcv_wnd 262144, snt_ack 265469200, win_now 131184] [copied_seq 259909392-&gt;260034360 (124968), unread 5565800, qlen 85, ofoq 0] [OFO queue: gap: 65480, len: 0] [5201&lt;-&gt;39222]: tcp_data_queue(&lt;-) [5201&lt;-&gt;39222]: __tcp_transmit_skb(-&gt;) [tp-&gt;rcv_wup: 265469200, tp-&gt;rcv_wnd: 262144, tp-&gt;rcv_nxt 265600160] [5201&lt;-&gt;39222]: tcp_select_window(-&gt;) [5201&lt;-&gt;39222]: (inet_csk(sk)-&gt;icsk_ack.pending &amp; ICSK_ACK_NOMEM) ? --&gt; TRUE [tp-&gt;rcv_wup: 265469200, tp-&gt;rcv_wnd: 262144, tp-&gt;rcv_nxt 265600160] returning 0 [5201&lt;-&gt;39222]: tcp_select_window(&lt;-) [5201&lt;-&gt;39222]: ADVERTISING WIN 0, ACK_SEQ: 265600160 [5201&lt;-&gt;39222]: [__tcp_transmit_skb(&lt;-) [5201&lt;-&gt;39222]: tcp_rcv_established(&lt;-) [5201&lt;-&gt;39222]: tcp_v4_rcv(&lt;-) // La cola de recepción está en 85 búferes y nos hemos quedado sin memoria. // Descartamos el búfer entrante, aunque esté en secuencia, y decidimos // enviar un anuncio con una ventana de cero. // No actualizamos tp-&gt;rcv_wnd y tp-&gt;rcv_wup en consecuencia, lo que significa // que reducimos incondicionalmente la ventana. [5201&lt;-&gt;39222]: tcp_recvmsg_locked(-&gt;) [5201&lt;-&gt;39222]: __tcp_cleanup_rbuf(-&gt;) tp-&gt;rcv_wup: 265469200, tp-&gt;rcv_wnd: 262144, tp-&gt;rcv_nxt 265600160 [5201&lt;-&gt;39222]: [new_win = 0, win_now = 131184, 2 * win_now = 262368] [5201&lt;-&gt;39222]: [new_win &gt;= (2 * win_now) ? --&gt; time_to_ack = 0] [5201&lt;-&gt;39222]: NOT calling tcp_send_ack() [tp-&gt;rcv_wup: 265469200, tp-&gt;rcv_wnd: 262144, tp-&gt;rcv_nxt 265600160] [5201&lt;-&gt;39222]: __tcp_cleanup_rbuf(&lt;-) [rcv_nxt 265600160, rcv_wnd 262144, snt_ack 265469200, win_now 131184] [copied_seq 260040464-&gt;260040464 (0), unread 5559696, qlen 85, ofoq 0] returning 6104 bytes [5201&lt;-&gt;39222]: tcp_recvmsg_locked(&lt;-) // Después de cada lectura, el algoritmo para calcular la nueva ventana de recepción // en __tcp_cleanup_rbuf() encuentra que es demasiado pequeña para anunciar // o actualizar tp-&gt;rcv_wnd. // Mientras tanto, el par piensa que la ventana es cero y no enviará // más datos para activar una actualización desde el lado del modo de interrupción. [5201&lt;-&gt;39222]: tcp_recvmsg_locked(-&gt;) [5201&lt;-&gt;39222]: __tcp_cleanup_rbuf(-&gt;) tp-&gt;rcv_wup: 265469200, tp-&gt;rcv_wnd: 262144, tp-&gt;rcv_nxt 265600160 [5201&lt;-&gt;39222]: [new
References () https://git.kernel.org/stable/c/1dd823a46e25ffde1492c391934f69a9e5eb574f - () https://git.kernel.org/stable/c/1dd823a46e25ffde1492c391934f69a9e5eb574f - Patch
References () https://git.kernel.org/stable/c/8c670bdfa58e48abad1d5b6ca1ee843ca91f7303 - () https://git.kernel.org/stable/c/8c670bdfa58e48abad1d5b6ca1ee843ca91f7303 - Patch
References () https://git.kernel.org/stable/c/b01e7ceb35dcb7ffad413da657b78c3340a09039 - () https://git.kernel.org/stable/c/b01e7ceb35dcb7ffad413da657b78c3340a09039 - Patch
References () https://git.kernel.org/stable/c/b4055e2fe96f4ef101d8af0feb056d78d77514ff - () https://git.kernel.org/stable/c/b4055e2fe96f4ef101d8af0feb056d78d77514ff - Patch

27 Feb 2025, 02:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-02-27 02:15

Updated : 2025-12-16 16:58


NVD link : CVE-2025-21710

Mitre link : CVE-2025-21710

CVE.ORG link : CVE-2025-21710


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-667

Improper Locking