====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Not tainted ------------------------------------------------------ syz-executor.2/7277 is trying to acquire lock: ffffffff94958428 (&obj_hash[i].lock){-.-.}-{2:2}, at: debug_object_activate+0x16d/0x510 lib/debugobjects.c:708 but task is already holding lock: ffff8880626131f8 (&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 0xffffffffa00008f2 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_active_state+0x15d/0x360 lib/debugobjects.c:936 debug_rcu_head_unqueue kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2188 [inline] rcu_core+0xa70/0x1830 kernel/rcu/tree.c:2471 __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 tomoyo_path_matches_pattern+0x18f/0x270 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_check_path_acl+0x114/0x1c0 security/tomoyo/file.c:260 tomoyo_check_acl+0x130/0x3f0 security/tomoyo/domain.c:175 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_path_perm+0x480/0x740 security/tomoyo/file.c:838 security_inode_getattr+0xda/0x130 security/security.c:2269 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_fstat fs/stat.c:198 [inline] vfs_fstatat+0xd6/0x190 fs/stat.c:300 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x117/0x190 fs/stat.c:462 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 generic_map_update_batch+0x60d/0x900 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x3e2/0x690 kernel/bpf/syscall.c:5174 __sys_bpf+0x377/0x810 __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.2/7277: #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: ffff8880626131f8 (&trie->lock){-.-.}-{2:2}, at: trie_update_elem+0xcb/0xc10 kernel/bpf/lpm_trie.c:324 stack backtrace: CPU: 0 PID: 7277 Comm: syz-executor.2 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 generic_map_update_batch+0x60d/0x900 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x3e2/0x690 kernel/bpf/syscall.c:5174 __sys_bpf+0x377/0x810 __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:0x7f3bd267dea9 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:00007f3bd336f0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f3bd27abf80 RCX: 00007f3bd267dea9 RDX: 0000000000000038 RSI: 0000000020000240 RDI: 000000000000001a RBP: 00007f3bd26ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f3bd27abf80 R15: 00007ffc8c29ed08