Lines Matching refs:cred

71 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,  in cap_capable()  argument
82 if (ns == cred->user_ns) in cap_capable()
83 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; in cap_capable()
89 if (ns->level <= cred->user_ns->level) in cap_capable()
96 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable()
142 const struct cred *cred, *child_cred; in cap_ptrace_access_check() local
146 cred = current_cred(); in cap_ptrace_access_check()
149 caller_caps = &cred->cap_effective; in cap_ptrace_access_check()
151 caller_caps = &cred->cap_permitted; in cap_ptrace_access_check()
152 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check()
179 const struct cred *cred, *child_cred; in cap_ptrace_traceme() local
182 cred = __task_cred(parent); in cap_ptrace_traceme()
184 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme()
185 cap_issubset(child_cred->cap_permitted, cred->cap_permitted)) in cap_ptrace_traceme()
208 const struct cred *cred; in cap_capget() local
212 cred = __task_cred(target); in cap_capget()
213 *effective = cred->cap_effective; in cap_capget()
214 *inheritable = cred->cap_inheritable; in cap_capget()
215 *permitted = cred->cap_permitted; in cap_capget()
248 int cap_capset(struct cred *new, in cap_capset()
249 const struct cred *old, in cap_capset()
540 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
660 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
693 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
700 static inline bool __is_real(kuid_t uid, struct cred *cred) in __is_real() argument
701 { return uid_eq(cred->uid, uid); } in __is_real()
703 static inline bool __is_eff(kuid_t uid, struct cred *cred) in __is_eff() argument
704 { return uid_eq(cred->euid, uid); } in __is_eff()
706 static inline bool __is_suid(kuid_t uid, struct cred *cred) in __is_suid() argument
707 { return !__is_real(uid, cred) && __is_eff(uid, cred); } in __is_suid()
724 const struct cred *old = current_cred(); in handle_privileged_root()
725 struct cred *new = bprm->cred; in handle_privileged_root()
757 #define __cap_grew(target, source, cred) \ argument
758 !cap_issubset(cred->cap_##target, cred->cap_##source)
759 #define __cap_full(field, cred) \ argument
760 cap_issubset(CAP_FULL_SET, cred->cap_##field)
762 static inline bool __is_setuid(struct cred *new, const struct cred *old) in __is_setuid()
765 static inline bool __is_setgid(struct cred *new, const struct cred *old) in __is_setgid()
785 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old, in nonroot_raised_pE()
817 const struct cred *old = current_cred(); in cap_bprm_set_creds()
818 struct cred *new = bprm->cred; in cap_bprm_set_creds()
1005 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) in cap_emulate_setxuid()
1042 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags) in cap_task_fix_setuid()
1149 struct cred *new; in cap_prctl_drop()
1178 const struct cred *old = current_cred(); in cap_task_prctl()
1179 struct cred *new; in cap_task_prctl()