Lines Matching refs:old
370 const struct cred *old; in __sys_setregid() local
386 old = current_cred(); in __sys_setregid()
390 if (gid_eq(old->gid, krgid) || in __sys_setregid()
391 gid_eq(old->egid, krgid) || in __sys_setregid()
392 ns_capable_setid(old->user_ns, CAP_SETGID)) in __sys_setregid()
398 if (gid_eq(old->gid, kegid) || in __sys_setregid()
399 gid_eq(old->egid, kegid) || in __sys_setregid()
400 gid_eq(old->sgid, kegid) || in __sys_setregid()
401 ns_capable_setid(old->user_ns, CAP_SETGID)) in __sys_setregid()
408 (egid != (gid_t) -1 && !gid_eq(kegid, old->gid))) in __sys_setregid()
412 retval = security_task_fix_setgid(new, old, LSM_SETID_RE); in __sys_setregid()
436 const struct cred *old; in __sys_setgid() local
448 old = current_cred(); in __sys_setgid()
451 if (ns_capable_setid(old->user_ns, CAP_SETGID)) in __sys_setgid()
453 else if (gid_eq(kgid, old->gid) || gid_eq(kgid, old->sgid)) in __sys_setgid()
458 retval = security_task_fix_setgid(new, old, LSM_SETID_ID); in __sys_setgid()
527 const struct cred *old; in __sys_setreuid() local
543 old = current_cred(); in __sys_setreuid()
548 if (!uid_eq(old->uid, kruid) && in __sys_setreuid()
549 !uid_eq(old->euid, kruid) && in __sys_setreuid()
550 !ns_capable_setid(old->user_ns, CAP_SETUID)) in __sys_setreuid()
556 if (!uid_eq(old->uid, keuid) && in __sys_setreuid()
557 !uid_eq(old->euid, keuid) && in __sys_setreuid()
558 !uid_eq(old->suid, keuid) && in __sys_setreuid()
559 !ns_capable_setid(old->user_ns, CAP_SETUID)) in __sys_setreuid()
563 if (!uid_eq(new->uid, old->uid)) { in __sys_setreuid()
569 (euid != (uid_t) -1 && !uid_eq(keuid, old->uid))) in __sys_setreuid()
573 retval = security_task_fix_setuid(new, old, LSM_SETID_RE); in __sys_setreuid()
608 const struct cred *old; in __sys_setuid() local
620 old = current_cred(); in __sys_setuid()
623 if (ns_capable_setid(old->user_ns, CAP_SETUID)) { in __sys_setuid()
625 if (!uid_eq(kuid, old->uid)) { in __sys_setuid()
630 } else if (!uid_eq(kuid, old->uid) && !uid_eq(kuid, new->suid)) { in __sys_setuid()
636 retval = security_task_fix_setuid(new, old, LSM_SETID_ID); in __sys_setuid()
665 const struct cred *old; in __sys_setresuid() local
684 old = current_cred(); in __sys_setresuid()
687 if ((ruid == (uid_t) -1 || uid_eq(kruid, old->uid)) && in __sys_setresuid()
688 (euid == (uid_t) -1 || (uid_eq(keuid, old->euid) && in __sys_setresuid()
689 uid_eq(keuid, old->fsuid))) && in __sys_setresuid()
690 (suid == (uid_t) -1 || uid_eq(ksuid, old->suid))) in __sys_setresuid()
693 ruid_new = ruid != (uid_t) -1 && !uid_eq(kruid, old->uid) && in __sys_setresuid()
694 !uid_eq(kruid, old->euid) && !uid_eq(kruid, old->suid); in __sys_setresuid()
695 euid_new = euid != (uid_t) -1 && !uid_eq(keuid, old->uid) && in __sys_setresuid()
696 !uid_eq(keuid, old->euid) && !uid_eq(keuid, old->suid); in __sys_setresuid()
697 suid_new = suid != (uid_t) -1 && !uid_eq(ksuid, old->uid) && in __sys_setresuid()
698 !uid_eq(ksuid, old->euid) && !uid_eq(ksuid, old->suid); in __sys_setresuid()
700 !ns_capable_setid(old->user_ns, CAP_SETUID)) in __sys_setresuid()
709 if (!uid_eq(kruid, old->uid)) { in __sys_setresuid()
721 retval = security_task_fix_setuid(new, old, LSM_SETID_RES); in __sys_setresuid()
767 const struct cred *old; in __sys_setresgid() local
784 old = current_cred(); in __sys_setresgid()
787 if ((rgid == (gid_t) -1 || gid_eq(krgid, old->gid)) && in __sys_setresgid()
788 (egid == (gid_t) -1 || (gid_eq(kegid, old->egid) && in __sys_setresgid()
789 gid_eq(kegid, old->fsgid))) && in __sys_setresgid()
790 (sgid == (gid_t) -1 || gid_eq(ksgid, old->sgid))) in __sys_setresgid()
793 rgid_new = rgid != (gid_t) -1 && !gid_eq(krgid, old->gid) && in __sys_setresgid()
794 !gid_eq(krgid, old->egid) && !gid_eq(krgid, old->sgid); in __sys_setresgid()
795 egid_new = egid != (gid_t) -1 && !gid_eq(kegid, old->gid) && in __sys_setresgid()
796 !gid_eq(kegid, old->egid) && !gid_eq(kegid, old->sgid); in __sys_setresgid()
797 sgid_new = sgid != (gid_t) -1 && !gid_eq(ksgid, old->gid) && in __sys_setresgid()
798 !gid_eq(ksgid, old->egid) && !gid_eq(ksgid, old->sgid); in __sys_setresgid()
800 !ns_capable_setid(old->user_ns, CAP_SETGID)) in __sys_setresgid()
815 retval = security_task_fix_setgid(new, old, LSM_SETID_RES); in __sys_setresgid()
860 const struct cred *old; in __sys_setfsuid() local
865 old = current_cred(); in __sys_setfsuid()
866 old_fsuid = from_kuid_munged(old->user_ns, old->fsuid); in __sys_setfsuid()
868 kuid = make_kuid(old->user_ns, uid); in __sys_setfsuid()
876 if (uid_eq(kuid, old->uid) || uid_eq(kuid, old->euid) || in __sys_setfsuid()
877 uid_eq(kuid, old->suid) || uid_eq(kuid, old->fsuid) || in __sys_setfsuid()
878 ns_capable_setid(old->user_ns, CAP_SETUID)) { in __sys_setfsuid()
879 if (!uid_eq(kuid, old->fsuid)) { in __sys_setfsuid()
881 if (security_task_fix_setuid(new, old, LSM_SETID_FS) == 0) in __sys_setfsuid()
904 const struct cred *old; in __sys_setfsgid() local
909 old = current_cred(); in __sys_setfsgid()
910 old_fsgid = from_kgid_munged(old->user_ns, old->fsgid); in __sys_setfsgid()
912 kgid = make_kgid(old->user_ns, gid); in __sys_setfsgid()
920 if (gid_eq(kgid, old->gid) || gid_eq(kgid, old->egid) || in __sys_setfsgid()
921 gid_eq(kgid, old->sgid) || gid_eq(kgid, old->fsgid) || in __sys_setfsgid()
922 ns_capable_setid(old->user_ns, CAP_SETGID)) { in __sys_setfsgid()
923 if (!gid_eq(kgid, old->fsgid)) { in __sys_setfsgid()
925 if (security_task_fix_setgid(new,old,LSM_SETID_FS) == 0) in __sys_setfsgid()
1684 struct rlimit old, new; in SYSCALL_DEFINE4() local
1714 old_rlim ? &old : NULL); in SYSCALL_DEFINE4()
1717 rlim_to_rlim64(&old, &old64); in SYSCALL_DEFINE4()