Re: [PATCH net-next v5 4/7] vsock: add a netlink command to assign the g2h device to a netns

From: Bobby Eshleman

Date: Thu Nov 12 2026 - 14:55:01 EST


On Thu, Nov 12, 2026 at 11:34:49AM +0100, Michal Luczaj wrote:
> 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
>

That's fair, will break out on its own.

Thanks,
Bobby