Davide Caratti
767d3ded5f
net: mptcp: don't hang before sending 'MP capable with data'
...
the following packetdrill script
socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
> S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8,mpcapable v1 flags[flag_h] nokey>
< S. 0:0(0) ack 1 win 65535 <mss 1460,sackOK,TS val 700 ecr 100,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey=2]>
> . 1:1(0) ack 1 win 256 <nop, nop, TS val 100 ecr 700,mpcapable v1 flags[flag_h] key[ckey,skey]>
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
fcntl(3, F_SETFL, O_RDWR) = 0
write(3, ..., 1000) = 1000
doesn't transmit 1KB data packet after a successful three-way-handshake,
using mp_capable with data as required by protocol v1, and write() hangs
forever:
PID: 973 TASK: ffff97dd399cae80 CPU: 1 COMMAND: "packetdrill"
#0 [ffffa9b94062fb78] __schedule at ffffffff9c90a000
#1 [ffffa9b94062fc08] schedule at ffffffff9c90a4a0
#2 [ffffa9b94062fc18] schedule_timeout at ffffffff9c90e00d
#3 [ffffa9b94062fc90] wait_woken at ffffffff9c120184
#4 [ffffa9b94062fcb0] sk_stream_wait_connect at ffffffff9c75b064
#5 [ffffa9b94062fd20] mptcp_sendmsg at ffffffff9c8e801c
#6 [ffffa9b94062fdc0] sock_sendmsg at ffffffff9c747324
#7 [ffffa9b94062fdd8] sock_write_iter at ffffffff9c7473c7
#8 [ffffa9b94062fe48] new_sync_write at ffffffff9c302976
#9 [ffffa9b94062fed0] vfs_write at ffffffff9c305685
#10 [ffffa9b94062ff00] ksys_write at ffffffff9c305985
#11 [ffffa9b94062ff38] do_syscall_64 at ffffffff9c004475
#12 [ffffa9b94062ff50] entry_SYSCALL_64_after_hwframe at ffffffff9ca0008c
RIP: 00007f959407eaf7 RSP: 00007ffe9e95a910 RFLAGS: 00000293
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f959407eaf7
RDX: 00000000000003e8 RSI: 0000000001785fe0 RDI: 0000000000000008
RBP: 0000000001785fe0 R8: 0000000000000000 R9: 0000000000000003
R10: 0000000000000007 R11: 0000000000000293 R12: 00000000000003e8
R13: 00007ffe9e95ae30 R14: 0000000000000000 R15: 0000000000000000
ORIG_RAX: 0000000000000001 CS: 0033 SS: 002b
Fix it ensuring that socket state is TCP_ESTABLISHED on reception of the
third ack.
Fixes: 1954b86016cf ("mptcp: Check connection state before attempting send")
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-11 23:59:11 -07:00
..
2019-09-27 15:10:34 -07:00
2020-02-24 13:02:53 -08:00
2020-02-17 14:30:54 -08:00
2019-09-24 16:37:18 +02:00
2020-02-04 03:05:26 +00:00
2020-01-09 18:41:40 -08:00
2020-02-17 22:43:42 +01:00
2020-01-26 10:34:17 +02:00
2020-02-24 16:20:09 -08:00
2020-02-04 01:53:07 +09:00
2020-02-24 11:11:19 -08:00
2020-01-24 08:12:06 +01:00
2019-12-08 11:52:02 +01:00
2020-02-08 13:26:41 -08:00
2020-03-11 23:17:28 -07:00
2020-02-29 15:53:35 -08:00
2020-01-09 18:41:40 -08:00
2020-03-08 21:07:48 -07:00
2020-01-27 11:09:31 +01:00
2020-03-05 12:12:34 -08:00
2020-03-05 11:59:47 -08:00
2019-11-02 13:54:56 -07:00
2019-09-26 08:56:17 +02:00
2020-03-11 23:19:41 -07:00
2020-03-03 14:50:08 -08:00
2019-12-09 10:36:44 -08:00
2020-02-24 16:20:09 -08:00
2020-02-28 12:08:37 -08:00
2020-02-26 20:38:13 -08:00
2020-02-27 18:31:39 -08:00
2020-02-28 12:08:37 -08:00
2020-03-11 23:59:11 -07:00
2020-01-09 18:36:22 -08:00
2020-02-26 23:25:07 +01:00
2020-02-18 12:44:23 -08:00
2020-03-11 23:19:41 -07:00
2020-02-24 13:26:49 -08:00
2020-02-17 19:05:05 -08:00
2020-02-21 13:39:34 -08:00
2020-01-29 14:55:47 -08:00
2020-01-03 12:25:50 -08:00
2019-11-26 14:40:13 -08:00
2020-03-03 17:52:21 -08:00
2020-02-16 18:37:09 -08:00
2019-12-16 10:15:49 +01:00
2020-01-26 10:40:21 +01:00
2020-02-07 11:20:57 +01:00
2020-03-11 23:17:28 -07:00
2020-02-29 15:53:35 -08:00
2020-02-27 18:31:39 -08:00
2020-02-13 15:35:33 -05:00
2020-02-26 20:58:33 -08:00
2020-02-10 10:23:00 +01:00
2020-02-21 15:22:45 -08:00
2020-02-28 12:12:53 -08:00
2020-02-27 18:31:39 -08:00
2020-02-27 18:31:39 -08:00
2020-02-16 18:59:42 -08:00
2020-02-28 12:08:37 -08:00
2020-02-28 12:12:53 -08:00
2019-11-15 14:38:29 +01:00
2020-02-20 15:02:02 -08:00
2020-01-24 13:44:07 +01:00
2020-01-08 15:02:21 -08:00