Lines Matching full:cap
273 * @cap: The capability to be tested for
281 struct user_namespace *ns, int cap) in has_ns_capability() argument
286 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NONE); in has_ns_capability()
295 * @cap: The capability to be tested for
302 bool has_capability(struct task_struct *t, int cap) in has_capability() argument
304 return has_ns_capability(t, &init_user_ns, cap); in has_capability()
313 * @cap: The capability to be tested for
322 struct user_namespace *ns, int cap) in has_ns_capability_noaudit() argument
327 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NOAUDIT); in has_ns_capability_noaudit()
337 * @cap: The capability to be tested for
345 bool has_capability_noaudit(struct task_struct *t, int cap) in has_capability_noaudit() argument
347 return has_ns_capability_noaudit(t, &init_user_ns, cap); in has_capability_noaudit()
352 int cap, in ns_capable_common() argument
357 if (unlikely(!cap_valid(cap))) { in ns_capable_common()
358 pr_crit("capable() called with invalid cap=%u\n", cap); in ns_capable_common()
362 capable = security_capable(current_cred(), ns, cap, opts); in ns_capable_common()
373 * @cap: The capability to be tested for
381 bool ns_capable(struct user_namespace *ns, int cap) in ns_capable() argument
383 return ns_capable_common(ns, cap, CAP_OPT_NONE); in ns_capable()
391 * @cap: The capability to be tested for
399 bool ns_capable_noaudit(struct user_namespace *ns, int cap) in ns_capable_noaudit() argument
401 return ns_capable_common(ns, cap, CAP_OPT_NOAUDIT); in ns_capable_noaudit()
410 * @cap: The capability to be tested for
418 bool ns_capable_setid(struct user_namespace *ns, int cap) in ns_capable_setid() argument
420 return ns_capable_common(ns, cap, CAP_OPT_INSETID); in ns_capable_setid()
426 * @cap: The capability to be tested for
434 bool capable(int cap) in capable() argument
436 return ns_capable(&init_user_ns, cap); in capable()
445 * @cap: The capability to be tested for
454 int cap) in file_ns_capable() argument
457 if (WARN_ON_ONCE(!cap_valid(cap))) in file_ns_capable()
460 if (security_capable(file->f_cred, ns, cap, CAP_OPT_NONE) == 0) in file_ns_capable()
487 * @cap: The capability in question
494 const struct inode *inode, int cap) in capable_wrt_inode_uidgid() argument
498 return ns_capable(ns, cap) && in capable_wrt_inode_uidgid()