函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rypted_update - update the master key description* Change the master key description for an existing encrypted key.* The next read will return an encrypted datablob using the new* master key description.* On success, return 0. Otherwise return errno.

函数原型:static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)

返回类型:int

参数:

类型参数名称
struct key *key
struct key_preparsed_payload *prep
856  epayload等于data[0]
859  char * new_master_desc = NULL
860  const char * format = NULL
861  datalen等于Raw datalen
862  ret等于0
864  如果key_is_negative(key)则返回:负ENOKEY
866  如果datalen小于等于0或datalen大于32767或非Raw data 则返回:负EINVAL
869  buf等于开辟内存
870  如果非buf则返回:负ENOMEM
873  buf[datalen]等于0
874  memcpy(buf, Raw data , datalen)
875  ret等于datablob_parse - parse the keyctl data* datablob format:* new [] * load [] * * update * Tokenizes a copy of the
876  如果ret小于0则转到:out
879  ret等于valid_master_desc - verify the 'key-type:desc' of a new/updated master-key* key-type:= "trusted:" | "user:"* desc:= master-key description* Verify that 'key-type' is valid and that 'desc' exists. On key update,
880  如果ret小于0则转到:out
883  new_epayload等于Allocate memory for decrypted key and datablob.
885  如果是错误
886  ret等于错误
887  转到:out
890  __ekey_init(new_epayload, datablob: format , new_master_desc, datablob: decrypted key length )
893  memcpy( datablob: iv , datablob: iv , ivsize)
894  memcpy( payload data + datablob + hmac , payload data + datablob + hmac , payload data length )
897  rcu_assign_keypointer(key, new_epayload)
898  Post an RCU callback to be invoked after the end of an RCU grace* period. But since we have but one CPU, that would be after any* quiescent state.
899  out :
900  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
901  返回:ret