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.
/P