]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/landlock: Test UNIX sockets with any address formats
authorTahera Fahimi <fahimitahera@gmail.com>
Thu, 5 Sep 2024 00:13:58 +0000 (18:13 -0600)
committerMickaël Salaün <mic@digikod.net>
Mon, 16 Sep 2024 21:50:49 +0000 (23:50 +0200)
commit4f9a5b50d3b39027c5fdb44b33835209665fe069
tree8c83e7468badc85cb633cf703da8c91377403cd8
parentfefcf0f7cf470845b3675286c298484a056a7b13
selftests/landlock: Test UNIX sockets with any address formats

Expand abstract UNIX socket restriction tests by examining different
scenarios for UNIX sockets with pathname or unnamed address formats
connection with scoped domain.

The various_address_sockets tests ensure that UNIX sockets bound to a
filesystem pathname and unnamed sockets created by socketpair can still
connect to a socket outside of their scoped domain, meaning that even if
the domain is scoped with LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET, the
socket can connect to a socket outside the scoped domain.

Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
Link: https://lore.kernel.org/r/a9e8016aaa5846252623b158c8f1ce0d666944f4.1725494372.git.fahimitahera@gmail.com
[mic: Remove useless clang-format tags, fix unlink/rmdir calls, drop
capabilities, rename variables, remove useless mknod/unlink calls, clean
up fixture, test write/read on sockets, test sendto() on datagram
sockets, close sockets as soon as possible]
Co-developed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/common.h
tools/testing/selftests/landlock/fs_test.c
tools/testing/selftests/landlock/scoped_abstract_unix_test.c