====================================================== WARNING: possible circular locking dependency detected 5.15.181-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.84/5406 is trying to acquire lock: ffff88807639c9e0 (rlock-AF_UNIX){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] ffff88807639c9e0 (rlock-AF_UNIX){+.+.}-{2:2}, at: scan_inflight+0x48/0x3e0 net/unix/garbage.c:97 but task is already holding lock: ffffffff8d320698 (unix_gc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] ffffffff8d320698 (unix_gc_lock){+.+.}-{2:2}, at: unix_gc+0x103/0x10e0 net/unix/garbage.c:215 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (unix_gc_lock){+.+.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] unix_notinflight+0x139/0x380 net/unix/scm.c:73 unix_detach_fds net/unix/scm.c:136 [inline] unix_destruct_scm+0x195/0x270 net/unix/scm.c:147 skb_release_head_state+0xf6/0x240 net/core/skbuff.c:729 skb_release_all net/core/skbuff.c:740 [inline] __kfree_skb net/core/skbuff.c:756 [inline] consume_skb+0x72/0x100 net/core/skbuff.c:914 queue_oob+0x546/0x800 net/unix/af_unix.c:2000 unix_stream_sendmsg+0xb5d/0xc80 net/unix/af_unix.c:2105 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436 ___sys_sendmsg+0x1f0/0x260 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg+0x190/0x250 net/socket.c:2526 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (rlock-AF_UNIX){+.+.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] scan_inflight+0x48/0x3e0 net/unix/garbage.c:97 scan_children+0x269/0x410 net/unix/garbage.c:137 unix_gc+0x499/0x10e0 net/unix/garbage.c:273 unix_release_sock+0x905/0xa70 net/unix/af_unix.c:598 unix_release+0x88/0xc0 net/unix/af_unix.c:933 __sock_release net/socket.c:649 [inline] sock_close+0xd5/0x240 net/socket.c:1336 __fput+0x234/0x930 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(unix_gc_lock); lock(rlock-AF_UNIX); lock(unix_gc_lock); lock(rlock-AF_UNIX); *** DEADLOCK *** 2 locks held by syz.1.84/5406: #0: ffff8880581cc410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #0: ffff8880581cc410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:648 [inline] #0: ffff8880581cc410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x90/0x240 net/socket.c:1336 #1: ffffffff8d320698 (unix_gc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #1: ffffffff8d320698 (unix_gc_lock){+.+.}-{2:2}, at: unix_gc+0x103/0x10e0 net/unix/garbage.c:215 stack backtrace: CPU: 1 PID: 5406 Comm: syz.1.84 Not tainted 5.15.181-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] scan_inflight+0x48/0x3e0 net/unix/garbage.c:97 scan_children+0x269/0x410 net/unix/garbage.c:137 unix_gc+0x499/0x10e0 net/unix/garbage.c:273 unix_release_sock+0x905/0xa70 net/unix/af_unix.c:598 unix_release+0x88/0xc0 net/unix/af_unix.c:933 __sock_release net/socket.c:649 [inline] sock_close+0xd5/0x240 net/socket.c:1336 __fput+0x234/0x930 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f32e912fde9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffda0434a68 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f32e934aba0 RCX: 00007f32e912fde9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f32e934aba0 R08: 0000000000000000 R09: 0000000aa0434d5f R10: 000000000003fd80 R11: 0000000000000246 R12: 000000000001e68f R13: 00007f32e9349080 R14: ffffffffffffffff R15: 00007ffda0434b80