lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 2 May 2022 18:00:23 +0200 From: Christian Göttsche <cgzones@...glemail.com> To: selinux@...r.kernel.org Cc: Serge Hallyn <serge@...lyn.com>, linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org Subject: [PATCH v2 2/8] capability: use new capable_or functionality Use the new added capable_or function in appropriate cases, where a task is required to have any of two capabilities. Signed-off-by: Christian Göttsche <cgzones@...glemail.com> --- include/linux/capability.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/capability.h b/include/linux/capability.h index a16d1edea9b3..1f26d6bae4f3 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -261,12 +261,12 @@ extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns); static inline bool perfmon_capable(void) { - return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); + return capable_or(CAP_PERFMON, CAP_SYS_ADMIN); } static inline bool bpf_capable(void) { - return capable(CAP_BPF) || capable(CAP_SYS_ADMIN); + return capable_or(CAP_BPF, CAP_SYS_ADMIN); } static inline bool checkpoint_restore_ns_capable(struct user_namespace *ns) -- 2.36.0
Powered by blists - more mailing lists