Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\permission.c Create Date:2022-07-28 18:21:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:key_task_permission - Check a key can be used*@key_ref: The key to check.*@cred: The credentials to use.*@perm: The permissions to check for.* Check to see whether permission is granted to use a key in the desired way,

Proto:int key_task_permission(const key_ref_t key_ref, const struct cred *cred, unsigned perm)

Type:int

Parameter:

TypeParameterName
const key_ref_tkey_ref
const struct cred *cred
unsignedperm
33  key = key_ref_to_ptr(key_ref)
36  If uid_eq(uid, UID for VFS ops ) Then
37  kperm = access permissions >> 16
38  Go to use_these_perms
43  If gid_valid(gid) && access permissions & KEY_GRP_ALL Then
44  If gid_eq(gid, GID for VFS ops ) Then
46  Go to use_these_perms
49  ret = groups_search( supplementary groups for euid/fsgid , gid)
50  If ret Then
52  Go to use_these_perms
57  kperm = access permissions
59  use_these_perms :
64  If is_key_possessed(key_ref) Then kperm |= access permissions >> 24
67  kperm = kperm & perm & All the above permissions
69  If kperm != perm Then Return -EACCES
73  Return security_key_permission(key_ref, cred, perm)
Caller
NameDescribe
search_nested_keyringsSearch a tree of keyrings that point to other keyrings up to the maximum* depth.
keyring_search_rcukeyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
lookup_user_keyLook up a key ID given us by userspace with a given permissions mask to get* the key it refers to.* Flags can be passed to request that special keyrings be created if referred* to directly, to permit partially constructed keys to be found and to skip
request_key_and_linkquest_key_and_link - Request a key and cache it in a keyring.*@type: The type of key we want.*@description: The searchable description of the key.*@domain_tag: The domain in which the key operates.
proc_keys_show
key_get_persistentGet the persistent keyring for a specific UID and link it to the nominated* keyring.