samples/landlock: Enable users to log sandbox denials
authorMickaël Salaün <mic@digikod.net>
Thu, 20 Mar 2025 19:07:08 +0000 (20:07 +0100)
committerMickaël Salaün <mic@digikod.net>
Wed, 26 Mar 2025 12:59:44 +0000 (13:59 +0100)
commitec2798d85b1c29f4549849f1332555a0fd09686f
treecd978c8d65f01fe691f9f59519ec3b959c9b8edb
parentead9079f75696a028aea8860787770c80eddb8f9
samples/landlock: Enable users to log sandbox denials

By default, denials from within the sandbox are not logged.  Indeed, the
sandboxer's security policy might not be fitted to the set of sandboxed
processes that could be spawned (e.g. from a shell).

For test purpose, parse the LL_FORCE_LOG environment variable to log
every sandbox denials, including after launching the initial sandboxed
program thanks to LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON.

Cc: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20250320190717.2287696-20-mic@digikod.net
[mic: Remove inappropriate hunk]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
samples/landlock/sandboxer.c