Home
last modified time | relevance | path

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

/linux-3.4.99/security/keys/
Dprocess_keys.c337 key_ref_t key_ref, ret, err; in search_my_process_keyrings() local
346 key_ref = NULL; in search_my_process_keyrings()
352 key_ref = keyring_search_aux( in search_my_process_keyrings()
355 if (!IS_ERR(key_ref)) in search_my_process_keyrings()
358 switch (PTR_ERR(key_ref)) { in search_my_process_keyrings()
363 ret = key_ref; in search_my_process_keyrings()
366 err = key_ref; in search_my_process_keyrings()
373 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 …]
Dkeyctl.c60 key_ref_t keyring_ref, key_ref; in SYSCALL_DEFINE5() local
111 key_ref = key_create_or_update(keyring_ref, type, description, in SYSCALL_DEFINE5()
114 if (!IS_ERR(key_ref)) { in SYSCALL_DEFINE5()
115 ret = key_ref_to_ptr(key_ref)->serial; in SYSCALL_DEFINE5()
116 key_ref_put(key_ref); in SYSCALL_DEFINE5()
119 ret = PTR_ERR(key_ref); in SYSCALL_DEFINE5()
240 key_ref_t key_ref; in keyctl_get_keyring_ID() local
245 key_ref = lookup_user_key(id, lflags, KEY_SEARCH); in keyctl_get_keyring_ID()
246 if (IS_ERR(key_ref)) { in keyctl_get_keyring_ID()
247 ret = PTR_ERR(key_ref); in keyctl_get_keyring_ID()
[all …]
Dkey.c708 static inline key_ref_t __key_update(key_ref_t key_ref, in __key_update() argument
711 struct key *key = key_ref_to_ptr(key_ref); in __key_update()
715 ret = key_permission(key_ref, KEY_WRITE); in __key_update()
735 return key_ref; in __key_update()
739 key_ref = ERR_PTR(ret); in __key_update()
780 key_ref_t key_ref; in key_create_or_update() local
787 key_ref = ERR_PTR(-ENODEV); in key_create_or_update()
791 key_ref = ERR_PTR(-EINVAL); in key_create_or_update()
799 key_ref = ERR_PTR(-ENOTDIR); in key_create_or_update()
811 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()
73 if (is_key_possessed(key_ref)) in key_task_permission()
82 return security_key_permission(key_ref, cred, perm); in key_task_permission()
Drequest_key.c357 key_ref_t key_ref; in construct_alloc_key() local
384 key_ref = search_process_keyrings(type, description, type->match, cred); in construct_alloc_key()
385 if (!IS_ERR(key_ref)) in construct_alloc_key()
404 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
525 key_ref_t key_ref; in request_key_and_link() local
533 key_ref = search_process_keyrings(type, description, type->match, cred); in request_key_and_link()
535 if (!IS_ERR(key_ref)) { in request_key_and_link()
536 key = key_ref_to_ptr(key_ref); in request_key_and_link()
547 } else if (PTR_ERR(key_ref) != -EAGAIN) { in request_key_and_link()
548 key = ERR_CAST(key_ref); in request_key_and_link()
Dinternal.h158 extern int key_task_permission(const key_ref_t key_ref,
165 static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) in key_permission() argument
167 return key_task_permission(key_ref, current_cred(), perm); in key_permission()
Dkeyring.c320 key_ref_t key_ref; in keyring_search_aux() local
331 key_ref = ERR_PTR(err); in keyring_search_aux()
335 key_ref = ERR_PTR(-ENOTDIR); in keyring_search_aux()
347 key_ref = ERR_PTR(-EAGAIN); in keyring_search_aux()
360 key_ref = ERR_PTR(key->type_data.reject_error); in keyring_search_aux()
368 key_ref = ERR_PTR(-EAGAIN); in keyring_search_aux()
464 key_ref = ERR_PTR(err); in keyring_search_aux()
471 key_ref = make_key_ref(key, possessed); in keyring_search_aux()
475 return key_ref; in keyring_search_aux()
Dproc.c190 key_ref_t key_ref, skey_ref; in proc_keys_show() local
194 key_ref = make_key_ref(key, 0); in proc_keys_show()
205 key_ref = make_key_ref(key, 1); in proc_keys_show()
214 rc = key_task_permission(key_ref, cred, KEY_VIEW); in proc_keys_show()
/linux-3.4.99/include/linux/
Dkey.h106 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() argument
108 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr()
111 static inline unsigned long is_key_possessed(const key_ref_t key_ref) in is_key_possessed() argument
113 return (unsigned long) key_ref & 1UL; in is_key_possessed()
211 static inline void key_ref_put(key_ref_t key_ref) in key_ref_put() argument
213 key_put(key_ref_to_ptr(key_ref)); in key_ref_put()
Dsecurity.h1644 int (*key_permission) (key_ref_t key_ref,
2905 int security_key_permission(key_ref_t key_ref,
2922 static inline int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
/linux-3.4.99/security/
Dsecurity.c1292 int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
1295 return security_ops->key_permission(key_ref, cred, perm); in security_key_permission()
Dcapability.c833 static int cap_key_permission(key_ref_t key_ref, const struct cred *cred, in cap_key_permission() argument
/linux-3.4.99/security/smack/
Dsmack_lsm.c3290 static int smack_key_permission(key_ref_t key_ref, in smack_key_permission() argument
3297 keyp = key_ref_to_ptr(key_ref); in smack_key_permission()
/linux-3.4.99/Documentation/security/
Dkeys.txt850 struct key *key_ref_to_ptr(const key_ref_t key_ref);
852 unsigned long is_key_possessed(const key_ref_t key_ref);
937 void key_ref_put(key_ref_t key_ref);
/linux-3.4.99/security/selinux/
Dhooks.c5609 static int selinux_key_permission(key_ref_t key_ref, in selinux_key_permission() argument
5625 key = key_ref_to_ptr(key_ref); in selinux_key_permission()