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()
621 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
759 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
790 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
797 static inline bool __is_real(kuid_t uid, struct cred *cred) in __is_real() argument
798 { return uid_eq(cred->uid, uid); } in __is_real()
800 static inline bool __is_eff(kuid_t uid, struct cred *cred) in __is_eff() argument
801 { return uid_eq(cred->euid, uid); } in __is_eff()
803 static inline bool __is_suid(kuid_t uid, struct cred *cred) in __is_suid() argument
804 { return !__is_real(uid, cred) && __is_eff(uid, cred); } in __is_suid()
821 const struct cred *old = current_cred(); in handle_privileged_root()
822 struct cred *new = bprm->cred; in handle_privileged_root()
854 #define __cap_grew(target, source, cred) \ argument
855 !cap_issubset(cred->cap_##target, cred->cap_##source)
856 #define __cap_full(field, cred) \ argument
857 cap_issubset(CAP_FULL_SET, cred->cap_##field)
876 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old, in nonroot_raised_pE()
912 const struct cred *old = current_cred(); in cap_bprm_creds_from_file()
913 struct cred *new = bprm->cred; in cap_bprm_creds_from_file()
1110 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) in cap_emulate_setxuid()
1149 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags) in cap_task_fix_setuid()
1262 struct cred *new; in cap_prctl_drop()
1294 const struct cred *old = current_cred(); in cap_task_prctl()
1295 struct cred *new; in cap_task_prctl()