====================================================== WARNING: possible circular locking dependency detected 5.1.0+ #19 Not tainted ------------------------------------------------------ syz-executor.3/2751 is trying to acquire lock: 0000000002211bdb (&(&u->lock)->rlock/1){+.+.}, at: sk_diag_dump_icons net/unix/diag.c:83 [inline] 0000000002211bdb (&(&u->lock)->rlock/1){+.+.}, at: sk_diag_fill.isra.0+0x9c0/0xf30 net/unix/diag.c:145 but task is already holding lock: 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: sk_diag_dump_icons net/unix/diag.c:65 [inline] 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: sk_diag_fill.isra.0+0x8cb/0xf30 net/unix/diag.c:145 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rlock-AF_UNIX){+.+.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:159 skb_queue_tail+0x26/0x150 net/core/skbuff.c:3004 unix_dgram_sendmsg+0xc31/0x11e0 net/unix/af_unix.c:1755 sock_sendmsg_nosec net/socket.c:660 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:671 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2292 __sys_sendmmsg+0x2db/0x4d0 net/socket.c:2380 __compat_sys_sendmmsg net/compat.c:654 [inline] __do_compat_sys_sendmmsg net/compat.c:661 [inline] __se_compat_sys_sendmmsg net/compat.c:658 [inline] __ia32_compat_sys_sendmmsg+0x9f/0x100 net/compat.c:658 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xd7d arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 -> #0 (&(&u->lock)->rlock/1){+.+.}: lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4302 _raw_spin_lock_nested+0x35/0x50 kernel/locking/spinlock.c:361 sk_diag_dump_icons net/unix/diag.c:83 [inline] sk_diag_fill.isra.0+0x9c0/0xf30 net/unix/diag.c:145 sk_diag_dump net/unix/diag.c:179 [inline] unix_diag_dump+0x35c/0x550 net/unix/diag.c:207 netlink_dump+0x558/0xfb0 net/netlink/af_netlink.c:2253 __netlink_dump_start+0x5b1/0x7d0 net/netlink/af_netlink.c:2361 netlink_dump_start include/linux/netlink.h:226 [inline] unix_diag_handler_dump+0x390/0x740 net/unix/diag.c:308 __sock_diag_cmd net/core/sock_diag.c:232 [inline] sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:263 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2486 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926 sock_sendmsg_nosec net/socket.c:660 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:671 sock_write_iter+0x27c/0x3e0 net/socket.c:1000 call_write_iter include/linux/fs.h:1872 [inline] do_iter_readv_writev+0x5f8/0x8f0 fs/read_write.c:693 do_iter_write fs/read_write.c:970 [inline] do_iter_write+0x184/0x610 fs/read_write.c:951 compat_writev+0x1f6/0x3a0 fs/read_write.c:1295 do_compat_writev+0xf5/0x1f0 fs/read_write.c:1316 __do_compat_sys_writev fs/read_write.c:1327 [inline] __se_compat_sys_writev fs/read_write.c:1323 [inline] __ia32_compat_sys_writev+0x74/0xb0 fs/read_write.c:1323 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xd7d arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rlock-AF_UNIX); lock(&(&u->lock)->rlock/1); lock(rlock-AF_UNIX); lock(&(&u->lock)->rlock/1); *** DEADLOCK *** 5 locks held by syz-executor.3/2751: #0: 00000000e58dd4ea (sock_diag_mutex){+.+.}, at: sock_diag_rcv+0x1c/0x40 net/core/sock_diag.c:273 #1: 00000000d2e4fdac (sock_diag_table_mutex){+.+.}, at: __sock_diag_cmd net/core/sock_diag.c:227 [inline] #1: 00000000d2e4fdac (sock_diag_table_mutex){+.+.}, at: sock_diag_rcv_msg+0x19d/0x410 net/core/sock_diag.c:263 #2: 000000005177ea9d (nlk_cb_mutex-SOCK_DIAG){+.+.}, at: netlink_dump+0xe7/0xfb0 net/netlink/af_netlink.c:2208 #3: 0000000059298b0e (unix_table_lock){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #3: 0000000059298b0e (unix_table_lock){+.+.}, at: unix_diag_dump+0x10d/0x550 net/unix/diag.c:193 #4: 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #4: 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: sk_diag_dump_icons net/unix/diag.c:65 [inline] #4: 000000002308a4dd (rlock-AF_UNIX){+.+.}, at: sk_diag_fill.isra.0+0x8cb/0xf30 net/unix/diag.c:145 stack backtrace: CPU: 1 PID: 2751 Comm: syz-executor.3 Not tainted 5.1.0+ #19 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_circular_bug.cold+0x1cc/0x28f kernel/locking/lockdep.c:1564 check_prev_add kernel/locking/lockdep.c:2309 [inline] check_prevs_add kernel/locking/lockdep.c:2417 [inline] validate_chain kernel/locking/lockdep.c:2799 [inline] __lock_acquire+0x3755/0x5490 kernel/locking/lockdep.c:3792 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4302 _raw_spin_lock_nested+0x35/0x50 kernel/locking/spinlock.c:361 sk_diag_dump_icons net/unix/diag.c:83 [inline] sk_diag_fill.isra.0+0x9c0/0xf30 net/unix/diag.c:145 sk_diag_dump net/unix/diag.c:179 [inline] unix_diag_dump+0x35c/0x550 net/unix/diag.c:207 netlink_dump+0x558/0xfb0 net/netlink/af_netlink.c:2253 __netlink_dump_start+0x5b1/0x7d0 net/netlink/af_netlink.c:2361 netlink_dump_start include/linux/netlink.h:226 [inline] unix_diag_handler_dump+0x390/0x740 net/unix/diag.c:308 __sock_diag_cmd net/core/sock_diag.c:232 [inline] sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:263 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2486 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926 sock_sendmsg_nosec net/socket.c:660 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:671 sock_write_iter+0x27c/0x3e0 net/socket.c:1000 call_write_iter include/linux/fs.h:1872 [inline] do_iter_readv_writev+0x5f8/0x8f0 fs/read_write.c:693 do_iter_write fs/read_write.c:970 [inline] do_iter_write+0x184/0x610 fs/read_write.c:951 compat_writev+0x1f6/0x3a0 fs/read_write.c:1295 do_compat_writev+0xf5/0x1f0 fs/read_write.c:1316 __do_compat_sys_writev fs/read_write.c:1327 [inline] __se_compat_sys_writev fs/read_write.c:1323 [inline] __ia32_compat_sys_writev+0x74/0xb0 fs/read_write.c:1323 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xd7d arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f1a849 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 14 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5d160cc EFLAGS: 00000296 ORIG_RAX: 0000000000000092 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000200001c0 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000