From: Bobby Eshleman <bobbyeshleman@meta.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: "Paolo Abeni" <pabeni@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowangio@gmail.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Simon Horman" <horms@kernel.org>,
kvm@vger.kernel.org, virtualization@lists.linux.dev,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] vsock: only deliver taps to namespaces that can reach the device
Date: Mon, 23 Nov 2026 08:18:47 -0800 [thread overview]
Message-ID: <awRnZ9S+3B996VqJ@devvm29614.prn0.facebook.com> (raw)
In-Reply-To: <awQ5xzF8P0NJiCsv@sgarzare-redhat>
On Mon, Nov 23, 2026 at 02:17:54PM +0100, Stefano Garzarella wrote:
> On Mon, Nov 23, 2026 at 12:58:38PM +0100, Paolo Abeni wrote:
> > On 11/23/26 10:43, Stefano Garzarella wrote:
> > > On Mon, Nov 16, 2026 at 03:46:49PM -0800, Bobby Eshleman wrote:
> > > > vsock_deliver_tap() clones every packet to every vsockmon device on the
> > > > system. Creating one needs only CAP_NET_ADMIN in the owning user
> > > > namespace, so an unprivileged user can capture the traffic of local mode
> > > > namespaces.
> > > >
> > > > Pass the packet's netns to vsock_deliver_tap() and only deliver to
> > > > devices that pass vsock_net_check_mode(), the same rule socket lookups
> > > > use. vhost passes the vhost_vsock netns, loopback the sending socket's
> > > > netns, and virtio-vsock NULL (global mode).
> > >
> > > For local namespaces I think we are fine, but what about global?
> > >
> > > Is it okay that a namespace with global can capture all the packets of other global namespaces?
> > >
> > > Asking because at this point the CAP_NET_ADMIN is useless, since an user on a global namespace, without CAP_NET_ADMIN, can just create a namespace to have CAP_NET_ADMIN and access all the traffic. Should we fix also that?
> > My take is that the above question is quite orthogonal to the current patch
> > and may impact old applications relying on the legacy behavior.
>
> True, but I'm not sure that behavior was correct since the beginning.
> E.g., what is the point of having CAP_NET_ADMIN requirement if an
> unprivileged user can just crate a new namespace and get it?
>
> Anyway, it's eventually pre-existing netns support in vsock, so it should be
> fixed with a followup.
>
>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
> Thanks,
> Stefano
>
Its a fair point and I agree we should take it up in a follow up. My
current instinct is that CAP_NET_ADMIN probably shouldn't be enforced
for some (all?) of these global-mode paths.
Best,
Bobby
next prev parent reply other threads:[~2026-11-23 16:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 23:46 Bobby Eshleman
2026-11-16 23:52 ` netdev-bot+sinfo
2026-11-17 1:20 ` Bobby Eshleman
2026-11-19 9:03 ` Paolo Abeni
2026-11-19 17:25 ` Bobby Eshleman
2026-11-23 9:43 ` Stefano Garzarella
2026-11-23 11:58 ` Paolo Abeni
2026-11-23 13:17 ` Stefano Garzarella
2026-11-23 16:18 ` Bobby Eshleman [this message]
2026-11-23 12:10 ` 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=awRnZ9S+3B996VqJ@devvm29614.prn0.facebook.com \
--to=bobbyeshleman@meta.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--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
all inboxes | Powered by JetHome®