Lines Matching refs:cred

68 static inline int cap_capable_helper(const struct cred *cred,  in cap_capable_helper()  argument
82 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; in cap_capable_helper()
95 if ((ns->parent == cred_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable_helper()
124 int cap_capable(const struct cred *cred, struct user_namespace *target_ns, in cap_capable() argument
127 const struct user_namespace *cred_ns = cred->user_ns; in cap_capable()
128 int ret = cap_capable_helper(cred, target_ns, cred_ns, cap); in cap_capable()
130 trace_cap_capable(cred, target_ns, cred_ns, cap, ret); in cap_capable()
167 const struct cred *cred, *child_cred; in cap_ptrace_access_check() local
171 cred = current_cred(); in cap_ptrace_access_check()
174 caller_caps = &cred->cap_effective; in cap_ptrace_access_check()
176 caller_caps = &cred->cap_permitted; in cap_ptrace_access_check()
177 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check()
204 const struct cred *cred, *child_cred; in cap_ptrace_traceme() local
207 cred = __task_cred(parent); in cap_ptrace_traceme()
209 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme()
210 cap_issubset(child_cred->cap_permitted, cred->cap_permitted)) in cap_ptrace_traceme()
233 const struct cred *cred; in cap_capget() local
237 cred = __task_cred(target); in cap_capget()
238 *effective = cred->cap_effective; in cap_capget()
239 *inheritable = cred->cap_inheritable; in cap_capget()
240 *permitted = cred->cap_permitted; in cap_capget()
272 int cap_capset(struct cred *new, in cap_capset()
273 const struct cred *old, in cap_capset()
631 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
769 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
800 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
807 static inline bool __is_real(kuid_t uid, struct cred *cred) in __is_real() argument
808 { return uid_eq(cred->uid, uid); } in __is_real()
810 static inline bool __is_eff(kuid_t uid, struct cred *cred) in __is_eff() argument
811 { return uid_eq(cred->euid, uid); } in __is_eff()
813 static inline bool __is_suid(kuid_t uid, struct cred *cred) in __is_suid() argument
814 { return !__is_real(uid, cred) && __is_eff(uid, cred); } in __is_suid()
831 const struct cred *old = current_cred(); in handle_privileged_root()
832 struct cred *new = bprm->cred; in handle_privileged_root()
864 #define __cap_grew(target, source, cred) \ argument
865 !cap_issubset(cred->cap_##target, cred->cap_##source)
866 #define __cap_full(field, cred) \ argument
867 cap_issubset(CAP_FULL_SET, cred->cap_##field)
886 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old, in nonroot_raised_pE()
922 const struct cred *old = current_cred(); in cap_bprm_creds_from_file()
923 struct cred *new = bprm->cred; in cap_bprm_creds_from_file()
1120 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) in cap_emulate_setxuid()
1159 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags) in cap_task_fix_setuid()
1272 struct cred *new; in cap_prctl_drop()
1304 const struct cred *old = current_cred(); in cap_task_prctl()
1305 struct cred *new; in cap_task_prctl()