Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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).

Proto:int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey)

Type:int

Parameter:

TypeParameterName
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, size of 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  If preparse Then
510  ret = preparse( & prep)
511  If ret < 0 Then Go to error
515  If keyring Then
516  ret = __key_link_lock(keyring, & index_key)
517  If ret < 0 Then Go to error
520  ret = Preallocate memory so that a key can be linked into to a keyring.
521  If ret < 0 Then Go to error_link_end
529  If ret < 0 Then Go to 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  If keyring Then Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
540  error :
541  If preparse Then free_preparse( & prep)
543  Return ret
Caller
NameDescribe
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.