Skip to content

Commit bbb6f53

Browse files
mtth-bfftl0kod
authored andcommitted
landlock: Minor reword of docs for TCP access rights
- Move ABI requirement next to each access right to prepare adding more access rights; - Mention the possibility to remove the random component of a socket's ephemeral port choice within the netns-wide ephemeral port range, since it allows choosing the "random" ephemeral port. Signed-off-by: Matthieu Buffet <matthieu@buffet.re> Link: https://lore.kernel.org/r/20251212163704.142301-2-matthieu@buffet.re Signed-off-by: Mickaël Salaün <mic@digikod.net>
1 parent 3950840 commit bbb6f53

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

include/uapi/linux/landlock.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,13 @@ struct landlock_net_port_attr {
195195
* It should be noted that port 0 passed to :manpage:`bind(2)` will bind
196196
* to an available port from the ephemeral port range. This can be
197197
* configured with the ``/proc/sys/net/ipv4/ip_local_port_range`` sysctl
198-
* (also used for IPv6).
198+
* (also used for IPv6), and within that range, on a per-socket basis
199+
* with ``setsockopt(IP_LOCAL_PORT_RANGE)``.
199200
*
200-
* A Landlock rule with port 0 and the ``LANDLOCK_ACCESS_NET_BIND_TCP``
201+
* A Landlock rule with port 0 and the %LANDLOCK_ACCESS_NET_BIND_TCP
201202
* right means that requesting to bind on port 0 is allowed and it will
202-
* automatically translate to binding on the related port range.
203+
* automatically translate to binding on a kernel-assigned ephemeral
204+
* port.
203205
*/
204206
__u64 port;
205207
};
@@ -342,13 +344,12 @@ struct landlock_net_port_attr {
342344
* These flags enable to restrict a sandboxed process to a set of network
343345
* actions.
344346
*
345-
* This is supported since Landlock ABI version 4.
346-
*
347347
* The following access rights apply to TCP port numbers:
348348
*
349-
* - %LANDLOCK_ACCESS_NET_BIND_TCP: Bind a TCP socket to a local port.
350-
* - %LANDLOCK_ACCESS_NET_CONNECT_TCP: Connect an active TCP socket to
351-
* a remote port.
349+
* - %LANDLOCK_ACCESS_NET_BIND_TCP: Bind TCP sockets to the given local
350+
* port. Support added in Landlock ABI version 4.
351+
* - %LANDLOCK_ACCESS_NET_CONNECT_TCP: Connect TCP sockets to the given
352+
* remote port. Support added in Landlock ABI version 4.
352353
*/
353354
/* clang-format off */
354355
#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)

0 commit comments

Comments
 (0)