函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:key_link - Link a key to a keyring*@keyring: The keyring to make the link in

函数原型:int key_link(struct key *keyring, struct key *key)

返回类型:int

参数:

类型参数名称
struct key *keyring
struct key *key
1437  struct assoc_array_edit * edit = NULL
1440  kenter("{%d,%d}", key serial number , _read - get a refcount's value*@r: the refcount* Return: the refcount's value)
1442  key_check(keyring)
1443  key_check(key)
1445  ret等于Lock keyring for link.
1446  如果ret小于0则转到:error
1449  ret等于Preallocate memory so that a key can be linked into to a keyring.
1450  如果ret小于0则转到:error_end
1453  kdebug("begun {%d,%d}", key serial number , _read - get a refcount's value*@r: the refcount* Return: the refcount's value)
1454  ret等于Check addition of keys to restricted keyrings.
1455  如果ret恒等于0则ret等于Check already instantiated keys aren't going to be a problem.* The caller must have called __key_link_begin(). Don't need to call this for* keys that were created since __key_link_begin() was called.
1457  如果ret恒等于0则Link a key into to a keyring.* Must be called with __key_link_begin() having being called. Discards any* already extant link to matching key if there is one, so that each keyring* holds at most one link to any given key of a particular type+description
1460  error_end :
1461  Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
1462  error :
1463  kleave(" = %d {%d,%d}", ret, key serial number , _read - get a refcount's value*@r: the refcount* Return: the refcount's value)
1464  返回:ret
调用者
名称描述
keyctl_keyring_linkCreate a link from a keyring to a key if there's no matching key in the* keyring, otherwise replace the link to the matching key with a link to the* new key.* The key must grant the caller Link permission and the the keyring must grant
keyctl_keyring_searchSearch the specified keyring and any keyrings it links to for a matching* key
look_up_user_keyringsLook up the user and user session keyrings for the current process's UID,* creating them if they don't exist.
call_sbin_request_keyRequest userspace finish the construction of a key* - execute "/sbin/request-key "
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.
key_get_persistentGet the persistent keyring for a specific UID and link it to the nominated* keyring.