Home
last modified time | relevance | path

Searched refs:key_ref (Results 1 - 25 of 30) sorted by relevance

12

/kernel/linux/linux-5.10/security/keys/
H A Dkeyctl.c80 key_ref_t keyring_ref, key_ref; in SYSCALL_DEFINE5() local
134 key_ref = key_create_or_update(keyring_ref, type, description, in SYSCALL_DEFINE5()
137 if (!IS_ERR(key_ref)) { in SYSCALL_DEFINE5()
138 ret = key_ref_to_ptr(key_ref)->serial; in SYSCALL_DEFINE5()
139 key_ref_put(key_ref); in SYSCALL_DEFINE5()
142 ret = PTR_ERR(key_ref); in SYSCALL_DEFINE5()
260 key_ref_t key_ref; in keyctl_get_keyring_ID() local
265 key_ref = lookup_user_key(id, lflags, KEY_NEED_SEARCH); in keyctl_get_keyring_ID()
266 if (IS_ERR(key_ref)) { in keyctl_get_keyring_ID()
267 ret = PTR_ERR(key_ref); in keyctl_get_keyring_ID()
329 key_ref_t key_ref; keyctl_update_key() local
381 key_ref_t key_ref; keyctl_revoke_key() local
422 key_ref_t key_ref; keyctl_invalidate_key() local
517 key_ref_t keyring_ref, key_ref; keyctl_keyring_link() local
554 key_ref_t keyring_ref, key_ref; keyctl_keyring_unlink() local
598 key_ref_t key_ref, from_ref, to_ref; keyctl_keyring_move() local
649 key_ref_t key_ref; keyctl_describe_key() local
722 key_ref_t keyring_ref, key_ref, dest_ref; keyctl_keyring_search() local
828 key_ref_t key_ref; keyctl_read_key() local
953 key_ref_t key_ref; keyctl_chown_key() local
1075 key_ref_t key_ref; keyctl_setperm_key() local
1460 key_ref_t key_ref; keyctl_set_timeout() local
1566 key_ref_t key_ref; keyctl_get_security() local
1732 key_ref_t key_ref; keyctl_restrict_keyring() local
1779 key_ref_t key_ref; keyctl_watch_key() local
[all...]
H A Dprocess_keys.c425 key_ref_t key_ref, ret, err; in search_cred_keyrings_rcu() local
435 key_ref = NULL; in search_cred_keyrings_rcu()
441 key_ref = keyring_search_rcu( in search_cred_keyrings_rcu()
443 if (!IS_ERR(key_ref)) in search_cred_keyrings_rcu()
446 switch (PTR_ERR(key_ref)) { in search_cred_keyrings_rcu()
449 ret = key_ref; in search_cred_keyrings_rcu()
452 err = key_ref; in search_cred_keyrings_rcu()
459 key_ref = keyring_search_rcu( in search_cred_keyrings_rcu()
461 if (!IS_ERR(key_ref)) in search_cred_keyrings_rcu()
464 switch (PTR_ERR(key_ref)) { in search_cred_keyrings_rcu()
542 key_ref_t key_ref, ret = ERR_PTR(-EACCES), err; search_process_keyrings_rcu() local
622 key_ref_t key_ref, skey_ref; lookup_user_key() local
[all...]
H A Dkey.c749 static inline key_ref_t __key_update(key_ref_t key_ref, in __key_update() argument
752 struct key *key = key_ref_to_ptr(key_ref); in __key_update()
756 ret = key_permission(key_ref, KEY_NEED_WRITE); in __key_update()
778 return key_ref; in __key_update()
782 key_ref = ERR_PTR(ret); in __key_update()
826 key_ref_t key_ref; in key_create_or_update() local
834 key_ref = ERR_PTR(-ENODEV); in key_create_or_update()
838 key_ref = ERR_PTR(-EINVAL); in key_create_or_update()
850 key_ref = ERR_PTR(-ENOTDIR); in key_create_or_update()
862 key_ref in key_create_or_update()
997 key_update(key_ref_t key_ref, const void *payload, size_t plen) key_update() argument
[all...]
H A Drequest_key.c378 key_ref_t key_ref; in construct_alloc_key() local
422 key_ref = search_process_keyrings_rcu(ctx); in construct_alloc_key()
424 if (!IS_ERR(key_ref)) in construct_alloc_key()
447 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
597 key_ref_t key_ref; in request_key_and_link() local
618 key_ref = search_process_keyrings_rcu(&ctx); in request_key_and_link()
621 if (!IS_ERR(key_ref)) { in request_key_and_link()
623 ret = key_task_permission(key_ref, current_cred(), in request_key_and_link()
626 key_ref_put(key_ref); in request_key_and_link()
632 key = key_ref_to_ptr(key_ref); in request_key_and_link()
799 key_ref_t key_ref; request_key_rcu() local
[all...]
H A Dpermission.c14 * @key_ref: The key to check.
26 int key_task_permission(const key_ref_t key_ref, const struct cred *cred, in key_task_permission() argument
51 key = key_ref_to_ptr(key_ref); in key_task_permission()
82 if (is_key_possessed(key_ref)) in key_task_permission()
90 return security_key_permission(key_ref, cred, need_perm); in key_task_permission()
H A Dkeyctl_pkey.c82 key_ref_t key_ref; in keyctl_pkey_params_get() local
98 key_ref = lookup_user_key(id, 0, KEY_NEED_SEARCH); in keyctl_pkey_params_get()
99 if (IS_ERR(key_ref)) in keyctl_pkey_params_get()
100 return PTR_ERR(key_ref); in keyctl_pkey_params_get()
101 params->key = key_ref_to_ptr(key_ref); in keyctl_pkey_params_get()
H A Ddh.c20 key_ref_t key_ref; in dh_data_from_key() local
24 key_ref = lookup_user_key(keyid, 0, KEY_NEED_READ); in dh_data_from_key()
25 if (IS_ERR(key_ref)) { in dh_data_from_key()
30 key = key_ref_to_ptr(key_ref); in dh_data_from_key()
H A Dproc.c158 key_ref_t key_ref, skey_ref; in proc_keys_show() local
175 key_ref = make_key_ref(key, 0); in proc_keys_show()
186 key_ref = make_key_ref(key, 1); in proc_keys_show()
191 rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); in proc_keys_show()
H A Dinternal.h184 extern int key_task_permission(const key_ref_t key_ref,
208 static inline int key_permission(const key_ref_t key_ref, in key_permission() argument
211 return key_task_permission(key_ref, current_cred(), need_perm); in key_permission()
/kernel/linux/linux-6.6/security/keys/
H A Dkeyctl.c80 key_ref_t keyring_ref, key_ref; in SYSCALL_DEFINE5() local
134 key_ref = key_create_or_update(keyring_ref, type, description, in SYSCALL_DEFINE5()
137 if (!IS_ERR(key_ref)) { in SYSCALL_DEFINE5()
138 ret = key_ref_to_ptr(key_ref)->serial; in SYSCALL_DEFINE5()
139 key_ref_put(key_ref); in SYSCALL_DEFINE5()
142 ret = PTR_ERR(key_ref); in SYSCALL_DEFINE5()
260 key_ref_t key_ref; in keyctl_get_keyring_ID() local
265 key_ref = lookup_user_key(id, lflags, KEY_NEED_SEARCH); in keyctl_get_keyring_ID()
266 if (IS_ERR(key_ref)) { in keyctl_get_keyring_ID()
267 ret = PTR_ERR(key_ref); in keyctl_get_keyring_ID()
329 key_ref_t key_ref; keyctl_update_key() local
381 key_ref_t key_ref; keyctl_revoke_key() local
422 key_ref_t key_ref; keyctl_invalidate_key() local
517 key_ref_t keyring_ref, key_ref; keyctl_keyring_link() local
554 key_ref_t keyring_ref, key_ref; keyctl_keyring_unlink() local
598 key_ref_t key_ref, from_ref, to_ref; keyctl_keyring_move() local
649 key_ref_t key_ref; keyctl_describe_key() local
722 key_ref_t keyring_ref, key_ref, dest_ref; keyctl_keyring_search() local
828 key_ref_t key_ref; keyctl_read_key() local
953 key_ref_t key_ref; keyctl_chown_key() local
1075 key_ref_t key_ref; keyctl_setperm_key() local
1460 key_ref_t key_ref; keyctl_set_timeout() local
1566 key_ref_t key_ref; keyctl_get_security() local
1732 key_ref_t key_ref; keyctl_restrict_keyring() local
1779 key_ref_t key_ref; keyctl_watch_key() local
[all...]
H A Dprocess_keys.c425 key_ref_t key_ref, ret, err; in search_cred_keyrings_rcu() local
435 key_ref = NULL; in search_cred_keyrings_rcu()
441 key_ref = keyring_search_rcu( in search_cred_keyrings_rcu()
443 if (!IS_ERR(key_ref)) in search_cred_keyrings_rcu()
446 switch (PTR_ERR(key_ref)) { in search_cred_keyrings_rcu()
449 ret = key_ref; in search_cred_keyrings_rcu()
452 err = key_ref; in search_cred_keyrings_rcu()
459 key_ref = keyring_search_rcu( in search_cred_keyrings_rcu()
461 if (!IS_ERR(key_ref)) in search_cred_keyrings_rcu()
464 switch (PTR_ERR(key_ref)) { in search_cred_keyrings_rcu()
542 key_ref_t key_ref, ret = ERR_PTR(-EACCES), err; search_process_keyrings_rcu() local
622 key_ref_t key_ref, skey_ref; lookup_user_key() local
[all...]
H A Dkey.c749 static inline key_ref_t __key_update(key_ref_t key_ref, in __key_update() argument
752 struct key *key = key_ref_to_ptr(key_ref); in __key_update()
756 ret = key_permission(key_ref, KEY_NEED_WRITE); in __key_update()
778 return key_ref; in __key_update()
782 key_ref = ERR_PTR(ret); in __key_update()
806 key_ref_t key_ref; in __key_create_or_update() local
814 key_ref = ERR_PTR(-ENODEV); in __key_create_or_update()
818 key_ref = ERR_PTR(-EINVAL); in __key_create_or_update()
830 key_ref = ERR_PTR(-ENOTDIR); in __key_create_or_update()
843 key_ref in __key_create_or_update()
1061 key_update(key_ref_t key_ref, const void *payload, size_t plen) key_update() argument
[all...]
H A Drequest_key.c378 key_ref_t key_ref; in construct_alloc_key() local
422 key_ref = search_process_keyrings_rcu(ctx); in construct_alloc_key()
424 if (!IS_ERR(key_ref)) in construct_alloc_key()
447 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
597 key_ref_t key_ref; in request_key_and_link() local
618 key_ref = search_process_keyrings_rcu(&ctx); in request_key_and_link()
621 if (!IS_ERR(key_ref)) { in request_key_and_link()
623 ret = key_task_permission(key_ref, current_cred(), in request_key_and_link()
626 key_ref_put(key_ref); in request_key_and_link()
632 key = key_ref_to_ptr(key_ref); in request_key_and_link()
799 key_ref_t key_ref; request_key_rcu() local
[all...]
H A Dpermission.c14 * @key_ref: The key to check.
26 int key_task_permission(const key_ref_t key_ref, const struct cred *cred, in key_task_permission() argument
51 key = key_ref_to_ptr(key_ref); in key_task_permission()
82 if (is_key_possessed(key_ref)) in key_task_permission()
90 return security_key_permission(key_ref, cred, need_perm); in key_task_permission()
H A Dkeyctl_pkey.c82 key_ref_t key_ref; in keyctl_pkey_params_get() local
98 key_ref = lookup_user_key(id, 0, KEY_NEED_SEARCH); in keyctl_pkey_params_get()
99 if (IS_ERR(key_ref)) in keyctl_pkey_params_get()
100 return PTR_ERR(key_ref); in keyctl_pkey_params_get()
101 params->key = key_ref_to_ptr(key_ref); in keyctl_pkey_params_get()
H A Ddh.c21 key_ref_t key_ref; in dh_data_from_key() local
25 key_ref = lookup_user_key(keyid, 0, KEY_NEED_READ); in dh_data_from_key()
26 if (IS_ERR(key_ref)) { in dh_data_from_key()
31 key = key_ref_to_ptr(key_ref); in dh_data_from_key()
H A Dproc.c158 key_ref_t key_ref, skey_ref; in proc_keys_show() local
175 key_ref = make_key_ref(key, 0); in proc_keys_show()
186 key_ref = make_key_ref(key, 1); in proc_keys_show()
191 rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); in proc_keys_show()
H A Dinternal.h182 extern int key_task_permission(const key_ref_t key_ref,
206 static inline int key_permission(const key_ref_t key_ref, in key_permission() argument
209 return key_task_permission(key_ref, current_cred(), need_perm); in key_permission()
/kernel/linux/linux-5.10/include/linux/
H A Dkey.h155 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() argument
157 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr()
160 static inline bool is_key_possessed(const key_ref_t key_ref) in is_key_possessed() argument
162 return (unsigned long) key_ref & 1UL; in is_key_possessed()
311 static inline void key_ref_put(key_ref_t key_ref) in key_ref_put() argument
313 key_put(key_ref_to_ptr(key_ref)); in key_ref_put()
H A Dsecurity.h1821 int security_key_permission(key_ref_t key_ref, const struct cred *cred,
1838 static inline int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
/kernel/linux/linux-6.6/include/linux/
H A Dkey.h161 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() argument
163 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr()
166 static inline bool is_key_possessed(const key_ref_t key_ref) in is_key_possessed() argument
168 return (unsigned long) key_ref & 1UL; in is_key_possessed()
317 static inline void key_ref_put(key_ref_t key_ref) in key_ref_put() argument
319 key_put(key_ref_to_ptr(key_ref)); in key_ref_put()
H A Dsecurity.h1921 int security_key_permission(key_ref_t key_ref, const struct cred *cred,
1938 static inline int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
/kernel/linux/linux-6.6/crypto/
H A Daf_alg.c277 key_ref_t key_ref; in lookup_key() local
279 key_ref = lookup_user_key(serial, 0, KEY_NEED_SEARCH); in lookup_key()
280 if (IS_ERR(key_ref)) in lookup_key()
281 return ERR_CAST(key_ref); in lookup_key()
283 return key_ref_to_ptr(key_ref); in lookup_key()
/kernel/linux/linux-6.6/kernel/trace/
H A Dbpf_trace.c1286 key_ref_t key_ref; in bpf_lookup_user_key() local
1296 key_ref = lookup_user_key(serial, flags, KEY_DEFER_PERM_CHECK); in bpf_lookup_user_key()
1297 if (IS_ERR(key_ref)) in bpf_lookup_user_key()
1302 key_put(key_ref_to_ptr(key_ref)); in bpf_lookup_user_key()
1306 bkey->key = key_ref_to_ptr(key_ref); in bpf_lookup_user_key()
/kernel/linux/linux-5.10/security/
H A Dsecurity.c2509 int security_key_permission(key_ref_t key_ref, const struct cred *cred, in security_key_permission() argument
2512 return call_int_hook(key_permission, 0, key_ref, cred, need_perm); in security_key_permission()

Completed in 33 milliseconds

12