All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Anirudh Rayabharam <mail@anirudhrb.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	Mike Christie <michael.christie@oracle.com>,
	Jason Wang <jasowang@redhat.com>, netdev <netdev@vger.kernel.org>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	Stefan Hajnoczi <stefanha@redhat.com>, kvm <kvm@vger.kernel.org>,
	Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing
Date: Mon, 21 Feb 2022 17:44:20 +0100	[thread overview]
Message-ID: <20220221164420.cnhs6sgxizc6tcok@sgarzare-redhat> (raw)
In-Reply-To: <YhO6bwu7iDtUFQGj@anirudhrb.com>

On Mon, Feb 21, 2022 at 09:44:39PM +0530, Anirudh Rayabharam wrote:
>On Mon, Feb 21, 2022 at 02:59:30PM +0100, Stefano Garzarella wrote:
>> On Mon, Feb 21, 2022 at 12:49 PM Stefano Garzarella <sgarzare@redhat.com> wrote:
>> >
>> > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device
>> > ownership. It expects current->mm to be valid.
>> >
>> > vhost_vsock_stop() is also called by vhost_vsock_dev_release() when
>> > the user has not done close(), so when we are in do_exit(). In this
>> > case current->mm is invalid and we're releasing the device, so we
>> > should clean it anyway.
>> >
>> > Let's check the owner only when vhost_vsock_stop() is called
>> > by an ioctl.
>> >
>> > Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
>> > Cc: stable@vger.kernel.org
>> > Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com
>> > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>> > ---
>> >  drivers/vhost/vsock.c | 14 ++++++++------
>> >  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> Reported-and-tested-by: syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com
>
>I don't think this patch fixes "INFO: task hung in vhost_work_dev_flush"
>even though syzbot says so. I am able to reproduce the issue locally
>even with this patch applied.

Are you using the sysbot reproducer or another test?
In that case, can you share it?

 From the stack trace it seemed to me that the worker accesses a zone 
that has been cleaned (iotlb), so it is invalid and fails.
That's why I had this patch tested which should stop the worker before 
cleaning.

Thanks,
Stefano


WARNING: multiple messages have this Message-ID (diff)
From: Stefano Garzarella <sgarzare@redhat.com>
To: Anirudh Rayabharam <mail@anirudhrb.com>
Cc: Hillf Danton <hdanton@sina.com>, kvm <kvm@vger.kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	netdev <netdev@vger.kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing
Date: Mon, 21 Feb 2022 17:44:20 +0100	[thread overview]
Message-ID: <20220221164420.cnhs6sgxizc6tcok@sgarzare-redhat> (raw)
In-Reply-To: <YhO6bwu7iDtUFQGj@anirudhrb.com>

On Mon, Feb 21, 2022 at 09:44:39PM +0530, Anirudh Rayabharam wrote:
>On Mon, Feb 21, 2022 at 02:59:30PM +0100, Stefano Garzarella wrote:
>> On Mon, Feb 21, 2022 at 12:49 PM Stefano Garzarella <sgarzare@redhat.com> wrote:
>> >
>> > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device
>> > ownership. It expects current->mm to be valid.
>> >
>> > vhost_vsock_stop() is also called by vhost_vsock_dev_release() when
>> > the user has not done close(), so when we are in do_exit(). In this
>> > case current->mm is invalid and we're releasing the device, so we
>> > should clean it anyway.
>> >
>> > Let's check the owner only when vhost_vsock_stop() is called
>> > by an ioctl.
>> >
>> > Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
>> > Cc: stable@vger.kernel.org
>> > Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com
>> > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>> > ---
>> >  drivers/vhost/vsock.c | 14 ++++++++------
>> >  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> Reported-and-tested-by: syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com
>
>I don't think this patch fixes "INFO: task hung in vhost_work_dev_flush"
>even though syzbot says so. I am able to reproduce the issue locally
>even with this patch applied.

Are you using the sysbot reproducer or another test?
In that case, can you share it?

 From the stack trace it seemed to me that the worker accesses a zone 
that has been cleaned (iotlb), so it is invalid and fails.
That's why I had this patch tested which should stop the worker before 
cleaning.

Thanks,
Stefano

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-02-21 16:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 11:49 [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing Stefano Garzarella
2022-02-21 11:49 ` Stefano Garzarella
2022-02-21 13:59 ` Stefano Garzarella
2022-02-21 13:59   ` Stefano Garzarella
2022-02-21 16:14   ` Anirudh Rayabharam
2022-02-21 16:44     ` Stefano Garzarella [this message]
2022-02-21 16:44       ` Stefano Garzarella
2022-02-21 18:03       ` Anirudh Rayabharam
2022-02-21 18:26         ` Stefano Garzarella
2022-02-21 18:26           ` Stefano Garzarella
2022-02-21 19:36           ` Anirudh Rayabharam
2022-02-22  9:05             ` Stefano Garzarella
2022-02-22  9:05               ` Stefano Garzarella
2022-02-21 15:03 ` Michael S. Tsirkin
2022-02-21 15:03   ` Michael S. Tsirkin
2022-02-21 15:22   ` Stefano Garzarella
2022-02-21 15:22     ` Stefano Garzarella
2022-02-21 23:51 ` kernel test robot
2022-02-22  5:30   ` Dan Carpenter
2022-02-22  5:30   ` Dan Carpenter
2022-02-22  5:30   ` Dan Carpenter
2022-02-22  8:11   ` Stefano Garzarella
2022-02-22  8:11     ` Stefano Garzarella
2022-02-22  8:11     ` 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=20220221164420.cnhs6sgxizc6tcok@sgarzare-redhat \
    --to=sgarzare@redhat.com \
    --cc=hdanton@sina.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@anirudhrb.com \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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.