syzbot


BUG: sleeping function called from invalid context in sock_map_delete_elem

Status: upstream: reported C repro on 2025/08/27 23:56
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+1f1fbecb9413cdbfbef8@syzkaller.appspotmail.com
First crash: 51d, last: 6d04h
Cause bisection: failed (error log, bisect log)
  
Discussions (11)
Title Replies (including bot) Last reply
[PATCH v3] bpf: test_run: fix atomic context in timer path causing sleep-in-atomic BUG 3 (3) 2025/10/13 20:01
[PATCH] bpf: avoid sleeping in invalid context during sock_map_delete_elem path 1 (2) 2025/10/13 17:51
[PATCH v2] bpf: avoid sleeping in invalid context during sock_map_delete_elem path 1 (1) 2025/10/13 17:11
[syzbot] [bpf?] [net?] BUG: sleeping function called from invalid context in sock_map_delete_elem 0 (4) 2025/10/13 16:29
[PATCH v2] bpf: test_run: Use migrate_enable()/disable() universally 3 (3) 2025/10/11 13:17
Re: [PATCH] bpf: test_run: Fix timer mode initialization to NO_MIGRATE mode 3 (3) 2025/10/10 03:43
[PATCH] bpf: avoid sleeping in invalid context during sock_map_delete_elem path 2 (3) 2025/10/09 23:29
Re: [bpf?] [net?] BUG: sleeping function called from invalid context in sock_map_delete_elem 1 (2) 2025/10/09 22:38
[PATCH] bpf: test_run: Fix timer mode initialization to NO_MIGRATE mode 3 (3) 2025/10/07 05:15
[syzbot] Monthly bpf report (Oct 2025) 0 (1) 2025/10/06 17:29
[syzbot] Monthly bpf report (Sep 2025) 0 (1) 2025/09/03 12:45
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/10/13 16:29 26m listout@listout.xyz patch upstream OK log
2025/10/09 22:28 50m listout@listout.xyz patch upstream OK log
2025/10/09 21:26 55m listout@listout.xyz patch upstream OK log
2025/10/01 18:26 24m chandna.linuxkernel@gmail.com patch upstream OK log

Sample crash report:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6096, name: syz.0.28
preempt_count: 1, expected: 0
RCU nest depth: 1, expected: 1
3 locks held by syz.0.28/6096:
 #0: ffffffff8d3aa400 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #0: ffffffff8d3aa400 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:867 [inline]
 #0: ffffffff8d3aa400 (rcu_read_lock){....}-{1:3}, at: bpf_test_timer_enter+0x1e/0x2b0 net/bpf/test_run.c:40
 #1: ffffffff8d24aa40 (local_bh){.+.+}-{1:3}, at: __local_bh_disable_ip+0xa1/0x540 kernel/softirq.c:163
 #2: ffff8880310e62c0 (&stab->lock){+...}-{3:3}, at: spin_lock_bh include/linux/spinlock_rt.h:88 [inline]
 #2: ffff8880310e62c0 (&stab->lock){+...}-{3:3}, at: __sock_map_delete net/core/sock_map.c:421 [inline]
 #2: ffff8880310e62c0 (&stab->lock){+...}-{3:3}, at: sock_map_delete_elem+0xb7/0x170 net/core/sock_map.c:452
Preemption disabled at:
[<ffffffff88e51368>] bpf_test_timer_enter+0x158/0x2b0 net/bpf/test_run.c:42
CPU: 0 UID: 0 PID: 6096 Comm: syz.0.28 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 __might_resched+0x44b/0x5d0 kernel/sched/core.c:8925
 __rt_spin_lock kernel/locking/spinlock_rt.c:48 [inline]
 rt_spin_lock+0xc7/0x3e0 kernel/locking/spinlock_rt.c:57
 spin_lock_bh include/linux/spinlock_rt.h:88 [inline]
 __sock_map_delete net/core/sock_map.c:421 [inline]
 sock_map_delete_elem+0xb7/0x170 net/core/sock_map.c:452
 bpf_prog_e78d8a1634f5e22d+0x46/0x4e
 bpf_dispatcher_nop_func include/linux/bpf.h:1350 [inline]
 __bpf_prog_run include/linux/filter.h:721 [inline]
 bpf_prog_run include/linux/filter.h:728 [inline]
 bpf_prog_run_pin_on_cpu include/linux/filter.h:745 [inline]
 bpf_flow_dissect+0x225/0x720 net/core/flow_dissector.c:1024
 bpf_prog_test_run_flow_dissector+0x37c/0x5c0 net/bpf/test_run.c:1425
 bpf_prog_test_run+0x2cd/0x340 kernel/bpf/syscall.c:4673
 __sys_bpf+0x562/0x860 kernel/bpf/syscall.c:6152
 __do_sys_bpf kernel/bpf/syscall.c:6244 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6242 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6242
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f72c82deec9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff31811128 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f72c8535fa0 RCX: 00007f72c82deec9
RDX: 0000000000000050 RSI: 0000200000000000 RDI: 000000000000000a
RBP: 00007f72c8361f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f72c8535fa0 R14: 00007f72c8535fa0 R15: 0000000000000003
 </TASK>

Crashes (54):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/06 20:47 upstream fd94619c4336 91305dbe .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/06 17:43 upstream fd94619c4336 91305dbe .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/24 05:10 upstream 8d245acc1e88 bf27483f .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/24 04:13 upstream 8d245acc1e88 bf27483f .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/07 18:01 upstream c746c3b51698 8ef35d49 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/07 04:57 upstream c746c3b51698 8ef35d49 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/06 15:13 upstream fd94619c4336 91305dbe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/06 05:52 upstream 7a405dbb0f03 49379ee0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/10/02 13:10 upstream 7f7072574127 a1859138 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/30 06:13 upstream 1896ce8eb6c6 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/30 06:13 upstream 1896ce8eb6c6 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/29 22:11 upstream e5f0a698b34e 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/29 22:11 upstream e5f0a698b34e 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/27 09:17 upstream 083fc6d7fa0d 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/27 09:17 upstream 083fc6d7fa0d 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/20 12:07 upstream cd89d487374c 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/17 10:41 upstream 5aca7966d2a7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/17 10:41 upstream 5aca7966d2a7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/16 20:46 upstream 46a51f4f5eda e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/16 20:46 upstream 46a51f4f5eda e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/14 06:19 upstream 5cd64d4f9268 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/14 06:19 upstream 5cd64d4f9268 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/14 04:19 upstream 5cd64d4f9268 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/14 04:19 upstream 5cd64d4f9268 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/14 00:30 upstream 5cd64d4f9268 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 11:19 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 11:19 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 11:16 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 11:16 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 05:50 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/13 05:50 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/11 08:12 upstream 7aac71907bde fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/11 08:12 upstream 7aac71907bde fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/08 13:29 upstream 76eeb9b8de98 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/08 13:29 upstream 76eeb9b8de98 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/04 16:08 upstream b9a10f876409 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/04 16:08 upstream b9a10f876409 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/03 13:12 upstream e6b9dce0aeeb 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/03 13:12 upstream e6b9dce0aeeb 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/03 07:21 upstream e6b9dce0aeeb 091ba174 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/01 04:39 upstream 5c3b3264e585 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/09/01 04:38 upstream 5c3b3264e585 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/29 04:52 upstream 07d9df80082b 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/29 04:52 upstream 07d9df80082b 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/23 22:25 upstream 8d245acc1e88 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/23 21:35 upstream 8d245acc1e88 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/23 17:38 upstream 8d245acc1e88 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
2025/08/23 17:37 upstream 8d245acc1e88 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in sock_map_delete_elem
* Struck through repros no longer work on HEAD.