diff options
| author | Mickaël Salaün <mic@digikod.net> | 2026-11-18 15:54:28 +0100 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-11-19 11:55:34 +0100 |
| commit | 2ff5a29db0f542226d5bd029459de9703fc2a2ae (patch) | |
| tree | 79888aab8a25bd01da8f716087740bef0d071dbb /tools/perf/scripts/python | |
| parent | c0aa8acdd94e9ec0ea2fefe8fa5b31c03c271c4b (diff) | |
capabilities: Check PR_SET_SECUREBITS with ns_capable()
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@kernel.org>
Cc: Günther Noack <gnoack@google.com>
Cc: James Morris <jmorris@namei.org>
Cc: John Johansen <john.johansen@canonical.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Matt Bobrowski <matt@bobrowski.net>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Serge Hallyn (AMD) <sergeh@kernel.org>
Fixes: 3898b1b4ebff ("capabilities: implement per-process securebits")
Link: https://patch.msgid.link/20261118145431.2551578-2-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
