====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc6-syzkaller-00110-gff7afaeca1a1 #0 Not tainted ------------------------------------------------------ syz.1.6479/28087 is trying to acquire lock: ffff88801b098018 (&pool->lock){-.-.}-{2:2}, at: try_to_grab_pending+0x145/0x850 kernel/workqueue.c:2081 but task is already holding lock: ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:3312 [inline] ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline] ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3811 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (krc.lock){..-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:3312 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline] kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3811 trie_delete_elem+0x5c5/0x820 kernel/bpf/lpm_trie.c:540 0xffffffffa000085f bpf_dispatcher_nop_func include/linux/bpf.h:1265 [inline] __bpf_prog_run include/linux/filter.h:701 [inline] bpf_prog_run include/linux/filter.h:708 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2316 [inline] bpf_trace_run3+0x243/0x5a0 kernel/trace/bpf_trace.c:2358 __bpf_trace_workqueue_queue_work+0x101/0x140 include/trace/events/workqueue.h:23 __traceiter_workqueue_queue_work+0x6f/0xc0 include/trace/events/workqueue.h:23 trace_workqueue_queue_work include/trace/events/workqueue.h:23 [inline] __queue_work+0x4fa/0x1080 kernel/workqueue.c:2321 queue_work_on+0x11a/0x140 kernel/workqueue.c:2390 bpf_map_put kernel/bpf/syscall.c:816 [inline] bpf_map_put+0x22f/0x2b0 kernel/bpf/syscall.c:804 bpf_map_put_with_uref kernel/bpf/syscall.c:824 [inline] bpf_map_release+0x95/0xc0 kernel/bpf/syscall.c:834 __fput+0x3f9/0xb60 fs/file_table.c:431 __fput_sync+0x45/0x50 fs/file_table.c:516 __do_sys_close fs/open.c:1567 [inline] __se_sys_close fs/open.c:1552 [inline] __x64_sys_close+0x86/0x100 fs/open.c:1552 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&pool->lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 try_to_grab_pending+0x145/0x850 kernel/workqueue.c:2081 work_grab_pending kernel/workqueue.c:2157 [inline] mod_delayed_work_on+0x9a/0x1d0 kernel/workqueue.c:2585 kvfree_call_rcu+0x749/0xbe0 kernel/rcu/tree.c:3839 trie_update_elem+0xc1d/0xe00 kernel/bpf/lpm_trie.c:441 bpf_map_update_value+0x2c4/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1849 bpf_map_do_batch+0x5ab/0x670 kernel/bpf/syscall.c:5162 __sys_bpf+0x1ce4/0x49a0 kernel/bpf/syscall.c:5717 __do_sys_bpf kernel/bpf/syscall.c:5760 [inline] __se_sys_bpf kernel/bpf/syscall.c:5758 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5758 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(krc.lock); lock(&pool->lock); lock(krc.lock); lock(&pool->lock); *** DEADLOCK *** 3 locks held by syz.1.6479/28087: #0: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #0: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #0: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x24b/0x6c0 kernel/bpf/syscall.c:202 #1: ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:3312 [inline] #1: ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline] #1: ffff8880b8629598 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3811 #2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: try_to_grab_pending+0x100/0x850 kernel/workqueue.c:2072 stack backtrace: CPU: 0 UID: 0 PID: 28087 Comm: syz.1.6479 Not tainted 6.12.0-rc6-syzkaller-00110-gff7afaeca1a1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x41c/0x610 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 try_to_grab_pending+0x145/0x850 kernel/workqueue.c:2081 work_grab_pending kernel/workqueue.c:2157 [inline] mod_delayed_work_on+0x9a/0x1d0 kernel/workqueue.c:2585 kvfree_call_rcu+0x749/0xbe0 kernel/rcu/tree.c:3839 trie_update_elem+0xc1d/0xe00 kernel/bpf/lpm_trie.c:441 bpf_map_update_value+0x2c4/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1849 bpf_map_do_batch+0x5ab/0x670 kernel/bpf/syscall.c:5162 __sys_bpf+0x1ce4/0x49a0 kernel/bpf/syscall.c:5717 __do_sys_bpf kernel/bpf/syscall.c:5760 [inline] __se_sys_bpf kernel/bpf/syscall.c:5758 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5758 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbb2a97e719 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:00007fbb2b714038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fbb2ab35f80 RCX: 00007fbb2a97e719 RDX: 0000000000000038 RSI: 0000000020000640 RDI: 000000000000001a RBP: 00007fbb2a9f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fbb2ab35f80 R15: 00007ffdd7619ef8