函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:quest_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.

函数原型:struct key *request_key_and_link(struct key_type *type, const char *description, struct key_tag *domain_tag, const void *callout_info, size_t callout_len, void *aux, struct key *dest_keyring, unsigned long flags)

返回类型:struct key

参数:

类型参数名称
struct key_type *type
const char *description
struct key_tag *domain_tag
const void *callout_info
size_tcallout_len
void *aux
struct key *dest_keyring
unsigned longflags
567  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) | Search child keyrings also ), }
584  kenter("%s,%s,%p,%zu,%p,%p,%lx", name, description, callout_info, callout_len, aux, dest_keyring, flags)
588  如果match_preparse
589  ret等于match_preparse( & match_data)
590  如果ret小于0则
591  key等于错误号
592  转到:error
596  key等于check_cached_key( & ctx)
597  如果key则转到:error_free
601  _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
602  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.
603  _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()
605  如果非是错误
606  如果dest_keyring
609  如果ret小于0则
611  key等于错误号
612  转到:error_free
616  key等于key_ref_to_ptr(key_ref)
617  如果dest_keyring
619  如果ret小于0则
627  cache_requested_key(key)
628  否则如果错误不等于负EAGAIN
629  key等于错误指示
630  否则
633  key等于错误号
634  如果非callout_info则转到:error_free
637  key等于Commence key construction.
641  error_free :
642  如果match_freematch_free( & match_data)
644  error :
645  kleave(" = %p", key)
646  返回:key
调用者
名称描述
request_key_tagquest_key_tag - Request a key and wait for construction*@type: Type of key
request_key_with_auxdataquest_key_with_auxdata - Request a key with auxiliary data for the upcaller*@type: The type of key we want.*@description: The searchable description of the key.*@domain_tag: The domain in which the key operates.
SYSCALL_DEFINE4Search the process keyrings and keyring trees linked from those for a* matching key. Keyrings must have appropriate Search permission to be* searched.* If a key is found, it will be attached to the destination keyring if there's