linux/tools/testing/selftests/landlock
Mickaël Salaün d41d0021a6
landlock: Test trace path output boundaries
Use focused KUnit tests to exercise the renderer's internal boundary and
composition contracts with synthetic scratch states, including both
sibling-helper evaluation orders.  Check the exact output and
reservation boundaries, including a four-byte octal escape accepted at
exact capacity and rejected one byte short.  Also verify an unchanged
cursor on failure, that bracketed process names and embedded NUL bytes
remain data, and that input ellipsis bytes are escaped rather than
mistaken for the raw truncation marker.

The composition test requires generic trace output helpers.  Enable
CONFIG_FTRACE and CONFIG_SCHED_TRACER because the latter selects the
otherwise-hidden CONFIG_TRACING support required by
trace_print_flags_seq().

Use kselftests to exercise the complete tracefs path for both affected
filesystem events.  A valid path containing 2640 spaces exceeds the
scratch output budget.  Require its escaped prefix to end in the raw
UTF-8 ellipsis while access_rights and blockers remain intact.

This division keeps the exact safety contract compiler-independent while
proving that real tracepoints preserve their surrounding symbolic
fields.  The end-to-end assertions fail after a full fix revert with
both GCC and Clang, while the composition KUnit test fails if the
scratch reserve is removed.

Cc: Günther Noack <gnoack@google.com>
Link: https://patch.msgid.link/20260907154401.124362-2-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2026-09-08 11:49:39 +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: Test abstract socket trace name limits 2026-09-07 12:38:01 +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 landlock: Test trace path output boundaries 2026-09-08 11:49:39 +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