====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Not tainted ------------------------------------------------------ syz-executor.0/7398 is trying to acquire lock: ffffffff94915888 (&obj_hash[i].lock){-.-.}-{2:2}, at: debug_object_activate+0x16d/0x510 lib/debugobjects.c:708 but task is already holding lock: ffff88801e3d09f8 (&trie->lock){-.-.}-{2:2}, at: trie_update_elem+0xcb/0xc10 kernel/bpf/lpm_trie.c:324 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&trie->lock){-.-.}-{2:2}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x96/0x6a0 kernel/bpf/lpm_trie.c:451 bpf_prog_22fedb13000eacf7+0x6/0x1b 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+0x206/0x420 kernel/trace/bpf_trace.c:2420 trace_contention_end+0x114/0x140 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x939/0xc60 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline] queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162 debug_object_activate+0x16d/0x510 lib/debugobjects.c:708 debug_rcu_head_queue kernel/rcu/rcu.h:227 [inline] kvfree_call_rcu+0x99/0x790 kernel/rcu/tree.c:3434 cfg80211_update_known_bss+0xb39/0x1500 net/wireless/scan.c:1847 __cfg80211_bss_update+0x150/0x20c0 net/wireless/scan.c:1893 cfg80211_inform_single_bss_data+0xec6/0x22e0 net/wireless/scan.c:2264 cfg80211_inform_bss_data+0x3e3/0x57d0 net/wireless/scan.c:3067 cfg80211_inform_bss_frame_data+0x3bc/0x720 net/wireless/scan.c:3157 ieee80211_bss_info_update+0x8a7/0xbc0 net/mac80211/scan.c:226 ieee80211_scan_rx+0x526/0x9c0 net/mac80211/scan.c:340 __ieee80211_rx_handle_packet net/mac80211/rx.c:5210 [inline] ieee80211_rx_list+0x2b00/0x3780 net/mac80211/rx.c:5447 ieee80211_rx_napi+0x18a/0x3c0 net/mac80211/rx.c:5470 ieee80211_rx include/net/mac80211.h:5083 [inline] ieee80211_tasklet_handler+0xeb/0x1f0 net/mac80211/main.c:438 tasklet_action_common+0x323/0x4d0 kernel/softirq.c:781 __do_softirq+0x2c8/0x980 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 lock_acquire+0x264/0x550 kernel/locking/lockdep.c:5758 rcu_lock_acquire include/linux/rcupdate.h:329 [inline] rcu_read_lock include/linux/rcupdate.h:781 [inline] page_ext_get+0x3d/0x2a0 mm/page_ext.c:508 page_table_check_set+0x5d/0x700 mm/page_table_check.c:109 __page_table_check_ptes_set+0x220/0x280 mm/page_table_check.c:196 page_table_check_ptes_set include/linux/page_table_check.h:74 [inline] set_ptes include/linux/pgtable.h:267 [inline] __copy_present_ptes mm/memory.c:953 [inline] copy_present_ptes mm/memory.c:1036 [inline] copy_pte_range mm/memory.c:1151 [inline] copy_pmd_range mm/memory.c:1238 [inline] copy_pud_range mm/memory.c:1275 [inline] copy_p4d_range mm/memory.c:1299 [inline] copy_page_range+0x3d46/0x58e0 mm/memory.c:1397 dup_mmap kernel/fork.c:751 [inline] dup_mm kernel/fork.c:1688 [inline] copy_mm+0x1321/0x2180 kernel/fork.c:1737 copy_process+0x187a/0x3df0 kernel/fork.c:2390 kernel_clone+0x226/0x8f0 kernel/fork.c:2797 __do_sys_clone kernel/fork.c:2940 [inline] __se_sys_clone kernel/fork.c:2924 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&obj_hash[i].lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 debug_object_activate+0x16d/0x510 lib/debugobjects.c:708 debug_rcu_head_queue kernel/rcu/rcu.h:227 [inline] kvfree_call_rcu+0x99/0x790 kernel/rcu/tree.c:3434 trie_update_elem+0x819/0xc10 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x4d5/0x540 kernel/bpf/syscall.c:203 map_update_elem+0x53a/0x6f0 kernel/bpf/syscall.c:1641 __sys_bpf+0x76f/0x810 kernel/bpf/syscall.c:5648 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5765 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 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(&trie->lock); lock(&obj_hash[i].lock); lock(&trie->lock); lock(&obj_hash[i].lock); *** DEADLOCK *** 2 locks held by syz-executor.0/7398: #0: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8e334d20 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x3c4/0x540 kernel/bpf/syscall.c:202 #1: ffff88801e3d09f8 (&trie->lock){-.-.}-{2:2}, at: trie_update_elem+0xcb/0xc10 kernel/bpf/lpm_trie.c:324 stack backtrace: CPU: 1 PID: 7398 Comm: syz-executor.0 Not tainted 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 debug_object_activate+0x16d/0x510 lib/debugobjects.c:708 debug_rcu_head_queue kernel/rcu/rcu.h:227 [inline] kvfree_call_rcu+0x99/0x790 kernel/rcu/tree.c:3434 trie_update_elem+0x819/0xc10 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x4d5/0x540 kernel/bpf/syscall.c:203 map_update_elem+0x53a/0x6f0 kernel/bpf/syscall.c:1641 __sys_bpf+0x76f/0x810 kernel/bpf/syscall.c:5648 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5765 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe5bec7dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe5bf92a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fe5bedabf80 RCX: 00007fe5bec7dea9 RDX: 0000000000000020 RSI: 0000000020000380 RDI: 0000000000000002 RBP: 00007fe5becca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe5bedabf80 R15: 00007ffd7c760748