====================================================== WARNING: possible circular locking dependency detected 5.18.0-rc1-next-20220406-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/20708 is trying to acquire lock: ffff8880280e79e8 (rlock-AF_UNIX){+.+.}-{2:2}, at: skb_queue_tail+0x21/0x140 net/core/skbuff.c:3373 but task is already holding lock: ffff8880280e7e78 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock net/unix/af_unix.c:1276 [inline] ffff8880280e7e78 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock+0x77/0xa0 net/unix/af_unix.c:1268 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&u->lock/1){+.+.}-{2:2}: _raw_spin_lock_nested+0x30/0x40 kernel/locking/spinlock.c:378 sk_diag_dump_icons net/unix/diag.c:87 [inline] sk_diag_fill+0xaaf/0x10d0 net/unix/diag.c:155 sk_diag_dump net/unix/diag.c:193 [inline] unix_diag_dump+0x3b9/0x620 net/unix/diag.c:221 netlink_dump+0x4b5/0xb70 net/netlink/af_netlink.c:2270 __netlink_dump_start+0x647/0x900 net/netlink/af_netlink.c:2375 netlink_dump_start include/linux/netlink.h:245 [inline] unix_diag_handler_dump+0x43b/0x840 net/unix/diag.c:320 __sock_diag_cmd net/core/sock_diag.c:235 [inline] sock_diag_rcv_msg+0x31a/0x440 net/core/sock_diag.c:266 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496 sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:277 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 sock_write_iter+0x283/0x3c0 net/socket.c:1061 call_write_iter include/linux/fs.h:2067 [inline] do_iter_readv_writev+0x3d1/0x640 fs/read_write.c:726 do_iter_write+0x182/0x700 fs/read_write.c:852 vfs_writev+0x1aa/0x630 fs/read_write.c:925 do_writev+0x279/0x2f0 fs/read_write.c:968 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (rlock-AF_UNIX){+.+.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 skb_queue_tail+0x21/0x140 net/core/skbuff.c:3373 unix_dgram_sendmsg+0xef1/0x1a90 net/unix/af_unix.c:2027 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 io_send+0x1bd/0x450 fs/io_uring.c:5555 io_issue_sqe+0x293d/0x9a40 fs/io_uring.c:7526 __io_queue_sqe fs/io_uring.c:7887 [inline] io_queue_sqe fs/io_uring.c:7929 [inline] io_submit_sqe fs/io_uring.c:8134 [inline] io_submit_sqes+0x1f97/0x9c30 fs/io_uring.c:8240 __do_sys_io_uring_enter+0xa83/0x1660 fs/io_uring.c:11308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&u->lock/1); lock(rlock-AF_UNIX); lock(&u->lock/1); lock(rlock-AF_UNIX); *** DEADLOCK *** 2 locks held by syz-executor.4/20708: #0: ffff888079f060a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter+0xa78/0x1660 fs/io_uring.c:11307 #1: ffff8880280e7e78 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock net/unix/af_unix.c:1276 [inline] #1: ffff8880280e7e78 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock+0x77/0xa0 net/unix/af_unix.c:1268 stack backtrace: CPU: 0 PID: 20708 Comm: syz-executor.4 Not tainted 5.18.0-rc1-next-20220406-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 skb_queue_tail+0x21/0x140 net/core/skbuff.c:3373 unix_dgram_sendmsg+0xef1/0x1a90 net/unix/af_unix.c:2027 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 io_send+0x1bd/0x450 fs/io_uring.c:5555 io_issue_sqe+0x293d/0x9a40 fs/io_uring.c:7526 __io_queue_sqe fs/io_uring.c:7887 [inline] io_queue_sqe fs/io_uring.c:7929 [inline] io_submit_sqe fs/io_uring.c:8134 [inline] io_submit_sqes+0x1f97/0x9c30 fs/io_uring.c:8240 __do_sys_io_uring_enter+0xa83/0x1660 fs/io_uring.c:11308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f76bf089049 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f76c0130168 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007f76bf19bf60 RCX: 00007f76bf089049 RDX: 0000000000000000 RSI: 0000000000002a6e RDI: 0000000000000003 RBP: 00007f76bf0e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffccd47784f R14: 00007f76c0130300 R15: 0000000000022000