函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:key_instantiate_and_link - Instantiate a key and link it into the keyring.*@key: The key to instantiate.*@data: The data to use to instantiate the keyring.*@datalen: The length of @data.*@keyring: Keyring to create a link in on success (or NULL).

函数原型:int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey)

返回类型:int

参数:

类型参数名称
struct key *key
const void *data
size_tdatalen
struct key *keyring
struct key *authkey
501  struct assoc_array_edit * edit = NULL
504  memset( & prep, 0, prep的长度)
505  Raw data 等于data
506  Raw datalen 等于datalen
507  Quota length for proposed payload 等于def_datalen
508  Expiry time of key 等于Located here for timespec[64]_valid_strict
509  如果preparse
510  ret等于preparse( & prep)
511  如果ret小于0则转到:error
515  如果keyring
516  ret等于__key_link_lock(keyring, & index_key)
517  如果ret小于0则转到:error
520  ret等于Preallocate memory so that a key can be linked into to a keyring.
521  如果ret小于0则转到:error_link_end
529  如果ret小于0则转到:error_link_end
534  ret等于Instantiate a key and link it into the target keyring atomically. Must be* called with the target keyring's semaphore writelocked. The target key's* semaphore need not be locked as instantiation is serialised by* key_construction_mutex.
536  error_link_end :
537  如果keyringFinish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
540  error :
541  如果preparsefree_preparse( & prep)
543  返回:ret
调用者
名称描述
keyring_allocAllocate a keyring and link into the destination keyring.
keyctl_instantiate_key_commonInstantiate a key with the specified payload and link the key into the* destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority). No other permissions are required.
request_key_auth_newCreate an authorisation token for /sbin/request-key or whoever to gain* access to the caller's security data.
add_new_master_keyAllocate a new fscrypt_master_key which contains the given secret, set it as* the payload of a new 'struct key' of type fscrypt, and link the 'struct key'* into the given keyring. Synchronized by fscrypt_add_key_mutex.