diff options
| author | Matthieu Buffet <matthieu@buffet.re> | 2026-06-11 19:21:02 +0300 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-06-14 00:15:04 +0300 |
| commit | e61247a2e694d17236149135b2d22f0f7d19578c (patch) | |
| tree | 1c201bb119f605565d97918d0656410a7267033c /include/linux/string.h | |
| parent | 9a8ed15ce22472fe0363e33738b4317d06b13c3a (diff) | |
| download | linux-e61247a2e694d17236149135b2d22f0f7d19578c.tar.xz | |
landlock: Add UDP send+connect access control
Add support for a second fine-grained UDP access right.
LANDLOCK_ACCESS_NET_CONNECT_SEND_UDP controls the ability to set the
remote port of a socket (via connect()) and to specify an explicit
destination when sending a datagram, to override any remote peer set on
a UDP socket (e.g. in sendto() or sendmsg()). It will be useful for
applications that send datagrams, and for some servers too (those
creating per-client sockets, which want to receive traffic only from a
specific address).
Similarly as for bind(), this access control is performed when
configuring sockets, not in hot code paths.
Add detection of when autobind is about to be required, and deny the
operation if the process would not be allowed to call bind(0)
explicitly. Autobind can only be performed in udp_lib_get_port() from
code paths already controlled by LSM hooks: when connect()ing, sending a
first datagram, and in some splice() EOF edge case which, afaiu, can
only happen after a remote peer has been set. This invariant needs to be
preserved to keep bind policies actually enforced.
Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Link: https://patch.msgid.link/20260611162107.49278-3-matthieu@buffet.re
[mic: Add quick return for non-sandboxed tasks, fix sa_family
dereferencing, fix comment formatting]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions
