selftests/landlock: Add audit tests for ptrace
authorMickaël Salaün <mic@digikod.net>
Thu, 20 Mar 2025 19:07:13 +0000 (20:07 +0100)
committerMickaël Salaün <mic@digikod.net>
Wed, 26 Mar 2025 12:59:47 +0000 (13:59 +0100)
commite2893c0a696f285e1163bc0db26253bf8d3e4c54
tree8dbcd11bfe46b47f5a1cfb136cabfed014b51f56
parent960ed6ca4c46c1e7a44f3f7b8be2c147757459e4
selftests/landlock: Add audit tests for ptrace

Add tests for all ptrace actions checking "blockers=ptrace" records.

This also improves PTRACE_TRACEME and PTRACE_ATTACH tests by making sure
that the restrictions comes from Landlock, and with the expected
process.  These extended tests are like enhanced errno checks that make
sure Landlock enforcement is consistent.

Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Link: https://lore.kernel.org/r/20250320190717.2287696-25-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/ptrace_test.c