diff options
| author | Mickaël Salaün <mic@digikod.net> | 2026-11-18 15:52:09 +0100 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-11-19 11:55:31 +0100 |
| commit | 2c709fccbac59ac66774ef06b4bff56eab9311c0 (patch) | |
| tree | 9c0c9c19b346a19bb11a5bd1d76617262b1feaf5 /tools/perf/scripts/python | |
| parent | a338ad4cc5b95e53f3e49c434235c09732740dbe (diff) | |
selftests/landlock: Test capability checks outside the capable hook
Test the commoncap checks that the previous commits make Landlock
restrict: mapping below vm.mmap_min_addr (CAP_SYS_RAWIO) and adding
inheritable capabilities (CAP_SETPCAP). Each test checks that the
operation needs the capability, then runs it with the capability in four
variants: unsandboxed, denied, allowed and unhandled. The mmap_addr
tests skip if the architecture rejects the low page before the hook
(e.g. 32-bit ARM).
Audit tests check that these denials are logged, and that the admin
reserve check and allowed uses are not. The admin reserve has no
functional test because it depends on vm.overcommit_memory=2, a
system-wide setting.
Add CAP_SETPCAP and CAP_SYS_RAWIO to the capabilities that the tests may
raise.
Without the mmap_addr and capset fixes, their denied variants and the
denial audit test fail.
Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <serge@hallyn.com>
Acked-by: Serge Hallyn (AMD) <sergeh@kernel.org>
Link: https://patch.msgid.link/20261118145217.2551053-6-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
