/security/keys/ |
D | process_keys.c | 46 const struct cred *cred; in install_user_keyrings() local 54 cred = current_cred(); in install_user_keyrings() 55 user = cred->user; in install_user_keyrings() 56 uid = from_kuid(cred->user_ns, user->uid); in install_user_keyrings() 78 cred, user_keyring_perm, in install_user_keyrings() 94 cred, user_keyring_perm, in install_user_keyrings() 131 int install_thread_keyring_to_cred(struct cred *new) in install_thread_keyring_to_cred() 150 struct cred *new; in install_thread_keyring() 174 int install_process_keyring_to_cred(struct cred *new) in install_process_keyring_to_cred() 200 struct cred *new; in install_process_keyring() [all …]
|
D | request_key_auth.c | 103 if (rka->cred) { in request_key_auth_revoke() 104 put_cred(rka->cred); in request_key_auth_revoke() 105 rka->cred = NULL; in request_key_auth_revoke() 118 if (rka->cred) { in request_key_auth_destroy() 119 put_cred(rka->cred); in request_key_auth_destroy() 120 rka->cred = NULL; in request_key_auth_destroy() 137 const struct cred *cred = current->cred; in request_key_auth_new() local 159 if (cred->request_key_auth) { in request_key_auth_new() 161 down_read(&cred->request_key_auth->sem); in request_key_auth_new() 165 if (test_bit(KEY_FLAG_REVOKED, &cred->request_key_auth->flags)) in request_key_auth_new() [all …]
|
D | request_key.c | 74 static int umh_keys_init(struct subprocess_info *info, struct cred *cred) in umh_keys_init() argument 78 return install_session_keyring_to_cred(cred, keyring); in umh_keys_init() 116 const struct cred *cred = current_cred(); in call_sbin_request_key() local 134 cred = get_current_cred(); in call_sbin_request_key() 135 keyring = keyring_alloc(desc, cred->fsuid, cred->fsgid, cred, in call_sbin_request_key() 138 put_cred(cred); in call_sbin_request_key() 150 sprintf(uid_str, "%d", from_kuid(&init_user_ns, cred->fsuid)); in call_sbin_request_key() 151 sprintf(gid_str, "%d", from_kgid(&init_user_ns, cred->fsgid)); in call_sbin_request_key() 158 cred->thread_keyring ? cred->thread_keyring->serial : 0); in call_sbin_request_key() 161 if (cred->process_keyring) in call_sbin_request_key() [all …]
|
D | internal.h | 113 const struct cred *cred, 123 const struct cred *cred); 127 const struct cred *cred); 132 extern int install_thread_keyring_to_cred(struct cred *); 133 extern int install_process_keyring_to_cred(struct cred *); 134 extern int install_session_keyring_to_cred(struct cred *, struct key *); 162 const struct cred *cred, 188 const struct cred *cred; member
|
D | permission.c | 30 int key_task_permission(const key_ref_t key_ref, const struct cred *cred, in key_task_permission() argument 40 if (uid_eq(key->uid, cred->fsuid)) { in key_task_permission() 48 if (gid_eq(key->gid, cred->fsgid)) { in key_task_permission() 53 ret = groups_search(cred->group_info, key->gid); in key_task_permission() 77 return security_key_permission(key_ref, cred, perm); in key_task_permission()
|
D | keyctl.c | 975 struct cred *new; in keyctl_change_reqkey_auth() 1017 const struct cred *cred = current_cred(); in keyctl_instantiate_key_common() local 1033 instkey = cred->request_key_auth; in keyctl_instantiate_key_common() 1191 const struct cred *cred = current_cred(); in keyctl_reject_key() local 1210 instkey = cred->request_key_auth; in keyctl_reject_key() 1248 struct cred *new; in keyctl_set_reqkey_keyring() 1479 const struct cred *mycred, *pcred; in keyctl_session_to_parent() 1482 struct cred *cred; in keyctl_session_to_parent() local 1494 cred = cred_alloc_blank(); in keyctl_session_to_parent() 1495 if (!cred) in keyctl_session_to_parent() [all …]
|
D | proc.c | 185 const struct cred *cred = current_cred(); in proc_keys_show() local 202 true, cred); in proc_keys_show() 214 rc = key_task_permission(key_ref, cred, KEY_VIEW); in proc_keys_show()
|
D | key.c | 225 kuid_t uid, kgid_t gid, const struct cred *cred, in key_alloc() argument 310 ret = security_key_alloc(key, cred, flags); in key_alloc() 785 const struct cred *cred = current_cred(); in key_create_or_update() local 867 key = key_alloc(ktype, description, cred->fsuid, cred->fsgid, cred, in key_create_or_update()
|
D | keyring.c | 260 const struct cred *cred, key_perm_t perm, in keyring_alloc() argument 267 uid, gid, cred, perm, flags); in keyring_alloc() 317 const struct cred *cred, in keyring_search_aux() argument 343 err = key_task_permission(keyring_ref, cred, KEY_SEARCH); in keyring_search_aux() 427 cred, KEY_SEARCH) < 0) in keyring_search_aux() 459 cred, KEY_SEARCH) < 0) in keyring_search_aux() 519 return keyring_search_aux(keyring, current->cred, in keyring_search()
|
/security/ |
D | commoncap.c | 80 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns, in cap_capable() argument 98 if (ns == cred->user_ns) in cap_capable() 99 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; in cap_capable() 109 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable() 155 const struct cred *cred, *child_cred; in cap_ptrace_access_check() local 158 cred = current_cred(); in cap_ptrace_access_check() 160 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check() 161 cap_issubset(child_cred->cap_permitted, cred->cap_permitted)) in cap_ptrace_access_check() 187 const struct cred *cred, *child_cred; in cap_ptrace_traceme() local 190 cred = __task_cred(parent); in cap_ptrace_traceme() [all …]
|
D | security.c | 187 int security_capset(struct cred *new, const struct cred *old, in security_capset() 196 int security_capable(const struct cred *cred, struct user_namespace *ns, in security_capable() argument 199 return security_ops->capable(cred, ns, cap, SECURITY_CAP_AUDIT); in security_capable() 202 int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns, in security_capable_noaudit() argument 205 return security_ops->capable(cred, ns, cap, SECURITY_CAP_NOAUDIT); in security_capable_noaudit() 784 int security_file_open(struct file *file, const struct cred *cred) in security_file_open() argument 788 ret = security_ops->file_open(file, cred); in security_file_open() 808 int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) in security_cred_alloc_blank() argument 810 return security_ops->cred_alloc_blank(cred, gfp); in security_cred_alloc_blank() 813 void security_cred_free(struct cred *cred) in security_cred_free() argument [all …]
|
D | capability.c | 372 static int cap_file_open(struct file *file, const struct cred *cred) in cap_file_open() argument 386 static int cap_cred_alloc_blank(struct cred *cred, gfp_t gfp) in cap_cred_alloc_blank() argument 391 static void cap_cred_free(struct cred *cred) in cap_cred_free() argument 395 static int cap_cred_prepare(struct cred *new, const struct cred *old, gfp_t gfp) in cap_cred_prepare() 400 static void cap_cred_transfer(struct cred *new, const struct cred *old) in cap_cred_transfer() 404 static int cap_kernel_act_as(struct cred *new, u32 secid) in cap_kernel_act_as() 409 static int cap_kernel_create_files_as(struct cred *new, struct inode *inode) in cap_kernel_create_files_as() 869 static int cap_key_alloc(struct key *key, const struct cred *cred, in cap_key_alloc() argument 879 static int cap_key_permission(key_ref_t key_ref, const struct cred *cred, in cap_key_permission() argument
|
/security/tomoyo/ |
D | tomoyo.c | 18 static int tomoyo_cred_alloc_blank(struct cred *new, gfp_t gfp) in tomoyo_cred_alloc_blank() 33 static int tomoyo_cred_prepare(struct cred *new, const struct cred *old, in tomoyo_cred_prepare() 49 static void tomoyo_cred_transfer(struct cred *new, const struct cred *old) in tomoyo_cred_transfer() 59 static void tomoyo_cred_free(struct cred *cred) in tomoyo_cred_free() argument 61 struct tomoyo_domain_info *domain = cred->security; in tomoyo_cred_free() 102 bprm->cred->security)->users); in tomoyo_bprm_set_creds() 107 bprm->cred->security = NULL; in tomoyo_bprm_set_creds() 120 struct tomoyo_domain_info *domain = bprm->cred->security; in tomoyo_bprm_check_security() 329 static int tomoyo_file_open(struct file *f, const struct cred *cred) in tomoyo_file_open() argument 548 struct cred *cred = (struct cred *) current_cred(); in tomoyo_init() local [all …]
|
D | securityfs_if.c | 73 struct cred *cred = prepare_creds(); in tomoyo_write_self() local 74 if (!cred) { in tomoyo_write_self() 78 cred->security; in tomoyo_write_self() 79 cred->security = new_domain; in tomoyo_write_self() 82 commit_creds(cred); in tomoyo_write_self()
|
D | domain.c | 843 bprm->cred->security = domain; in tomoyo_find_next_domain()
|
D | common.c | 929 (!uid_eq(task->cred->uid, GLOBAL_ROOT_UID) || in tomoyo_manager() 930 !uid_eq(task->cred->euid, GLOBAL_ROOT_UID))) in tomoyo_manager()
|
/security/apparmor/ |
D | lsm.c | 49 static void apparmor_cred_free(struct cred *cred) in apparmor_cred_free() argument 51 aa_free_task_context(cred->security); in apparmor_cred_free() 52 cred->security = NULL; in apparmor_cred_free() 58 static int apparmor_cred_alloc_blank(struct cred *cred, gfp_t gfp) in apparmor_cred_alloc_blank() argument 65 cred->security = cxt; in apparmor_cred_alloc_blank() 72 static int apparmor_cred_prepare(struct cred *new, const struct cred *old, in apparmor_cred_prepare() 88 static void apparmor_cred_transfer(struct cred *new, const struct cred *old) in apparmor_cred_transfer() 120 const struct cred *cred; in apparmor_capget() local 123 cred = __task_cred(target); in apparmor_capget() 124 profile = aa_cred_profile(cred); in apparmor_capget() [all …]
|
D | domain.c | 65 const struct cred *cred = NULL; in may_change_ptraced_domain() local 73 cred = get_task_cred(tracer); in may_change_ptraced_domain() 74 tracerp = aa_cred_profile(cred); in may_change_ptraced_domain() 85 if (cred) in may_change_ptraced_domain() 86 put_cred(cred); in may_change_ptraced_domain() 363 cxt = bprm->cred->security; in apparmor_bprm_set_creds() 560 struct aa_task_cxt *new_cxt = bprm->cred->security; in apparmor_bprm_committing_creds() 618 const struct cred *cred; in aa_change_hat() local 636 cred = get_current_cred(); in aa_change_hat() 637 cxt = cred->security; in aa_change_hat() [all …]
|
D | ipc.c | 100 const struct cred *cred = get_task_cred(tracer); in aa_ptrace() local 102 tracer_p = aa_cred_profile(cred); in aa_ptrace() 106 const struct cred *lcred = get_task_cred(tracee); in aa_ptrace() 114 put_cred(cred); in aa_ptrace()
|
D | context.c | 80 struct cred *new; in aa_replace_current_profile() 122 struct cred *new = prepare_creds(); in aa_set_current_onexec() 148 struct cred *new = prepare_creds(); in aa_set_current_hat() 186 struct cred *new = prepare_creds(); in aa_restore_previous_profile()
|
/security/selinux/ |
D | hooks.c | 165 struct cred *cred = (struct cred *) current->real_cred; in cred_init_security() local 173 cred->security = tsec; in cred_init_security() 179 static inline u32 cred_sid(const struct cred *cred) in cred_sid() argument 183 tsec = cred->security; in cred_sid() 352 const struct cred *cred) in may_context_mount_sb_relabel() argument 354 const struct task_security_struct *tsec = cred->security; in may_context_mount_sb_relabel() 369 const struct cred *cred) in may_context_mount_inode_relabel() argument 371 const struct task_security_struct *tsec = cred->security; in may_context_mount_inode_relabel() 587 const struct cred *cred = current_cred(); in selinux_set_mnt_opts() local 718 rc = may_context_mount_sb_relabel(fscontext_sid, sbsec, cred); in selinux_set_mnt_opts() [all …]
|
/security/apparmor/include/ |
D | context.h | 109 static inline struct aa_profile *aa_cred_profile(const struct cred *cred) in aa_cred_profile() argument 111 struct aa_task_cxt *cxt = cred->security; in aa_cred_profile()
|
/security/smack/ |
D | smack_lsm.c | 460 struct task_smack *bsp = bprm->cred->security; in smack_bprm_set_creds() 492 struct task_smack *bsp = bprm->cred->security; in smack_bprm_committing_creds() 1302 char *tsp = smk_of_task(tsk->cred->security); in smack_file_send_sigiotask() 1354 static int smack_file_open(struct file *file, const struct cred *cred) in smack_file_open() argument 1376 static int smack_cred_alloc_blank(struct cred *cred, gfp_t gfp) in smack_cred_alloc_blank() argument 1384 cred->security = tsp; in smack_cred_alloc_blank() 1395 static void smack_cred_free(struct cred *cred) in smack_cred_free() argument 1397 struct task_smack *tsp = cred->security; in smack_cred_free() 1404 cred->security = NULL; in smack_cred_free() 1422 static int smack_cred_prepare(struct cred *new, const struct cred *old, in smack_cred_prepare() [all …]
|
D | smackfs.c | 1648 char *sp = smk_of_task(current->cred->security); in smk_write_onlycap()
|
/security/integrity/ima/ |
D | ima_policy.c | 168 const struct cred *cred = current_cred(); in ima_match_rules() local 181 if ((rule->flags & IMA_UID) && !uid_eq(rule->uid, cred->uid)) in ima_match_rules()
|