Lines Matching refs:cred

65 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,  in cap_capable()  argument
76 if (ns == cred->user_ns) in cap_capable()
77 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; in cap_capable()
83 if (ns->level <= cred->user_ns->level) in cap_capable()
90 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable()
136 const struct cred *cred, *child_cred; in cap_ptrace_access_check() local
140 cred = current_cred(); in cap_ptrace_access_check()
143 caller_caps = &cred->cap_effective; in cap_ptrace_access_check()
145 caller_caps = &cred->cap_permitted; in cap_ptrace_access_check()
146 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check()
173 const struct cred *cred, *child_cred; in cap_ptrace_traceme() local
176 cred = __task_cred(parent); in cap_ptrace_traceme()
178 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme()
179 cap_issubset(child_cred->cap_permitted, cred->cap_permitted)) in cap_ptrace_traceme()
202 const struct cred *cred; in cap_capget() local
206 cred = __task_cred(target); in cap_capget()
207 *effective = cred->cap_effective; in cap_capget()
208 *inheritable = cred->cap_inheritable; in cap_capget()
209 *permitted = cred->cap_permitted; in cap_capget()
241 int cap_capset(struct cred *new, in cap_capset()
242 const struct cred *old, in cap_capset()
594 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
732 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
763 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
770 static inline bool __is_real(kuid_t uid, struct cred *cred) in __is_real() argument
771 { return uid_eq(cred->uid, uid); } in __is_real()
773 static inline bool __is_eff(kuid_t uid, struct cred *cred) in __is_eff() argument
774 { return uid_eq(cred->euid, uid); } in __is_eff()
776 static inline bool __is_suid(kuid_t uid, struct cred *cred) in __is_suid() argument
777 { return !__is_real(uid, cred) && __is_eff(uid, cred); } in __is_suid()
794 const struct cred *old = current_cred(); in handle_privileged_root()
795 struct cred *new = bprm->cred; in handle_privileged_root()
827 #define __cap_grew(target, source, cred) \ argument
828 !cap_issubset(cred->cap_##target, cred->cap_##source)
829 #define __cap_full(field, cred) \ argument
830 cap_issubset(CAP_FULL_SET, cred->cap_##field)
832 static inline bool __is_setuid(struct cred *new, const struct cred *old) in __is_setuid()
835 static inline bool __is_setgid(struct cred *new, const struct cred *old) in __is_setgid()
855 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old, in nonroot_raised_pE()
891 const struct cred *old = current_cred(); in cap_bprm_creds_from_file()
892 struct cred *new = bprm->cred; in cap_bprm_creds_from_file()
1087 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) in cap_emulate_setxuid()
1126 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags) in cap_task_fix_setuid()
1239 struct cred *new; in cap_prctl_drop()
1271 const struct cred *old = current_cred(); in cap_task_prctl()
1272 struct cred *new; in cap_task_prctl()