Re: [PATCH net-next v5 4/7] vsock: add a netlink command to assign the g2h device to a netns
From: Michal Luczaj
Date: Thu Nov 12 2026 - 05:39:53 EST
On 11/4/26 02:53, Bobby Eshleman wrote:
> +/* Avoid breaking the socket when another thread has changed its sock->state
> + * while we were asleep.
> + */
> +static void vsock_connect_close(struct socket *sock)
> +{
> + sock->sk->sk_state = TCP_CLOSE;
> + if (sock->state == SS_CONNECTING)
> + sock->state = SS_UNCONNECTED;
> +}
> +
It'd be nice to have it as a separate commit. If I'm not mistaken, this
itself solved the vsock_connect() vs. transport reset
(vhost_vsock_reset_orphans(), virtio_vsock_reset_sock(),
vmci_transport_handle_detach()) races. And those were already reported a
couple of times, including a recent NIPA/Sashiko Severity-Medium[1].
[1]:
https://lore.kernel.org/netdev/179447093204.2199510.8895677421994612994@xxxxxxxxxx/
thanks,
Michal