From: Michal Luczaj <mhal@rbox.co>
To: "Stefan Hajnoczi" <stefanha@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowangio@gmail.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>, "Asias He" <asias@redhat.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Luczaj <mhal@rbox.co>
Subject: [PATCH net v2 2/5] vsock/virtio: Streamline socket reset on transport/PM event
Date: Tue, 15 Sep 2026 15:15:13 +0200 [thread overview]
Message-ID: <20260915-vsock-connect-reset-closing-v2-2-a1d9abb472f7@rbox.co> (raw)
In-Reply-To: <20260915-vsock-connect-reset-closing-v2-0-a1d9abb472f7@rbox.co>
Follow vhost's vhost_vsock_reset_orphans() and VMCI's
vmci_transport_handle_detach(): set SHUTDOWN_MASK, which will come handy
later in the series.
Note that commit c38f57da428b ("vhost/vsock: fix reset orphans race with
close timeout") fixed a race between pending close timer, i.e.
virtio_transport_close_timeout(), and a transport/PM reset. But here we
never set SOCK_DONE, hence no race.
Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko")
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/vmw_vsock/virtio_transport.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 4f9aa9c4c3aa..4d6991321699 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -413,11 +413,14 @@ static void virtio_vsock_event_fill(struct virtio_vsock *vsock)
static void virtio_vsock_reset_sock(struct sock *sk)
{
+ struct vsock_sock *vsk = vsock_sk(sk);
+
/* vmci_transport.c doesn't take sk_lock here either. At least we're
* under vsock_table_lock so the sock cannot disappear while we're
* executing.
*/
+ vsk->peer_shutdown = SHUTDOWN_MASK;
sk->sk_state = TCP_CLOSE;
sk->sk_err = ECONNRESET;
sk_error_report(sk);
--
2.55.0
next prev parent reply other threads:[~2026-09-15 13:15 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 13:15 [PATCH net v2 0/5] vsock: Fix connect() races Michal Luczaj
2026-09-15 13:15 ` [PATCH net v2 1/5] vhost/vsock: Fix socket state constant Michal Luczaj
2026-09-16 12:28 ` Stefano Garzarella
2026-09-16 13:15 ` sashiko-bot
2026-09-15 13:15 ` Michal Luczaj [this message]
2026-09-16 12:30 ` [PATCH net v2 2/5] vsock/virtio: Streamline socket reset on transport/PM event Stefano Garzarella
2026-09-22 13:17 ` Michal Luczaj
2026-09-24 10:06 ` Stefano Garzarella
2026-09-24 21:26 ` Michal Luczaj
2026-09-16 13:15 ` sashiko-bot
2026-09-16 23:39 ` netdev-bot+sashiko
2026-09-15 13:15 ` [PATCH net v2 3/5] vsock: Enforce no-transport invariant for TCP_LISTEN sockets Michal Luczaj
2026-09-16 12:30 ` Stefano Garzarella
2026-09-22 13:18 ` Michal Luczaj
2026-09-24 10:17 ` Stefano Garzarella
2026-09-24 21:26 ` Michal Luczaj
2026-09-28 10:31 ` Stefano Garzarella
2026-10-05 7:58 ` Michal Luczaj
2026-09-16 13:15 ` sashiko-bot
2026-09-16 23:39 ` netdev-bot+sashiko
2026-09-15 13:15 ` [PATCH net v2 4/5] vsock: Do not reset a TCP_CLOSING socket Michal Luczaj
2026-09-16 12:30 ` Stefano Garzarella
2026-09-22 13:17 ` Michal Luczaj
2026-09-16 13:16 ` sashiko-bot
2026-09-16 23:39 ` netdev-bot+sashiko
2026-09-15 13:15 ` [PATCH net v2 5/5] vsock: Handle sudden TCP_CLOSE during connect Michal Luczaj
2026-09-16 12:31 ` Stefano Garzarella
2026-09-22 13:18 ` Michal Luczaj
2026-09-28 10:44 ` Stefano Garzarella
2026-09-16 13:16 ` sashiko-bot
2026-09-16 23:39 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915-vsock-connect-reset-closing-v2-2-a1d9abb472f7@rbox.co \
--to=mhal@rbox.co \
--cc=asias@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox