linux/security/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
..
errata landlock: Require LANDLOCK_ACCESS_FS_MAKE_REG for whiteout creation 2026-08-15 09:14:43 +02:00
.kunitconfig landlock: Test trace path output boundaries 2026-09-08 11:49:39 +02:00
access.h landlock: Split denial logging from audit into common framework 2026-08-17 10:17:11 +02:00
audit.c landlock: Consolidate access-right and scope names in a shared header 2026-08-17 10:17:13 +02:00
audit.h landlock: Decouple the per-denial logging decision from CONFIG_AUDIT 2026-08-17 10:17:12 +02:00
common.h landlock: Add support for KUnit tests 2024-02-27 11:21:45 +01:00
cred.c landlock: Split denial logging from audit into common framework 2026-08-17 10:17:11 +02:00
cred.h landlock: Split denial logging from audit into common framework 2026-08-17 10:17:11 +02:00
domain.c landlock: Clean up ruleset validation checks 2026-09-08 11:49:32 +02:00
domain.h landlock: Add tracepoints for rule checking 2026-08-17 10:17:15 +02:00
errata.h landlock: Prepare to add second errata 2025-03-21 12:12:21 +01:00
fs.c landlock: Fix use-after-free of the source's parent directory 2026-09-07 12:01:47 +02:00
fs.h landlock: Add landlock_add_rule_fs and landlock_add_rule_net tracepoints 2026-08-17 10:17:14 +02:00
id.c landlock: Improve kernel-doc "Return:" section consistency 2026-04-07 18:51:04 +02:00
id.h landlock: Split denial logging from audit into common framework 2026-08-17 10:17:11 +02:00
Kconfig landlock: Add create_ruleset and free_ruleset tracepoints 2026-08-17 10:17:13 +02:00
limits.h landlock: Add LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS 2026-08-15 09:14:46 +02:00
log.c landlock: Add landlock_deny_access_fs and landlock_deny_access_net 2026-08-17 10:17:16 +02:00
log.h landlock: Add tracepoints for ptrace and scope denials 2026-08-17 10:17:16 +02:00
Makefile landlock: Add create_ruleset and free_ruleset tracepoints 2026-08-17 10:17:13 +02:00
net.c landlock: Add tracepoints for rule checking 2026-08-17 10:17:15 +02:00
net.h landlock: Add API support and docs for the quiet flags 2026-06-14 20:17:19 +02:00
object.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
object.h landlock: Format with clang-format 2022-05-09 12:31:10 +02:00
ruleset.c landlock: Clean up ruleset validation checks 2026-09-08 11:49:32 +02:00
ruleset.h landlock: Add landlock_add_rule_fs and landlock_add_rule_net tracepoints 2026-08-17 10:17:14 +02:00
setup.c lsm: replace the name field with a pointer to the lsm_id struct 2025-10-22 19:24:18 -04:00
setup.h landlock: Add the errata interface 2025-03-21 12:12:19 +01:00
syscalls.c landlock: Add landlock_enforce_domain tracepoint 2026-08-17 10:17:15 +02:00
task.c landlock: Add tracepoints for ptrace and scope denials 2026-08-17 10:17:16 +02:00
task.h landlock: Rename "ptrace" files to "task" 2024-03-08 18:22:16 +01:00
trace.c landlock: Test trace path output boundaries 2026-09-08 11:49:39 +02:00
trace.h landlock: Add landlock_deny_access_fs and landlock_deny_access_net 2026-08-17 10:17:16 +02:00
tsync.c landlock: Add landlock_enforce_domain tracepoint 2026-08-17 10:17:15 +02:00
tsync.h landlock: Add LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS 2026-08-15 09:14:46 +02:00