函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Request userspace finish the construction of a key* - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>"

函数原型:static int call_sbin_request_key(struct key *authkey, void *aux)

返回类型:int

参数:

类型参数名称
struct key *authkey
void *aux
117  request_key[]等于"/sbin/request-key"
118  rka等于get_request_key_auth(authkey)
119  cred等于current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.()
121  key等于target_key
122  char * argv[9], * envp[3], uid_str[12], gid_str[12]
123  char key_str[12], keyring_str[3][12]
127  kenter("{%d},{%d},%s", key serial number , key serial number , op)
129  ret等于Look up the user and user session keyrings for the current process's UID,* creating them if they don't exist.
130  如果ret小于0则转到:error_us
134  输出格式化串
136  cred等于get_current_cred - Get the current task's subjective credentials* Get the subjective credentials of the current task, pinning them so that* they can't go away. Accessing the current task's credentials directly is* not permitted.()
137  keyring等于Allocate a keyring and link into the destination keyring.
140  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
141  如果是错误
142  ret等于错误
143  转到:error_alloc
147  ret等于key_link - Link a key to a keyring*@keyring: The keyring to make the link in
148  如果ret小于0则转到:error_link
152  输出格式化串
153  输出格式化串
156  输出格式化串
159  输出格式化串
162  prkey等于0
163  如果 keyring private to this process prkey等于 key serial number
165  输出格式化串
167  session等于 keyring inherited over fork
168  如果非sessionsession等于user_session
170  sskey等于 key serial number
172  输出格式化串
175  i等于0
176  envp[i++]等于"HOME=/"
177  envp[i++]等于"PATH=/sbin:/bin:/usr/sbin:/usr/bin"
178  envp[i] = NULL
181  i等于0
182  argv[i++]等于request_key
183  argv[i++]等于op
184  argv[i++]等于key_str
185  argv[i++]等于uid_str
186  argv[i++]等于gid_str
187  argv[i++]等于keyring_str[0]
188  argv[i++]等于keyring_str[1]
189  argv[i++]等于keyring_str[2]
190  argv[i] = NULL
193  ret等于Call a usermode helper with a specific session keyring.
195  kdebug("usermode -> 0x%x", ret)
196  如果ret大于等于0则
198  如果st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting fromkey_validate - Validate a key.*@key: The key to be validated.* Check that a key is valid, returning 0 if the key is okay, -ENOKEY if the* key is invalidated, -EKEYREVOKED if the key's type has been removed or if小于0则ret等于负ENOKEY
201  否则ret等于0
207  error_link :
208  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
210  error_alloc :
211  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
212  error_us :
213  mplete_request_key - Complete the construction of a key.*@authkey: The authorisation key.*@error: The success or failute of the construction.* Complete the attempt to construct a key. The key will be negated* if an error is indicated
214  kleave(" = %d", ret)
215  返回:ret