Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyring.c Create Date:2022-07-28 18:18:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:key_link - Link a key to a keyring*@keyring: The keyring to make the link in

Proto:int key_link(struct key *keyring, struct key *key)

Type:int

Parameter:

TypeParameterName
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  If ret < 0 Then Go to error
1449  ret = Preallocate memory so that a key can be linked into to a keyring.
1450  If ret < 0 Then Go to 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  If ret == 0 Then 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  If ret == 0 Then 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  Return ret
Caller
NameDescribe
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.