Skip to content

Commit 88f8598

Browse files
yuchungchengdavem330
authored andcommitted
tcp: exit if nothing to retransmit on RTO timeout
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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Neal Cardwell <[email protected]> Reviewed-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9b420ef commit 88f8598

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
@@ -443,10 +443,8 @@ void tcp_retransmit_timer(struct sock *sk)
443443
*/
444444
return;
445445
}
446-
if (!tp->packets_out)
447-
goto out;
448-
449-
WARN_ON(tcp_rtx_queue_empty(sk));
446+
if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
447+
return;
450448

451449
tp->tlp_high_seq = 0;
452450

0 commit comments

Comments
 (0)