• Home
  • Raw
  • Download

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()
570 struct key *key, *instkey; in keyctl_describe_key() local
597 key = key_ref_to_ptr(key_ref); in keyctl_describe_key()
598 desclen = strlen(key->description); in keyctl_describe_key()
604 key->type->name, in keyctl_describe_key()
605 from_kuid_munged(current_user_ns(), key->uid), in keyctl_describe_key()
606 from_kgid_munged(current_user_ns(), key->gid), in keyctl_describe_key()
607 key->perm); in keyctl_describe_key()
616 copy_to_user(buffer + infolen, key->description, in keyctl_describe_key()
734 struct key *key; in keyctl_read_key() local
745 key = key_ref_to_ptr(key_ref); in keyctl_read_key()
747 if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) { in keyctl_read_key()
771 if (key->type->read) { in keyctl_read_key()
775 down_read(&key->sem); in keyctl_read_key()
776 ret = key_validate(key); in keyctl_read_key()
778 ret = key->type->read(key, buffer, buflen); in keyctl_read_key()
779 up_read(&key->sem); in keyctl_read_key()
783 key_put(key); in keyctl_read_key()
806 struct key *key; in keyctl_chown_key() local
831 key = key_ref_to_ptr(key_ref); in keyctl_chown_key()
835 down_write(&key->sem); in keyctl_chown_key()
839 if (user != (uid_t) -1 && !uid_eq(key->uid, uid)) in keyctl_chown_key()
844 if (group != (gid_t) -1 && !gid_eq(gid, key->gid) && !in_group_p(gid)) in keyctl_chown_key()
849 if (user != (uid_t) -1 && !uid_eq(uid, key->uid)) { in keyctl_chown_key()
856 if (test_bit(KEY_FLAG_IN_QUOTA, &key->flags)) { in keyctl_chown_key()
864 newowner->qnbytes + key->quotalen >= maxbytes || in keyctl_chown_key()
865 newowner->qnbytes + key->quotalen < in keyctl_chown_key()
870 newowner->qnbytes += key->quotalen; in keyctl_chown_key()
873 spin_lock(&key->user->lock); in keyctl_chown_key()
874 key->user->qnkeys--; in keyctl_chown_key()
875 key->user->qnbytes -= key->quotalen; in keyctl_chown_key()
876 spin_unlock(&key->user->lock); in keyctl_chown_key()
879 atomic_dec(&key->user->nkeys); in keyctl_chown_key()
882 if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) { in keyctl_chown_key()
883 atomic_dec(&key->user->nikeys); in keyctl_chown_key()
887 zapowner = key->user; in keyctl_chown_key()
888 key->user = newowner; in keyctl_chown_key()
889 key->uid = uid; in keyctl_chown_key()
894 key->gid = gid; in keyctl_chown_key()
899 up_write(&key->sem); in keyctl_chown_key()
900 key_put(key); in keyctl_chown_key()
922 struct key *key; in keyctl_setperm_key() local
937 key = key_ref_to_ptr(key_ref); in keyctl_setperm_key()
941 down_write(&key->sem); in keyctl_setperm_key()
944 if (capable(CAP_SYS_ADMIN) || uid_eq(key->uid, current_fsuid())) { in keyctl_setperm_key()
945 key->perm = perm; in keyctl_setperm_key()
949 up_write(&key->sem); in keyctl_setperm_key()
950 key_put(key); in keyctl_setperm_key()
961 struct key **_dest_keyring) in get_instantiation_keyring()
996 static int keyctl_change_reqkey_auth(struct key *key) in keyctl_change_reqkey_auth() argument
1005 new->request_key_auth = key_get(key); in keyctl_change_reqkey_auth()
1042 struct key *instkey, *dest_keyring; in keyctl_instantiate_key_common()
1216 struct key *instkey, *dest_keyring; in keyctl_reject_key()
1333 struct key *key, *instkey; in keyctl_set_timeout() local
1359 key = key_ref_to_ptr(key_ref); in keyctl_set_timeout()
1360 key_set_timeout(key, timeout); in keyctl_set_timeout()
1361 key_put(key); in keyctl_set_timeout()
1387 struct key *authkey; in keyctl_assume_authority()
1436 struct key *key, *instkey; in keyctl_get_security() local
1458 key = key_ref_to_ptr(key_ref); in keyctl_get_security()
1459 ret = security_key_getsecurity(key, &context); in keyctl_get_security()