android_kernel_motorola_sm6375/drivers/vhost
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Al Viro 3a12b2c413 Fix double fget() in vhost_net_set_backend()
commit fb4554c2232e44d595920f4d5c66cf8f7d13f9bc upstream.

Descriptor table is a shared resource; two fget() on the same descriptor
may return different struct file references.  get_tap_ptr_ring() is
called after we'd found (and pinned) the socket we'll be using and it
tries to find the private tun/tap data structures associated with it.
Redoing the lookup by the same file descriptor we'd used to get the
socket is racy - we need to same struct file.

Thanks to Jason for spotting a braino in the original variant of patch -
I'd missed the use of fd == -1 for disabling backend, and in that case
we can end up with sock == NULL and sock != oldsock.

Cc: [email protected]
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-05-25 09:14:34 +02:00
..
Kconfig
Kconfig.vringh
Makefile
net.c Fix double fget() in vhost_net_set_backend() 2022-05-25 09:14:34 +02:00
scsi.c
test.c
test.h
vhost.c
vhost.h
vringh.c
vsock.c vhost/vsock: don't check owner in vhost_vsock_stop() while releasing 2022-03-02 11:41:00 +01:00