/security/selinux/ |
D | xfrm.c | 55 static inline int selinux_authorizable_ctx(struct xfrm_sec_ctx *ctx) in selinux_authorizable_ctx() argument 57 return (ctx && in selinux_authorizable_ctx() 58 (ctx->ctx_doi == XFRM_SC_DOI_LSM) && in selinux_authorizable_ctx() 59 (ctx->ctx_alg == XFRM_SC_ALG_SELINUX)); in selinux_authorizable_ctx() 80 struct xfrm_sec_ctx *ctx = NULL; in selinux_xfrm_alloc_user() local 92 ctx = kmalloc(sizeof(*ctx) + str_len + 1, gfp); in selinux_xfrm_alloc_user() 93 if (!ctx) in selinux_xfrm_alloc_user() 96 ctx->ctx_doi = XFRM_SC_DOI_LSM; in selinux_xfrm_alloc_user() 97 ctx->ctx_alg = XFRM_SC_ALG_SELINUX; in selinux_xfrm_alloc_user() 98 ctx->ctx_len = str_len; in selinux_xfrm_alloc_user() [all …]
|
D | hooks.c | 2948 const struct qstr *name, void **ctx, in selinux_dentry_init_security() argument 2961 return security_sid_to_context(&selinux_state, newsid, (char **)ctx, in selinux_dentry_init_security() 6717 static int selinux_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) in selinux_inode_notifysecctx() argument 6720 ctx, ctxlen, 0); in selinux_inode_notifysecctx() 6728 static int selinux_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) in selinux_inode_setsecctx() argument 6731 ctx, ctxlen, 0); in selinux_inode_setsecctx() 6734 static int selinux_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) in selinux_inode_getsecctx() argument 6738 XATTR_SELINUX_SUFFIX, ctx, true); in selinux_inode_getsecctx()
|
/security/apparmor/ |
D | task.c | 44 struct aa_task_ctx *ctx = task_ctx(current); in aa_replace_current_label() local 59 if (ctx->nnp && label_is_stale(ctx->nnp)) { in aa_replace_current_label() 60 struct aa_label *tmp = ctx->nnp; in aa_replace_current_label() 62 ctx->nnp = aa_get_newest_label(tmp); in aa_replace_current_label() 95 struct aa_task_ctx *ctx = task_ctx(current); in aa_set_current_onexec() local 98 aa_put_label(ctx->onexec); in aa_set_current_onexec() 99 ctx->onexec = label; in aa_set_current_onexec() 100 ctx->token = stack; in aa_set_current_onexec() 117 struct aa_task_ctx *ctx = task_ctx(current); in aa_set_current_hat() local 125 if (!ctx->previous) { in aa_set_current_hat() [all …]
|
D | lsm.c | 447 struct aa_file_ctx *ctx = file_ctx(file); in apparmor_file_alloc_security() local 450 spin_lock_init(&ctx->lock); in apparmor_file_alloc_security() 451 rcu_assign_pointer(ctx->label, aa_get_label(label)); in apparmor_file_alloc_security() 458 struct aa_file_ctx *ctx = file_ctx(file); in apparmor_file_free_security() local 460 if (ctx) in apparmor_file_free_security() 461 aa_put_label(rcu_access_pointer(ctx->label)); in apparmor_file_free_security() 603 struct aa_task_ctx *ctx = task_ctx(current); in apparmor_getprocattr() local 608 else if (strcmp(name, "prev") == 0 && ctx->previous) in apparmor_getprocattr() 609 label = aa_get_newest_label(ctx->previous); in apparmor_getprocattr() 610 else if (strcmp(name, "exec") == 0 && ctx->onexec) in apparmor_getprocattr() [all …]
|
D | domain.c | 856 struct aa_task_ctx *ctx; in apparmor_bprm_creds_for_exec() local 870 ctx = task_ctx(current); in apparmor_bprm_creds_for_exec() 872 AA_BUG(!ctx); in apparmor_bprm_creds_for_exec() 884 !ctx->nnp) in apparmor_bprm_creds_for_exec() 885 ctx->nnp = aa_get_label(label); in apparmor_bprm_creds_for_exec() 895 if (ctx->onexec) in apparmor_bprm_creds_for_exec() 896 new = handle_onexec(label, ctx->onexec, ctx->token, in apparmor_bprm_creds_for_exec() 922 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in apparmor_bprm_creds_for_exec() 1152 struct aa_task_ctx *ctx = task_ctx(current); in aa_change_hat() local 1162 previous = aa_get_newest_label(ctx->previous); in aa_change_hat() [all …]
|
/security/apparmor/include/ |
D | task.h | 42 static inline void aa_free_task_ctx(struct aa_task_ctx *ctx) in aa_free_task_ctx() argument 44 if (ctx) { in aa_free_task_ctx() 45 aa_put_label(ctx->nnp); in aa_free_task_ctx() 46 aa_put_label(ctx->previous); in aa_free_task_ctx() 47 aa_put_label(ctx->onexec); in aa_free_task_ctx() 69 static inline void aa_clear_task_ctx_trans(struct aa_task_ctx *ctx) in aa_clear_task_ctx_trans() argument 71 AA_BUG(!ctx); in aa_clear_task_ctx_trans() 73 aa_put_label(ctx->previous); in aa_clear_task_ctx_trans() 74 aa_put_label(ctx->onexec); in aa_clear_task_ctx_trans() 75 ctx->previous = NULL; in aa_clear_task_ctx_trans() [all …]
|
D | file.h | 57 struct aa_file_ctx *ctx; in aa_alloc_file_ctx() local 59 ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); in aa_alloc_file_ctx() 60 if (ctx) { in aa_alloc_file_ctx() 61 spin_lock_init(&ctx->lock); in aa_alloc_file_ctx() 62 rcu_assign_pointer(ctx->label, aa_get_label(label)); in aa_alloc_file_ctx() 64 return ctx; in aa_alloc_file_ctx() 71 static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) in aa_free_file_ctx() argument 73 if (ctx) { in aa_free_file_ctx() 74 aa_put_label(rcu_access_pointer(ctx->label)); in aa_free_file_ctx() 75 kfree_sensitive(ctx); in aa_free_file_ctx() [all …]
|
/security/keys/ |
D | keyring.c | 460 struct keyring_read_iterator_context *ctx = data; in keyring_read_iterator() local 464 key->type->name, key->serial, ctx->count, ctx->buflen); in keyring_read_iterator() 466 if (ctx->count >= ctx->buflen) in keyring_read_iterator() 469 *ctx->buffer++ = key->serial; in keyring_read_iterator() 470 ctx->count += sizeof(key->serial); in keyring_read_iterator() 484 struct keyring_read_iterator_context ctx; in keyring_read() local 494 ctx.buffer = (key_serial_t *)buffer; in keyring_read() 495 ctx.buflen = buflen; in keyring_read() 496 ctx.count = 0; in keyring_read() 498 keyring_read_iterator, &ctx); in keyring_read() [all …]
|
D | process_keys.c | 191 struct keyring_search_context ctx = { in get_user_session_keyring_rcu() local 204 ctx.index_key.desc_len = snprintf(buf, sizeof(buf), "_uid_ses.%u", in get_user_session_keyring_rcu() 209 &ctx); in get_user_session_keyring_rcu() 422 key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx) in search_cred_keyrings_rcu() argument 426 const struct cred *cred = ctx->cred; in search_cred_keyrings_rcu() 442 make_key_ref(cred->thread_keyring, 1), ctx); in search_cred_keyrings_rcu() 460 make_key_ref(cred->process_keyring, 1), ctx); in search_cred_keyrings_rcu() 481 make_key_ref(cred->session_keyring, 1), ctx); in search_cred_keyrings_rcu() 502 ctx); in search_cred_keyrings_rcu() 539 key_ref_t search_process_keyrings_rcu(struct keyring_search_context *ctx) in search_process_keyrings_rcu() argument [all …]
|
D | request_key.c | 22 static struct key *check_cached_key(struct keyring_search_context *ctx) in check_cached_key() argument 28 ctx->match_data.cmp(key, &ctx->match_data) && in check_cached_key() 369 static int construct_alloc_key(struct keyring_search_context *ctx, in construct_alloc_key() argument 382 ctx->index_key.type->name, ctx->index_key.description); in construct_alloc_key() 389 if (ctx->index_key.type->read) in construct_alloc_key() 391 if (ctx->index_key.type == &key_type_keyring || in construct_alloc_key() 392 ctx->index_key.type->update) in construct_alloc_key() 395 key = key_alloc(ctx->index_key.type, ctx->index_key.description, in construct_alloc_key() 396 ctx->cred->fsuid, ctx->cred->fsgid, ctx->cred, in construct_alloc_key() 422 key_ref = search_process_keyrings_rcu(ctx); in construct_alloc_key() [all …]
|
D | request_key_auth.c | 249 struct keyring_search_context ctx = { in key_get_instantiation_authkey() local 262 ctx.index_key.desc_len = sprintf(description, "%x", target_id); in key_get_instantiation_authkey() 265 authkey_ref = search_process_keyrings_rcu(&ctx); in key_get_instantiation_authkey()
|
D | internal.h | 144 struct keyring_search_context *ctx); 146 extern key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx); 147 extern key_ref_t search_process_keyrings_rcu(struct keyring_search_context *ctx);
|
D | proc.c | 165 struct keyring_search_context ctx = { in proc_keys_show() local 182 skey_ref = search_cred_keyrings_rcu(&ctx); in proc_keys_show() 191 rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); in proc_keys_show()
|
D | dh.c | 84 char ctx[]; member
|
/security/keys/trusted-keys/ |
D | trusted_tpm2.c | 101 struct tpm2_key_context ctx; in tpm2_key_decode() local 104 memset(&ctx, 0, sizeof(ctx)); in tpm2_key_decode() 106 ret = asn1_ber_decoder(&tpm2key_decoder, &ctx, payload->blob, in tpm2_key_decode() 111 if (ctx.priv_len + ctx.pub_len > MAX_BLOB_SIZE) in tpm2_key_decode() 114 blob = kmalloc(ctx.priv_len + ctx.pub_len + 4, GFP_KERNEL); in tpm2_key_decode() 119 options->keyhandle = ctx.parent; in tpm2_key_decode() 121 memcpy(blob, ctx.priv, ctx.priv_len); in tpm2_key_decode() 122 blob += ctx.priv_len; in tpm2_key_decode() 124 memcpy(blob, ctx.pub, ctx.pub_len); in tpm2_key_decode() 133 struct tpm2_key_context *ctx = context; in tpm2_key_parent() local [all …]
|
D | trusted_tee.c | 53 struct tee_context *ctx; member 73 reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->key, in trusted_tee_seal() 81 reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob, in trusted_tee_seal() 103 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in trusted_tee_seal() 134 reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob, in trusted_tee_unseal() 142 reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->key, in trusted_tee_unseal() 164 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in trusted_tee_unseal() 195 reg_shm = tee_shm_register(pvt_data.ctx, (unsigned long)key, key_len, in trusted_tee_get_random() 211 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in trusted_tee_get_random() 241 pvt_data.ctx = tee_client_open_context(NULL, optee_ctx_match, NULL, in trusted_key_probe() [all …]
|
D | trusted_tpm1.c | 32 char ctx[]; member
|
/security/selinux/include/ |
D | xfrm.h | 18 void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx); 19 int selinux_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); 26 int selinux_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid);
|
/security/integrity/ |
D | integrity.h | 250 integrity_audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type) in integrity_audit_log_start() argument 252 return audit_log_start(ctx, gfp_mask, type); in integrity_audit_log_start() 272 integrity_audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type) in integrity_audit_log_start() argument
|
/security/ |
D | security.c | 1070 const struct qstr *name, void **ctx, in security_dentry_init_security() argument 1074 name, ctx, ctxlen); in security_dentry_init_security() 2152 int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) in security_inode_notifysecctx() argument 2154 return call_int_hook(inode_notifysecctx, 0, inode, ctx, ctxlen); in security_inode_notifysecctx() 2158 int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) in security_inode_setsecctx() argument 2160 return call_int_hook(inode_setsecctx, 0, dentry, ctx, ctxlen); in security_inode_setsecctx() 2164 int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) in security_inode_getsecctx() argument 2173 rc = hp->hook.inode_getsecctx(inode, ctx, ctxlen); in security_inode_getsecctx() 2481 void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx) in security_xfrm_policy_free() argument 2483 call_void_hook(xfrm_policy_free_security, ctx); in security_xfrm_policy_free() [all …]
|
/security/selinux/ss/ |
D | services.c | 1443 struct context *ctx, in string_to_context_struct() argument 1452 context_init(ctx); in string_to_context_struct() 1473 ctx->user = usrdatum->value; in string_to_context_struct() 1488 ctx->role = role->value; in string_to_context_struct() 1501 ctx->type = typdatum->value; in string_to_context_struct() 1503 rc = mls_context_to_sid(pol, oldc, p, ctx, sidtabp, def_sid); in string_to_context_struct() 1509 if (!policydb_context_isvalid(pol, ctx)) in string_to_context_struct() 1514 context_destroy(ctx); in string_to_context_struct() 3886 struct context *ctx; in security_netlbl_secattr_to_sid() local 3907 ctx = sidtab_search(sidtab, SECINITSID_NETMSG); in security_netlbl_secattr_to_sid() [all …]
|
/security/smack/ |
D | smack_lsm.c | 4626 static int smack_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) in smack_inode_notifysecctx() argument 4628 return smack_inode_setsecurity(inode, XATTR_SMACK_SUFFIX, ctx, in smack_inode_notifysecctx() 4632 static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) in smack_inode_setsecctx() argument 4635 ctx, ctxlen, 0); in smack_inode_setsecctx() 4638 static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) in smack_inode_getsecctx() argument 4642 *ctx = skp->smk_known; in smack_inode_getsecctx()
|