]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/landlock: Add missing connect(minimal AF_UNSPEC) test
authorMatthieu Buffet <matthieu@buffet.re>
Mon, 27 Oct 2025 19:07:25 +0000 (20:07 +0100)
committerMickaël Salaün <mic@digikod.net>
Fri, 26 Dec 2025 19:38:57 +0000 (20:38 +0100)
commit6685201ebfacff0c889bcd569181fa6e8af5575e
treee31777c0fce28a57f133f7dd42f5b9a24cf82586
parentbd09d9a05cf04028f639e209b416bacaeffd4909
selftests/landlock: Add missing connect(minimal AF_UNSPEC) test

connect_variant(unspec_any0) is called twice. Both calls end
up in connect_variant_addrlen() with an address length of
get_addrlen(minimal=false).
However, the connect() syscall and its variants (e.g.
iouring/compat) accept much shorter addresses of 4 bytes
and that behaviour was not tested.

Replace one of these calls with one using a minimal address
length (just a bare sa_family=AF_UNSPEC field with no actual
address). Also add a call using a truncated address for good
measure.

Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Link: https://lore.kernel.org/r/20251027190726.626244-3-matthieu@buffet.re
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/net_test.c