Skip to content

Commit

Permalink
mptcp: validate TFO_CONNECT with blocking sendmsg
Browse files Browse the repository at this point in the history
Our CI found a deadlock when validating MSG_FASTOPEN, see:

  https://cirrus-ci.com/task/6007236538400768

Paolo noticed it can also happen with TCP_CONNECT_FASTOPEN.

Here is a new test to reproduce the deadlock. The calltrace is visible
when the test is stopped (timeout or CTRL+C).

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
(cherry picked from commit b047d8a)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
matttbe committed Oct 14, 2022
1 parent 0f0f876 commit 99fc45e
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Send data in SYN with a blocking sendto()
--tolerance_usecs=100000
`../common/defaults.sh
sysctl -q net.ipv4.tcp_fastopen=0x5`

0.0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0.0 setsockopt(3, SOL_TCP, TCP_FASTOPEN_CONNECT, [1], 4) = 0
+0.0 connect(3, ..., ...) = 0

// Switch to "blocking" mode, only the msk should be "blocked"
+0.0 fcntl(3, F_SETFL, O_RDWR) = 0
+0...0.4 sendto(3, ..., 500, 0, ..., ...) = 500

+0.0 > S 0:500(500) <mss 1460, sackOK, TS val 100 ecr 0, nop, wscale 8, mpcapable v1 flags[flag_h] nokey>
+0.4 < S. 0:0(0) ack 501 win 65535 <mss 1460, sackOK, TS val 700 ecr 100, nop, wscale 8, mpcapable v1 flags[flag_h] key[skey=2]>
+0.0 > . 501:501(0) ack 1 <nop, nop, TS val 100 ecr 700, mpcapable v1 flags[flag_h] key[ckey, skey]>

0 comments on commit 99fc45e

Please sign in to comment.