• Stefano Garzarella's avatar
    vsock/virtio: fix sock refcnt holding during the shutdown · ad8a7220
    Stefano Garzarella authored
    The "42f5cda5" commit rightly set SOCK_DONE on peer shutdown,
    but there is an issue if we receive the SHUTDOWN(RDWR) while the
    virtio_transport_close_timeout() is scheduled.
    In this case, when the timeout fires, the SOCK_DONE is already
    set and the virtio_transport_close_timeout() will not call
    virtio_transport_reset() and virtio_transport_do_close().
    This causes that both sockets remain open and will never be released,
    preventing the unloading of [virtio|vhost]_transport modules.
    
    This patch fixes this issue, calling virtio_transport_reset() and
    virtio_transport_do_close() when we receive the SHUTDOWN(RDWR)
    and there is nothing left to read.
    
    Fixes: 42f5cda5 ("vsock/virtio: set SOCK_DONE on peer shutdown")
    Cc: Stephen Barber <smbarber@chromium.org>
    Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ad8a7220
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
af_vsock.c Loading commit data...
af_vsock_tap.c Loading commit data...
diag.c Loading commit data...
hyperv_transport.c Loading commit data...
virtio_transport.c Loading commit data...
virtio_transport_common.c Loading commit data...
vmci_transport.c Loading commit data...
vmci_transport.h Loading commit data...
vmci_transport_notify.c Loading commit data...
vmci_transport_notify.h Loading commit data...
vmci_transport_notify_qstate.c Loading commit data...
vsock_addr.c Loading commit data...