函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\permission.c Create Date:2022-07-27 19:56:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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,

函数原型:int key_task_permission(const key_ref_t key_ref, const struct cred *cred, unsigned perm)

返回类型:int

参数:

类型参数名称
const key_ref_tkey_ref
const struct cred *cred
unsignedperm
33  key等于key_ref_to_ptr(key_ref)
36  如果uid_eq(uid, UID for VFS ops )则
37  kperm等于 access permissions 右移16位
38  转到:use_these_perms
43  如果gid_valid(gid)且 access permissions 按位与KEY_GRP_ALL
44  如果gid_eq(gid, GID for VFS ops )则
45  kperm等于 access permissions 右移8位
46  转到:use_these_perms
49  ret等于groups_search(组补充信息, gid)
50  如果ret
51  kperm等于 access permissions 右移8位
52  转到:use_these_perms
57  kperm等于 access permissions
59  use_these_perms :
64  如果is_key_possessed(key_ref)则kperm或等于 access permissions 右移24位
67  kperm等于kperm按位与perm按位与All the above permissions
69  如果kperm不等于perm则返回:负EACCES
73  返回:security_key_permission(key_ref, cred, perm)
调用者
名称描述
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.