函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Search the process keyrings and keyring trees linked from those for a* matching key. Keyrings must have appropriate Search permission to be* searched.* If a key is found, it will be attached to the destination keyring if there's

函数原型:SYSCALL_DEFINE4(request_key, const char __user *, _type, const char __user *, _description, const char __user *, _callout_info, key_serial_t, destringid)

返回类型:

参数:

181  ret等于key_get_type_from_user(type, _type, type的长度)
182  如果ret小于0则转到:error
186  description等于strndup_user - duplicate an existing string from user space*@s: The string to duplicate*@n: Maximum number of bytes to copy, including the trailing NUL.* Return: newly allocated copy of @s or an ERR_PTR() in case of error
187  如果是错误
188  ret等于错误
189  转到:error
193  callout_info = NULL
194  callout_len等于0
195  如果_callout_info
196  callout_info等于strndup_user - duplicate an existing string from user space*@s: The string to duplicate*@n: Maximum number of bytes to copy, including the trailing NUL.* Return: newly allocated copy of @s or an ERR_PTR() in case of error
197  如果是错误
198  ret等于错误
199  转到:error2
201  callout_len等于strlen - Find the length of a string*@s: The string to be sized
205  dest_ref = NULL
206  如果destringid
207  dest_ref等于Look 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
209  如果是错误
210  ret等于错误
211  转到:error3
216  ktype等于Find and lock the specified key type against removal.* We return with the sem read-locked if successful. If the type wasn't* available -ENOKEY is returned instead.
217  如果是错误
218  ret等于错误
219  转到:error4
223  key等于quest_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.
226  如果是错误
227  ret等于错误
228  转到:error5
232  ret等于wait_for_key_construction(key, 1)
233  如果ret小于0则转到:error6
236  ret等于 key serial number
238  error6 :
239  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
240  error5 :
241  Unlock a key type locked by key_type_lookup().
242  error4 :
243  key_ref_put(dest_ref)
244  error3 :
245  释放内存
246  error2 :
247  释放内存
248  error :
249  返回:ret