[PATCH v2 2/4] capability: bound ptrace and cred subset checks by userns ceilings
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 19 10:51:34 UTC 2026
> Same-namespace ptrace checks only compare cap_permitted (or
> cap_effective), ignoring the userns capability ceiling. As a result, a
> task with a lowered ceiling could trace a less-restricted same-UID task
> in the same user namespace and use it to create a wider child user
> namespace.
>
> Require the tracee's cred_userns_bset() to be a subset of the tracer's
> in the same-namespace check in cap_ptrace_access_check() and
> cap_ptrace_traceme(). Cross-namespace implicit CAP_SYS_PTRACE via user
> namespace ownership is already bounded by cap_capable_helper(), while
> tracers holding explicit CAP_SYS_PTRACE retain access.
>
> Also update cred_cap_issubset() so commit_creds() resets mm->dumpable
> and pdeath_signal whenever a credential transition widens the effective
> userns capability ceiling.
>
> Suggested-by: Christian Brauner <brauner at kernel.org>
> Suggested-by: Andy Lutomirski <luto at kernel.org>
> 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=2
More information about the Linux-security-module-archive
mailing list