====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc7-syzkaller-00117-g448b3fe5a0ea #0 Not tainted ------------------------------------------------------ syz-executor.2/21643 is trying to acquire lock: ffff88802c529558 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2960 [inline] ffff88802c529558 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] ffff88802c529558 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3444 but task is already holding lock: ffff88807eba61f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xda0 kernel/bpf/lpm_trie.c:324 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&trie->lock){..-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 trie_delete_elem+0xb0/0x7e0 kernel/bpf/lpm_trie.c:451 0xffffffffa00024a1 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run2+0x151/0x420 kernel/trace/bpf_trace.c:2420 trace_timer_start include/trace/events/timer.h:52 [inline] enqueue_timer+0x2b4/0x550 kernel/time/timer.c:664 internal_add_timer kernel/time/timer.c:689 [inline] __mod_timer+0x8d7/0xdc0 kernel/time/timer.c:1184 sk_reset_timer+0x21/0xc0 net/core/sock.c:3420 tipc_sk_finish_conn+0x183/0x790 net/tipc/socket.c:1675 tipc_socketpair+0x364/0x470 net/tipc/socket.c:3352 __sys_socketpair+0x2f0/0x5a0 net/socket.c:1786 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __ia32_sys_socketpair+0x95/0x100 net/socket.c:1819 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (&base->lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 lock_timer_base+0x5d/0x220 kernel/time/timer.c:1052 __mod_timer+0x426/0xdc0 kernel/time/timer.c:1133 add_timer_global+0x8a/0xc0 kernel/time/timer.c:1331 __queue_delayed_work+0x1ba/0x2e0 kernel/workqueue.c:2580 queue_delayed_work_on+0x10e/0x130 kernel/workqueue.c:2608 kvfree_call_rcu+0x749/0xbe0 kernel/rcu/tree.c:3472 rtnl_register_internal+0x343/0x670 net/core/rtnetlink.c:265 rtnl_register+0x34/0x80 net/core/rtnetlink.c:315 ip_rt_init+0x343/0x450 net/ipv4/route.c:3720 ip_init+0xe/0x20 net/ipv4/ip_output.c:1663 inet_init+0x3f0/0x6f0 net/ipv4/af_inet.c:2023 do_one_initcall+0x128/0x630 init/main.c:1245 do_initcall_level init/main.c:1307 [inline] do_initcalls init/main.c:1323 [inline] do_basic_setup init/main.c:1342 [inline] kernel_init_freeable+0x660/0xc50 init/main.c:1555 kernel_init+0x1c/0x2b0 init/main.c:1444 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (krc.lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:2960 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3444 trie_update_elem+0xb05/0xda0 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x2c1/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x615/0x6e0 kernel/bpf/syscall.c:5174 __sys_bpf+0x18ff/0x58b0 kernel/bpf/syscall.c:5724 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5765 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: krc.lock --> &base->lock --> &trie->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&trie->lock); lock(&base->lock); lock(&trie->lock); lock(krc.lock); *** DEADLOCK *** 2 locks held by syz-executor.2/21643: #0: ffffffff8d7b43e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8d7b43e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8d7b43e0 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x24b/0x6c0 kernel/bpf/syscall.c:202 #1: ffff88807eba61f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xda0 kernel/bpf/lpm_trie.c:324 stack backtrace: CPU: 3 PID: 21643 Comm: syz-executor.2 Not tainted 6.9.0-rc7-syzkaller-00117-g448b3fe5a0ea #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:2960 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3444 trie_update_elem+0xb05/0xda0 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x2c1/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x615/0x6e0 kernel/bpf/syscall.c:5174 __sys_bpf+0x18ff/0x58b0 kernel/bpf/syscall.c:5724 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5765 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf734a579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5f3c5ac EFLAGS: 00000292 ORIG_RAX: 0000000000000165 RAX: ffffffffffffffda RBX: 000000000000001a RCX: 0000000020000240 RDX: 0000000000000038 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi