============================================ WARNING: possible recursive locking detected 6.12.0-rc4-syzkaller-g9a783139614f #0 Not tainted -------------------------------------------- udevd/6804 is trying to acquire lock: ffffc9000ec9f0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 but task is already holding lock: ffffc90004c690d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&rb->spinlock); lock(&rb->spinlock); *** DEADLOCK *** May be due to missing lock nesting notation 7 locks held by udevd/6804: #0: ffff888023d8e420 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515 #1: ffff888035b9a9f8 (&type->i_mutex_dir_key#5/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff888035b9a9f8 (&type->i_mutex_dir_key#5/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3161 [inline] #1: ffff888035b9a9f8 (&type->i_mutex_dir_key#5/1){+.+.}-{3:3}, at: do_renameat2+0x62c/0x13f0 fs/namei.c:5105 #2: ffff8880b8637ef8 (lock#4){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #2: ffff8880b8637ef8 (lock#4){+.+.}-{2:2}, at: lru_add_drain+0x79/0x3e0 mm/swap.c:742 #3: ffff88801aca30b0 (&lruvec->lru_lock){....}-{2:2}, at: folio_lruvec_lock_irqsave+0x110/0x1d0 mm/memcontrol.c:1237 #4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2339 [inline] #4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run1+0x1d6/0x520 kernel/trace/bpf_trace.c:2380 #5: ffffc90004c690d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 #6: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbc/0x8a0 stack backtrace: CPU: 0 UID: 0 PID: 6804 Comm: udevd Not tainted 6.12.0-rc4-syzkaller-g9a783139614f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 ____bpf_ringbuf_output kernel/bpf/ringbuf.c:553 [inline] bpf_ringbuf_output+0x67/0x1e0 kernel/bpf/ringbuf.c:543 bpf_prog_4aaef4562453526c+0x43/0x47 bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline] __bpf_prog_run include/linux/filter.h:701 [inline] bpf_prog_run include/linux/filter.h:708 [inline] bpf_prog_run_array include/linux/bpf.h:2165 [inline] trace_call_bpf+0x369/0x8a0 kernel/trace/bpf_trace.c:146 perf_trace_run_bpf_submit+0x82/0x180 kernel/events/core.c:10416 perf_trace_lock+0x388/0x490 include/trace/events/lock.h:50 trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x9cc/0xa30 kernel/locking/lockdep.c:5836 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:149 [inline] _raw_spin_unlock_irqrestore+0x79/0x140 kernel/locking/spinlock.c:194 __bpf_ringbuf_reserve+0x48a/0x600 kernel/bpf/ringbuf.c:465 ____bpf_ringbuf_output kernel/bpf/ringbuf.c:553 [inline] bpf_ringbuf_output+0x67/0x1e0 kernel/bpf/ringbuf.c:543 bpf_prog_4fbc9f341a3014d4+0x49/0x52 bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline] __bpf_prog_run include/linux/filter.h:701 [inline] bpf_prog_run include/linux/filter.h:708 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2340 [inline] bpf_trace_run1+0x2ca/0x520 kernel/trace/bpf_trace.c:2380 trace_mm_lru_insertion include/trace/events/pagemap.h:28 [inline] lru_add+0xf0c/0x1a20 mm/swap.c:200 folio_batch_move_lru+0x25e/0x4e0 mm/swap.c:213 lru_add_drain_cpu+0x118/0x890 mm/swap.c:661 lru_add_drain+0x123/0x3e0 mm/swap.c:743 __folio_batch_release+0x55/0xa0 mm/swap.c:1064 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x64c/0x1cf0 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1272 evict+0x4e8/0x9b0 fs/inode.c:725 __dentry_kill+0x20d/0x630 fs/dcache.c:615 dput+0x19f/0x2b0 fs/dcache.c:857 do_renameat2+0xda1/0x13f0 fs/namei.c:5172 __do_sys_rename fs/namei.c:5217 [inline] __se_sys_rename fs/namei.c:5215 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5215 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbaa0a9a93b Code: 48 8b 15 f0 64 15 00 83 c8 ff 64 83 3a 15 75 0e 48 8b 7c 24 08 e8 d5 d4 07 00 f7 d8 19 c0 48 83 c4 18 c3 b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 be 64 15 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffd23e5bd48 EFLAGS: 00000206 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbaa0a9a93b RDX: 000055a9b8f6e29f RSI: 00007ffd23e5bd68 RDI: 00007ffd23e5c168 RBP: 000055ace2379330 R08: 0000000000000006 R09: 6d934fde8202c9b9 R10: 00000000000001b6 R11: 0000000000000206 R12: 000055ace237ff20 R13: 00007ffd23e5bd68 R14: 00007ffd23e5c168 R15: 000055acc8527160