linux/tools/testing/selftests/landlock
Mickaël Salaün ac6d193de5
selftests/landlock: Add landlock_enforce_domain trace tests
Add trace tests for the landlock_enforce_domain event in trace_test.c,
asserting field counts after the syscall returns rather than line
ordering across per-CPU buffers.  They cover single-threaded and TSYNC
enforcement (complete and process_wide set), a multi-threaded non-TSYNC
process (process_wide clear), the single-threaded non-leader edge case,
the flags-only path that creates no domain, and a thread-sync abort that
emits create_domain and free_domain but no enforce_domain.

landlock_enforce_domain is added to the fixture enable path and every
disable list so its zero-events assertions cannot be tripped by a stray
enforcement event.

Test coverage for security/landlock is 91.6% of 2571 lines according to
LLVM 22.

Cc: Günther Noack <gnoack@google.com>
Cc: Tingmao Wang <m@maowtm.org>
Link: https://patch.msgid.link/20260811094338.288094-19-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2026-08-17 10:17:19 +02:00
..
.gitignore selftests/landlock: Add filesystem access benchmark 2026-02-10 16:46:42 +01:00
audit_test.c selftests/landlock: Add tests for quiet flag with scope 2026-06-14 20:17:24 +02:00
audit.h selftests/landlock: Add trace event test infrastructure and tests 2026-08-17 10:17:17 +02:00
base_test.c selftests/landlock: Test LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS 2026-08-15 09:14:47 +02:00
common.h selftests/landlock: Add trace event test infrastructure and tests 2026-08-17 10:17:17 +02:00
config selftests/landlock: Add trace event test infrastructure and tests 2026-08-17 10:17:17 +02:00
config.um selftests/landlock: Add hostfs tests 2023-06-12 21:26:23 +02:00
fs_bench.c selftests/landlock: Add filesystem access benchmark 2026-02-10 16:46:42 +01:00
fs_test.c selftests/landlock: Add filesystem tracepoint tests 2026-08-17 10:17:17 +02:00
Makefile selftests/landlock: Add filesystem access benchmark 2026-02-10 16:46:42 +01:00
net_test.c selftests/landlock: Add network tracepoint tests 2026-08-17 10:17:18 +02:00
ptrace_test.c selftests/landlock: Add scope and ptrace tracepoint tests 2026-08-17 10:17:18 +02:00
sandbox-and-launch.c selftests/landlock: Add layout1.umount_sandboxer tests 2025-01-17 19:05:38 +01:00
scoped_abstract_unix_test.c selftests/landlock: Add scope and ptrace tracepoint tests 2026-08-17 10:17:18 +02:00
scoped_base_variants.h selftests/landlock: Use scoped_base_variants.h for ptrace_test 2025-12-29 16:19:39 +01:00
scoped_common.h selftests/landlock: Test abstract UNIX socket scoping 2024-09-16 23:50:48 +02:00
scoped_multiple_domain_variants.h selftests/landlock: Test abstract UNIX socket scoping 2024-09-16 23:50:48 +02:00
scoped_signal_test.c selftests/landlock: Add scope and ptrace tracepoint tests 2026-08-17 10:17:18 +02:00
scoped_test.c landlock: Add signal scoping 2024-09-16 23:50:52 +02:00
trace_fs_test.c selftests/landlock: Add filesystem tracepoint tests 2026-08-17 10:17:17 +02:00
trace_test.c selftests/landlock: Add landlock_enforce_domain trace tests 2026-08-17 10:17:19 +02:00
trace.h selftests/landlock: Add landlock_enforce_domain trace tests 2026-08-17 10:17:19 +02:00
true.c selftests/landlock: Add trace event test infrastructure and tests 2026-08-17 10:17:17 +02:00
tsync_test.c selftests/landlock: Test LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS 2026-08-15 09:14:47 +02:00
wait-pipe-sandbox.c selftests/landlock: Test audit with restrict flags 2025-03-26 13:59:46 +01:00
wait-pipe.c selftests/landlock: Add layout1.umount_sandboxer tests 2025-01-17 19:05:38 +01:00
wrappers.h selftests/landlock: Add wrappers.h 2025-01-17 19:05:38 +01:00