net_access(9)
π net_access π
okay bestie so this is net_access(9), straight out of the Kernel API Manual, and it's literally all about the network flags π β the ones that let you lock a sandboxed process down to a specific little set of network actions. No random internet shenanigans, we're on a strict vibe check here β¨
πΈ Network flags πΈ
These flags exist so you can restrict a sandboxed process to a set of network actions β like, only these ports, nothing else, periodt π«Ά
So for TCP port numbers, the following access rights apply:
LANDLOCK_ACCESS_NET_BIND_TCPβ bind TCP sockets to the given local port π Support added in Landlock ABI version 4.LANDLOCK_ACCESS_NET_CONNECT_TCPβ connect TCP sockets to the given remote port π Support added in Landlock ABI version 4.
And similarly for UDP port numbers, we got:
LANDLOCK_ACCESS_NET_BIND_UDPβ bind UDP sockets to the given local port β¨ Support added in Landlock ABI version 10.LANDLOCK_ACCESS_NET_CONNECT_SEND_UDPβ set the remote port of UDP sockets to the given port, or send datagrams to the given remote port ignoring any destination pre-set on a socket π₯ Support added in Landlock ABI version 10.
π note note note β setting a remote address or sending a first datagram auto-binds UDP sockets to an ephemeral local source port if they're not already bound. To allow this when bothLANDLOCK_ACCESS_NET_BIND_UDPandLANDLOCK_ACCESS_NET_CONNECT_SEND_UDPare handled, you need to either: - use a socket already bound to a port before the ruleset started being enforced; - or grantLANDLOCK_ACCESS_NET_BIND_UDPon port0, meaning "any port in the ephemeral port range"; - or grantLANDLOCK_ACCESS_NET_BIND_UDPon a specific port, and callbind(2)on that port before trying toconnect(2)or send datagrams.
π« also a note β sending datagrams to anAF_UNSPECdestination address family is not supported for IPv6 UDP sockets: you will need to use aNULLaddress instead.
π SEE ALSO π
Kernel file ./include/uapi/linux/landlock.h, struct landlock_ruleset_attr(9), landlock_create_ruleset_flags(9), landlock_add_rule_flags(9), landlock_restrict_self_flags(9), enum landlock_rule_type(9), struct landlock_path_beneath_attr(9), struct landlock_net_port_attr(9), fs_access(9), scope(9) π¦
k that's the whole thing bestie, go forth and sandbox responsibly π
β¨ this came from ./include/uapi/linux, dated October 2026 β mwah, ily, bye ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms