Lines Matching refs:old
273 const struct cred *old, in cap_capset() argument
280 cap_combine(old->cap_inheritable, in cap_capset()
281 old->cap_permitted))) in cap_capset()
286 cap_combine(old->cap_inheritable, in cap_capset()
287 old->cap_bset))) in cap_capset()
292 if (!cap_issubset(*permitted, old->cap_permitted)) in cap_capset()
821 const struct cred *old = current_cred(); in handle_privileged_root() local
842 new->cap_permitted = cap_combine(old->cap_bset, in handle_privileged_root()
843 old->cap_inheritable); in handle_privileged_root()
876 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old, in nonroot_raised_pE() argument
888 (uid_eq(new->euid, old->euid) && in nonroot_raised_pE()
890 __cap_gained(permitted, new, old)) || in nonroot_raised_pE()
891 __cap_gained(ambient, new, old)))) in nonroot_raised_pE()
912 const struct cred *old = current_cred(); in cap_bprm_creds_from_file() local
918 if (WARN_ON(!cap_ambient_invariant_ok(old))) in cap_bprm_creds_from_file()
930 if (__cap_gained(permitted, new, old)) in cap_bprm_creds_from_file()
938 id_changed = !uid_eq(new->euid, old->euid) || !in_group_p(new->egid); in cap_bprm_creds_from_file()
940 if ((id_changed || __cap_gained(permitted, new, old)) && in cap_bprm_creds_from_file()
950 old->cap_permitted); in cap_bprm_creds_from_file()
978 if (nonroot_raised_pE(new, old, root_uid, has_fcap)) { in cap_bprm_creds_from_file()
979 ret = audit_log_bprm_fcaps(bprm, new, old); in cap_bprm_creds_from_file()
991 !uid_eq(new->euid, old->uid) || in cap_bprm_creds_from_file()
992 !gid_eq(new->egid, old->gid) || in cap_bprm_creds_from_file()
1110 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) in cap_emulate_setxuid() argument
1112 kuid_t root_uid = make_kuid(old->user_ns, 0); in cap_emulate_setxuid()
1114 if ((uid_eq(old->uid, root_uid) || in cap_emulate_setxuid()
1115 uid_eq(old->euid, root_uid) || in cap_emulate_setxuid()
1116 uid_eq(old->suid, root_uid)) && in cap_emulate_setxuid()
1132 if (uid_eq(old->euid, root_uid) && !uid_eq(new->euid, root_uid)) in cap_emulate_setxuid()
1134 if (!uid_eq(old->euid, root_uid) && uid_eq(new->euid, root_uid)) in cap_emulate_setxuid()
1149 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags) in cap_task_fix_setuid() argument
1158 cap_emulate_setxuid(new, old); in cap_task_fix_setuid()
1169 kuid_t root_uid = make_kuid(old->user_ns, 0); in cap_task_fix_setuid()
1170 if (uid_eq(old->fsuid, root_uid) && !uid_eq(new->fsuid, root_uid)) in cap_task_fix_setuid()
1174 if (!uid_eq(old->fsuid, root_uid) && uid_eq(new->fsuid, root_uid)) in cap_task_fix_setuid()
1294 const struct cred *old = current_cred(); in cap_task_prctl() local
1301 return !!cap_raised(old->cap_bset, arg2); in cap_task_prctl()
1326 if ((((old->securebits & SECURE_ALL_LOCKS) >> 1) in cap_task_prctl()
1327 & (old->securebits ^ arg2)) /*[1]*/ in cap_task_prctl()
1328 || ((old->securebits & SECURE_ALL_LOCKS & ~arg2)) /*[2]*/ in cap_task_prctl()
1351 const unsigned long changed = old->securebits ^ arg2; in cap_task_prctl()
1369 return old->securebits; in cap_task_prctl()