Home
last modified time | relevance | path

Searched refs:key_ref (Results 1 – 15 of 15) sorted by relevance

/Linux-v4.19/security/keys/
Dkeyctl.c68 key_ref_t keyring_ref, key_ref; in SYSCALL_DEFINE5() local
122 key_ref = key_create_or_update(keyring_ref, type, description, in SYSCALL_DEFINE5()
125 if (!IS_ERR(key_ref)) { in SYSCALL_DEFINE5()
126 ret = key_ref_to_ptr(key_ref)->serial; in SYSCALL_DEFINE5()
127 key_ref_put(key_ref); in SYSCALL_DEFINE5()
130 ret = PTR_ERR(key_ref); in SYSCALL_DEFINE5()
251 key_ref_t key_ref; in keyctl_get_keyring_ID() local
256 key_ref = lookup_user_key(id, lflags, KEY_NEED_SEARCH); in keyctl_get_keyring_ID()
257 if (IS_ERR(key_ref)) { in keyctl_get_keyring_ID()
258 ret = PTR_ERR(key_ref); in keyctl_get_keyring_ID()
[all …]
Dprocess_keys.c341 key_ref_t key_ref, ret, err; in search_my_process_keyrings() local
350 key_ref = NULL; in search_my_process_keyrings()
356 key_ref = keyring_search_aux( in search_my_process_keyrings()
358 if (!IS_ERR(key_ref)) in search_my_process_keyrings()
361 switch (PTR_ERR(key_ref)) { in search_my_process_keyrings()
364 ret = key_ref; in search_my_process_keyrings()
367 err = key_ref; in search_my_process_keyrings()
374 key_ref = keyring_search_aux( in search_my_process_keyrings()
376 if (!IS_ERR(key_ref)) in search_my_process_keyrings()
379 switch (PTR_ERR(key_ref)) { in search_my_process_keyrings()
[all …]
Dkey.c740 static inline key_ref_t __key_update(key_ref_t key_ref, in __key_update() argument
743 struct key *key = key_ref_to_ptr(key_ref); in __key_update()
747 ret = key_permission(key_ref, KEY_NEED_WRITE); in __key_update()
767 return key_ref; in __key_update()
771 key_ref = ERR_PTR(ret); in __key_update()
815 key_ref_t key_ref; in key_create_or_update() local
823 key_ref = ERR_PTR(-ENODEV); in key_create_or_update()
827 key_ref = ERR_PTR(-EINVAL); in key_create_or_update()
839 key_ref = ERR_PTR(-ENOTDIR); in key_create_or_update()
851 key_ref = ERR_PTR(ret); in key_create_or_update()
[all …]
Dpermission.c30 int key_task_permission(const key_ref_t key_ref, const struct cred *cred, in key_task_permission() argument
37 key = key_ref_to_ptr(key_ref); in key_task_permission()
68 if (is_key_possessed(key_ref)) in key_task_permission()
77 return security_key_permission(key_ref, cred, perm); in key_task_permission()
Drequest_key.c363 key_ref_t key_ref; in construct_alloc_key() local
399 key_ref = search_process_keyrings(ctx); in construct_alloc_key()
400 if (!IS_ERR(key_ref)) in construct_alloc_key()
419 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
556 key_ref_t key_ref; in request_key_and_link() local
572 key_ref = search_process_keyrings(&ctx); in request_key_and_link()
574 if (!IS_ERR(key_ref)) { in request_key_and_link()
575 key = key_ref_to_ptr(key_ref); in request_key_and_link()
584 } else if (PTR_ERR(key_ref) != -EAGAIN) { in request_key_and_link()
585 key = ERR_CAST(key_ref); in request_key_and_link()
Dproc.c161 key_ref_t key_ref, skey_ref; in proc_keys_show() local
178 key_ref = make_key_ref(key, 0); in proc_keys_show()
187 key_ref = make_key_ref(key, 1); in proc_keys_show()
192 rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); in proc_keys_show()
Ddh.c24 key_ref_t key_ref; in dh_data_from_key() local
28 key_ref = lookup_user_key(keyid, 0, KEY_NEED_READ); in dh_data_from_key()
29 if (IS_ERR(key_ref)) { in dh_data_from_key()
34 key = key_ref_to_ptr(key_ref); in dh_data_from_key()
Dinternal.h179 extern int key_task_permission(const key_ref_t key_ref,
186 static inline int key_permission(const key_ref_t key_ref, unsigned perm) in key_permission() argument
188 return key_task_permission(key_ref, current_cred(), perm); in key_permission()
/Linux-v4.19/include/linux/
Dkey.h121 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() argument
123 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr()
126 static inline bool is_key_possessed(const key_ref_t key_ref) in is_key_possessed() argument
128 return (unsigned long) key_ref & 1UL; in is_key_possessed()
268 static inline void key_ref_put(key_ref_t key_ref) in key_ref_put() argument
270 key_put(key_ref_to_ptr(key_ref)); in key_ref_put()
Dsecurity.h1667 int security_key_permission(key_ref_t key_ref,
1684 static inline int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
Dlsm_hooks.h1756 int (*key_permission)(key_ref_t key_ref, const struct cred *cred,
/Linux-v4.19/security/
Dsecurity.c1731 int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
1734 return call_int_hook(key_permission, 0, key_ref, cred, perm); in security_key_permission()
/Linux-v4.19/security/smack/
Dsmack_lsm.c4320 static int smack_key_permission(key_ref_t key_ref, in smack_key_permission() argument
4329 keyp = key_ref_to_ptr(key_ref); in smack_key_permission()
/Linux-v4.19/Documentation/security/keys/
Dcore.rst933 struct key *key_ref_to_ptr(const key_ref_t key_ref);
935 bool is_key_possessed(const key_ref_t key_ref);
1020 void key_ref_put(key_ref_t key_ref);
/Linux-v4.19/security/selinux/
Dhooks.c6652 static int selinux_key_permission(key_ref_t key_ref, in selinux_key_permission() argument
6668 key = key_ref_to_ptr(key_ref); in selinux_key_permission()