linux/include/net/netns
Bobby Eshleman eafb64f40c vsock: add netns to vsock core
Add netns logic to vsock core. Additionally, modify transport hook
prototypes to be used by later transport-specific patches (e.g.,
*_seqpacket_allow()).

Namespaces are supported primarily by changing socket lookup functions
(e.g., vsock_find_connected_socket()) to take into account the socket
namespace and the namespace mode before considering a candidate socket a
"match".

This patch also introduces the sysctl /proc/sys/net/vsock/ns_mode to
report the mode and /proc/sys/net/vsock/child_ns_mode to set the mode
for new namespaces.

Add netns functionality (initialization, passing to transports, procfs,
etc...) to the af_vsock socket layer. Later patches that add netns
support to transports depend on this patch.

This patch changes the allocation of random ports for connectible vsocks
in order to avoid leaking the random port range starting point to other
namespaces.

dgram_allow(), stream_allow(), and seqpacket_allow() callbacks are
modified to take a vsk in order to perform logic on namespace modes. In
future patches, the net will also be used for socket
lookups in these functions.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260121-vsock-vmtest-v16-1-2859a7512097@meta.com
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-01-27 10:45:38 +01:00
..
bpf.h
can.h
conntrack.h netfilter: conntrack: remove DCCP protocol support 2025-07-03 13:51:39 +02:00
core.h net: Introduce net.core.bypass_prot_mem sysctl. 2025-10-16 12:04:47 -07:00
flow_table.h
generic.h
hash.h
ieee802154_6lowpan.h
ipv4.h tcp: add net.ipv4.tcp_rcvbuf_low_rtt 2025-11-20 17:44:23 -08:00
ipv6.h ipv6: add sysctl_ipv6_flowlabel group 2026-01-19 09:56:42 -08:00
mctp.h net: mctp: Use hashtable for binds 2025-07-15 12:08:39 +02:00
mib.h
mpls.h mpls: Protect net->mpls.platform_label with a per-netns mutex. 2025-11-03 17:40:53 -08:00
netfilter.h
nexthop.h
nftables.h netfilter: nf_tables: place base_seq in struct net 2025-09-10 20:30:37 +02:00
packet.h
sctp.h sctp: Convert cookie authentication to use HMAC-SHA256 2025-08-19 19:36:26 -07:00
smc.h net/smc: bpf: Introduce generic hook for handshake flow 2025-11-10 11:19:41 -08:00
unix.h
vsock.h vsock: add netns to vsock core 2026-01-27 10:45:38 +01:00
xdp.h
xfrm.h xfrm: Add an inbound percpu state cache. 2024-10-29 11:56:18 +01:00