[PATCH v2 4/4] selftests/capabilities: add userns capability bounding set tests

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 19 10:47:50 UTC 2026


> Add selftests in tools/testing/selftests/capabilities covering:
> 
> - prctl(PR_CAP_USERNS) argument validation and authorization rules for
>   lowering, clearing, and raising capabilities.
> - Default full capability grants, cap_userns restrictions (including
>   clearing all capabilities), and monotonic inheritance across nested
>   user namespaces.
> - Default retention of capabilities in cap_permitted, and strict
>   enforcement and persistence of SECBIT_CAP_USERNS_STRICT and its lock
>   across user namespace transitions.
> - Credential and cap_userns clamping upon entering a user namespace via
>   setns().
> - Implicit parent-owner capability bounding by the owned namespace's
>   cap_bset (including over descendants) and the caller's userns
>   ceiling, while preserving explicit ancestor capabilities.
> - Ptrace restrictions across PTRACE_ATTACH, PTRACE_TRACEME, and
>   PTRACE_MODE_READ for same-userns peers and owned descendant
>   namespaces, while preserving explicit CAP_SYS_PTRACE.
> - Preservation of dumpable and pdeath_signal when narrowing the userns
>   ceiling and resets when widening it.
> - CapUns reporting in /proc/self/status.
> 
> Signed-off-by: Hallgrimur H. Gunnarsson <halg at google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119104208.782900-1-halg@google.com?part=4




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