netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tcp: fix retrans timestamp on passive Fast Open
@ 2019-05-10 23:00 Yuchung Cheng
  2019-05-10 23:41 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Yuchung Cheng @ 2019-05-10 23:00 UTC (permalink / raw)
  To: davem; +Cc: netdev, ncardwell, Yuchung Cheng

Commit 3844718c20d0 ("tcp: properly track retry time on
passive Fast Open") sets the start of SYNACK retransmission
time on passive Fast Open in "retrans_stamp". However the
timestamp is not reset upon the handshake has completed. As a
result, future data packet retransmission may not update it in
tcp_retransmit_skb(). This may lead to socket aborting earlier
unexpectedly by retransmits_timed_out() since retrans_stamp remains
the SYNACK rtx time.

This bug only manifests on passive TFO sender that a) suffered
SYNACK timeout and then b) stalls on very first loss recovery. Any
successful loss recovery would reset the timestamp to avoid this
issue.

Fixes: 3844718c20d0 ("tcp: properly track retry time on passive Fast Open")
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_input.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 20f6fac5882e..cf69f50855ea 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6024,6 +6024,9 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
 static void tcp_rcv_synrecv_state_fastopen(struct sock *sk)
 {
 	tcp_try_undo_loss(sk, false);
+
+	/* Reset rtx states to prevent spurious retransmits_timed_out() */
+	tcp_sk(sk)->retrans_stamp = 0;
 	inet_csk(sk)->icsk_retransmits = 0;
 
 	/* Once we leave TCP_SYN_RECV or TCP_FIN_WAIT_1,
-- 
2.21.0.1020.gf2820cf01a-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] tcp: fix retrans timestamp on passive Fast Open
  2019-05-10 23:00 [PATCH net] tcp: fix retrans timestamp on passive Fast Open Yuchung Cheng
@ 2019-05-10 23:41 ` David Miller
  2019-05-13 17:31   ` Yuchung Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2019-05-10 23:41 UTC (permalink / raw)
  To: ycheng; +Cc: netdev, ncardwell

From: Yuchung Cheng <ycheng@google.com>
Date: Fri, 10 May 2019 16:00:19 -0700

> Fixes: 3844718c20d0 ("tcp: properly track retry time on passive Fast Open")

This is not a valid commit ID.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] tcp: fix retrans timestamp on passive Fast Open
  2019-05-10 23:41 ` David Miller
@ 2019-05-13 17:31   ` Yuchung Cheng
  0 siblings, 0 replies; 3+ messages in thread
From: Yuchung Cheng @ 2019-05-13 17:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell

From: David Miller <davem@davemloft.net>
Date: Fri, May 10, 2019 at 4:41 PM
To: <ycheng@google.com>
Cc: <netdev@vger.kernel.org>, <ncardwell@google.com>

> From: Yuchung Cheng <ycheng@google.com>
> Date: Fri, 10 May 2019 16:00:19 -0700
>
> > Fixes: 3844718c20d0 ("tcp: properly track retry time on passive Fast Open")
>
> This is not a valid commit ID.
Oops submitting a v2. sorry for the typo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-13 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 23:00 [PATCH net] tcp: fix retrans timestamp on passive Fast Open Yuchung Cheng
2019-05-10 23:41 ` David Miller
2019-05-13 17:31   ` Yuchung Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).