diff options
| author | Mickaël Salaün <mic@digikod.net> | 2026-10-07 12:02:49 +0200 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-10-07 12:04:10 +0200 |
| commit | 6931f6e6bcd313c17656cf4656ab9b857b6895e4 (patch) | |
| tree | baa9b51b19850a0745caec2026ac6a410e110f63 /tools/perf/python | |
| parent | 886ee9a20b2813ef070b5cd0926924b786988fe7 (diff) | |
| download | linux-next-6931f6e6bcd313c17656cf4656ab9b857b6895e4.tar.gz linux-next-6931f6e6bcd313c17656cf4656ab9b857b6895e4.zip | |
selftests/landlock: Add capability restriction tests
Add tests to exercise LANDLOCK_PERMISSION_CAPABILITY_USE enforcement. A
sandboxed process is denied a handled capability when no rule grants it,
and an explicit rule restores it. Unknown capability values above
CAP_LAST_CAP are accepted at rule-add time yet have no runtime effect,
because deny-by-default still applies once the domain is enforced.
Stacking tests cover the per-layer allow/deny combinations, including a
layer that does not handle the permission, and invalid rule attributes
return the expected errors.
Three tests exercise non-standard capability contexts: enforcing a
domain via CAP_SYS_ADMIN authorization without no_new_privs, restricting
capabilities gained through the kernel's user namespace ownership bypass
(cap_capable_helper), and checking CAP_SYS_ADMIN against a descendant
user namespace, with an unsandboxed positive control, to confirm the
decision is independent of the target.
Audit tests verify denied and allowed capabilities, per-member quiet
interactions, and CAP_OPT_NOAUDIT suppression. Trace tests cover
accepted, rejected, and no-op rule adds, and normal, quiet, and
CAP_OPT_NOAUDIT denials.
Test coverage for security/landlock is 91.8% of 2864 lines according to
LLVM 22.
Cc: Christian Brauner <brauner@kernel.org>
Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge E. Hallyn <serge@hallyn.com>
Link: https://patch.msgid.link/20261007100255.1333386-7-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'tools/perf/python')
0 files changed, 0 insertions, 0 deletions
