函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create an authorisation token for /sbin/request-key or whoever to gain* access to the caller's security data.

函数原型:struct key *request_key_auth_new(struct key *target, const char *op, const void *callout_info, size_t callout_len, struct key *dest_keyring)

返回类型:struct key

参数:

类型参数名称
struct key *target
const char *op
const void *callout_info
size_tcallout_len
struct key *dest_keyring
167  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.()
168  struct key * authkey = NULL
170  ret等于负ENOMEM
172  kenter("%d,", key serial number )
175  rka等于分配内存并置零
176  如果非rka则转到:error
178  callout_info等于kmemdup - duplicate region of memory*@src: memory region to duplicate*@len: memory region length*@gfp: GFP mask to use* Return: newly allocated copy of @src or %NULL in case of error
179  如果非callout_info则转到:error_free_rka
181  callout_len等于callout_len
182  长字符串复制
186  如果 assumed request_key authority
188  lock for reading
195  ret等于负EKEYREVOKED
196  转到:error_free_rka
199  irka等于data[0]
200  cred等于get_cred - Get a reference on a set of credentials*@cred: The credentials to reference* Get a reference on the specified set of credentials. The caller must* release the reference. If %NULL is passed, it is returned with no action.
201  pid等于pid
203  lease a read lock
205  否则
207  cred等于get_cred - Get a reference on a set of credentials*@cred: The credentials to reference* Get a reference on the specified set of credentials. The caller must* release the reference. If %NULL is passed, it is returned with no action.
208  pid等于pid
211  target_key等于key_get(target)
212  dest_keyring等于key_get(dest_keyring)
215  输出格式化串
217  authkey等于key_alloc - Allocate a key of the specified type.*@type: The type of key to allocate.*@desc: The key description to allow the key to be searched out.*@uid: The owner of the new key.*@gid: The group ID for the new key's group permissions.
221  如果是错误
222  ret等于错误
223  转到:error_free_rka
227  ret等于key_instantiate_and_link - Instantiate a key and link it into the keyring.*@key: The key to instantiate.*@data: The data to use to instantiate the keyring.*@datalen: The length of @data.*@keyring: Keyring to create a link in on success (or NULL).
228  如果ret小于0则转到:error_put_authkey
231  kleave(" = {%d,%d}", key serial number , _read - get a refcount's value*@r: the refcount* Return: the refcount's value)
232  返回:authkey
234  error_put_authkey :
235  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
236  error_free_rka :
237  free_request_key_auth(rka)
238  error :
239  kleave("= %d", ret)
240  返回:错误号
调用者
名称描述
construct_keyCall out to userspace for key construction.* Program failure is ignored in favour of key status.