diff options
author | Eric Dumazet <edumazet@google.com> | 2019-02-15 13:36:20 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-23 09:07:26 +0100 |
commit | df1b583c1654133825d4a9e5e7e048d0edb32bda (patch) | |
tree | da39f0af471a026a7e6e756c5ec544db1ad54284 /net/ipv4 | |
parent | 56e97e70f7e36a678ef1847a0b0e2d46caa7ac40 (diff) | |
download | linux-stable-df1b583c1654133825d4a9e5e7e048d0edb32bda.tar.gz linux-stable-df1b583c1654133825d4a9e5e7e048d0edb32bda.tar.bz2 linux-stable-df1b583c1654133825d4a9e5e7e048d0edb32bda.zip |
tcp: clear icsk_backoff in tcp_write_queue_purge()
[ Upstream commit 04c03114be82194d4a4858d41dba8e286ad1787c ]
soukjin bae reported a crash in tcp_v4_err() handling
ICMP_DEST_UNREACH after tcp_write_queue_head(sk)
returned a NULL pointer.
Current logic should have prevented this :
if (seq != tp->snd_una || !icsk->icsk_retransmits ||
!icsk->icsk_backoff || fastopen)
break;
Problem is the write queue might have been purged
and icsk_backoff has not been cleared.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: soukjin bae <soukjin.bae@samsung.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 87fe44197aa1..432dc9af1172 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2519,6 +2519,7 @@ void tcp_write_queue_purge(struct sock *sk) sk_mem_reclaim(sk); tcp_clear_all_retrans_hints(tcp_sk(sk)); tcp_sk(sk)->packets_out = 0; + inet_csk(sk)->icsk_backoff = 0; } int tcp_disconnect(struct sock *sk, int flags) @@ -2567,7 +2568,6 @@ int tcp_disconnect(struct sock *sk, int flags) tp->write_seq += tp->max_window + 2; if (tp->write_seq == 0) tp->write_seq = 1; - icsk->icsk_backoff = 0; tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; |