Paolo Abeni
26736a08ee
tipc: don't call sock_release() in atomic context
...
syzbot reported a scheduling while atomic issue at netns
destruction time:
BUG: sleeping function called from invalid context at net/core/sock.c:2769
in_atomic(): 1, irqs_disabled(): 0, pid: 85, name: kworker/u4:3
5 locks held by kworker/u4:3/85:
#0 : ((wq_completion)"%s""netns"){+.+.}, at: [<00000000c9792deb>]
process_one_work+0xaaf/0x1af0 kernel/workqueue.c:2084
#1 : (net_cleanup_work){+.+.}, at: [<00000000adc12e2a>]
process_one_work+0xb01/0x1af0 kernel/workqueue.c:2088
#2 : (net_sem){++++}, at: [<000000009ccb5669>] cleanup_net+0x23f/0xd20
net/core/net_namespace.c:494
#3 : (net_mutex){+.+.}, at: [<00000000a92767d9>] cleanup_net+0xa7d/0xd20
net/core/net_namespace.c:496
#4 : (&(&srv->idr_lock)->rlock){+...}, at: [<000000001343e568>]
spin_lock_bh include/linux/spinlock.h:315 [inline]
#4 : (&(&srv->idr_lock)->rlock){+...}, at: [<000000001343e568>]
tipc_topsrv_stop+0x231/0x610 net/tipc/topsrv.c:685
CPU: 0 PID: 85 Comm: kworker/u4:3 Not tainted 4.16.0-rc1+ #230
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:53
___might_sleep+0x2b2/0x470 kernel/sched/core.c:6128
__might_sleep+0x95/0x190 kernel/sched/core.c:6081
lock_sock_nested+0x37/0x110 net/core/sock.c:2769
lock_sock include/net/sock.h:1463 [inline]
tipc_release+0x103/0xff0 net/tipc/socket.c:572
sock_release+0x8d/0x1e0 net/socket.c:594
tipc_topsrv_stop+0x3c0/0x610 net/tipc/topsrv.c:696
tipc_exit_net+0x15/0x40 net/tipc/core.c:96
ops_exit_list.isra.6+0xae/0x150 net/core/net_namespace.c:148
cleanup_net+0x6ba/0xd20 net/core/net_namespace.c:529
process_one_work+0xbbf/0x1af0 kernel/workqueue.c:2113
worker_thread+0x223/0x1990 kernel/workqueue.c:2247
kthread+0x33c/0x400 kernel/kthread.c:238
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:429
This is caused by tipc_topsrv_stop() releasing the listener socket
with the idr lock held. This changeset addresses the issue moving
the release operation outside such lock.
Reported-and-tested-by: syzbot+749d9d87c294c00ca856@syzkaller.appspotmail.com
Fixes: 0ef897be12b8 ("tipc: separate topology server listener socket from subcsriber sockets")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: ///jon
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-19 14:38:50 -05:00
..
2017-11-02 11:10:55 +01:00
2018-02-11 14:34:03 -08:00
2017-11-21 15:57:07 -08:00
2018-01-16 15:01:33 -05:00
2018-02-12 14:15:04 -05:00
2018-02-12 14:15:04 -05:00
2018-02-12 14:15:04 -05:00
2018-02-11 14:34:03 -08:00
2018-02-15 15:43:49 -05:00
2018-02-01 07:43:56 -08:00
2018-02-01 09:47:37 -05:00
2018-02-11 14:34:03 -08:00
2018-02-12 14:15:04 -05:00
2018-01-29 18:36:12 +01:00
2018-02-16 16:04:16 -05:00
2018-02-11 14:34:03 -08:00
2018-02-12 14:15:04 -05:00
2018-02-06 14:43:37 +00:00
2018-02-14 14:33:37 -05:00
2017-10-25 13:00:27 +09:00
2017-11-04 09:26:51 +09:00
2017-11-01 12:19:03 +09:00
2018-02-19 14:19:12 -05:00
2018-02-19 14:19:12 -05:00
2018-02-12 14:15:04 -05:00
2018-02-14 15:38:39 -05:00
2018-01-10 09:45:11 +01:00
2018-02-12 14:15:04 -05:00
2017-11-21 16:35:54 -08:00
2018-02-12 14:15:04 -05:00
2018-01-22 14:03:28 +01:00
2017-11-04 09:26:51 +09:00
2018-02-08 15:24:12 -05:00
2017-12-18 14:50:11 -05:00
2018-02-19 14:19:12 -05:00
2017-11-18 10:32:41 +09:00
2018-02-13 10:36:09 -05:00
2018-02-12 14:15:04 -05:00
2018-02-12 14:15:04 -05:00
2017-11-08 16:12:33 +09:00
2018-02-01 09:46:22 -05:00
2018-02-13 10:36:08 -05:00
2018-02-12 14:15:04 -05:00
2017-11-01 12:19:03 +09:00
2018-02-12 14:15:04 -05:00
2018-02-16 16:04:17 -05:00
2018-02-11 14:34:03 -08:00
2018-02-12 14:15:04 -05:00
2018-02-11 14:34:03 -08:00
2018-02-16 16:05:51 -05:00
2018-02-13 13:56:31 -05:00
2018-02-12 14:15:04 -05:00
2017-12-28 14:28:22 -05:00
2018-02-12 14:15:04 -05:00
2017-11-10 13:41:40 +09:00
2018-02-19 14:38:50 -05:00
2018-02-06 11:39:31 +01:00
2018-02-13 10:36:08 -05:00
2018-02-12 14:15:04 -05:00
2017-11-02 11:10:55 +01:00
2018-02-19 14:19:09 -05:00
2018-02-12 14:15:04 -05:00
2018-02-13 10:36:08 -05:00
2017-09-20 15:36:18 -07:00
2018-02-01 09:51:57 -08:00
2017-11-28 13:55:00 +01:00
2018-02-15 15:34:42 -05:00
2018-02-13 10:36:05 -05:00