Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 25) sorted by relevance

/security/keys/
Dkey.c50 void __key_check(const struct key *key) in __key_check() argument
53 key, key->magic, KEY_DEBUG_MAGIC); in __key_check()
151 static inline void key_alloc_serial(struct key *key) in key_alloc_serial() argument
154 struct key *xkey; in key_alloc_serial()
159 get_random_bytes(&key->serial, sizeof(key->serial)); in key_alloc_serial()
161 key->serial >>= 1; /* negative numbers are not permitted */ in key_alloc_serial()
162 } while (key->serial < 3); in key_alloc_serial()
172 xkey = rb_entry(parent, struct key, serial_node); in key_alloc_serial()
174 if (key->serial < xkey->serial) in key_alloc_serial()
176 else if (key->serial > xkey->serial) in key_alloc_serial()
[all …]
Drequest_key.c47 kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error); in complete_request_key()
50 key_negate_and_link(cons->key, key_negative_timeout, NULL, in complete_request_key()
55 key_put(cons->key); in complete_request_key()
71 struct key *key = cons->key, *authkey = cons->authkey, *keyring; in call_sbin_request_key() local
77 kenter("{%d},{%d},%s", key->serial, authkey->serial, op); in call_sbin_request_key()
84 sprintf(desc, "_req.%u", key->serial); in call_sbin_request_key()
105 sprintf(key_str, "%d", key->serial); in call_sbin_request_key()
146 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || in call_sbin_request_key()
147 key_validate(key) < 0) in call_sbin_request_key()
168 static int construct_key(struct key *key, const void *callout_info, in construct_key() argument
[all …]
Dpermission.c32 struct key *key; in key_task_permission() local
36 key = key_ref_to_ptr(key_ref); in key_task_permission()
39 if (key->uid == cred->fsuid) { in key_task_permission()
40 kperm = key->perm >> 16; in key_task_permission()
46 if (key->gid != -1 && key->perm & KEY_GRP_ALL) { in key_task_permission()
47 if (key->gid == cred->fsgid) { in key_task_permission()
48 kperm = key->perm >> 8; in key_task_permission()
52 ret = groups_search(cred->group_info, key->gid); in key_task_permission()
54 kperm = key->perm >> 8; in key_task_permission()
60 kperm = key->perm; in key_task_permission()
[all …]
Dkeyring.c50 static int keyring_instantiate(struct key *keyring,
52 static int keyring_match(const struct key *keyring, const void *criterion);
53 static void keyring_revoke(struct key *keyring);
54 static void keyring_destroy(struct key *keyring);
55 static void keyring_describe(const struct key *keyring, struct seq_file *m);
56 static long keyring_read(const struct key *keyring,
83 static void keyring_publish_name(struct key *keyring) in keyring_publish_name()
108 static int keyring_instantiate(struct key *keyring, in keyring_instantiate()
128 static int keyring_match(const struct key *keyring, const void *description) in keyring_match()
139 static void keyring_destroy(struct key *keyring) in keyring_destroy()
[all …]
Duser_defined.c42 int user_instantiate(struct key *key, const void *data, size_t datalen) in user_instantiate() argument
51 ret = key_payload_reserve(key, datalen); in user_instantiate()
63 rcu_assign_pointer(key->payload.data, upayload); in user_instantiate()
92 int user_update(struct key *key, const void *data, size_t datalen) in user_update() argument
113 ret = key_payload_reserve(key, datalen); in user_update()
117 zap = key->payload.data; in user_update()
118 rcu_assign_pointer(key->payload.data, upayload); in user_update()
119 key->expiry = 0; in user_update()
135 int user_match(const struct key *key, const void *description) in user_match() argument
137 return strcmp(key->description, description) == 0; in user_match()
[all …]
Drequest_key_auth.c22 static int request_key_auth_instantiate(struct key *, const void *, size_t);
23 static void request_key_auth_describe(const struct key *, struct seq_file *);
24 static void request_key_auth_revoke(struct key *);
25 static void request_key_auth_destroy(struct key *);
26 static long request_key_auth_read(const struct key *, char __user *, size_t);
45 static int request_key_auth_instantiate(struct key *key, in request_key_auth_instantiate() argument
49 key->payload.data = (struct request_key_auth *) data; in request_key_auth_instantiate()
58 static void request_key_auth_describe(const struct key *key, in request_key_auth_describe() argument
61 struct request_key_auth *rka = key->payload.data; in request_key_auth_describe()
64 seq_puts(m, key->description); in request_key_auth_describe()
[all …]
Dinternal.h88 extern int __key_link(struct key *keyring, struct key *key);
95 extern struct key *keyring_search_instkey(struct key *keyring,
98 typedef int (*key_match_func_t)(const struct key *, const void *);
111 extern struct key *find_keyring_by_name(const char *name, bool skip_perm_check);
117 extern struct key *request_key_and_link(struct key_type *type,
122 struct key *dest_keyring,
155 struct key *target_key;
156 struct key *dest_keyring;
164 extern struct key *request_key_auth_new(struct key *target,
167 struct key *dest_keyring);
[all …]
Dprocess_keys.c47 struct key *uid_keyring, *session_keyring; in install_user_keyrings()
127 struct key *keyring; in install_thread_keyring_to_cred()
168 struct key *keyring; in install_process_keyring_to_cred()
218 struct key *keyring) in install_session_keyring_to_cred()
221 struct key *old; in install_session_keyring_to_cred()
259 static int install_session_keyring(struct key *keyring) in install_session_keyring()
476 static int lookup_user_key_possessed(const struct key *key, const void *target) in lookup_user_key_possessed() argument
478 return key == target; in lookup_user_key_possessed()
493 struct key *key; in lookup_user_key() local
509 key = ERR_PTR(ret); in lookup_user_key()
[all …]
Dkeyctl.c155 struct key *key; in SYSCALL_DEFINE4() local
203 key = request_key_and_link(ktype, description, callout_info, in SYSCALL_DEFINE4()
206 if (IS_ERR(key)) { in SYSCALL_DEFINE4()
207 ret = PTR_ERR(key); in SYSCALL_DEFINE4()
211 ret = key->serial; in SYSCALL_DEFINE4()
213 key_put(key); in SYSCALL_DEFINE4()
463 struct key *key, *instkey; in keyctl_describe_key() local
494 key = key_ref_to_ptr(key_ref); in keyctl_describe_key()
635 struct key *key; in keyctl_read_key() local
646 key = key_ref_to_ptr(key_ref); in keyctl_read_key()
[all …]
Dproc.c132 struct key *key = rb_entry(_p, struct key, serial_node); in proc_keys_show() local
143 rc = key_task_permission(make_key_ref(key, 0), current_cred(), in proc_keys_show()
153 if (key->expiry == 0) { in proc_keys_show()
156 else if (now.tv_sec >= key->expiry) { in proc_keys_show()
160 timo = key->expiry - now.tv_sec; in proc_keys_show()
178 key->serial, in proc_keys_show()
179 showflag(key, 'I', KEY_FLAG_INSTANTIATED), in proc_keys_show()
180 showflag(key, 'R', KEY_FLAG_REVOKED), in proc_keys_show()
181 showflag(key, 'D', KEY_FLAG_DEAD), in proc_keys_show()
182 showflag(key, 'Q', KEY_FLAG_IN_QUOTA), in proc_keys_show()
[all …]
DMakefile6 key.o \
/security/selinux/ss/
Davtab.c37 struct avtab_key *key, struct avtab_datum *datum) in avtab_insert_node() argument
43 newnode->key = *key; in avtab_insert_node()
57 static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert() argument
61 u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); in avtab_insert()
66 hvalue = avtab_hash(key, h->mask); in avtab_insert()
70 if (key->source_type == cur->key.source_type && in avtab_insert()
71 key->target_type == cur->key.target_type && in avtab_insert()
72 key->target_class == cur->key.target_class && in avtab_insert()
73 (specified & cur->key.specified)) in avtab_insert()
75 if (key->source_type < cur->key.source_type) in avtab_insert()
[all …]
Dhashtab.c11 struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key), in hashtab_create() argument
38 int hashtab_insert(struct hashtab *h, void *key, void *datum) in hashtab_insert() argument
46 hvalue = h->hash_value(h, key); in hashtab_insert()
49 while (cur && h->keycmp(h, key, cur->key) > 0) { in hashtab_insert()
54 if (cur && (h->keycmp(h, key, cur->key) == 0)) in hashtab_insert()
60 newnode->key = key; in hashtab_insert()
74 void *hashtab_search(struct hashtab *h, const void *key) in hashtab_search() argument
82 hvalue = h->hash_value(h, key); in hashtab_search()
84 while (cur && h->keycmp(h, key, cur->key) > 0) in hashtab_search()
87 if (cur == NULL || (h->keycmp(h, key, cur->key) != 0)) in hashtab_search()
[all …]
Dpolicydb.c147 char *key = NULL; in roles_init() local
161 key = kmalloc(strlen(OBJECT_R)+1, GFP_KERNEL); in roles_init()
162 if (!key) { in roles_init()
166 strcpy(key, OBJECT_R); in roles_init()
167 rc = hashtab_insert(p->p_roles.table, key, role); in roles_init()
174 kfree(key); in roles_init()
229 static int common_index(void *key, void *datum, void *datap) in common_index() argument
238 p->p_common_val_to_name[comdatum->value - 1] = key; in common_index()
242 static int class_index(void *key, void *datum, void *datap) in class_index() argument
251 p->p_class_val_to_name[cladatum->value - 1] = key; in class_index()
[all …]
Dconditional.c102 cur->node->key.specified &= ~AVTAB_ENABLED; in evaluate_cond_node()
104 cur->node->key.specified |= AVTAB_ENABLED; in evaluate_cond_node()
110 cur->node->key.specified &= ~AVTAB_ENABLED; in evaluate_cond_node()
112 cur->node->key.specified |= AVTAB_ENABLED; in evaluate_cond_node()
181 int cond_destroy_bool(void *key, void *datum, void *p) in cond_destroy_bool() argument
183 kfree(key); in cond_destroy_bool()
188 int cond_index_bool(void *key, void *datum, void *datap) in cond_index_bool() argument
199 p->p_bool_val_to_name[booldatum->value - 1] = key; in cond_index_bool()
214 char *key = NULL; in cond_read_bool() local
236 key = kmalloc(len + 1, GFP_KERNEL); in cond_read_bool()
[all …]
Dhashtab.h16 void *key; member
25 u32 (*hash_value)(struct hashtab *h, const void *key);
42 struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
Dconditional.h66 int cond_destroy_bool(void *key, void *datum, void *p);
68 int cond_index_bool(void *key, void *datum, void *datap);
73 void cond_compute_av(struct avtab *ctab, struct avtab_key *key, struct av_decision *avd);
Davtab.h48 struct avtab_key key; member
75 struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key,
78 struct avtab_node *avtab_search_node(struct avtab *h, struct avtab_key *key);
Dsymtab.c12 static unsigned int symhash(struct hashtab *h, const void *key) in symhash() argument
19 keyp = key; in symhash()
Dservices.c460 if (node->key.specified == AVTAB_ALLOWED) in context_struct_compute_av()
462 else if (node->key.specified == AVTAB_AUDITALLOW) in context_struct_compute_av()
464 else if (node->key.specified == AVTAB_AUDITDENY) in context_struct_compute_av()
1211 if (node->key.specified & AVTAB_ENABLED) { in security_compute_sid()
1509 static int convert_context(u32 key, in convert_context() argument
/security/
DKconfig8 bool "Enable access key retention support"
17 Furthermore, a special type of key is available that acts as keyring:
37 Only key attributes are listed here; key payloads are not included in
Dsecurity.c1202 int security_key_alloc(struct key *key, const struct cred *cred, in security_key_alloc() argument
1205 return security_ops->key_alloc(key, cred, flags); in security_key_alloc()
1208 void security_key_free(struct key *key) in security_key_free() argument
1210 security_ops->key_free(key); in security_key_free()
1219 int security_key_getsecurity(struct key *key, char **_buffer) in security_key_getsecurity() argument
1221 return security_ops->key_getsecurity(key, _buffer); in security_key_getsecurity()
Dcapability.c809 static int cap_key_alloc(struct key *key, const struct cred *cred, in cap_key_alloc() argument
815 static void cap_key_free(struct key *key) in cap_key_free() argument
825 static int cap_key_getsecurity(struct key *key, char **_buffer) in cap_key_getsecurity() argument
/security/smack/
Dsmack_lsm.c2583 static int smack_key_alloc(struct key *key, const struct cred *cred, in smack_key_alloc() argument
2586 key->security = cred->security; in smack_key_alloc()
2596 static void smack_key_free(struct key *key) in smack_key_free() argument
2598 key->security = NULL; in smack_key_free()
2613 struct key *keyp; in smack_key_permission()
/security/selinux/
Dhooks.c4931 ad.u.ipc_id = ipc_perms->key; in ipc_has_perm()
4961 ad.u.ipc_id = msq->q_perm.key; in selinux_msg_queue_alloc_security()
4986 ad.u.ipc_id = msq->q_perm.key; in selinux_msg_queue_associate()
5046 ad.u.ipc_id = msq->q_perm.key; in selinux_msg_queue_msgsnd()
5077 ad.u.ipc_id = msq->q_perm.key; in selinux_msg_queue_msgrcv()
5102 ad.u.ipc_id = shp->shm_perm.key; in selinux_shm_alloc_security()
5127 ad.u.ipc_id = shp->shm_perm.key; in selinux_shm_associate()
5199 ad.u.ipc_id = sma->sem_perm.key; in selinux_sem_alloc_security()
5224 ad.u.ipc_id = sma->sem_perm.key; in selinux_sem_associate()
5500 static int selinux_key_alloc(struct key *k, const struct cred *cred, in selinux_key_alloc()
[all …]