[syzbot] [net?] [virt?] [io-uring?] [kvm?] BUG: soft lockup in vsock_connect

1 view
Skip to first unread message

syzbot

unread,
Mar 23, 2023, 8:52:42 PM3/23/23
to ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, sgar...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org
Hello,

syzbot found the following issue on:

HEAD commit: fe15c26ee26e Linux 6.3-rc1
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=1577c97ec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=7573cbcd881a88c9
dashboard link: https://syzkaller.appspot.com/bug?extid=0bc015ebddc291a97116
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1077c996c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17e38929c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/89d41abd07bd/disk-fe15c26e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fa75f5030ade/vmlinux-fe15c26e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/590d0f5903ee/Image-fe15c26e.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0bc015...@syzkaller.appspotmail.com

watchdog: BUG: soft lockup - CPU#0 stuck for 27s! [syz-executor244:6747]
Modules linked in:
irq event stamp: 6033
hardirqs last enabled at (6032): [<ffff8000124604ac>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline]
hardirqs last enabled at (6032): [<ffff8000124604ac>] exit_to_kernel_mode+0xe8/0x118 arch/arm64/kernel/entry-common.c:94
hardirqs last disabled at (6033): [<ffff80001245e188>] __el1_irq arch/arm64/kernel/entry-common.c:468 [inline]
hardirqs last disabled at (6033): [<ffff80001245e188>] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:486
softirqs last enabled at (616): [<ffff80001066ca80>] spin_unlock_bh include/linux/spinlock.h:395 [inline]
softirqs last enabled at (616): [<ffff80001066ca80>] lock_sock_nested+0xe8/0x138 net/core/sock.c:3480
softirqs last disabled at (618): [<ffff8000122dbcfc>] spin_lock_bh include/linux/spinlock.h:355 [inline]
softirqs last disabled at (618): [<ffff8000122dbcfc>] virtio_transport_purge_skbs+0x11c/0x500 net/vmw_vsock/virtio_transport_common.c:1372
CPU: 0 PID: 6747 Comm: syz-executor244 Not tainted 6.3.0-rc1-syzkaller-gfe15c26ee26e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __sanitizer_cov_trace_pc+0xc/0x8c kernel/kcov.c:203
lr : virtio_transport_purge_skbs+0x19c/0x500 net/vmw_vsock/virtio_transport_common.c:1374
sp : ffff80001e787890
x29: ffff80001e7879e0 x28: 1ffff00003cf0f2a x27: ffff80001a487a60
x26: ffff80001e787950 x25: ffff0000ce2d3b80 x24: ffff80001a487a78
x23: 1ffff00003490f4c x22: ffff80001a29c1a8 x21: dfff800000000000
x20: ffff80001a487a60 x19: ffff80001e787940 x18: 1fffe000368951b6
x17: ffff800015cdd000 x16: ffff8000085110b0 x15: 0000000000000000
x14: 1ffff00002b9c0b2 x13: dfff800000000000 x12: ffff700003cf0efc
x11: ff808000122dbee8 x10: 0000000000000000 x9 : ffff8000122dbee8
x8 : ffff0000ce511b40 x7 : ffff8000122dbcfc x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80000832d758
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
get_current arch/arm64/include/asm/current.h:19 [inline]
__sanitizer_cov_trace_pc+0xc/0x8c kernel/kcov.c:206
vsock_loopback_cancel_pkt+0x28/0x3c net/vmw_vsock/vsock_loopback.c:48
vsock_transport_cancel_pkt net/vmw_vsock/af_vsock.c:1284 [inline]
vsock_connect+0x6b8/0xaec net/vmw_vsock/af_vsock.c:1426
__sys_connect_file net/socket.c:2004 [inline]
__sys_connect+0x268/0x290 net/socket.c:2021
__do_sys_connect net/socket.c:2031 [inline]
__se_sys_connect net/socket.c:2028 [inline]
__arm64_sys_connect+0x7c/0x94 net/socket.c:2028
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Stefano Garzarella

unread,
Mar 24, 2023, 4:48:44 AM3/24/23
to Bobby Eshleman, Bobby Eshleman, syzbot, ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org, Krasnov Arseniy, Krasnov Arseniy Vladimirovich
Hi Bobby,
FYI we have also this one, but it seems related to
syzbot+befff0...@syzkaller.appspotmail.com

Thanks,
Stefano

Hillf Danton

unread,
Mar 24, 2023, 6:42:25 AM3/24/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 23 Mar 2023 17:52:41 -0700
> HEAD commit: fe15c26ee26e Linux 6.3-rc1
> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17e38929c80000

Splice skb before purging it.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fff5a5e7f528

--- x/net/vmw_vsock/vsock_loopback.c
+++ y/net/vmw_vsock/vsock_loopback.c
@@ -44,8 +44,15 @@ static int vsock_loopback_send_pkt(struc
static int vsock_loopback_cancel_pkt(struct vsock_sock *vsk)
{
struct vsock_loopback *vsock = &the_vsock_loopback;
+ struct sk_buff_head pkts;

- virtio_transport_purge_skbs(vsk, &vsock->pkt_queue);
+ skb_queue_head_init(&pkts);
+
+ spin_lock_bh(&vsock->pkt_list_lock);
+ skb_queue_splice_init(&vsock->pkt_queue, &pkts);
+ spin_unlock_bh(&vsock->pkt_list_lock);
+
+ virtio_transport_purge_skbs(vsk, &pkts);

return 0;
}
--

syzbot

unread,
Mar 24, 2023, 7:07:24 AM3/24/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+0bc015...@syzkaller.appspotmail.com

Tested on:

commit: fff5a5e7 Merge tag 'for-linus' of git://git.armlinux.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=133635eec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=12e37aa0abf8dee
dashboard link: https://syzkaller.appspot.com/bug?extid=0bc015ebddc291a97116
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=1478e85ac80000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Mar 24, 2023, 10:59:28 AM3/24/23
to sgar...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file net/vmw_vsock/vsock_loopback.c
patch: **** unexpected end of file in patch



Tested on:

commit: fff5a5e7 Merge tag 'for-linus' of git://git.armlinux.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=131b20d5c80000

syzbot

unread,
Mar 24, 2023, 11:31:27 AM3/24/23
to sgar...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+0bc015...@syzkaller.appspotmail.com

Tested on:

commit: b86958d7 vsock/loopback: use only sk_buff_head.lock to..
git tree: https://github.com/stefano-garzarella/linux.git vsock-fix-loopback-cancel
console output: https://syzkaller.appspot.com/x/log.txt?x=1624510ec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=12e37aa0abf8dee
dashboard link: https://syzkaller.appspot.com/bug?extid=0bc015ebddc291a97116
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

Note: no patches were applied.

Stefano Garzarella

unread,
Mar 24, 2023, 11:33:20 AM3/24/23
to syzbot, ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org
#syz dup general protection fault in virtio_transport_purge_skbs

On Fri, Mar 24, 2023 at 1:52 AM syzbot
<syzbot+0bc015...@syzkaller.appspotmail.com> wrote:
>

Bobby Eshleman

unread,
Mar 24, 2023, 8:44:49 PM3/24/23
to Stefano Garzarella, Bobby Eshleman, Bobby Eshleman, syzbot, ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org, Krasnov Arseniy, Krasnov Arseniy Vladimirovich
On Fri, Mar 24, 2023 at 09:38:38AM +0100, Stefano Garzarella wrote:
> Hi Bobby,
> FYI we have also this one, but it seems related to
> syzbot+befff0...@syzkaller.appspotmail.com
>
> Thanks,
> Stefano
>

Got it, I'll look into it.

Best,
Bobby

Cong Wang

unread,
Mar 26, 2023, 3:20:35 PM3/26/23
to Bobby Eshleman, Stefano Garzarella, Bobby Eshleman, Bobby Eshleman, syzbot, ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org, Krasnov Arseniy, Krasnov Arseniy Vladimirovich
On Sat, Mar 18, 2023 at 12:32:39AM +0000, Bobby Eshleman wrote:
> On Fri, Mar 24, 2023 at 09:38:38AM +0100, Stefano Garzarella wrote:
> > Hi Bobby,
> > FYI we have also this one, but it seems related to
> > syzbot+befff0...@syzkaller.appspotmail.com
> >
> > Thanks,
> > Stefano
> >
>
> Got it, I'll look into it.
>

It seems you forgot to set skb->sk??

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 957cdc01c8e8..d47ad27b409d 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -236,6 +236,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
}

virtio_transport_inc_tx_pkt(vvs, skb);
+ skb_set_owner_w(skb, sk_vsock(vsk));

return t_ops->send_pkt(skb);
}

Stefano Garzarella

unread,
Mar 27, 2023, 5:08:08 AM3/27/23
to Bobby Eshleman, Bobby Eshleman, Bobby Eshleman, syzbot, ax...@kernel.dk, da...@davemloft.net, edum...@google.com, io-u...@vger.kernel.org, ku...@kernel.org, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, stef...@redhat.com, syzkall...@googlegroups.com, virtual...@lists.linux-foundation.org, Krasnov Arseniy, Krasnov Arseniy Vladimirovich
On Sat, Mar 25, 2023 at 1:44 AM Bobby Eshleman <bobbye...@gmail.com> wrote:
>
> On Fri, Mar 24, 2023 at 09:38:38AM +0100, Stefano Garzarella wrote:
> > Hi Bobby,
> > FYI we have also this one, but it seems related to
> > syzbot+befff0...@syzkaller.appspotmail.com
> >
> > Thanks,
> > Stefano
> >
>
> Got it, I'll look into it.

I think it is related to
syzbot+befff0...@syzkaller.appspotmail.com, so I tested the
same patch and syzbot seems happy.
I marked this as duplicated, but feel free to undup if it is not the case.

Thanks,
Stefano

Reply all
Reply to author
Forward
0 new messages