Paolo Abeni
c09ddc6058
net: relax socket state check at accept time.
...
[ Upstream commit 26afda78cda3da974fd4c287962c169e9462c495 ]
Christoph reported the following splat:
WARNING: CPU: 1 PID: 772 at net/ipv4/af_inet.c:761 __inet_accept+0x1f4/0x4a0
Modules linked in:
CPU: 1 PID: 772 Comm: syz-executor510 Not tainted 6.9.0-rc7-g7da7119fe22b #56
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014
RIP: 0010:__inet_accept+0x1f4/0x4a0 net/ipv4/af_inet.c:759
Code: 04 38 84 c0 0f 85 87 00 00 00 41 c7 04 24 03 00 00 00 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc e8 ec b7 da fd <0f> 0b e9 7f fe ff ff e8 e0 b7 da fd 0f 0b e9 fe fe ff ff 89 d9 80
RSP: 0018:ffffc90000c2fc58 EFLAGS: 00010293
RAX: ffffffff836bdd14 RBX: 0000000000000000 RCX: ffff888104668000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff836bdb89 R09: fffff52000185f64
R10: dffffc0000000000 R11: fffff52000185f64 R12: dffffc0000000000
R13: 1ffff92000185f98 R14: ffff88810754d880 R15: ffff8881007b7800
FS: 000000001c772880(0000) GS:ffff88811b280000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb9fcf2e178 CR3: 00000001045d2002 CR4: 0000000000770ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
inet_accept+0x138/0x1d0 net/ipv4/af_inet.c:786
do_accept+0x435/0x620 net/socket.c:1929
__sys_accept4_file net/socket.c:1969 [inline]
__sys_accept4+0x9b/0x110 net/socket.c:1999
__do_sys_accept net/socket.c:2016 [inline]
__se_sys_accept net/socket.c:2013 [inline]
__x64_sys_accept+0x7d/0x90 net/socket.c:2013
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x58/0x100 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x4315f9
Code: fd ff 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 ab b4 fd ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffdb26d9c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002b
RAX: ffffffffffffffda RBX: 0000000000400300 RCX: 00000000004315f9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006e1018 R08: 0000000000400300 R09: 0000000000400300
R10: 0000000000400300 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000040cdf0 R14: 000000000040ce80 R15: 0000000000000055
</TASK>
The reproducer invokes shutdown() before entering the listener status.
After commit 94062790aedb ("tcp: defer shutdown(SEND_SHUTDOWN) for
TCP_SYN_RECV sockets"), the above causes the child to reach the accept
syscall in FIN_WAIT1 status.
Eric noted we can relax the existing assertion in __inet_accept()
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/490
Suggested-by: Eric Dumazet <edumazet@google.com>
Fixes: 94062790aedb ("tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets")
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/23ab880a44d8cfd967e84de8b93dbf48848e3d8c.1716299669.git.pabeni@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:03:53 +02:00
..
2024-04-17 11:18:25 +02:00
2024-06-12 11:03:53 +02:00
2022-09-29 07:17:59 +02:00
2024-03-01 13:26:39 +01:00
2022-09-10 17:27:32 -07:00
2022-07-08 12:10:33 +01:00
2023-08-30 16:11:02 +02:00
2024-03-01 13:26:36 +01:00
2023-06-28 11:12:29 +02:00
2023-10-25 12:03:06 +02:00
2023-03-22 13:33:50 +01:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2022-04-30 15:12:58 +01:00
2023-10-25 12:03:11 +02:00
2023-10-25 12:03:11 +02:00
2022-08-29 12:47:15 +01:00
2022-08-25 10:33:21 +02:00
2024-05-02 16:29:23 +02:00
2023-12-08 08:51:17 +01:00
2024-04-10 16:28:29 +02:00
2024-03-26 18:20:31 -04:00
2024-04-10 16:28:23 +02:00
2024-06-12 11:03:12 +02:00
2024-03-26 18:20:58 -04:00
2022-07-08 12:10:33 +01:00
2022-07-15 11:49:55 +01:00
2024-04-10 16:28:23 +02:00
2024-04-10 16:28:27 +02:00
2023-09-19 12:28:01 +02:00
2022-01-29 17:53:07 +00:00
2024-02-05 20:13:02 +00:00
2024-02-05 20:13:00 +00:00
2024-02-16 19:06:26 +01:00
2024-03-26 18:20:41 -04:00
2023-08-23 17:52:32 +02:00
2022-09-29 07:18:00 +02:00
2022-08-04 11:31:20 -07:00
2022-10-03 07:59:06 +01:00
2022-06-24 11:34:38 +01:00
2024-03-26 18:20:42 -04:00
2022-11-16 13:02:04 +00:00
2023-02-01 08:34:45 +01:00
2022-05-16 13:03:29 +02:00
2023-10-10 22:00:42 +02:00
2023-04-13 16:55:24 +02:00
2022-09-20 10:21:49 -07:00
2023-04-13 16:55:23 +02:00
2024-03-26 18:21:00 -04:00
2024-05-02 16:29:24 +02:00
2023-11-20 11:51:54 +01:00
2023-10-19 23:08:54 +02:00
2022-07-21 20:59:42 -07:00
2022-04-06 12:05:41 -07:00
2023-10-25 12:03:13 +02:00
2022-10-16 15:27:07 -07:00
2022-04-07 20:33:15 -07:00
2022-07-21 20:59:42 -07:00
2024-06-12 11:03:51 +02:00
2022-09-20 10:21:49 -07:00
2023-07-27 08:50:49 +02:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2024-05-17 11:56:11 +02:00
2024-06-12 11:03:13 +02:00
2022-04-06 12:05:41 -07:00
2023-11-20 11:51:53 +01:00
2024-03-26 18:20:58 -04:00
2022-04-06 12:05:41 -07:00
2023-06-14 11:15:20 +02:00
2024-05-17 11:56:11 +02:00
2022-04-28 13:02:01 -07:00
2023-10-25 12:03:06 +02:00
2022-04-06 12:05:41 -07:00
2023-09-13 09:42:32 +02:00
2023-01-24 07:24:43 +01:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2024-05-17 11:56:11 +02:00
2023-03-17 08:50:24 +01:00
2021-07-13 09:28:29 -07:00
2022-04-12 15:00:25 +02:00
2024-05-17 11:56:02 +02:00
2024-01-10 17:10:28 +01:00
2022-02-23 12:35:00 +00:00
2024-06-12 11:03:12 +02:00
2023-05-30 14:03:20 +01:00
2024-05-17 11:56:10 +02:00
2022-06-09 21:52:55 -07:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00