Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:key_update - Update a key's contents.*@key_ref: The pointer (plus possession flag) to the key.*@payload: The data to be used to update the key.*@plen: The length of @payload.* Attempt to update the contents of a key with the given payload data. The

Proto:int key_update(key_ref_t key_ref, const void *payload, size_t plen)

Type:int

Parameter:

TypeParameterName
key_ref_tkey_ref
const void *payload
size_tplen
988  key = key_ref_to_ptr(key_ref)
991  key_check(key)
994  ret = Check to see whether permission is granted to use a key in the desired way.
995  If ret < 0 Then Return ret
999  If Not update Then Return -EOPNOTSUPP
1002  memset( & prep, 0, size of prep )
1003  Raw data = payload
1004  Raw datalen = plen
1005  Quota length for proposed payload = def_datalen
1006  Expiry time of key = Located here for timespec[64]_valid_strict
1007  If preparse Then
1008  ret = preparse( & prep)
1009  If ret < 0 Then Go to error
1013  lock for writing
1015  ret = update(key, & prep)
1016  If ret == 0 Then Change the key state to being instantiated.
1020  lease a write lock
1022  error :
1023  If preparse Then free_preparse( & prep)
1025  Return ret
Caller
NameDescribe
keyctl_update_keyUpdate a key's data payload from the given data.* The key must grant the caller Write permission and the key type must support* updating for this to work. A negative key can be positively instantiated* with this call.* If successful, 0 will be returned