Skip to content

Commit b2f277a

Browse files
committed
tcp: exit if nothing to retransmit on RTO timeout
jira LE-3201 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author Yuchung Cheng <ycheng@google.com> commit 88f8598 Previously TCP only warns if its RTO timer fires and the retransmission queue is empty, but it'll cause null pointer reference later on. It's better to avoid such catastrophic failure and simply exit with a warning. Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 88f8598) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 56c0f67 commit b2f277a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/ipv4/tcp_timer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,8 @@ void tcp_retransmit_timer(struct sock *sk)
449449
*/
450450
return;
451451
}
452-
if (!tp->packets_out)
453-
goto out;
454-
455-
WARN_ON(tcp_rtx_queue_empty(sk));
452+
if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
453+
return;
456454

457455
tp->tlp_high_seq = 0;
458456

0 commit comments

Comments
 (0)