android_kernel_sony_sdm845/drivers/vhost
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stefano Garzarella 26e792517f vhost/vsock: don't check owner in vhost_vsock_stop() while releasing
commit a58da53ffd70294ebea8ecd0eb45fd0d74add9f9 upstream.

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.

When invoked from release we can not fail so we don't check return
code of vhost_vsock_stop(). We need to stop vsock even if it's not
the owner.

Fixes: 433fc58e6b ("VSOCK: Introduce vhost_vsock.ko")
Cc: stable@vger.kernel.org
Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+3140b17cb44a7b174008@syzkaller.appspotmail.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:32:00 +01:00
..
Kconfig vhost: split out vringh Kconfig 2016-08-02 16:54:28 +03:00
Kconfig.vringh vhost: split out vringh Kconfig 2016-08-02 16:54:28 +03:00
Makefile VSOCK: Add Makefile and Kconfig 2016-08-02 02:57:30 +03:00
net.c vhost_net: fix ubuf refcount incorrectly when sendmsg fails 2021-01-12 19:49:02 +01:00
scsi.c vhost: scsi: add weight support 2019-08-25 10:51:42 +02:00
test.c vhost/test: fix build for vhost test 2019-09-16 08:19:33 +02:00
test.h
vhost.c vhost: Fix the calculation in vhost_overflow() 2021-08-26 08:37:27 -04:00
vhost.h vhost: introduce vhost_exceeds_weight() 2019-08-25 10:51:41 +02:00
vringh.c vringh: Use wiov->used to check for read/write desc order 2021-09-03 09:44:40 +02:00
vsock.c vhost/vsock: don't check owner in vhost_vsock_stop() while releasing 2022-03-02 11:32:00 +01:00