====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:36/9636 is trying to acquire lock: ffff88807bf80238 (&trie->lock){-.-.}-{2:2}, at: trie_delete_elem+0x94/0x630 kernel/bpf/lpm_trie.c:466 but task is already holding lock: ffff8880b8c38e30 (batched_entropy_u8.lock){-.-.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b8c38e30 (batched_entropy_u8.lock){-.-.}-{2:2}, at: get_random_u8+0x16c/0x980 drivers/char/random.c:520 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (batched_entropy_u8.lock){-.-.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] get_random_u8+0x184/0x980 drivers/char/random.c:520 get_random_u32_below include/linux/random.h:78 [inline] kfence_guarded_alloc+0x9f/0xe50 mm/kfence/core.c:400 __kfence_alloc+0x39a/0x3d0 mm/kfence/core.c:1150 kfence_alloc include/linux/kfence.h:129 [inline] __kmem_cache_alloc_bulk mm/slub.c:3994 [inline] kmem_cache_alloc_bulk+0x2f5/0x5b0 mm/slub.c:4093 napi_skb_cache_get+0x11c/0x1e0 net/core/skbuff.c:333 __napi_build_skb net/core/skbuff.c:512 [inline] __napi_alloc_skb+0x21c/0x540 net/core/skbuff.c:832 napi_alloc_skb include/linux/skbuff.h:3369 [inline] page_to_skb+0x2be/0x8a0 drivers/net/virtio_net.c:571 receive_mergeable drivers/net/virtio_net.c:1707 [inline] receive_buf+0x321/0x3610 drivers/net/virtio_net.c:1839 virtnet_receive drivers/net/virtio_net.c:2159 [inline] virtnet_poll+0x69e/0x1300 drivers/net/virtio_net.c:2236 __napi_poll+0xbb/0x460 net/core/dev.c:6714 napi_poll net/core/dev.c:6781 [inline] net_rx_action+0x65f/0xcc0 net/core/dev.c:6917 handle_softirqs+0x27d/0x820 kernel/softirq.c:578 __do_softirq kernel/softirq.c:612 [inline] invoke_softirq kernel/softirq.c:452 [inline] __irq_exit_rcu+0xd3/0x190 kernel/softirq.c:661 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673 common_interrupt+0xb9/0xd0 arch/x86/kernel/irq.c:249 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:678 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] pv_native_safe_halt+0xf/0x10 arch/x86/kernel/paravirt.c:147 arch_safe_halt arch/x86/include/asm/paravirt.h:108 [inline] default_idle+0x13/0x20 arch/x86/kernel/process.c:753 default_idle_call+0x6c/0xa0 kernel/sched/idle.c:97 cpuidle_idle_call kernel/sched/idle.c:178 [inline] do_idle+0x334/0x5c0 kernel/sched/idle.c:302 cpu_startup_entry+0x43/0x60 kernel/sched/idle.c:401 start_secondary+0xee/0xf0 arch/x86/kernel/smpboot.c:323 secondary_startup_64_no_verify+0x179/0x17b -> #1 (&c->lock){-.-.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ___slab_alloc+0x207/0x12f0 mm/slub.c:3176 __slab_alloc mm/slub.c:3361 [inline] __slab_alloc_node mm/slub.c:3414 [inline] slab_alloc_node mm/slub.c:3508 [inline] __kmem_cache_alloc_node+0x122/0x260 mm/slub.c:3557 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node+0xa6/0x240 mm/slab_common.c:1014 kmalloc_node include/linux/slab.h:620 [inline] bpf_map_kmalloc_node+0xbc/0x1b0 kernel/bpf/syscall.c:424 lpm_trie_node_alloc kernel/bpf/lpm_trie.c:291 [inline] trie_update_elem+0x172/0xd60 kernel/bpf/lpm_trie.c:338 bpf_map_update_value+0x64b/0x710 kernel/bpf/syscall.c:203 map_update_elem+0x586/0x710 kernel/bpf/syscall.c:1567 __sys_bpf+0x6b5/0x890 kernel/bpf/syscall.c:5485 __do_sys_bpf kernel/bpf/syscall.c:5601 [inline] __se_sys_bpf kernel/bpf/syscall.c:5599 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5599 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&trie->lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb4/0x100 kernel/locking/spinlock.c:162 trie_delete_elem+0x94/0x630 kernel/bpf/lpm_trie.c:466 bpf_prog_2c29ac5cdc6b1842+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1226 [inline] __bpf_prog_run include/linux/filter.h:617 [inline] bpf_prog_run include/linux/filter.h:624 [inline] bpf_prog_run_array include/linux/bpf.h:2007 [inline] trace_call_bpf+0x333/0x6c0 kernel/trace/bpf_trace.c:143 perf_trace_run_bpf_submit+0x7a/0x1c0 kernel/events/core.c:10283 perf_trace_lock_acquire+0x342/0x400 include/trace/events/lock.h:24 trace_lock_acquire include/trace/events/lock.h:24 [inline] lock_acquire+0x3ef/0x420 kernel/locking/lockdep.c:5761 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] crng_make_state+0x15f/0x700 drivers/char/random.c:340 _get_random_bytes+0x100/0x250 drivers/char/random.c:378 get_random_u8+0x308/0x980 drivers/char/random.c:520 get_random_u32_below include/linux/random.h:78 [inline] batadv_iv_ogm_emit_send_time net/batman-adv/bat_iv_ogm.c:277 [inline] batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:850 [inline] batadv_iv_ogm_schedule+0x799/0x1080 net/batman-adv/bat_iv_ogm.c:907 batadv_iv_send_outstanding_bat_ogm_packet+0x6ed/0x800 net/batman-adv/bat_iv_ogm.c:1804 process_one_work kernel/workqueue.c:2657 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 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: Chain exists of: &trie->lock --> &c->lock --> batched_entropy_u8.lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(batched_entropy_u8.lock); lock(&c->lock); lock(batched_entropy_u8.lock); lock(&trie->lock); *** DEADLOCK *** 5 locks held by kworker/u4:36/9636: #0: ffff88802f0f0d38 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2632 [inline] #0: ffff88802f0f0d38 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_scheduled_works+0x975/0x1600 kernel/workqueue.c:2734 #1: ffffc9000b397d00 ((work_completion)(&(&forw_packet_aggr->delayed_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2632 [inline] #1: ffffc9000b397d00 ((work_completion)(&(&forw_packet_aggr->delayed_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x975/0x1600 kernel/workqueue.c:2734 #2: ffff88807e24f1b8 (&hard_iface->bat_iv.ogm_buff_mutex){+.+.}-{3:3}, at: batadv_iv_ogm_schedule+0xe5/0x1080 net/batman-adv/bat_iv_ogm.c:906 #3: ffff8880b8c38e30 (batched_entropy_u8.lock){-.-.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #3: ffff8880b8c38e30 (batched_entropy_u8.lock){-.-.}-{2:2}, at: get_random_u8+0x16c/0x980 drivers/char/random.c:520 #4: ffffffff8e1322e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline] #4: ffffffff8e1322e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline] #4: ffffffff8e1322e0 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xc3/0x6c0 kernel/trace/bpf_trace.c:142 stack backtrace: CPU: 0 PID: 9636 Comm: kworker/u4:36 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/15/2026 Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb4/0x100 kernel/locking/spinlock.c:162 trie_delete_elem+0x94/0x630 kernel/bpf/lpm_trie.c:466 bpf_prog_2c29ac5cdc6b1842+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1226 [inline] __bpf_prog_run include/linux/filter.h:617 [inline] bpf_prog_run include/linux/filter.h:624 [inline] bpf_prog_run_array include/linux/bpf.h:2007 [inline] trace_call_bpf+0x333/0x6c0 kernel/trace/bpf_trace.c:143 perf_trace_run_bpf_submit+0x7a/0x1c0 kernel/events/core.c:10283 perf_trace_lock_acquire+0x342/0x400 include/trace/events/lock.h:24 trace_lock_acquire include/trace/events/lock.h:24 [inline] lock_acquire+0x3ef/0x420 kernel/locking/lockdep.c:5761 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] crng_make_state+0x15f/0x700 drivers/char/random.c:340 _get_random_bytes+0x100/0x250 drivers/char/random.c:378 get_random_u8+0x308/0x980 drivers/char/random.c:520 get_random_u32_below include/linux/random.h:78 [inline] batadv_iv_ogm_emit_send_time net/batman-adv/bat_iv_ogm.c:277 [inline] batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:850 [inline] batadv_iv_ogm_schedule+0x799/0x1080 net/batman-adv/bat_iv_ogm.c:907 batadv_iv_send_outstanding_bat_ogm_packet+0x6ed/0x800 net/batman-adv/bat_iv_ogm.c:1804 process_one_work kernel/workqueue.c:2657 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 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