> Namespaces let a host isolate a VM's vsock traffic to a specific > namespace, but in a guest vsock traffic cannot be isolated to a > namespace. The vsock device is hardcoded to global mode and can't be > moved into a local-mode namespace. > > Introduce a vsock generic netlink family with VSOCK_CMD_DEV_NETNS_SET, > which moves the device to the namespace given by the netns-fd or > netns-pid attribute, as rtnetlink and devlink do, or to the namespace > the request was sent from if neither is given. > > VSOCK_CMD_DEV_NETNS_GET reads the assignment back, reporting the > namespace as an nsid relative to the caller. VSOCK_CMD_DEV_NETNS_SET > only returns the netlink ack. > > The command requires CAP_NET_ADMIN in the initial user namespace. A > [ ... ] > user namespace is required for the assignment. > > Suggested-by: Stefano Garzarella <[email protected]> > Link: https://lore.kernel.org/all/20200427142518.uwssa6dtasrp3bfc@steredhat/ > Signed-off-by: Bobby Eshleman <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=5
