From: "Michael S. Tsirkin" <mst@redhat.com>
To: Hillf Danton <hdanton@sina.com>
Cc: syzbot <syzbot+3140b17cb44a7b174008@syzkaller.appspotmail.com>,
jasowang@redhat.com, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] kernel BUG in vhost_get_vq_desc
Date: Mon, 21 Feb 2022 08:58:48 -0500 [thread overview]
Message-ID: <20220221085709-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220221130022.1494-1-hdanton@sina.com>
On Mon, Feb 21, 2022 at 09:00:22PM +0800, Hillf Danton wrote:
> On Mon, 21 Feb 2022 05:48:48 -0500 Michael S. Tsirkin wrote:
> > On Mon, Feb 21, 2022 at 06:15:38PM +0800, Hillf Danton wrote:
> > > On Mon, 21 Feb 2022 04:17:02 -0500 Michael S. Tsirkin wrote:
> > > > On Mon, Feb 21, 2022 at 04:52:27PM +0800, Hillf Danton wrote:
> > > > > Another round of attempts to quiesce the
> > > > > WARNING: CPU: 1 PID: 4069 at drivers/vhost/vhost.c:715 after the
> > > > > BUG at drivers/vhost/vhost.c:2337 went home.
> > > >
> > > > Could you pls clarify what do you mean by "went home" here?
> > >
> > > The reproducer failed to trigger it.
> > >
> > > Hillf
> >
> > You mean this patch?
>
> No, it is part of the first round.
> >
> > @@ -2207,7 +2209,10 @@ int vhost_get_vq_desc(struct vhost_virtq
> > __virtio16 avail_idx;
> > __virtio16 ring_head;
> > int ret, access;
> > + bool was_set = !!(vq->used_flags & VRING_USED_F_NO_NOTIFY);
> >
> > + if (!was_set)
> > + return -EINVAL;
> > /* Check it isn't doing very strange things with descriptor numbers. */
> > last_avail_idx = vq->last_avail_idx;
> >
> >
> > However, I do not understand how do we enter vhost_get_vq_desc
> > with vq->used_flags & VRING_USED_F_NO_NOTIFY being clear.
> > Do you?
>
> The diff below turned BUG in to WARNING, and you can see it in one of the
> mails in your inbox as you are on the Cc list.
Right. So it's not a fix, it's just a work around, and we still need to
understand how we can get into this state.
> Hillf
> ---<---
>
> The re-trigger of the BUG_ON sends us to the start point and looks like it
> could not be solved without a mind refresh.
I don't understand this sentence btw. How does BUG_ON send us to the
start point? what is the start point? and what is a mind refresh?
> Add a flag to vsock and set it before work flush upon release, and no more
> works will be queued with it turned on.
>
> Hillf
>
> >>#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ f71077a4d84b
>
> --- x/drivers/vhost/vsock.c
> +++ y/drivers/vhost/vsock.c
> @@ -55,6 +55,7 @@ struct vhost_vsock {
> struct list_head send_pkt_list; /* host->guest pending packets */
>
> atomic_t queued_replies;
> + int cleanup;
>
> u32 guest_cid;
> bool seqpacket_allow;
> @@ -262,6 +263,9 @@ vhost_transport_do_send_pkt(struct vhost
> out:
> mutex_unlock(&vq->mutex);
>
> + if (vsock->cleanup)
> + return;
> +
> if (restart_tx)
> vhost_poll_queue(&tx_vq->poll);
> }
> @@ -678,6 +682,7 @@ static int vhost_vsock_dev_open(struct i
> }
>
> vsock->guest_cid = 0; /* no CID assigned yet */
> + vsock->cleanup = 0;
>
> atomic_set(&vsock->queued_replies, 0);
>
> @@ -741,6 +746,8 @@ static int vhost_vsock_dev_release(struc
> {
> struct vhost_vsock *vsock = file->private_data;
>
> + vsock->cleanup = 1;
> +
> mutex_lock(&vhost_vsock_mutex);
> if (vsock->guest_cid)
> hash_del_rcu(&vsock->hash);
> --
next prev parent reply other threads:[~2022-02-21 13:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220221040745.1177-1-hdanton@sina.com>
2022-02-21 4:18 ` [syzbot] kernel BUG in vhost_get_vq_desc syzbot
[not found] ` <20220221085227.1356-1-hdanton@sina.com>
2022-02-21 9:17 ` Michael S. Tsirkin
[not found] ` <20220221101538.1415-1-hdanton@sina.com>
2022-02-21 10:48 ` Michael S. Tsirkin
[not found] ` <20220221130022.1494-1-hdanton@sina.com>
2022-02-21 13:58 ` Michael S. Tsirkin [this message]
2022-02-21 12:46 ` syzbot
[not found] <20220222031128.1850-1-hdanton@sina.com>
2022-02-22 4:07 ` syzbot
[not found] <20220222001455.1737-1-hdanton@sina.com>
2022-02-22 0:26 ` syzbot
[not found] <20220221140558.1618-1-hdanton@sina.com>
2022-02-21 14:14 ` syzbot
[not found] <20220221054115.1270-1-hdanton@sina.com>
2022-02-21 5:51 ` syzbot
[not found] <20220221021208.1109-1-hdanton@sina.com>
2022-02-21 2:26 ` syzbot
[not found] <20220219125100.835-1-hdanton@sina.com>
2022-02-19 13:01 ` syzbot
2022-02-21 13:09 ` Stefano Garzarella
[not found] ` <20220221133646.1551-1-hdanton@sina.com>
2022-02-21 13:45 ` Stefano Garzarella
2022-02-21 13:59 ` Michael S. Tsirkin
2022-02-21 14:04 ` Stefano Garzarella
[not found] ` <20220220014715.921-1-hdanton@sina.com>
2022-02-20 2:10 ` syzbot
2022-02-21 14:09 ` Stefano Garzarella
2022-02-21 14:25 ` syzbot
2022-02-20 10:08 ` Michael S. Tsirkin
[not found] ` <20220220110941.980-1-hdanton@sina.com>
2022-02-20 12:16 ` Michael S. Tsirkin
2022-02-20 12:31 ` Dmitry Vyukov
2022-02-20 13:10 ` Michael S. Tsirkin
2022-02-20 13:29 ` Michael S. Tsirkin
2022-02-20 13:20 ` syzbot
[not found] <20220219114936.747-1-hdanton@sina.com>
2022-02-19 12:00 ` syzbot
2022-02-12 22:47 syzbot
2022-02-18 1:21 ` syzbot
2022-02-18 11:37 ` Michael S. Tsirkin
2022-02-18 11:37 ` Michael S. Tsirkin
2022-03-02 8:29 ` Lee Jones
2022-03-02 8:29 ` Lee Jones
2022-03-02 9:18 ` Stefano Garzarella
2022-03-02 9:18 ` Stefano Garzarella
2022-03-02 9:23 ` Stefano Garzarella
2022-03-02 9:23 ` Stefano Garzarella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220221085709-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=hdanton@sina.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+3140b17cb44a7b174008@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.