Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: bobbyeshleman@meta.com
Cc: sgarzare@redhat.com, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, corbet@lwn.net,
	skhan@linuxfoundation.org, stefanha@redhat.com, mst@redhat.com,
	jasowangio@gmail.com, xuanzhuo@linux.alibaba.com,
	eperezma@redhat.com, shuah@kernel.org, rdunlap@infradead.org,
	donald.hunter@gmail.com, edumazet@kernel.org,
	georgezhang@vmware.com, acking@vmware.com, dtor@vmware.com,
	virtualization@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	sargun@sargun.me, jlinbox@meta.com, bobbyeshleman@gmail.com
Subject: Re: [PATCH net-next v6 5/8] vsock: add a netlink command to assign the g2h device to a netns
Date: Sun, 15 Nov 2026 04:01:29 +0000	[thread overview]
Message-ID: <179471528940.2199510.18137700517588437955@kernel.org> (raw)
In-Reply-To: <20261113-vsock-guest-ns-v6-5-3737ce4673c0@meta.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new `vsock` generic netlink family defines `dev-netns-set`
  (VSOCK_CMD_DEV_NETNS_SET) as a do-request with no reply.

--

vsock: add a netlink command to assign the g2h device to a netns

This patch adds a vsock generic netlink family. VSOCK_CMD_DEV_NETNS_SET
moves the guest's G2H vsock device into a given network namespace, and
VSOCK_CMD_DEV_NETNS_GET reports the assignment as an nsid relative to
the caller. Connected sockets that can no longer reach the device are
closed with ECONNRESET, and an assignment that would cause a CID
collision is refused.

Link: https://lore.kernel.org/all/20200427142518.uwssa6dtasrp3bfc@steredhat/

> diff --git a/Documentation/netlink/specs/vsock.yaml b/Documentation/netlink/specs/vsock.yaml
> new file mode 100644
> index 0000000000000..f260ee88b1402
> --- /dev/null
> +++ b/Documentation/netlink/specs/vsock.yaml

[ ... ]

> +operations:
> +  list:
> +    -
> +      name: dev-netns-set
> +      doc: |
> +        Set the network namespace of the guest's vsock device.

[ ... ]

> +        The assignment holds a reference on the namespace.
> +      attribute-set: vsock
> +      flags: [admin-perm]
> +      do:
> +        request:
> +          attributes:
> +            - netns-fd
> +            - netns-pid

[Severity: Low]
This isn't a bug, but should dev-netns-set have a reply block here?

The spec gives dev-netns-set a request and no reply. As a result,
vsock_nl_dev_netns_set_doit() only returns an errno and the caller gets a
bare ACK.

The netlink guidance for new families says every operation should reply
with a full message that identifies the resulting object. It also says
that once a command only ACKs, the ACK-only behaviour becomes uAPI and
cannot be changed later.

The v3 revision replied with netns-id. The v5 changelog says the reply
was dropped at Stefano's request, so this looks deliberate. Since this
family has not been released yet, could that decision be checked once
more?

A netns-id reply would tell the caller where the device ended up,
relative to its own namespace, without a second dev-netns-get request.

> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 37abde1ca26cd..d4d88c8cf142f 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c

[ ... ]

> +int vsock_nl_dev_netns_set_doit(struct sk_buff *skb, struct genl_info *info)
> +{

[ ... ]

> +	err = vsock_g2h_net_assign(net, info->extack);
> +	put_net(net);
> +
> +	return err;
> +}

This is where a reply would be built, for example by reusing
vsock_nl_dev_netns_fill() as vsock_nl_dev_netns_get_doit() does.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-vsock-guest-ns-v6-0-3737ce4673c0%40meta.com

  reply	other threads:[~2026-11-15  4:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  3:14 [PATCH net-next v6 0/8] vsock: assign the guest vsock device to a network namespace Bobby Eshleman
2026-11-14  3:14 ` [PATCH net-next v6 1/8] vsock: only undo SS_CONNECTING when connect() fails Bobby Eshleman
2026-11-15  4:01   ` netdev-bot+sashiko
2026-11-14  3:14 ` [PATCH net-next v6 2/8] vsock: constify the transport in vsock_for_each_connected_socket() Bobby Eshleman
2026-11-14  3:14 ` [PATCH net-next v6 3/8] vsock: rename the vsock pernet operations Bobby Eshleman
2026-11-14  3:14 ` [PATCH net-next v6 4/8] vsock: pass the netns to ->has_remote_cid() Bobby Eshleman
2026-11-14  3:14 ` [PATCH net-next v6 5/8] vsock: add a netlink command to assign the g2h device to a netns Bobby Eshleman
2026-11-15  4:01   ` netdev-bot+sashiko [this message]
2026-11-14  3:14 ` [PATCH net-next v6 6/8] vsock/virtio: support guest device network namespace Bobby Eshleman
2026-11-15  4:01   ` netdev-bot+sashiko
2026-11-14  3:14 ` [PATCH net-next v6 7/8] selftests/vsock: test the guest vsock " Bobby Eshleman
2026-11-15  4:01   ` netdev-bot+sashiko
2026-11-14  3:14 ` [PATCH net-next v6 8/8] selftests/vsock: test the netns assign privilege checks Bobby Eshleman
2026-11-15  4:01   ` netdev-bot+sashiko
2026-11-14  3:22 ` [PATCH net-next v6 0/8] vsock: assign the guest vsock device to a network namespace netdev-bot+sinfo

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=179471528940.2199510.18137700517588437955@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=acking@vmware.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=bobbyeshleman@meta.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dtor@vmware.com \
    --cc=edumazet@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=georgezhang@vmware.com \
    --cc=horms@kernel.org \
    --cc=jasowangio@gmail.com \
    --cc=jlinbox@meta.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=sargun@sargun.me \
    --cc=sgarzare@redhat.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --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