Paolo Abeni
b4f166651d
mptcp: fix sleep in atomic at close time
...
Matt reported a splat at msk close time:
BUG: sleeping function called from invalid context at net/mptcp/protocol.c:2877
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 155, name: packetdrill
preempt_count: 201, expected: 0
RCU nest depth: 0, expected: 0
4 locks held by packetdrill/155:
#0 : ffff888001536990 (&sb->s_type->i_mutex_key#6){+.+.}-{3:3}, at: __sock_release (net/socket.c:650)
#1 : ffff88800b498130 (sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close (net/mptcp/protocol.c:2973)
#2 : ffff88800b49a130 (sk_lock-AF_INET/1){+.+.}-{0:0}, at: __mptcp_close_ssk (net/mptcp/protocol.c:2363)
#3 : ffff88800b49a0b0 (slock-AF_INET){+...}-{2:2}, at: __lock_sock_fast (include/net/sock.h:1820)
Preemption disabled at:
0x0
CPU: 1 PID: 155 Comm: packetdrill Not tainted 6.1.0-rc5 #365
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl (lib/dump_stack.c:107 (discriminator 4))
__might_resched.cold (kernel/sched/core.c:9891)
__mptcp_destroy_sock (include/linux/kernel.h:110)
__mptcp_close (net/mptcp/protocol.c:2959)
mptcp_subflow_queue_clean (include/net/sock.h:1777)
__mptcp_close_ssk (net/mptcp/protocol.c:2363)
mptcp_destroy_common (net/mptcp/protocol.c:3170)
mptcp_destroy (include/net/sock.h:1495)
__mptcp_destroy_sock (net/mptcp/protocol.c:2886)
__mptcp_close (net/mptcp/protocol.c:2959)
mptcp_close (net/mptcp/protocol.c:2974)
inet_release (net/ipv4/af_inet.c:432)
__sock_release (net/socket.c:651)
sock_close (net/socket.c:1367)
__fput (fs/file_table.c:320)
task_work_run (kernel/task_work.c:181 (discriminator 1))
exit_to_user_mode_prepare (include/linux/resume_user_mode.h:49)
syscall_exit_to_user_mode (kernel/entry/common.c:130)
do_syscall_64 (arch/x86/entry/common.c:87)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
We can't call mptcp_close under the 'fast' socket lock variant, replace
it with a sock_lock_nested() as the relevant code is already under the
listening msk socket lock protection.
Reported-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/316
Fixes: 30e51b923e43 ("mptcp: fix unreleased socket in accept queue")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-28 18:03:07 -08:00
..
2022-11-28 11:09:13 +00:00
2022-10-11 17:42:55 -06:00
2022-08-25 10:33:21 +02:00
2022-10-15 11:08:36 +01:00
2022-08-22 17:55:50 -07:00
2022-09-22 13:02:10 -07:00
2022-11-02 16:37:00 -07:00
2022-11-04 16:22:34 +01:00
2022-11-15 13:38:11 +01:00
2022-11-14 10:51:13 +00:00
2022-11-07 14:00:27 +01:00
2022-10-16 15:27:07 -07:00
2022-11-23 19:18:59 -08:00
2022-11-22 20:15:37 -08:00
2022-11-15 20:50:52 -08:00
2022-08-25 10:33:21 +02:00
2022-10-24 19:08:07 -07:00
2022-10-18 19:18:27 -07:00
2022-10-07 09:29:17 +02:00
2022-11-28 16:56:04 -08:00
2022-11-23 19:18:59 -08:00
2022-11-15 12:42:26 +01:00
2022-11-22 07:14:55 +01:00
2022-11-23 12:45:19 +00:00
2022-11-25 12:45:53 +01:00
2022-10-24 11:07:39 +02:00
2022-11-09 19:26:08 -08:00
2022-08-29 13:02:27 +01:00
2022-11-28 18:03:07 -08:00
2022-08-29 12:47:15 +01:00
2022-11-22 22:17:12 +01:00
2022-08-29 12:47:15 +01:00
2022-10-27 08:20:21 -07:00
2022-11-22 12:42:23 +01:00
2022-11-18 15:21:00 +01:00
2022-10-11 17:42:55 -06:00
2022-08-29 12:47:15 +01:00
2022-08-15 11:21:42 +01:00
2022-10-11 17:42:58 -06:00
2022-11-02 11:57:30 +00:00
2022-11-18 12:05:44 +00:00
2022-11-22 12:16:55 +01:00
2022-11-07 19:59:01 -08:00
2022-11-02 20:42:09 -07:00
2022-07-08 18:38:44 -07:00
2022-10-27 15:52:10 -04:00
2022-11-21 20:50:24 -08:00
2022-11-11 20:08:17 -08:00
2022-10-28 20:21:25 -07:00
2022-11-03 10:49:29 +01:00
2022-11-25 12:43:14 +01:00
2022-11-15 20:22:19 -08:00
2022-10-03 17:44:18 -07:00
2022-11-23 19:18:59 -08:00
2022-09-20 08:23:20 -07:00
2022-08-22 14:26:30 +01:00
2022-09-20 14:23:56 -07:00
2022-08-22 14:26:30 +01:00
2022-10-06 16:55:41 -07:00