]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/landlock: Test inherited restriction of abstract UNIX socket
authorTahera Fahimi <fahimitahera@gmail.com>
Thu, 5 Sep 2024 00:14:00 +0000 (18:14 -0600)
committerMickaël Salaün <mic@digikod.net>
Mon, 16 Sep 2024 21:50:50 +0000 (23:50 +0200)
commit644a728506c794e9e4f5fb9845ed4f7014cf46d9
treed92c2670d0daeddef1bd1b0e5d7a81a87db4c465
parentd1cc0ef80f2377a6970737ed88d95014ca461993
selftests/landlock: Test inherited restriction of abstract UNIX socket

A socket can be shared between multiple processes, so it can connect and
send data to them. Provide a test scenario where a sandboxed process
inherits a socket's file descriptor. The process cannot connect or send
data to the inherited socket since the process is scoped.

Test coverage for security/landlock is 92.0% of 1013 lines according to
gcc/gcov-14.

Signed-off-by: Tahera Fahimi <fahimitahera@gmail.com>
Link: https://lore.kernel.org/r/1428574deec13603b6ab2f2ed68ecbfa3b63bcb3.1725494372.git.fahimitahera@gmail.com
[mic: Remove negative ASSERT, fix potential race condition because of
closed connections, remove useless buffer, add test coverage]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/scoped_abstract_unix_test.c