diff options
author | Yuchung Cheng <ycheng@google.com> | 2019-01-16 15:05:28 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 09:21:34 +0100 |
commit | d832269ac697067335952ba3a9c185027065f95c (patch) | |
tree | 836d55e988816a8f10ea142291c9e52e8db573d4 /net | |
parent | 95442682dd2dfc6398be43574cb073f4322d6889 (diff) | |
download | linux-stable-d832269ac697067335952ba3a9c185027065f95c.tar.gz linux-stable-d832269ac697067335952ba3a9c185027065f95c.tar.bz2 linux-stable-d832269ac697067335952ba3a9c185027065f95c.zip |
tcp: exit if nothing to retransmit on RTO timeout
commit 88f8598d0a302a08380eadefd09b9f5cb1c4c428 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_timer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 9d775b8df57d..c719a41d2eba 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -443,10 +443,8 @@ void tcp_retransmit_timer(struct sock *sk) */ return; } - if (!tp->packets_out) - goto out; - - WARN_ON(tcp_rtx_queue_empty(sk)); + if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk))) + return; tp->tlp_high_seq = 0; |