函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Get the persistent keyring for a specific UID and link it to the nominated* keyring.

函数原型:static long key_get_persistent(struct user_namespace *ns, kuid_t uid, key_ref_t dest_ref)

返回类型:long

参数:

类型参数名称
struct user_namespace *ns
kuid_tuid
key_ref_tdest_ref
83  memset( & index_key, 0, index_key的长度)
84  type等于key_type_keyring
85  description等于buf
86  desc_len等于输出格式化串
87  Finalise an index key to include a part of the description actually in the* index key, to set the domain tag and to calculate the hash.
89  如果 Register of per-UID persistent keyrings for this namespace
90  reg_ref等于make_key_ref( Register of per-UID persistent keyrings for this namespace , true)
91  lock for reading
92  persistent_ref等于Search the given keyring for a key that might be updated.* The caller must guarantee that the keyring is a keyring and that the* permission is granted to modify the keyring as no check is made here. The
93  lease a read lock
95  如果persistent_ref则转到:found
102  lock for writing
103  persistent_ref等于Create the persistent keyring for the specified user.* Called with the namespace's sem locked for writing.
104  lease a write lock
105  如果非是错误则转到:found
108  返回:错误
110  found :
111  ret等于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,
112  如果ret恒等于0则
113  persistent等于key_ref_to_ptr(persistent_ref)
114  ret等于key_link - Link a key to a keyring*@keyring: The keyring to make the link in
115  如果ret恒等于0则
121  key_ref_put(persistent_ref)
122  返回:ret
调用者
名称描述
keyctl_get_persistentGet the persistent keyring for a specific UID and link it to the nominated* keyring.