acrn-kernel/net/vmw_vsock
Stefano Garzarella 1c5fae9c9a vsock: fix locking in vsock_shutdown()
In vsock_shutdown() we touched some socket fields without holding the
socket lock, such as 'state' and 'sk_flags'.

Also, after the introduction of multi-transport, we are accessing
'vsk->transport' in vsock_send_shutdown() without holding the lock
and this call can be made while the connection is in progress, so
the transport can change in the meantime.

To avoid issues, we hold the socket lock when we enter in
vsock_shutdown() and release it when we leave.

Among the transports that implement the 'shutdown' callback, only
hyperv_transport acquired the lock. Since the caller now holds it,
we no longer take it.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-02-09 15:31:22 -08:00
..
Kconfig
Makefile
af_vsock.c vsock: fix locking in vsock_shutdown() 2021-02-09 15:31:22 -08:00
af_vsock_tap.c
diag.c
hyperv_transport.c vsock: fix locking in vsock_shutdown() 2021-02-09 15:31:22 -08:00
virtio_transport.c
virtio_transport_common.c vsock/virtio: update credit only if socket is not closed 2021-02-08 13:27:46 -08:00
vmci_transport.c
vmci_transport.h
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport_notify_qstate.c
vsock_addr.c vsock_addr: Check for supported flag values 2020-12-14 19:33:39 -08:00
vsock_loopback.c