Lines Matching defs:cred
58 * @cred: The credentials to use
68 static inline int cap_capable_helper(const struct cred *cred,
75 /* See if cred has the capability in the target user namespace
82 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
95 if ((ns->parent == cred_ns) && uid_eq(ns->owner, cred->euid))
110 * @cred: The credentials to use
124 int cap_capable(const struct cred *cred, struct user_namespace *target_ns,
127 const struct user_namespace *cred_ns = cred->user_ns;
128 int ret = cap_capable_helper(cred, target_ns, cred_ns, cap);
130 trace_cap_capable(cred, target_ns, cred_ns, cap, ret);
167 const struct cred *cred, *child_cred;
171 cred = current_cred();
174 caller_caps = &cred->cap_effective;
176 caller_caps = &cred->cap_permitted;
177 if (cred->user_ns == child_cred->user_ns &&
204 const struct cred *cred, *child_cred;
207 cred = __task_cred(parent);
209 if (cred->user_ns == child_cred->user_ns &&
210 cap_issubset(child_cred->cap_permitted, cred->cap_permitted))
233 const struct cred *cred;
237 cred = __task_cred(target);
238 *effective = cred->cap_effective;
239 *inheritable = cred->cap_inheritable;
240 *permitted = cred->cap_permitted;
272 int cap_capset(struct cred *new,
273 const struct cred *old,
621 struct cred *new = bprm->cred;
759 cap_clear(bprm->cred->cap_permitted);
790 cap_clear(bprm->cred->cap_permitted);
797 static inline bool __is_real(kuid_t uid, struct cred *cred)
798 { return uid_eq(cred->uid, uid); }
800 static inline bool __is_eff(kuid_t uid, struct cred *cred)
801 { return uid_eq(cred->euid, uid); }
803 static inline bool __is_suid(kuid_t uid, struct cred *cred)
804 { return !__is_real(uid, cred) && __is_eff(uid, cred); }
821 const struct cred *old = current_cred();
822 struct cred *new = bprm->cred;
854 #define __cap_grew(target, source, cred) \
855 !cap_issubset(cred->cap_##target, cred->cap_##source)
856 #define __cap_full(field, cred) \
857 cap_issubset(CAP_FULL_SET, cred->cap_##field)
876 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
904 * constructed by execve(). The proposed creds in @bprm->cred is altered,
912 const struct cred *old = current_cred();
913 struct cred *new = bprm->cred;
1110 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)
1149 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
1262 struct cred *new;
1294 const struct cred *old = current_cred();
1295 struct cred *new;