[PATCH v3 3/6] landlock: Mediate CAP_SETPCAP for inheritable capabilities

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


> cap_capset() checks CAP_SETPCAP with cap_capable() (through
> cap_inh_is_capped()), which skips the capable hook, so a domain denying
> CAP_SETPCAP cannot prevent adding capabilities outside of the old
> inheritable and permitted sets to the inheritable set.  Without
> no_new_privs (possible when a task with CAP_SYS_ADMIN enforced the
> domain), file inheritable capabilities can then grant permitted
> capabilities on execve().
> 
> Add a Landlock capset hook that checks CAP_SETPCAP against the domain
> under the same condition, as SELinux checks its own setcap permission in
> this hook.
> 
> 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>
> Reviewed-by: Günther Noack <gnoack at google.com>
> Fixes: 97c8386f1d74 ("landlock: Enforce capability restrictions")
> 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=3




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