linux/net/vmw_vsock
Seth Forshee b9208492fc vsock: remove vsock from connected table when connect is interrupted by a signal
vsock_connect() expects that the socket could already be in the
TCP_ESTABLISHED state when the connecting task wakes up with a signal
pending. If this happens the socket will be in the connected table, and
it is not removed when the socket state is reset. In this situation it's
common for the process to retry connect(), and if the connection is
successful the socket will be added to the connected table a second
time, corrupting the list.

Prevent this by calling vsock_remove_connected() if a signal is received
while waiting for a connection. This is harmless if the socket is not in
the connected table, and if it is in the table then removing it will
prevent list corruption from a double add.

Note for backporting: this patch requires d5afa82c97 ("vsock: correct
removal of socket from the list"), which is in all current stable trees
except 4.9.y.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Signed-off-by: Seth Forshee <sforshee@digitalocean.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20220217141312.2297547-1-sforshee@digitalocean.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-17 08:56:02 -08:00
..
af_vsock_tap.c
af_vsock.c vsock: remove vsock from connected table when connect is interrupted by a signal 2022-02-17 08:56:02 -08:00
diag.c
hyperv_transport.c hv_sock: Extract hvs_send_data() helper that takes only header 2021-12-07 21:49:19 -08:00
Kconfig
Makefile
virtio_transport_common.c virtio/vsock: fix the transport to work with VMADDR_CID_ANY 2021-12-08 15:41:50 -05:00
virtio_transport.c virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
vmci_transport_notify_qstate.c
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport.c net: sock: introduce sk_error_report 2021-06-29 11:28:21 -07:00
vmci_transport.h
vsock_addr.c
vsock_loopback.c vsock/loopback: enable SEQPACKET for transport 2021-06-11 13:32:47 -07:00