From: Eric Dumazet <eduma...@google.com> Date: Thu, 26 Sep 2019 15:42:51 -0700
> Yuchung Cheng and Marek Majkowski independently reported a weird > behavior of TCP_USER_TIMEOUT option when used at connect() time. > > When the TCP_USER_TIMEOUT is reached, tcp_write_timeout() > believes the flow should live, and the following condition > in tcp_clamp_rto_to_user_timeout() programs one jiffie timers : > > remaining = icsk->icsk_user_timeout - elapsed; > if (remaining <= 0) > return 1; /* user timeout has passed; fire ASAP */ > > This silly situation ends when the max syn rtx count is reached. > > This patch makes sure we honor both TCP_SYNCNT and TCP_USER_TIMEOUT, > avoiding these spurious SYN packets. > > Fixes: b701a99e431d ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to > improve accuracy") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Reported-by: Yuchung Cheng <ych...@google.com> > Reported-by: Marek Majkowski <ma...@cloudflare.com> > Cc: Jon Maxwell <jmaxwel...@gmail.com> > Link: https://marc.info/?l=linux-netdev&m=156940118307949&w=2 Applied and queued up for -stable.