[PATCH v3 5/6] selftests/landlock: Test capability checks outside the capable hook

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Nov 18 14:58:31 UTC 2026


> 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 at google.com>
> Cc: Paul Moore <paul at paul-moore.com>
> Cc: Serge Hallyn <serge at hallyn.com>
> Acked-by: Serge Hallyn (AMD) <sergeh at kernel.org>
> Signed-off-by: Mickaël Salaün <mic at digikod.net>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118145217.2551053-1-mic@digikod.net?part=5




More information about the Linux-security-module-archive mailing list