WSL2-Linux-Kernel/net/vmw_vsock
Peilin Ye a3e7b29e30 vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()
Imagine two non-blocking vsock_connect() requests on the same socket.
The first request schedules @connect_work, and after it times out,
vsock_connect_timeout() sets *sock* state back to TCP_CLOSE, but keeps
*socket* state as SS_CONNECTING.

Later, the second request returns -EALREADY, meaning the socket "already
has a pending connection in progress", even though the first request has
already timed out.

As suggested by Stefano, fix it by setting *socket* state back to
SS_UNCONNECTED, so that the second request will return -ETIMEDOUT.

Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-08-10 09:50:18 +01:00
..
Kconfig
Makefile
af_vsock.c vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout() 2022-08-10 09:50:18 +01:00
af_vsock_tap.c
diag.c
hyperv_transport.c hv_sock: Add validation for untrusted Hyper-V values 2022-04-28 15:01:14 +00:00
virtio_transport.c vsock/virtio: add support for device suspend/resume 2022-05-02 16:04:34 -07:00
virtio_transport_common.c virtio/vsock: fix the transport to work with VMADDR_CID_ANY 2021-12-08 15:41:50 -05:00
vmci_transport.c net: remove noblock parameter from skb_recv_datagram() 2022-04-06 13:45:26 +01:00
vmci_transport.h
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport_notify_qstate.c
vsock_addr.c
vsock_loopback.c