Lines Matching refs:cred

54  * @cred: The credentials to use
67 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
72 /* See if cred has the capability in the target user namespace
78 if (ns == cred->user_ns)
79 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
85 if (ns->level <= cred->user_ns->level)
92 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid))
138 const struct cred *cred, *child_cred;
142 cred = current_cred();
145 caller_caps = &cred->cap_effective;
147 caller_caps = &cred->cap_permitted;
148 if (cred->user_ns == child_cred->user_ns &&
175 const struct cred *cred, *child_cred;
178 cred = __task_cred(parent);
180 if (cred->user_ns == child_cred->user_ns &&
181 cap_issubset(child_cred->cap_permitted, cred->cap_permitted))
204 const struct cred *cred;
208 cred = __task_cred(target);
209 *effective = cred->cap_effective;
210 *inheritable = cred->cap_inheritable;
211 *permitted = cred->cap_permitted;
243 int cap_capset(struct cred *new,
244 const struct cred *old,
592 struct cred *new = bprm->cred;
730 cap_clear(bprm->cred->cap_permitted);
761 cap_clear(bprm->cred->cap_permitted);
768 static inline bool __is_real(kuid_t uid, struct cred *cred)
769 { return uid_eq(cred->uid, uid); }
771 static inline bool __is_eff(kuid_t uid, struct cred *cred)
772 { return uid_eq(cred->euid, uid); }
774 static inline bool __is_suid(kuid_t uid, struct cred *cred)
775 { return !__is_real(uid, cred) && __is_eff(uid, cred); }
792 const struct cred *old = current_cred();
793 struct cred *new = bprm->cred;
825 #define __cap_grew(target, source, cred) \
826 !cap_issubset(cred->cap_##target, cred->cap_##source)
827 #define __cap_full(field, cred) \
828 cap_issubset(CAP_FULL_SET, cred->cap_##field)
830 static inline bool __is_setuid(struct cred *new, const struct cred *old)
833 static inline bool __is_setgid(struct cred *new, const struct cred *old)
853 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
881 * constructed by execve(). The proposed creds in @bprm->cred is altered,
889 const struct cred *old = current_cred();
890 struct cred *new = bprm->cred;
1085 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)
1124 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
1237 struct cred *new;
1269 const struct cred *old = current_cred();
1270 struct cred *new;