syzbot


possible deadlock in skb_queue_tail

Status: auto-closed as invalid on 2019/09/16 10:00
Reported-by: syzbot+6b495100f17ca8554ab9@syzkaller.appspotmail.com
First crash: 1769d, last: 1417d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in skb_queue_tail (3) 4 303d 561d 0/24 auto-closed as invalid on 2022/08/04 19:39
upstream possible deadlock in skb_queue_tail (2) 1 721d 717d 0/24 auto-closed as invalid on 2021/06/12 20:45
upstream possible deadlock in skb_queue_tail (4) 2 132d 137d 0/24 auto-obsoleted due to no activity on 2023/01/23 13:03
upstream possible deadlock in skb_queue_tail (5) 2 1d19h 1d02h 0/24 upstream: reported on 2023/02/03 12:29

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.0.0+ #15 Not tainted
------------------------------------------------------
syz-executor.2/844 is trying to acquire lock:
00000000520483ab (rlock-AF_UNIX){+.+.}, at: skb_queue_tail+0x26/0x150 net/core/skbuff.c:2972

but task is already holding lock:
00000000de9aec21 (&(&u->lock)->rlock/1){+.+.}, at: unix_state_double_lock net/unix/af_unix.c:1087 [inline]
00000000de9aec21 (&(&u->lock)->rlock/1){+.+.}, at: unix_state_double_lock+0x80/0xb0 net/unix/af_unix.c:1079

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&(&u->lock)->rlock/1){+.+.}:
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4202
       _raw_spin_lock_nested+0x35/0x50 kernel/locking/spinlock.c:354
       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+0x55d/0xfb0 net/netlink/af_netlink.c:2252
       __netlink_dump_start+0x5b4/0x7e0 net/netlink/af_netlink.c:2360
       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+0x322/0x410 net/core/sock_diag.c:263
       netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2485
       sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274
       netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
       netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336
       netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1925
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xdd/0x130 net/socket.c:632
       sock_write_iter+0x27c/0x3e0 net/socket.c:923
       call_write_iter include/linux/fs.h:1860 [inline]
       do_iter_readv_writev+0x5e1/0x8e0 fs/read_write.c:680
       do_iter_write fs/read_write.c:956 [inline]
       do_iter_write+0x184/0x610 fs/read_write.c:937
       vfs_writev+0x1b3/0x2f0 fs/read_write.c:1001
       do_writev+0xf6/0x290 fs/read_write.c:1036
       __do_sys_writev fs/read_write.c:1109 [inline]
       __se_sys_writev fs/read_write.c:1106 [inline]
       __x64_sys_writev+0x75/0xb0 fs/read_write.c:1106
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (rlock-AF_UNIX){+.+.}:
       check_prevs_add kernel/locking/lockdep.c:2324 [inline]
       validate_chain kernel/locking/lockdep.c:2705 [inline]
       __lock_acquire+0x239c/0x3fb0 kernel/locking/lockdep.c:3692
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4202
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
       skb_queue_tail+0x26/0x150 net/core/skbuff.c:2972
       unix_dgram_sendmsg+0xc31/0x11e0 net/unix/af_unix.c:1755
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xdd/0x130 net/socket.c:632
       ___sys_sendmsg+0x3e2/0x930 net/socket.c:2137
       __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2232
       __do_sys_sendmmsg net/socket.c:2261 [inline]
       __se_sys_sendmmsg net/socket.c:2258 [inline]
       __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2258
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&(&u->lock)->rlock/1);
                               lock(rlock-AF_UNIX);
                               lock(&(&u->lock)->rlock/1);
  lock(rlock-AF_UNIX);

 *** DEADLOCK ***

1 lock held by syz-executor.2/844:
 #0: 00000000de9aec21 (&(&u->lock)->rlock/1){+.+.}, at: unix_state_double_lock net/unix/af_unix.c:1087 [inline]
 #0: 00000000de9aec21 (&(&u->lock)->rlock/1){+.+.}, at: unix_state_double_lock+0x80/0xb0 net/unix/af_unix.c:1079

stack backtrace:
CPU: 0 PID: 844 Comm: syz-executor.2 Not tainted 5.0.0+ #15
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.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1562
 check_prev_add.constprop.0+0xf11/0x23c0 kernel/locking/lockdep.c:2211
 check_prevs_add kernel/locking/lockdep.c:2324 [inline]
 validate_chain kernel/locking/lockdep.c:2705 [inline]
 __lock_acquire+0x239c/0x3fb0 kernel/locking/lockdep.c:3692
 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4202
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
 skb_queue_tail+0x26/0x150 net/core/skbuff.c:2972
 unix_dgram_sendmsg+0xc31/0x11e0 net/unix/af_unix.c:1755
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xdd/0x130 net/socket.c:632
 ___sys_sendmsg+0x3e2/0x930 net/socket.c:2137
 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2232
 __do_sys_sendmmsg net/socket.c:2261 [inline]
 __se_sys_sendmmsg net/socket.c:2258 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2258
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457f29
Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f670cf55c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457f29
RDX: 0000000000000080 RSI: 00000000200bd000 RDI: 0000000000000004
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f670cf566d4
R13: 00000000004c4f12 R14: 00000000004d8c70 R15: 00000000ffffffff

Crashes (33):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-selinux-root 2019/03/10 03:08 upstream 6cdc577a18a6 12365b99 .config console log report
ci-upstream-kasan-gce 2018/09/02 06:55 upstream 360bd62dc494 a4718693 .config console log report
ci-upstream-kasan-gce 2018/08/20 18:19 upstream 2ad0d5269970 2dc4378f .config console log report
ci-upstream-kasan-gce 2018/05/23 18:25 upstream a048a07d7f45 f48c20b8 .config console log report
ci-upstream-kasan-gce-386 2019/02/12 14:12 upstream aa0c38cf39de 6ecc6d0f .config console log report
ci-upstream-kasan-gce-386 2018/07/31 00:12 upstream 527838d470e3 1a381291 .config console log report
ci-upstream-kasan-gce-386 2018/06/23 03:30 upstream 894b8c000ae6 89d2e600 .config console log report
ci-upstream-kasan-gce-386 2018/06/16 16:32 upstream 35773c93817c 27c5f59f .config console log report
ci-upstream-kasan-gce-386 2018/05/14 14:26 upstream 66e1c94db3cd 9467cacb .config console log report
ci-upstream-net-this-kasan-gce 2018/07/24 06:42 net 5302a84e3781 912c93d7 .config console log report
ci-upstream-net-this-kasan-gce 2018/07/19 21:51 net e56b8ce363a3 49f35839 .config console log report
ci-upstream-net-kasan-gce 2019/03/20 09:59 net-next 9bd5423fc75e 2458c1c6 .config console log report
ci-upstream-net-kasan-gce 2019/01/15 10:22 net-next b71acb0e3721 ebacf5cb .config console log report
ci-upstream-net-kasan-gce 2018/06/21 22:28 net-next f0dc7f9c6dd9 095ef806 .config console log report
ci-upstream-net-kasan-gce 2018/06/16 03:17 net-next f0dc7f9c6dd9 27c5f59f .config console log report
ci-upstream-net-kasan-gce 2018/06/15 05:21 net-next f0dc7f9c6dd9 27c5f59f .config console log report
ci-upstream-net-kasan-gce 2018/06/07 03:14 net-next 7170e6045a6a e0e534c6 .config console log report
ci-upstream-net-kasan-gce 2018/06/06 15:44 net-next 4016a7f15efc 41f9540d .config console log report
ci-upstream-net-kasan-gce 2018/06/06 15:24 net-next 4016a7f15efc 41f9540d .config console log report
ci-upstream-net-kasan-gce 2018/06/05 04:32 net-next 4cd328f83916 a50d873b .config console log report
ci-upstream-net-kasan-gce 2018/06/05 03:42 net-next 4cd328f83916 a50d873b .config console log report
ci-upstream-net-kasan-gce 2018/06/05 02:03 net-next 4cd328f83916 a50d873b .config console log report
ci-upstream-net-kasan-gce 2018/06/04 23:19 net-next 4cd328f83916 a50d873b .config console log report
ci-upstream-net-kasan-gce 2018/06/04 18:49 net-next f624434a0ec9 6cbe7c26 .config console log report
ci-upstream-net-kasan-gce 2018/06/03 05:06 net-next 1ffdd8e1643f 2f93b54f .config console log report
ci-upstream-net-kasan-gce 2018/06/01 22:21 net-next af066ed3d455 2f93b54f .config console log report
ci-upstream-net-kasan-gce 2018/06/01 18:35 net-next af066ed3d455 2f93b54f .config console log report
ci-upstream-net-kasan-gce 2018/06/01 16:26 net-next af066ed3d455 2f93b54f .config console log report
ci-upstream-net-kasan-gce 2018/05/30 23:17 net-next 37c9102f216c 2f93b54f .config console log report
ci-upstream-net-kasan-gce 2018/05/29 09:45 net-next cb1603948a0b f48c20b8 .config console log report
ci-upstream-net-kasan-gce 2018/05/20 19:37 net-next 571e7b85c5db f48c20b8 .config console log report
ci-upstream-net-kasan-gce 2018/05/12 13:40 net-next b2d6cee117f7 e726f42b .config console log report
ci-upstream-net-kasan-gce 2018/04/01 21:13 net-next 06b19fe9a6df dc889257 .config console log report
* Struck through repros no longer work on HEAD.