Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched

Proto:key_ref_t keyring_search(key_ref_t keyring, struct key_type *type, const char *description, bool recurse)

Type:key_ref_t

Parameter:

TypeParameterName
key_ref_tkeyring
struct key_type *type
const char *description
boolrecurse
946  struct keyring_search_context ctx = {type = type, description = description, desc_len = strlen - Find the length of a string*@s: The string to be sized, 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.(), cmp = By default, we keys found by getting an exact match on their descriptions., Raw match data = description, Type of lookup for this search. = Direct lookup by description. , flags = Override NO_STATE_CHECK , }
959  If recurse Then flags |= Search child keyrings also
961  If match_preparse Then
962  ret = match_preparse( & match_data)
963  If ret < 0 Then Return ERR_PTR(ret)
967  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
968  key = keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
969  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
971  If match_free Then match_free( & match_data)
973  Return key
Caller
NameDescribe
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.
request_asymmetric_keyRequest an asymmetric key.
digsig_verifydigsig_verify() - digital signature verification with public key*@keyring: keyring to search key in*@sig: digital signature*@siglen: length of the signature*@data: data*@datalen: length of the data* Returns 0 on success, -EINVAL otherwise