syzbot


BUG: sleeping function called from invalid context in lock_sock_nested

Status: fixed on 2020/02/18 14:31
Reported-by: syzbot+c2f1558d49e25cc36e5e@syzkaller.appspotmail.com
Fix commit: 37f96694cf73 crypto: af_alg - Use bh_lock_sock in sk_destruct
First crash: 942d, last: 867d
similar bugs (6):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 BUG: sleeping function called from invalid context in lock_sock_nested (2) C done 3909 296d 389d 1/1 fixed on 2021/10/12 13:38
upstream BUG: sleeping function called from invalid context in lock_sock_nested (2) C done error 19391 327d 863d 22/22 fixed on 2021/11/10 13:22
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested 1 1098d 1098d 0/1 auto-closed as invalid on 2019/10/30 11:24
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested (2) syz done 1 882d 942d 1/1 fixed on 2020/03/04 10:17
linux-4.19 BUG: sleeping function called from invalid context in lock_sock_nested syz done 1 912d 942d 1/1 fixed on 2020/02/05 13:33
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested (3) syz 144 15d 389d 0/1 upstream: reported syz repro on 2021/06/10 20:33

Sample crash report:
BUG: sleeping function called from invalid context at net/core/sock.c:2935
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3198, name: kworker/0:112
4 locks held by kworker/0:112/3198:
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: __write_once_size include/linux/compiler.h:226 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: atomic64_set include/asm-generic/atomic-instrumented.h:855 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: atomic_long_set include/asm-generic/atomic-long.h:40 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: set_work_data kernel/workqueue.c:615 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: set_work_pool_and_clear_pending kernel/workqueue.c:642 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: process_one_work+0x88b/0x1740 kernel/workqueue.c:2235
 #1: ffffc9000951fdc0 ((work_completion)(&map->work)){+.+.}, at: process_one_work+0x8c1/0x1740 kernel/workqueue.c:2239
 #2: ffffffff899a3f00 (rcu_read_lock){....}, at: sock_hash_free+0x0/0x540 net/core/sock_map.c:317
 #3: ffffc90002478d20 (&htab->buckets[i].lock){+...}, at: sock_hash_free+0x131/0x540 net/core/sock_map.c:865
Preemption disabled at:
[<ffffffff86341331>] sock_hash_free+0x131/0x540 net/core/sock_map.c:865
CPU: 0 PID: 3198 Comm: kworker/0:112 Not tainted 5.5.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events bpf_map_free_deferred
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 ___might_sleep.cold+0x1fb/0x23e kernel/sched/core.c:6800
 __might_sleep+0x95/0x190 kernel/sched/core.c:6753
 lock_sock_nested+0x39/0x120 net/core/sock.c:2935
 lock_sock include/net/sock.h:1531 [inline]
 sock_hash_free+0x29f/0x540 net/core/sock_map.c:868
 bpf_map_free_deferred+0xb3/0x100 kernel/bpf/syscall.c:327
 process_one_work+0x9af/0x1740 kernel/workqueue.c:2264
 worker_thread+0x98/0xe40 kernel/workqueue.c:2410
 kthread+0x361/0x430 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
BUG: scheduling while atomic: kworker/0:112/3198/0x00000202
4 locks held by kworker/0:112/3198:
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: __write_once_size include/linux/compiler.h:226 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: atomic64_set include/asm-generic/atomic-instrumented.h:855 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: atomic_long_set include/asm-generic/atomic-long.h:40 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: set_work_data kernel/workqueue.c:615 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: set_work_pool_and_clear_pending kernel/workqueue.c:642 [inline]
 #0: ffff8880aa426d28 ((wq_completion)events){+.+.}, at: process_one_work+0x88b/0x1740 kernel/workqueue.c:2235
 #1: ffffc9000951fdc0 ((work_completion)(&map->work)){+.+.}, at: process_one_work+0x8c1/0x1740 kernel/workqueue.c:2239
 #2: ffffffff899a3f00 (rcu_read_lock){....}, at: sock_hash_free+0x0/0x540 net/core/sock_map.c:317
 #3: ffffc90002478d20 (&htab->buckets[i].lock){+...}, at: sock_hash_free+0x131/0x540 net/core/sock_map.c:865
Modules linked in:
Preemption disabled at:
[<ffffffff86341331>] sock_hash_free+0x131/0x540 net/core/sock_map.c:865

Crashes (1232):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-this-kasan-gce 2020/01/17 09:38 net 93ad0f969fc7 3de7aabb .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/02/16 06:35 upstream 829e69446995 5d7b90f1 .config log report syz
ci-upstream-kasan-gce-smack-root 2020/02/13 14:23 upstream f2850dd5ee01 84f4fc8a .config log report syz
ci-upstream-kasan-gce-selinux-root 2020/02/13 07:41 upstream f2850dd5ee01 84f4fc8a .config log report syz
ci-upstream-kasan-gce-root 2020/02/11 18:36 upstream 0a679e13ea30 4d1ab643 .config log report syz
ci-upstream-kasan-gce-smack-root 2020/02/10 02:30 upstream d1ea35f4cdd4 35f5e45e .config log report syz
ci-upstream-kasan-gce-root 2020/02/10 02:02 upstream d1ea35f4cdd4 35f5e45e .config log report syz
ci-upstream-kasan-gce-smack-root 2020/02/08 13:35 upstream f757165705e9 06150bf1 .config log report syz
ci-upstream-kasan-gce 2019/12/05 01:44 upstream 63de37476ebd b2088328 .config log report syz
ci-upstream-net-this-kasan-gce 2020/02/10 02:38 net fdfa3a6778b1 35f5e45e .config log report syz
ci-upstream-net-this-kasan-gce 2020/02/08 05:02 net 73a21fa817f0 06150bf1 .config log report syz
ci-upstream-net-kasan-gce 2020/02/13 19:26 net-next fdfa3a6778b1 c5ed587f .config log report syz
ci-upstream-net-kasan-gce 2020/02/10 03:25 net-next fdfa3a6778b1 35f5e45e .config log report syz
ci-upstream-net-kasan-gce 2020/02/08 07:08 net-next 33b40134e5cf 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/15 00:36 linux-next 9f01828e9e16 5d7b90f1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/09 20:24 linux-next 6dff1565d69c 6ece2ea5 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/09 08:06 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 22:53 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 21:57 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 21:29 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 20:49 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 14:59 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 13:16 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 11:49 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 09:12 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 05:54 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 04:54 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 02:55 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/08 01:44 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 22:25 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 21:32 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 19:05 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 18:24 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 17:03 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 13:15 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 12:50 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 11:03 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 10:26 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 09:07 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 08:19 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 07:35 linux-next 6dff1565d69c 06150bf1 .config log report syz
ci-upstream-linux-next-kasan-gce-root 2020/02/07 01:04 linux-next a0c61bf1c773 c91cbc9d .config log report syz
ci-upstream-kasan-gce-selinux-root 2020/02/17 10:06 upstream 11a48a5a18c6 2b411596 .config log report
ci-upstream-kasan-gce-root 2020/02/16 22:30 upstream 11a48a5a18c6 1f448cd6 .config log report
ci-upstream-kasan-gce-root 2020/02/16 11:07 upstream db70e26e33ee cf914200 .config log report
ci-upstream-kasan-gce-smack-root 2020/02/15 20:38 upstream 829e69446995 5d7b90f1 .config log report
ci-upstream-kasan-gce-smack-root 2020/02/15 20:38 upstream 829e69446995 5d7b90f1 .config log report
ci-upstream-kasan-gce-root 2020/02/15 19:37 upstream 829e69446995 5d7b90f1 .config log report
ci-upstream-kasan-gce-root 2020/02/14 23:25 upstream 2019fc96af22 5d7b90f1 .config log report
ci-upstream-kasan-gce-root 2020/02/14 17:40 upstream b19e8c684703 5d7b90f1 .config log report
ci-qemu-upstream 2020/01/27 08:19 upstream d5226fa6dbae dd56146d .config log report
ci-upstream-net-this-kasan-gce 2020/02/18 01:06 net a81541041ceb 1ce142dc .config log report
ci-upstream-net-this-kasan-gce 2020/02/17 19:09 net 0d4597c8c5ab 2b411596 .config log report
ci-upstream-net-this-kasan-gce 2020/02/15 16:36 net 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-this-kasan-gce 2020/02/15 10:37 net 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-this-kasan-gce 2020/02/14 20:46 net a1fa83bdab78 5d7b90f1 .config log report
ci-upstream-net-this-kasan-gce 2020/02/13 23:13 net 6ee2deb6fbed c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/18 13:34 net-next 725d23b59cd1 1ce142dc .config log report
ci-upstream-net-kasan-gce 2020/02/18 11:23 net-next 725d23b59cd1 1ce142dc .config log report
ci-upstream-net-kasan-gce 2020/02/17 22:08 net-next ce7805513d90 2b411596 .config log report
ci-upstream-net-kasan-gce 2020/02/17 16:43 net-next ce7805513d90 2b411596 .config log report
ci-upstream-net-kasan-gce 2020/02/16 21:26 net-next 2019fc96af22 cf914200 .config log report
ci-upstream-net-kasan-gce 2020/02/16 19:53 net-next 2019fc96af22 cf914200 .config log report
ci-upstream-net-kasan-gce 2020/02/16 09:54 net-next 2019fc96af22 cf914200 .config log report
ci-upstream-net-kasan-gce 2020/02/16 08:06 net-next 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/16 04:58 net-next 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/16 01:35 net-next 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/15 12:23 net-next 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/14 23:08 net-next 2019fc96af22 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/14 19:32 net-next fdfa3a6778b1 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/14 16:33 net-next fdfa3a6778b1 5d7b90f1 .config log report
ci-upstream-net-kasan-gce 2020/02/14 05:22 net-next fdfa3a6778b1 c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/13 20:49 net-next fdfa3a6778b1 c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/13 17:53 net-next fdfa3a6778b1 c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/13 16:36 net-next fdfa3a6778b1 c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/13 15:59 net-next fdfa3a6778b1 c5ed587f .config log report
ci-upstream-net-kasan-gce 2020/02/13 12:42 net-next fdfa3a6778b1 84f4fc8a .config log report
ci-upstream-net-kasan-gce 2020/02/13 11:24 net-next fdfa3a6778b1 84f4fc8a .config log report
ci-upstream-net-kasan-gce 2020/02/13 10:14 net-next fdfa3a6778b1 84f4fc8a .config log report
ci-upstream-net-kasan-gce 2020/02/13 08:47 net-next fdfa3a6778b1 84f4fc8a .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/18 02:20 linux-next c25a951c50dc 1ce142dc .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/17 11:06 linux-next c25a951c50dc 2b411596 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/17 07:00 linux-next c25a951c50dc 1f448cd6 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/16 10:00 linux-next 9f01828e9e16 cf914200 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/16 03:31 linux-next 9f01828e9e16 5d7b90f1 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/16 00:19 linux-next 9f01828e9e16 5d7b90f1 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/14 07:14 linux-next 9f01828e9e16 5d7b90f1 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/14 06:12 linux-next 9f01828e9e16 5d7b90f1 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/14 04:21 linux-next 9f01828e9e16 c5ed587f .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/14 03:14 linux-next 9f01828e9e16 c5ed587f .config log report