Lines Matching refs:key
13 * key_task_permission - Check a key can be used
14 * @key_ref: The key to check.
18 * Check to see whether permission is granted to use a key in the desired way,
29 struct key *key;
51 key = key_ref_to_ptr(key_ref);
54 if (uid_eq(key->uid, cred->fsuid)) {
55 kperm = key->perm >> 16;
61 if (gid_valid(key->gid) && key->perm & KEY_GRP_ALL) {
62 if (gid_eq(key->gid, cred->fsgid)) {
63 kperm = key->perm >> 8;
67 ret = groups_search(cred->group_info, key->gid);
69 kperm = key->perm >> 8;
75 kperm = key->perm;
83 kperm |= key->perm >> 24;
95 * key_validate - Validate a key.
96 * @key: The key to be validated.
98 * Check that a key is valid, returning 0 if the key is okay, -ENOKEY if the
99 * key is invalidated, -EKEYREVOKED if the key's type has been removed or if
100 * the key has been revoked or -EKEYEXPIRED if the key has expired.
102 int key_validate(const struct key *key)
104 unsigned long flags = READ_ONCE(key->flags);
105 time64_t expiry = READ_ONCE(key->expiry);