Lines Matching refs:cred
53 * @cred: The credentials to use
66 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
71 /* See if cred has the capability in the target user namespace
77 if (ns == cred->user_ns)
78 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
84 if (ns->level <= cred->user_ns->level)
91 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid))
137 const struct cred *cred, *child_cred;
141 cred = current_cred();
144 caller_caps = &cred->cap_effective;
146 caller_caps = &cred->cap_permitted;
147 if (cred->user_ns == child_cred->user_ns &&
174 const struct cred *cred, *child_cred;
177 cred = __task_cred(parent);
179 if (cred->user_ns == child_cred->user_ns &&
180 cap_issubset(child_cred->cap_permitted, cred->cap_permitted))
203 const struct cred *cred;
207 cred = __task_cred(target);
208 *effective = cred->cap_effective;
209 *inheritable = cred->cap_inheritable;
210 *permitted = cred->cap_permitted;
242 int cap_capset(struct cred *new,
243 const struct cred *old,
591 struct cred *new = bprm->cred;
729 cap_clear(bprm->cred->cap_permitted);
760 cap_clear(bprm->cred->cap_permitted);
767 static inline bool __is_real(kuid_t uid, struct cred *cred)
768 { return uid_eq(cred->uid, uid); }
770 static inline bool __is_eff(kuid_t uid, struct cred *cred)
771 { return uid_eq(cred->euid, uid); }
773 static inline bool __is_suid(kuid_t uid, struct cred *cred)
774 { return !__is_real(uid, cred) && __is_eff(uid, cred); }
791 const struct cred *old = current_cred();
792 struct cred *new = bprm->cred;
824 #define __cap_grew(target, source, cred) \
825 !cap_issubset(cred->cap_##target, cred->cap_##source)
826 #define __cap_full(field, cred) \
827 cap_issubset(CAP_FULL_SET, cred->cap_##field)
829 static inline bool __is_setuid(struct cred *new, const struct cred *old)
832 static inline bool __is_setgid(struct cred *new, const struct cred *old)
852 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
880 * constructed by execve(). The proposed creds in @bprm->cred is altered,
888 const struct cred *old = current_cred();
889 struct cred *new = bprm->cred;
1084 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)
1123 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
1236 struct cred *new;
1268 const struct cred *old = current_cred();
1269 struct cred *new;