Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static int __key_instantiate_and_link(struct key *key, struct key_preparsed_payload *prep, struct key *keyring, struct key *authkey, struct assoc_array_edit **_edit)

Type:int

Parameter:

TypeParameterName
struct key *key
struct key_preparsed_payload *prep
struct key *keyring
struct key *authkey
struct assoc_array_edit **_edit
429  key_check(key)
430  key_check(keyring)
432  awaken = 0
433  ret = -EBUSY
435  mutex_lock( & We serialise key instantiation and link )
438  If Key state (+) or rejection error (-) == KEY_IS_UNINSTANTIATED Then
440  ret = instantiate(key, prep)
442  If ret == 0 Then
444  atomic_inc( & nikeys)
451  If keyring Then
469  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
472  If awaken Then wake_up_bit - wake up a waiter on a bit*@word: the word being waited on, a kernel virtual address*@bit: the bit of the word being waited on* There is a standard hashed waitqueue table for generic use
475  Return ret
Caller
NameDescribe
key_instantiate_and_linkkey_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).
key_create_or_updatekey_create_or_update - Update or create and instantiate a key.*@keyring_ref: A pointer to the destination keyring with possession flag.*@type: The type of key.*@description: The searchable description for the key.