====================================================== WARNING: possible circular locking dependency detected 6.1.92-syzkaller #0 Not tainted ------------------------------------------------------ swapper/1/0 is trying to acquire lock: ffff8880b9928118 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2990 [inline] ffff8880b9928118 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3310 [inline] ffff8880b9928118 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3401 but task is already holding lock: ffff888021c83a38 (&trie->lock){..-.}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:451 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&trie->lock){..-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:451 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x440/0x600 kernel/time/timer.c:609 __mod_timer+0x92b/0xee0 dsp_cmx_send+0x21bb/0x2240 drivers/isdn/mISDN/dsp_cmx.c:1850 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline] acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline] acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:572 acpi_idle_enter+0x352/0x4f0 drivers/acpi/processor_idle.c:709 cpuidle_enter_state+0x516/0xf80 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x59/0x90 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3ce/0x680 kernel/sched/idle.c:303 cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401 start_secondary+0xe4/0xf0 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xcf/0xdb -> #1 (&base->lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 lock_timer_base+0x120/0x260 kernel/time/timer.c:999 __mod_timer+0x1cb/0xee0 kernel/time/timer.c:1072 queue_delayed_work_on+0x156/0x250 kernel/workqueue.c:1704 queue_delayed_work include/linux/workqueue.h:527 [inline] schedule_delayed_monitor_work kernel/rcu/tree.c:3171 [inline] kvfree_call_rcu+0x520/0x8c0 kernel/rcu/tree.c:3427 rtnl_register_internal+0x489/0x580 net/core/rtnetlink.c:260 rtnl_register+0x32/0x70 net/core/rtnetlink.c:310 ip_rt_init+0x335/0x3c7 net/ipv4/route.c:3769 ip_init+0xa/0x14 net/ipv4/ip_output.c:1767 inet_init+0x2ae/0x3c0 net/ipv4/af_inet.c:2031 do_one_initcall+0x265/0x8f0 init/main.c:1299 do_initcall_level+0x157/0x207 init/main.c:1372 do_initcalls+0x49/0x86 init/main.c:1388 kernel_init_freeable+0x45c/0x60f init/main.c:1627 kernel_init+0x19/0x290 init/main.c:1515 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #0 (krc.lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:2990 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3310 [inline] kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3401 trie_delete_elem+0x520/0x690 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x440/0x600 kernel/time/timer.c:609 __mod_timer+0x92b/0xee0 dsp_cmx_send+0x21bb/0x2240 drivers/isdn/mISDN/dsp_cmx.c:1850 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline] acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline] acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:572 acpi_idle_enter+0x352/0x4f0 drivers/acpi/processor_idle.c:709 cpuidle_enter_state+0x516/0xf80 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x59/0x90 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3ce/0x680 kernel/sched/idle.c:303 cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401 start_secondary+0xe4/0xf0 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xcf/0xdb 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 *** 5 locks held by swapper/1/0: #0: ffffc900001e0bc0 ((&dsp_spl_tl)){+.-.}-{0:0}, at: call_timer_fn+0xc2/0x6b0 kernel/time/timer.c:1501 #1: ffffffff8e04cab8 (dsp_lock){..-.}-{2:2}, at: dsp_cmx_send+0x22/0x2240 drivers/isdn/mISDN/dsp_cmx.c:1643 #2: ffff8880b9928358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 #4: ffff888021c83a38 (&trie->lock){..-.}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:451 stack backtrace: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.92-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:2990 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3310 [inline] kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3401 trie_delete_elem+0x520/0x690 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x440/0x600 kernel/time/timer.c:609 __mod_timer+0x92b/0xee0 dsp_cmx_send+0x21bb/0x2240 drivers/isdn/mISDN/dsp_cmx.c:1850 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:22 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline] RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline] RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:113 [inline] RIP: 0010:acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:572 Code: 4f f5 f6 48 83 e3 08 0f 85 0b 01 00 00 4c 8d 74 24 20 e8 d4 0d fc f6 0f 1f 44 00 00 e8 7a 4b f5 f6 0f 00 2d 03 1f b2 00 fb f4 <4c> 89 f3 48 c1 eb 03 42 80 3c 3b 00 74 08 4c 89 f7 e8 5b cb 4c f7 RSP: 0018:ffffc90000177b80 EFLAGS: 000002d3 RAX: ffffffff8a9541d6 RBX: 0000000000000000 RCX: ffff888012739dc0 RDX: 0000000000000000 RSI: ffffffff8aec01c0 RDI: ffffffff8b3d45e0 RBP: ffffc90000177c10 R08: ffffffff8a9541b8 R09: ffffed10024e73b9 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff9200002ef70 R13: ffff888147e9a804 R14: ffffc90000177ba0 R15: dffffc0000000000 acpi_idle_enter+0x352/0x4f0 drivers/acpi/processor_idle.c:709 cpuidle_enter_state+0x516/0xf80 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x59/0x90 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3ce/0x680 kernel/sched/idle.c:303 cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401 start_secondary+0xe4/0xf0 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xcf/0xdb ---------------- Code disassembly (best guess): 0: 4f f5 rex.WRXB cmc 2: f6 48 83 e3 testb $0xe3,-0x7d(%rax) 6: 08 0f or %cl,(%rdi) 8: 85 0b test %ecx,(%rbx) a: 01 00 add %eax,(%rax) c: 00 4c 8d 74 add %cl,0x74(%rbp,%rcx,4) 10: 24 20 and $0x20,%al 12: e8 d4 0d fc f6 call 0xf6fc0deb 17: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 1c: e8 7a 4b f5 f6 call 0xf6f54b9b 21: 0f 00 2d 03 1f b2 00 verw 0xb21f03(%rip) # 0xb21f2b 28: fb sti 29: f4 hlt * 2a: 4c 89 f3 mov %r14,%rbx <-- trapping instruction 2d: 48 c1 eb 03 shr $0x3,%rbx 31: 42 80 3c 3b 00 cmpb $0x0,(%rbx,%r15,1) 36: 74 08 je 0x40 38: 4c 89 f7 mov %r14,%rdi 3b: e8 5b cb 4c f7 call 0xf74ccb9b