From: Stefano Garzarella <sgarzare@redhat.com>
To: netdev@vger.kernel.org
Cc: "Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
"Luigi Leonardi" <leonardi@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"Wongi Lee" <qwerty@theori.io>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Eric Dumazet" <edumazet@google.com>,
kvm@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Hyunwoo Kim" <v4bel@theori.io>,
"Jakub Kicinski" <kuba@kernel.org>,
"Michal Luczaj" <mhal@rbox.co>,
virtualization@lists.linux.dev,
"Bobby Eshleman" <bobby.eshleman@bytedance.com>
Subject: [PATCH net v2 0/5] vsock: some fixes due to transport de-assignment
Date: Fri, 10 Jan 2025 09:35:06 +0100 [thread overview]
Message-ID: <20250110083511.30419-1-sgarzare@redhat.com> (raw)
v1: https://lore.kernel.org/netdev/20250108180617.154053-1-sgarzare@redhat.com/
v2:
- Added patch 3 to cancel the virtio close delayed work when de-assigning
the transport
- Added patch 4 to clean the socket state after de-assigning the transport
- Added patch 5 as suggested by Michael and Hyunwoo Kim. It's based on
Hyunwoo Kim and Wongi Lee patch [1] but using WARN_ON and covering more
functions
- Added R-b/T-b tags
This series includes two patches discussed in the thread started by
Hyunwoo Kim a few weeks ago [1], plus 3 more patches added after some
discussions on v1 (see changelog). All related to the case where a vsock
socket is de-assigned from a transport (e.g., because the connect fails
or is interrupted by a signal) and then assigned to another transport
or to no-one (NULL).
I tested with usual vsock test suite, plus Michal repro [2]. (Note: the repo
works only if a G2H transport is not loaded, e.g. virtio-vsock driver).
The first patch is a fix more appropriate to the problem reported in
that thread, the second patch on the other hand is a related fix but
of a different problem highlighted by Michal Luczaj. It's present only
in vsock_bpf and already handled in af_vsock.c
The third patch is to cancel the virtio close delayed work when de-assigning
the transport, the fourth patch is to clean the socket state after de-assigning
the transport, the last patch adds warnings and prevents null-ptr-deref in
vsock_*[has_data|has_space].
Hyunwoo Kim, Michal, if you can test and report your Tested-by that
would be great!
[1] https://lore.kernel.org/netdev/Z2K%2FI4nlHdfMRTZC@v4bel-B760M-AORUS-ELITE-AX/
[2] https://lore.kernel.org/netdev/2b3062e3-bdaa-4c94-a3c0-2930595b9670@rbox.co/
Stefano Garzarella (5):
vsock/virtio: discard packets if the transport changes
vsock/bpf: return early if transport is not assigned
vsock/virtio: cancel close work in the destructor
vsock: reset socket state when de-assigning the transport
vsock: prevent null-ptr-deref in vsock_*[has_data|has_space]
net/vmw_vsock/af_vsock.c | 18 +++++++++++++
net/vmw_vsock/virtio_transport_common.c | 36 ++++++++++++++++++-------
net/vmw_vsock/vsock_bpf.c | 9 +++++++
3 files changed, 53 insertions(+), 10 deletions(-)
base-commit: fbfd64d25c7af3b8695201ebc85efe90be28c5a3
--
2.47.1
next reply other threads:[~2025-01-10 8:35 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 8:35 Stefano Garzarella [this message]
2025-01-10 8:35 ` [PATCH net v2 1/5] vsock/virtio: discard packets if the transport changes Stefano Garzarella
2025-01-10 22:46 ` Hyunwoo Kim
2025-01-12 22:42 ` Michal Luczaj
2025-01-13 8:57 ` Stefano Garzarella
2025-01-13 9:07 ` Stefano Garzarella
2025-01-13 10:12 ` Michal Luczaj
2025-01-13 11:05 ` Stefano Garzarella
2025-01-13 13:51 ` Michal Luczaj
2025-01-13 15:01 ` Stefano Garzarella
2025-01-14 0:09 ` Michal Luczaj
2025-01-14 10:16 ` Stefano Garzarella
2025-01-14 16:31 ` Michal Luczaj
2025-01-16 8:57 ` Stefano Garzarella
2025-01-17 22:02 ` Michal Luczaj
2025-01-10 8:35 ` [PATCH net v2 2/5] vsock/bpf: return early if transport is not assigned Stefano Garzarella
2025-01-10 8:35 ` [PATCH net v2 3/5] vsock/virtio: cancel close work in the destructor Stefano Garzarella
2025-01-10 10:57 ` Luigi Leonardi
2025-01-10 22:48 ` Hyunwoo Kim
2025-01-10 8:35 ` [PATCH net v2 4/5] vsock: reset socket state when de-assigning the transport Stefano Garzarella
2025-01-10 10:56 ` Luigi Leonardi
2025-01-10 11:25 ` Stefano Garzarella
2025-01-10 8:35 ` [PATCH net v2 5/5] vsock: prevent null-ptr-deref in vsock_*[has_data|has_space] Stefano Garzarella
2025-01-10 9:49 ` Luigi Leonardi
2025-01-10 22:52 ` Hyunwoo Kim
2025-01-14 11:50 ` [PATCH net v2 0/5] vsock: some fixes due to transport de-assignment patchwork-bot+netdevbpf
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=20250110083511.30419-1-sgarzare@redhat.com \
--to=sgarzare@redhat.com \
--cc=bobby.eshleman@bytedance.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=horms@kernel.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=leonardi@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhal@rbox.co \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=qwerty@theori.io \
--cc=stefanha@redhat.com \
--cc=v4bel@theori.io \
--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