From: sashiko-bot@kernel.org
To: "Bobby Eshleman" <bobbyeshleman@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH net-next 2/6] vsock: add IOCTL_VM_SOCKETS_ASSIGN_G2H_NETNS
Date: Thu, 03 Sep 2026 23:01:46 +0000 [thread overview]
Message-ID: <20260903230146.DD5351F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260902-vsock-guest-ns-v1-2-9995383e9a8b@meta.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unreachable connections are forcefully closed without notifying the transport, causing zombie connections on the remote host.
--
commit f3fdca73a2fc67941333bcc7521ccf2e755bdfaf
Author: Bobby Eshleman <bobbyeshleman@meta.com>
vsock: add IOCTL_VM_SOCKETS_ASSIGN_G2H_NETNS
This commit introduces an ioctl to assign a guest's vsock device to a
specific network namespace. When the device moves to a disallowed namespace,
existing sockets are reset to prevent unauthorized reachability.
Link: https://lore.kernel.org/all/20200427142518.uwssa6dtasrp3bfc@steredhat/
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 29cde17e08f31..ad11f0f56eb8a 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
[ ... ]
> @@ -710,6 +751,140 @@ bool vsock_find_cid(unsigned int cid)
[ ... ]
> +static void vsock_reset_unreachable_sock(struct sock *sk)
> +{
> + if (vsock_g2h_net_reachable(sock_net(sk)))
> + return;
> +
> + sk->sk_state = TCP_CLOSE;
> + sk->sk_err = ECONNRESET;
> + sk_error_report(sk);
> +}
[Severity: High]
Does forcefully setting the socket state to TCP_CLOSE here prevent the
transport from notifying the remote host?
When the state is set directly to TCP_CLOSE, a transport's release function
(like virtio_transport_release()) may see the socket as already fully
terminated and skip sending a reset message (like VIRTIO_VSOCK_OP_RST) to
the host.
Since this ioctl can be triggered by a guest user with CAP_NET_ADMIN in the
init user namespace, could this lead to zombie connections accumulating on
the host hypervisor, potentially allowing a guest to exhaust host resources
because the host is never informed of the dropped connections?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902-vsock-guest-ns-v1-0-9995383e9a8b@meta.com?part=2
next prev parent reply other threads:[~2026-09-03 23:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 23:00 [PATCH net-next 0/6] vsock: assign the guest vsock device to a network namespace Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 1/6] vsock: constify the transport in vsock_for_each_connected_socket() Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 2/6] vsock: add IOCTL_VM_SOCKETS_ASSIGN_G2H_NETNS Bobby Eshleman
2026-09-02 23:35 ` Randy Dunlap
2026-09-02 23:58 ` Bobby Eshleman
2026-09-03 23:01 ` sashiko-bot [this message]
2026-09-04 23:49 ` Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 3/6] vsock/virtio: support guest device network namespace Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 4/6] selftests/vsock: add a helper to assign the g2h device to a netns Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 5/6] selftests/vsock: test the guest vsock device network namespace Bobby Eshleman
2026-09-02 23:00 ` [PATCH net-next 6/6] selftests/vsock: test the assign ioctl privilege checks Bobby Eshleman
2026-09-03 23:01 ` sashiko-bot
2026-09-04 17:33 ` Bobby Eshleman
2026-09-04 8:55 ` [PATCH net-next 0/6] vsock: assign the guest vsock device to a network namespace Stefano Garzarella
2026-09-04 17:30 ` Bobby Eshleman
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=20260903230146.DD5351F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bobbyeshleman@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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