[PATCH v2 2/4] landlock: Add capability objects to denial tracing

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Nov 18 16:39:01 UTC 2026


> The capability denial tracepoint identifies the capability number but
> not the credentials or user namespace against which it was checked.
> Typed BPF consumers therefore cannot reconstruct the authoritative hook
> context, especially when a check targets a user namespace other than the
> caller's current namespace.
> 
> Carry the exact cred and user_ns used by each commoncap check through
> check_cap() to the tracepoint's BTF prototype.  The capable hook
> forwards its arguments.  Other callers mirror old->user_ns for
> CAP_SETPCAP, and init_user_ns for CAP_SYS_RAWIO and CAP_SYS_ADMIN.  The
> latter checks protect global hardening and the global admin memory
> reserve, so nested user-namespace capabilities must not authorize them.
> 
> Keep these pointers out of TP_STRUCT__entry and TP_printk so the raw
> ring-buffer layout and textual format remain unchanged.  They provide
> context only and do not participate in Landlock's verdict.
> 
> Do not carry the capability options.  CAP_OPT_NOAUDIT already suppresses
> the complete denial record, and the remaining option bits do not explain
> the checked security relationship.
> 
> Cc: 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/20261118163254.2554413-1-mic@digikod.net?part=2




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