Home
last modified time | relevance | path

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

/linux-4.4.14/security/keys/
Dkeyctl.c66 key_ref_t keyring_ref, key_ref; in SYSCALL_DEFINE5() local
125 key_ref = key_create_or_update(keyring_ref, type, description, in SYSCALL_DEFINE5()
128 if (!IS_ERR(key_ref)) { in SYSCALL_DEFINE5()
129 ret = key_ref_to_ptr(key_ref)->serial; in SYSCALL_DEFINE5()
130 key_ref_put(key_ref); in SYSCALL_DEFINE5()
133 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.c324 key_ref_t key_ref, ret, err; in search_my_process_keyrings() local
333 key_ref = NULL; in search_my_process_keyrings()
339 key_ref = keyring_search_aux( in search_my_process_keyrings()
341 if (!IS_ERR(key_ref)) in search_my_process_keyrings()
344 switch (PTR_ERR(key_ref)) { in search_my_process_keyrings()
347 ret = key_ref; in search_my_process_keyrings()
350 err = key_ref; in search_my_process_keyrings()
357 key_ref = keyring_search_aux( in search_my_process_keyrings()
359 if (!IS_ERR(key_ref)) in search_my_process_keyrings()
362 switch (PTR_ERR(key_ref)) { in search_my_process_keyrings()
[all …]
Dkey.c713 static inline key_ref_t __key_update(key_ref_t key_ref, in __key_update() argument
716 struct key *key = key_ref_to_ptr(key_ref); in __key_update()
720 ret = key_permission(key_ref, KEY_NEED_WRITE); in __key_update()
740 return key_ref; in __key_update()
744 key_ref = ERR_PTR(ret); in __key_update()
788 key_ref_t key_ref; in key_create_or_update() local
795 key_ref = ERR_PTR(-ENODEV); in key_create_or_update()
799 key_ref = ERR_PTR(-EINVAL); in key_create_or_update()
808 key_ref = ERR_PTR(-ENOTDIR); in key_create_or_update()
821 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.c339 key_ref_t key_ref; in construct_alloc_key() local
375 key_ref = search_process_keyrings(ctx); in construct_alloc_key()
376 if (!IS_ERR(key_ref)) in construct_alloc_key()
395 key = key_ref_to_ptr(key_ref); in construct_alloc_key()
527 key_ref_t key_ref; in request_key_and_link() local
543 key_ref = search_process_keyrings(&ctx); in request_key_and_link()
545 if (!IS_ERR(key_ref)) { in request_key_and_link()
546 key = key_ref_to_ptr(key_ref); in request_key_and_link()
557 } else if (PTR_ERR(key_ref) != -EAGAIN) { in request_key_and_link()
558 key = ERR_CAST(key_ref); in request_key_and_link()
Dproc.c183 key_ref_t key_ref, skey_ref; in proc_keys_show() local
197 key_ref = make_key_ref(key, 0); in proc_keys_show()
206 key_ref = make_key_ref(key, 1); in proc_keys_show()
215 rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); in proc_keys_show()
Dinternal.h172 extern int key_task_permission(const key_ref_t key_ref,
179 static inline int key_permission(const key_ref_t key_ref, unsigned perm) in key_permission() argument
181 return key_task_permission(key_ref, current_cred(), perm); in key_permission()
/linux-4.4.14/include/linux/
Dkey.h119 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() argument
121 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr()
124 static inline bool is_key_possessed(const key_ref_t key_ref) in is_key_possessed() argument
126 return (unsigned long) key_ref & 1UL; in is_key_possessed()
237 static inline void key_ref_put(key_ref_t key_ref) in key_ref_put() argument
239 key_put(key_ref_to_ptr(key_ref)); in key_ref_put()
Dsecurity.h1521 int security_key_permission(key_ref_t key_ref,
1538 static inline int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
Dlsm_hooks.h1603 int (*key_permission)(key_ref_t key_ref, const struct cred *cred,
/linux-4.4.14/security/
Dsecurity.c1502 int security_key_permission(key_ref_t key_ref, in security_key_permission() argument
1505 return call_int_hook(key_permission, 0, key_ref, cred, perm); in security_key_permission()
/linux-4.4.14/Documentation/security/
Dkeys.txt868 struct key *key_ref_to_ptr(const key_ref_t key_ref);
870 bool is_key_possessed(const key_ref_t key_ref);
955 void key_ref_put(key_ref_t key_ref);
/linux-4.4.14/security/smack/
Dsmack_lsm.c4309 static int smack_key_permission(key_ref_t key_ref, in smack_key_permission() argument
4318 keyp = key_ref_to_ptr(key_ref); in smack_key_permission()
/linux-4.4.14/security/selinux/
Dhooks.c5821 static int selinux_key_permission(key_ref_t key_ref, in selinux_key_permission() argument
5837 key = key_ref_to_ptr(key_ref); in selinux_key_permission()