Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Attempt to update an existing key.* The key is given to us with an incremented refcount that we need to discard* if we get an error.

Proto:static inline key_ref_t __key_update(key_ref_t key_ref, struct key_preparsed_payload *prep)

Type:key_ref_t

Parameter:

TypeParameterName
key_ref_tkey_ref
struct key_preparsed_payload *prep
751  key = key_ref_to_ptr(key_ref)
755  ret = Check to see whether permission is granted to use a key in the desired way.
756  If ret < 0 Then Go to error
759  ret = -EEXIST
760  If Not update Then Go to error
763  lock for writing
765  ret = update(key, prep)
766  If ret == 0 Then Change the key state to being instantiated.
770  lease a write lock
772  If ret < 0 Then Go to error
774  out :
775  Return key_ref
777  error :
778  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
779  key_ref = ERR_PTR(ret)
780  Go to out
Caller
NameDescribe
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.