[PATCH v3 1/2] capabilities: Check PR_SET_SECUREBITS with ns_capable()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Wed Nov 18 15:00:37 UTC 2026
> PR_SET_SECUREBITS checks CAP_SETPCAP with cap_capable(), which skips the
> LSM capable hooks, so a task can change privileged securebits despite an
> LSM denial.
>
> Use ns_capable() instead, as PR_CAPBSET_DROP already does. Move the
> check to a helper that only requires CAP_SETPCAP when needed, so that
> changes limited to the unprivileged securebits still do not reach the
> LSMs or set PF_SUPERPRIV.
>
> Cc: Christian Brauner <brauner at kernel.org>
> Cc: Günther Noack <gnoack at google.com>
> Cc: James Morris <jmorris at namei.org>
> Cc: John Johansen <john.johansen at canonical.com>
> Cc: KP Singh <kpsingh at kernel.org>
> Cc: Matt Bobrowski <matt at bobrowski.net>
> Cc: Paul Moore <paul at paul-moore.com>
> Cc: Serge Hallyn <serge at hallyn.com>
> Cc: Stephen Smalley <stephen.smalley.work at gmail.com>
> Cc: stable at vger.kernel.org
> Reviewed-by: Serge Hallyn (AMD) <sergeh at kernel.org>
> Fixes: 3898b1b4ebff ("capabilities: implement per-process securebits")
> 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/20261118145431.2551578-1-mic@digikod.net?part=1
More information about the Linux-security-module-archive
mailing list