syzbot


possible deadlock in skb_queue_tail

Status: auto-obsoleted due to no activity on 2023/09/23 13:49
Reported-by: syzbot+52739e7da8bd46b59ebc@syzkaller.appspotmail.com
First crash: 302d, last: 260d
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 33d 33d 24/26 internal: reported on 2024/01/28 06:35
upstream possible deadlock in skb_queue_tail (3) net 4 695d 953d 0/26 auto-closed as invalid on 2022/08/04 19:39
upstream possible deadlock in skb_queue_tail (2) net 1 1113d 1109d 0/26 auto-closed as invalid on 2021/06/12 20:45
upstream possible deadlock in skb_queue_tail net 33 1808d 2160d 0/26 auto-closed as invalid on 2019/09/16 10:00
upstream possible deadlock in skb_queue_tail (4) net 2 523d 528d 0/26 auto-obsoleted due to no activity on 2023/01/23 13:03
upstream possible deadlock in skb_queue_tail (5) net 5 236d 392d 0/26 auto-obsoleted due to no activity on 2023/10/17 03:25

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.117-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/4673 is trying to acquire lock:
ffff888020ce91e0 (rlock-AF_UNIX){+.+.}-{2:2}, at: skb_queue_tail+0x32/0x120 net/core/skbuff.c:3355

but task is already holding lock:
ffff888020ce9688 (&u->lock/1){+.+.}-{2:2}, at: unix_dgram_sendmsg+0x1001/0x2090 net/unix/af_unix.c:1924

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&u->lock/1){+.+.}-{2:2}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368
       sk_diag_dump_icons net/unix/diag.c:86 [inline]
       sk_diag_fill+0x6e6/0xfe0 net/unix/diag.c:156
       sk_diag_dump net/unix/diag.c:195 [inline]
       unix_diag_dump+0x3a5/0x5a0 net/unix/diag.c:223
       netlink_dump+0x606/0xc40 net/netlink/af_netlink.c:2278
       __netlink_dump_start+0x52f/0x6f0 net/netlink/af_netlink.c:2383
       netlink_dump_start include/linux/netlink.h:258 [inline]
       unix_diag_handler_dump+0x1be/0x810 net/unix/diag.c:323
       sock_diag_rcv_msg+0xd5/0x400
       netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504
       sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:276
       netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
       netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
       netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1923
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       sock_write_iter+0x39b/0x530 net/socket.c:1060
       do_iter_readv_writev+0x594/0x7a0
       do_iter_write+0x1ea/0x760 fs/read_write.c:855
       vfs_writev fs/read_write.c:928 [inline]
       do_writev+0x281/0x470 fs/read_write.c:971
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x61/0xcb

-> #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+0x1646/0x58b0 kernel/locking/lockdep.c:3787
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
       skb_queue_tail+0x32/0x120 net/core/skbuff.c:3355
       unix_dgram_sendmsg+0x15c1/0x2090 net/unix/af_unix.c:1947
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       sock_write_iter+0x39b/0x530 net/socket.c:1060
       call_write_iter include/linux/fs.h:2103 [inline]
       io_write+0x84f/0xea0 io_uring/io_uring.c:3771
       io_issue_sqe+0x176a/0xa770 io_uring/io_uring.c:6883
       __io_queue_sqe+0x34/0x360 io_uring/io_uring.c:7191
       io_queue_sqe io_uring/io_uring.c:7242 [inline]
       io_submit_sqe io_uring/io_uring.c:7419 [inline]
       io_submit_sqes+0x30fb/0xa410 io_uring/io_uring.c:7525
       __do_sys_io_uring_enter io_uring/io_uring.c:10254 [inline]
       __se_sys_io_uring_enter+0x28b/0x21c0 io_uring/io_uring.c:10196
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x61/0xcb

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.2/4673:
 #0: ffff88807eb3a0a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter io_uring/io_uring.c:10253 [inline]
 #0: ffff88807eb3a0a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __se_sys_io_uring_enter+0x280/0x21c0 io_uring/io_uring.c:10196
 #1: ffff888020ce9688 (&u->lock/1){+.+.}-{2:2}, at: unix_dgram_sendmsg+0x1001/0x2090 net/unix/af_unix.c:1924

stack backtrace:
CPU: 0 PID: 4673 Comm: syz-executor.2 Not tainted 5.15.117-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 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+0x1646/0x58b0 kernel/locking/lockdep.c:3787
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
 skb_queue_tail+0x32/0x120 net/core/skbuff.c:3355
 unix_dgram_sendmsg+0x15c1/0x2090 net/unix/af_unix.c:1947
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 sock_write_iter+0x39b/0x530 net/socket.c:1060
 call_write_iter include/linux/fs.h:2103 [inline]
 io_write+0x84f/0xea0 io_uring/io_uring.c:3771
 io_issue_sqe+0x176a/0xa770 io_uring/io_uring.c:6883
 __io_queue_sqe+0x34/0x360 io_uring/io_uring.c:7191
 io_queue_sqe io_uring/io_uring.c:7242 [inline]
 io_submit_sqe io_uring/io_uring.c:7419 [inline]
 io_submit_sqes+0x30fb/0xa410 io_uring/io_uring.c:7525
 __do_sys_io_uring_enter io_uring/io_uring.c:10254 [inline]
 __se_sys_io_uring_enter+0x28b/0x21c0 io_uring/io_uring.c:10196
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fc6c12df149
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:00007fc6bf851168 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 00007fc6c13fef80 RCX: 00007fc6c12df149
RDX: 0000000000000000 RSI: 0000000000002000 RDI: 0000000000000008
RBP: 00007fc6c133acd2 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd20896fcf R14: 00007fc6bf851300 R15: 0000000000022000
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/15 13:48 linux-5.15.y 471e639e59d1 90d4044e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in skb_queue_tail
2023/05/04 06:07 linux-5.15.y 8a7f2a5c5aa1 5b7ff9dd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in skb_queue_tail
* Struck through repros no longer work on HEAD.