android_kernel_motorola_sm6375/drivers/vhost
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stefano Garzarella 0b608b3392 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: [email protected]
Reported-by: [email protected]
Reported-and-tested-by: [email protected]
Signed-off-by: Stefano Garzarella <[email protected]>
Acked-by: Jason Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-03-02 11:41:00 +01:00
..
Kconfig
Kconfig.vringh
Makefile
net.c vhost_net: fix OoB on sendmsg() failure. 2021-09-22 12:26:41 +02:00
scsi.c
test.c
test.h
vhost.c
vhost.h
vringh.c vringh: Use wiov->used to check for read/write desc order 2021-09-03 10:08:15 +02:00
vsock.c vhost/vsock: don't check owner in vhost_vsock_stop() while releasing 2022-03-02 11:41:00 +01:00