====================================================== WARNING: possible circular locking dependency detected 6.6.94-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:3/48 is trying to acquire lock: ffff8880b8f295a8 (krc.lock){....}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2955 [inline] ffff8880b8f295a8 (krc.lock){....}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline] ffff8880b8f295a8 (krc.lock){....}-{2:2}, at: kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449 but task is already holding lock: ffff8880b8f297d8 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x123/0x270 kernel/time/timer.c:999 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&base->lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162 lock_timer_base+0x123/0x270 kernel/time/timer.c:999 __mod_timer+0xf9/0xdb0 kernel/time/timer.c:1080 queue_delayed_work_on+0x12a/0x1e0 kernel/workqueue.c:1987 kvfree_call_rcu+0x541/0x780 kernel/rcu/tree.c:3477 rtnl_register_internal+0x486/0x590 net/core/rtnetlink.c:264 rtnl_register+0x32/0x70 net/core/rtnetlink.c:314 ip_rt_init+0x2ec/0x390 net/ipv4/route.c:3789 ip_init+0xe/0x20 net/ipv4/ip_output.c:1663 inet_init+0x2c1/0x3e0 net/ipv4/af_inet.c:2024 do_one_initcall+0x1fd/0x750 init/main.c:1238 do_initcall_level+0x137/0x1f0 init/main.c:1300 do_initcalls+0x69/0xd0 init/main.c:1316 kernel_init_freeable+0x3d2/0x570 init/main.c:1553 kernel_init+0x1d/0x1c0 init/main.c:1443 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 -> #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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 __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:2955 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline] kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449 trie_delete_elem+0x535/0x6a0 kernel/bpf/lpm_trie.c:545 bpf_prog_2c29ac5cdc6b1842+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1213 [inline] __bpf_prog_run include/linux/filter.h:612 [inline] bpf_prog_run include/linux/filter.h:619 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline] bpf_trace_run3+0x1e7/0x400 kernel/trace/bpf_trace.c:2362 __bpf_trace_timer_start+0x14a/0x1b0 include/trace/events/timer.h:53 __traceiter_timer_start+0x77/0xc0 include/trace/events/timer.h:53 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x398/0x530 kernel/time/timer.c:609 internal_add_timer kernel/time/timer.c:634 [inline] __mod_timer+0x977/0xdb0 kernel/time/timer.c:1131 queue_delayed_work_on+0x12a/0x1e0 kernel/workqueue.c:1987 queue_delayed_work include/linux/workqueue.h:577 [inline] batadv_forw_packet_queue+0x221/0x260 net/batman-adv/send.c:690 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:848 [inline] batadv_iv_ogm_schedule+0xab3/0xe90 net/batman-adv/bat_iv_ogm.c:867 batadv_iv_send_outstanding_bat_ogm_packet+0x731/0x840 net/batman-adv/bat_iv_ogm.c:1711 process_one_work kernel/workqueue.c:2634 [inline] process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&base->lock); lock(krc.lock); lock(&base->lock); lock(krc.lock); *** DEADLOCK *** 7 locks held by kworker/u4:3/48: #0: ffff88802d456938 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline] #0: ffff88802d456938 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711 #1: ffffc90000b8fd00 ((work_completion)(&(&forw_packet_aggr->delayed_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline] #1: ffffc90000b8fd00 ((work_completion)(&(&forw_packet_aggr->delayed_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711 #2: ffff88805e9f5110 (&hard_iface->bat_iv.ogm_buff_mutex){+.+.}-{3:3}, at: batadv_iv_ogm_schedule+0xe0/0xe90 net/batman-adv/bat_iv_ogm.c:866 #3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline] #3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline] #3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:840 [inline] #3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: batadv_iv_ogm_schedule+0x82a/0xe90 net/batman-adv/bat_iv_ogm.c:867 #4: ffff88805f194d18 (&bat_priv->forw_bat_list_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline] #4: ffff88805f194d18 (&bat_priv->forw_bat_list_lock){+...}-{2:2}, at: batadv_forw_packet_queue+0x33/0x260 net/batman-adv/send.c:673 #5: ffff8880b8f297d8 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x123/0x270 kernel/time/timer.c:999 #6: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline] #6: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline] #6: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2321 [inline] #6: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0xf4/0x400 kernel/trace/bpf_trace.c:2362 stack backtrace: CPU: 1 PID: 48 Comm: kworker/u4:3 Not tainted 6.6.94-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 check_noncircular+0x2bd/0x3c0 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 __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:2955 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline] kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449 trie_delete_elem+0x535/0x6a0 kernel/bpf/lpm_trie.c:545 bpf_prog_2c29ac5cdc6b1842+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1213 [inline] __bpf_prog_run include/linux/filter.h:612 [inline] bpf_prog_run include/linux/filter.h:619 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline] bpf_trace_run3+0x1e7/0x400 kernel/trace/bpf_trace.c:2362 __bpf_trace_timer_start+0x14a/0x1b0 include/trace/events/timer.h:53 __traceiter_timer_start+0x77/0xc0 include/trace/events/timer.h:53 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x398/0x530 kernel/time/timer.c:609 internal_add_timer kernel/time/timer.c:634 [inline] __mod_timer+0x977/0xdb0 kernel/time/timer.c:1131 queue_delayed_work_on+0x12a/0x1e0 kernel/workqueue.c:1987 queue_delayed_work include/linux/workqueue.h:577 [inline] batadv_forw_packet_queue+0x221/0x260 net/batman-adv/send.c:690 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:848 [inline] batadv_iv_ogm_schedule+0xab3/0xe90 net/batman-adv/bat_iv_ogm.c:867 batadv_iv_send_outstanding_bat_ogm_packet+0x731/0x840 net/batman-adv/bat_iv_ogm.c:1711 process_one_work kernel/workqueue.c:2634 [inline] process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293