函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rusted_update - reseal an existing key with new PCR values

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

返回类型:int

参数:

类型参数名称
struct key *key
struct key_preparsed_payload *prep
1059  datalen等于Raw datalen
1061  ret等于0
1063  如果key_is_negative(key)则返回:负ENOKEY
1065  p等于data[0]
1066  如果非migratable则返回:负EPERM
1068  如果datalen小于等于0或datalen大于32767或非Raw data 则返回:负EINVAL
1071  datablob等于开辟内存
1072  如果非datablob则返回:负ENOMEM
1074  new_o等于trusted_options_alloc()
1075  如果非new_o
1076  ret等于负ENOMEM
1077  转到:out
1079  new_p等于trusted_payload_alloc(key)
1080  如果非new_p
1081  ret等于负ENOMEM
1082  转到:out
1085  memcpy(datablob, Raw data , datalen)
1086  datablob[datalen]等于'\0'
1087  ret等于datablob_parse - parse the keyctl data and fill in the* payload and options structures* On success returns 0, otherwise -EINVAL.
1088  如果ret不等于Opt_update
1089  ret等于负EINVAL
1090  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
1091  转到:out
1094  如果非keyhandle
1095  ret等于负EINVAL
1096  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
1097  转到:out
1101  migratable等于migratable
1102  key_len等于key_len
1103  memcpy(key, key, key_len)
1104  dump_payload(p)
1105  dump_payload(new_p)
1107  ret等于Have the TPM seal(encrypt) the symmetric key
1108  如果ret小于0则
1109  打印信息("trusted_key: key_seal failed (%d)\n", ret)
1110  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
1111  转到:out
1113  如果pcrlock
1114  ret等于Lock a trusted key, by extending a selected PCR.* Prevents a trusted key that is sealed to PCRs from being accessed.* This uses the tpm driver's extend function.
1115  如果ret小于0则
1116  打印信息("trusted_key: pcrlock failed (%d)\n", ret)
1118  转到:out
1121  rcu_assign_keypointer(key, new_p)
1122  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.
1123  out :
1124  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
1125  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
1126  返回:ret