Lines Matching refs:old
258 const struct cred *old; in prepare_creds() local
269 old = task->cred; in prepare_creds()
270 memcpy(new, old, sizeof(struct cred)); in prepare_creds()
294 if (security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT) < 0) in prepare_creds()
453 const struct cred *old = task->real_cred; in commit_creds() local
459 BUG_ON(task->cred != old); in commit_creds()
461 BUG_ON(read_cred_subscribers(old) < 2); in commit_creds()
462 validate_creds(old); in commit_creds()
470 if (!uid_eq(old->euid, new->euid) || in commit_creds()
471 !gid_eq(old->egid, new->egid) || in commit_creds()
472 !uid_eq(old->fsuid, new->fsuid) || in commit_creds()
473 !gid_eq(old->fsgid, new->fsgid) || in commit_creds()
474 !cred_cap_issubset(old, new)) { in commit_creds()
491 if (!uid_eq(new->fsuid, old->fsuid)) in commit_creds()
493 if (!gid_eq(new->fsgid, old->fsgid)) in commit_creds()
501 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds()
506 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds()
507 dec_rlimit_ucounts(old->ucounts, UCOUNT_RLIMIT_NPROC, 1); in commit_creds()
508 alter_cred_subscribers(old, -2); in commit_creds()
511 if (!uid_eq(new->uid, old->uid) || in commit_creds()
512 !uid_eq(new->euid, old->euid) || in commit_creds()
513 !uid_eq(new->suid, old->suid) || in commit_creds()
514 !uid_eq(new->fsuid, old->fsuid)) in commit_creds()
517 if (!gid_eq(new->gid, old->gid) || in commit_creds()
518 !gid_eq(new->egid, old->egid) || in commit_creds()
519 !gid_eq(new->sgid, old->sgid) || in commit_creds()
520 !gid_eq(new->fsgid, old->fsgid)) in commit_creds()
524 put_cred(old); in commit_creds()
525 put_cred(old); in commit_creds()
560 const struct cred *old = current->cred; in override_creds() local
566 validate_creds(old); in override_creds()
584 alter_cred_subscribers(old, -1); in override_creds()
586 kdebug("override_creds() = %p{%d,%d}", old, in override_creds()
587 atomic_read(&old->usage), in override_creds()
588 read_cred_subscribers(old)); in override_creds()
589 return old; in override_creds()
600 void revert_creds(const struct cred *old) in revert_creds() argument
604 kdebug("revert_creds(%p{%d,%d})", old, in revert_creds()
605 atomic_read(&old->usage), in revert_creds()
606 read_cred_subscribers(old)); in revert_creds()
608 validate_creds(old); in revert_creds()
610 alter_cred_subscribers(old, 1); in revert_creds()
611 rcu_assign_pointer(current->cred, old); in revert_creds()
612 trace_android_rvh_revert_creds(current, old); in revert_creds()
720 const struct cred *old; in prepare_kernel_cred() local
730 old = get_task_cred(daemon); in prepare_kernel_cred()
732 old = get_cred(&init_cred); in prepare_kernel_cred()
734 validate_creds(old); in prepare_kernel_cred()
736 *new = *old; in prepare_kernel_cred()
759 if (security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT) < 0) in prepare_kernel_cred()
762 put_cred(old); in prepare_kernel_cred()
768 put_cred(old); in prepare_kernel_cred()