Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:quest_key_rcu - Request key from RCU-read-locked context*@type: The type of key we want.*@description: The name of the key we want.*@domain_tag: The domain in which the key operates.* Request a key from a context that we may not sleep in (such as RCU-mode

Proto:struct key *request_key_rcu(struct key_type *type, const char *description, struct key_tag *domain_tag)

Type:struct key

Parameter:

TypeParameterName
struct key_type *type
const char *description
struct key_tag *domain_tag
770  struct keyring_search_context ctx = {type = type, Domain of operation = domain_tag, 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 | Ignore expired keys (intention to replace) ), }
785  kenter("%s,%s", ame of the type , description)
787  key = check_cached_key( & ctx)
788  If key Then Return key
792  key_ref = Search the process keyrings attached to the supplied cred for the first* matching key in the manner of search_my_process_keyrings(), but also search* the keys attached to the assumed authorisation key using its credentials if* one is available.
793  If IS_ERR(key_ref) Then
794  key = ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
795  If PTR_ERR(key_ref) == -EAGAIN Then key = ERR_PTR( - ENOKEY)
797  Else
798  key = key_ref_to_ptr(key_ref)
799  cache_requested_key(key)
802  kleave(" = %p", key)
803  Return key