syzbot


BUG: sleeping function called from invalid context in lock_sock_nested

Status: fixed on 2020/02/18 14:31
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+c2f1558d49e25cc36e5e@syzkaller.appspotmail.com
Fix commit: 37f96694cf73 crypto: af_alg - Use bh_lock_sock in sk_destruct
First crash: 1396d, last: 1320d
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 3.16 00/99] 3.16.84-rc1 review 112 (112) 2020/05/22 00:00
[PATCH 4.4 00/53] 4.4.213-stable review 63 (63) 2020/02/05 22:37
[PATCH 4.14 00/89] 4.14.170-stable review 93 (93) 2020/02/04 17:19
[PATCH 4.9 00/68] 4.9.213-stable review 72 (72) 2020/02/04 17:18
[PATCH 5.5 00/56] 5.5.1-stable review 66 (66) 2020/01/31 22:33
[PATCH 4.19 00/55] 4.19.101-stable review 66 (66) 2020/01/31 21:44
[PATCH 5.4 000/110] 5.4.17-stable review 116 (116) 2020/01/31 19:44
BUG: sleeping function called from invalid context in lock_sock_nested 1 (3) 2020/01/17 09:39
[PATCH] crypto: af_alg - Use bh_lock_sock in sk_destruct 1 (1) 2019/12/05 05:45
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 749d 842d 1/1 fixed on 2021/10/12 13:38
upstream BUG: sleeping function called from invalid context in lock_sock_nested (2) bluetooth C done error 19391 780d 1316d 22/25 fixed on 2021/11/10 13:22
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested 1 1551d 1551d 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 1336d 1396d 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 1366d 1396d 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 error 144 336d 842d 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):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/01/17 09:38 net-old 93ad0f969fc7 3de7aabb .config console log report syz C ci-upstream-net-this-kasan-gce
2020/02/16 06:35 upstream 829e69446995 5d7b90f1 .config console log report syz ci-upstream-kasan-gce-selinux-root
2020/02/13 14:23 upstream f2850dd5ee01 84f4fc8a .config console log report syz ci-upstream-kasan-gce-smack-root
2020/02/13 07:41 upstream f2850dd5ee01 84f4fc8a .config console log report syz ci-upstream-kasan-gce-selinux-root
2020/02/11 18:36 upstream 0a679e13ea30 4d1ab643 .config console log report syz ci-upstream-kasan-gce-root
2020/02/10 02:30 upstream d1ea35f4cdd4 35f5e45e .config console log report syz ci-upstream-kasan-gce-smack-root
2020/02/10 02:02 upstream d1ea35f4cdd4 35f5e45e .config console log report syz ci-upstream-kasan-gce-root
2020/02/08 13:35 upstream f757165705e9 06150bf1 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/12/05 01:44 upstream 63de37476ebd b2088328 .config console log report syz ci-upstream-kasan-gce
2020/02/10 02:38 net-old fdfa3a6778b1 35f5e45e .config console log report syz ci-upstream-net-this-kasan-gce
2020/02/08 05:02 net-old 73a21fa817f0 06150bf1 .config console log report syz ci-upstream-net-this-kasan-gce
2020/02/13 19:26 net-next-old fdfa3a6778b1 c5ed587f .config console log report syz ci-upstream-net-kasan-gce
2020/02/10 03:25 net-next-old fdfa3a6778b1 35f5e45e .config console log report syz ci-upstream-net-kasan-gce
2020/02/08 07:08 net-next-old 33b40134e5cf 06150bf1 .config console log report syz ci-upstream-net-kasan-gce
2020/02/15 00:36 linux-next 9f01828e9e16 5d7b90f1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/09 20:24 linux-next 6dff1565d69c 6ece2ea5 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/09 08:06 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 22:53 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 21:57 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 21:29 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 20:49 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 14:59 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 13:16 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 11:49 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 09:12 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 05:54 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 04:54 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 02:55 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/08 01:44 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 22:25 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 21:32 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 19:05 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 18:24 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 17:03 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 13:15 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 12:50 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 11:03 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 10:26 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 09:07 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 08:19 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 07:35 linux-next 6dff1565d69c 06150bf1 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/07 01:04 linux-next a0c61bf1c773 c91cbc9d .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/02/17 10:06 upstream 11a48a5a18c6 2b411596 .config console log report ci-upstream-kasan-gce-selinux-root
2020/02/16 22:30 upstream 11a48a5a18c6 1f448cd6 .config console log report ci-upstream-kasan-gce-root
2020/02/16 11:07 upstream db70e26e33ee cf914200 .config console log report ci-upstream-kasan-gce-root
2020/02/15 20:38 upstream 829e69446995 5d7b90f1 .config console log report ci-upstream-kasan-gce-smack-root
2020/02/15 20:38 upstream 829e69446995 5d7b90f1 .config console log report ci-upstream-kasan-gce-smack-root
2020/02/15 19:37 upstream 829e69446995 5d7b90f1 .config console log report ci-upstream-kasan-gce-root
2020/02/14 23:25 upstream 2019fc96af22 5d7b90f1 .config console log report ci-upstream-kasan-gce-root
2020/02/14 17:40 upstream b19e8c684703 5d7b90f1 .config console log report ci-upstream-kasan-gce-root
2020/01/27 08:19 upstream d5226fa6dbae dd56146d .config console log report ci-qemu-upstream
2020/02/18 01:06 net-old a81541041ceb 1ce142dc .config console log report ci-upstream-net-this-kasan-gce
2020/02/17 19:09 net-old 0d4597c8c5ab 2b411596 .config console log report ci-upstream-net-this-kasan-gce
2020/02/15 16:36 net-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-this-kasan-gce
2020/02/15 10:37 net-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-this-kasan-gce
2020/02/14 20:46 net-old a1fa83bdab78 5d7b90f1 .config console log report ci-upstream-net-this-kasan-gce
2020/02/13 23:13 net-old 6ee2deb6fbed c5ed587f .config console log report ci-upstream-net-this-kasan-gce
2020/02/18 13:34 net-next-old 725d23b59cd1 1ce142dc .config console log report ci-upstream-net-kasan-gce
2020/02/18 11:23 net-next-old 725d23b59cd1 1ce142dc .config console log report ci-upstream-net-kasan-gce
2020/02/17 22:08 net-next-old ce7805513d90 2b411596 .config console log report ci-upstream-net-kasan-gce
2020/02/17 16:43 net-next-old ce7805513d90 2b411596 .config console log report ci-upstream-net-kasan-gce
2020/02/16 21:26 net-next-old 2019fc96af22 cf914200 .config console log report ci-upstream-net-kasan-gce
2020/02/16 19:53 net-next-old 2019fc96af22 cf914200 .config console log report ci-upstream-net-kasan-gce
2020/02/16 09:54 net-next-old 2019fc96af22 cf914200 .config console log report ci-upstream-net-kasan-gce
2020/02/16 08:06 net-next-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/16 04:58 net-next-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/16 01:35 net-next-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/15 12:23 net-next-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/14 23:08 net-next-old 2019fc96af22 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/14 19:32 net-next-old fdfa3a6778b1 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/14 16:33 net-next-old fdfa3a6778b1 5d7b90f1 .config console log report ci-upstream-net-kasan-gce
2020/02/14 05:22 net-next-old fdfa3a6778b1 c5ed587f .config console log report ci-upstream-net-kasan-gce
2020/02/13 20:49 net-next-old fdfa3a6778b1 c5ed587f .config console log report ci-upstream-net-kasan-gce
2020/02/13 17:53 net-next-old fdfa3a6778b1 c5ed587f .config console log report ci-upstream-net-kasan-gce
2020/02/13 16:36 net-next-old fdfa3a6778b1 c5ed587f .config console log report ci-upstream-net-kasan-gce
2020/02/13 15:59 net-next-old fdfa3a6778b1 c5ed587f .config console log report ci-upstream-net-kasan-gce
2020/02/13 12:42 net-next-old fdfa3a6778b1 84f4fc8a .config console log report ci-upstream-net-kasan-gce
2020/02/13 11:24 net-next-old fdfa3a6778b1 84f4fc8a .config console log report ci-upstream-net-kasan-gce
2020/02/13 10:14 net-next-old fdfa3a6778b1 84f4fc8a .config console log report ci-upstream-net-kasan-gce
2020/02/13 08:47 net-next-old fdfa3a6778b1 84f4fc8a .config console log report ci-upstream-net-kasan-gce
2020/02/18 02:20 linux-next c25a951c50dc 1ce142dc .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/17 11:06 linux-next c25a951c50dc 2b411596 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/17 07:00 linux-next c25a951c50dc 1f448cd6 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/16 10:00 linux-next 9f01828e9e16 cf914200 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/16 03:31 linux-next 9f01828e9e16 5d7b90f1 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/16 00:19 linux-next 9f01828e9e16 5d7b90f1 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/14 07:14 linux-next 9f01828e9e16 5d7b90f1 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/14 06:12 linux-next 9f01828e9e16 5d7b90f1 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/14 04:21 linux-next 9f01828e9e16 c5ed587f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/14 03:14 linux-next 9f01828e9e16 c5ed587f .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.