Lines Matching refs:key

170 	struct key *key;  in SYSCALL_DEFINE4()  local
219 key = request_key_and_link(ktype, description, callout_info, in SYSCALL_DEFINE4()
222 if (IS_ERR(key)) { in SYSCALL_DEFINE4()
223 ret = PTR_ERR(key); in SYSCALL_DEFINE4()
228 ret = wait_for_key_construction(key, 1); in SYSCALL_DEFINE4()
232 ret = key->serial; in SYSCALL_DEFINE4()
235 key_put(key); in SYSCALL_DEFINE4()
565 struct key *key, *instkey; in keyctl_describe_key() local
592 key = key_ref_to_ptr(key_ref); in keyctl_describe_key()
593 desclen = strlen(key->description); in keyctl_describe_key()
599 key->type->name, in keyctl_describe_key()
600 from_kuid_munged(current_user_ns(), key->uid), in keyctl_describe_key()
601 from_kgid_munged(current_user_ns(), key->gid), in keyctl_describe_key()
602 key->perm); in keyctl_describe_key()
611 copy_to_user(buffer + infolen, key->description, in keyctl_describe_key()
729 struct key *key; in keyctl_read_key() local
740 key = key_ref_to_ptr(key_ref); in keyctl_read_key()
761 if (key->type->read) { in keyctl_read_key()
765 down_read(&key->sem); in keyctl_read_key()
766 ret = key_validate(key); in keyctl_read_key()
768 ret = key->type->read(key, buffer, buflen); in keyctl_read_key()
769 up_read(&key->sem); in keyctl_read_key()
773 key_put(key); in keyctl_read_key()
796 struct key *key; in keyctl_chown_key() local
821 key = key_ref_to_ptr(key_ref); in keyctl_chown_key()
825 down_write(&key->sem); in keyctl_chown_key()
829 if (user != (uid_t) -1 && !uid_eq(key->uid, uid)) in keyctl_chown_key()
834 if (group != (gid_t) -1 && !gid_eq(gid, key->gid) && !in_group_p(gid)) in keyctl_chown_key()
839 if (user != (uid_t) -1 && !uid_eq(uid, key->uid)) { in keyctl_chown_key()
846 if (test_bit(KEY_FLAG_IN_QUOTA, &key->flags)) { in keyctl_chown_key()
854 newowner->qnbytes + key->quotalen >= maxbytes || in keyctl_chown_key()
855 newowner->qnbytes + key->quotalen < in keyctl_chown_key()
860 newowner->qnbytes += key->quotalen; in keyctl_chown_key()
863 spin_lock(&key->user->lock); in keyctl_chown_key()
864 key->user->qnkeys--; in keyctl_chown_key()
865 key->user->qnbytes -= key->quotalen; in keyctl_chown_key()
866 spin_unlock(&key->user->lock); in keyctl_chown_key()
869 atomic_dec(&key->user->nkeys); in keyctl_chown_key()
872 if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) { in keyctl_chown_key()
873 atomic_dec(&key->user->nikeys); in keyctl_chown_key()
877 zapowner = key->user; in keyctl_chown_key()
878 key->user = newowner; in keyctl_chown_key()
879 key->uid = uid; in keyctl_chown_key()
884 key->gid = gid; in keyctl_chown_key()
889 up_write(&key->sem); in keyctl_chown_key()
890 key_put(key); in keyctl_chown_key()
912 struct key *key; in keyctl_setperm_key() local
927 key = key_ref_to_ptr(key_ref); in keyctl_setperm_key()
931 down_write(&key->sem); in keyctl_setperm_key()
934 if (capable(CAP_SYS_ADMIN) || uid_eq(key->uid, current_fsuid())) { in keyctl_setperm_key()
935 key->perm = perm; in keyctl_setperm_key()
939 up_write(&key->sem); in keyctl_setperm_key()
940 key_put(key); in keyctl_setperm_key()
951 struct key **_dest_keyring) in get_instantiation_keyring()
986 static int keyctl_change_reqkey_auth(struct key *key) in keyctl_change_reqkey_auth() argument
995 new->request_key_auth = key_get(key); in keyctl_change_reqkey_auth()
1015 struct key *instkey, *dest_keyring; in keyctl_instantiate_key_common()
1182 struct key *instkey, *dest_keyring; in keyctl_reject_key()
1302 struct key *key, *instkey; in keyctl_set_timeout() local
1328 key = key_ref_to_ptr(key_ref); in keyctl_set_timeout()
1329 key_set_timeout(key, timeout); in keyctl_set_timeout()
1330 key_put(key); in keyctl_set_timeout()
1356 struct key *authkey; in keyctl_assume_authority()
1405 struct key *key, *instkey; in keyctl_get_security() local
1427 key = key_ref_to_ptr(key_ref); in keyctl_get_security()
1428 ret = security_key_getsecurity(key, &context); in keyctl_get_security()