tcp: clear icsk_backoff in tcp_write_queue_purge()
authorEric Dumazet <edumazet@google.com>
Fri, 15 Feb 2019 21:36:20 +0000 (13:36 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Feb 2019 08:07:26 +0000 (09:07 +0100)
commitdf1b583c1654133825d4a9e5e7e048d0edb32bda
treeda39f0af471a026a7e6e756c5ec544db1ad54284
parent56e97e70f7e36a678ef1847a0b0e2d46caa7ac40
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>
net/ipv4/tcp.c