syzbot


possible deadlock in skb_queue_tail (5)

Status: auto-obsoleted due to no activity on 2023/10/17 03:25
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+99002eea79449bad3ce2@syzkaller.appspotmail.com
First crash: 486d, last: 326d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] possible deadlock in skb_queue_tail (5) 0 (1) 2023/02/03 12:29
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in skb_queue_tail (6) net 1 123d 123d 26/26 fixed on 2024/03/27 19:12
upstream possible deadlock in skb_queue_tail (3) net 4 785d 1043d 0/26 auto-closed as invalid on 2022/08/04 19:39
linux-5.15 possible deadlock in skb_queue_tail 2 350d 392d 0/3 auto-obsoleted due to no activity on 2023/09/23 13:49
upstream possible deadlock in skb_queue_tail (2) net 1 1203d 1199d 0/26 auto-closed as invalid on 2021/06/12 20:45
upstream possible deadlock in skb_queue_tail net 33 1898d 2250d 0/26 auto-closed as invalid on 2019/09/16 10:00
upstream possible deadlock in skb_queue_tail (4) net 2 613d 618d 0/26 auto-obsoleted due to no activity on 2023/01/23 13:03

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.4.0-syzkaller-12454-g1c7873e33645 #0 Not tainted
------------------------------------------------------
syz-executor.2/14643 is trying to acquire lock:
ffff8880394141e8 (rlock-AF_UNIX){+.+.}-{2:2}, at: skb_queue_tail+0x25/0x150 net/core/skbuff.c:3736

but task is already holding lock:
ffff888039414680 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock net/unix/af_unix.c:1341 [inline]
ffff888039414680 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock+0x77/0xa0 net/unix/af_unix.c:1333

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+0x34/0x40 kernel/locking/spinlock.c:378
       sk_diag_dump_icons net/unix/diag.c:87 [inline]
       sk_diag_fill+0x9f5/0xfc0 net/unix/diag.c:157
       sk_diag_dump net/unix/diag.c:196 [inline]
       unix_diag_dump+0x456/0x730 net/unix/diag.c:220
       netlink_dump+0x570/0xc50 net/netlink/af_netlink.c:2269
       __netlink_dump_start+0x6c0/0x9b0 net/netlink/af_netlink.c:2376
       netlink_dump_start include/linux/netlink.h:330 [inline]
       unix_diag_handler_dump net/unix/diag.c:319 [inline]
       unix_diag_handler_dump+0x679/0x9d0 net/unix/diag.c:308
       __sock_diag_cmd net/core/sock_diag.c:238 [inline]
       sock_diag_rcv_msg+0x31e/0x440 net/core/sock_diag.c:269
       netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2549
       sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
       netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
       netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365
       netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1914
       sock_sendmsg_nosec net/socket.c:725 [inline]
       sock_sendmsg+0xde/0x190 net/socket.c:748
       sock_write_iter+0x29b/0x3d0 net/socket.c:1129
       call_write_iter include/linux/fs.h:1871 [inline]
       do_iter_readv_writev+0x211/0x3b0 fs/read_write.c:735
       do_iter_write+0x182/0x810 fs/read_write.c:860
       vfs_writev+0x1b0/0x670 fs/read_write.c:933
       do_writev+0x270/0x2f0 fs/read_write.c:976
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (rlock-AF_UNIX){+.+.}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3142 [inline]
       check_prevs_add kernel/locking/lockdep.c:3261 [inline]
       validate_chain kernel/locking/lockdep.c:3876 [inline]
       __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
       lock_acquire kernel/locking/lockdep.c:5761 [inline]
       lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
       skb_queue_tail+0x25/0x150 net/core/skbuff.c:3736
       unix_dgram_sendmsg+0xf22/0x1b70 net/unix/af_unix.c:2082
       sock_sendmsg_nosec net/socket.c:725 [inline]
       sock_sendmsg+0xde/0x190 net/socket.c:748
       ____sys_sendmsg+0x34a/0x920 net/socket.c:2494
       ___sys_sendmsg+0x110/0x1b0 net/socket.c:2548
       __sys_sendmmsg+0x18f/0x460 net/socket.c:2634
       __do_sys_sendmmsg net/socket.c:2663 [inline]
       __se_sys_sendmmsg net/socket.c:2660 [inline]
       __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2660
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

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 ***

1 lock held by syz-executor.2/14643:
 #0: ffff888039414680 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock net/unix/af_unix.c:1341 [inline]
 #0: ffff888039414680 (&u->lock/1){+.+.}-{2:2}, at: unix_state_double_lock+0x77/0xa0 net/unix/af_unix.c:1333

stack backtrace:
CPU: 1 PID: 14643 Comm: syz-executor.2 Not tainted 6.4.0-syzkaller-12454-g1c7873e33645 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 check_noncircular+0x2df/0x3b0 kernel/locking/lockdep.c:2195
 check_prev_add kernel/locking/lockdep.c:3142 [inline]
 check_prevs_add kernel/locking/lockdep.c:3261 [inline]
 validate_chain kernel/locking/lockdep.c:3876 [inline]
 __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
 lock_acquire kernel/locking/lockdep.c:5761 [inline]
 lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
 skb_queue_tail+0x25/0x150 net/core/skbuff.c:3736
 unix_dgram_sendmsg+0xf22/0x1b70 net/unix/af_unix.c:2082
 sock_sendmsg_nosec net/socket.c:725 [inline]
 sock_sendmsg+0xde/0x190 net/socket.c:748
 ____sys_sendmsg+0x34a/0x920 net/socket.c:2494
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2548
 __sys_sendmmsg+0x18f/0x460 net/socket.c:2634
 __do_sys_sendmmsg net/socket.c:2663 [inline]
 __se_sys_sendmmsg net/socket.c:2660 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2660
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fccdc28c389
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fccdcf0f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fccdc3abf80 RCX: 00007fccdc28c389
RDX: 0000000000000318 RSI: 00000000200bd000 RDI: 0000000000000005
RBP: 00007fccdc2d7493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffdcddae1bf R14: 00007fccdcf0f300 R15: 0000000000022000
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/09 03:25 upstream 1c7873e33645 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in skb_queue_tail
2023/04/24 00:08 upstream 457391b03803 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in skb_queue_tail
2023/02/02 19:26 upstream 9f266ccaa2f5 16d19e30 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in skb_queue_tail
2023/03/23 02:54 upstream fff5a5e7f528 f94b4a29 .config console log report info ci-qemu-upstream-386 possible deadlock in skb_queue_tail
2023/01/30 12:26 upstream 6d796c50f84c 7374c4e5 .config console log report info ci-qemu-upstream-386 possible deadlock in skb_queue_tail
* Struck through repros no longer work on HEAD.