函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rypted_read - format and copy the encrypted data to userspace* The resulting datablob format is:* <master-key name> <decrypted data length> <encrypted iv> <encrypted data>* On success, return to userspace the encrypted key datablob size.

函数原型:static long encrypted_read(const struct key *key, char __user *buffer, size_t buflen)

返回类型:long

参数:

类型参数名称
const struct key *key
char __user *buffer
size_tbuflen
924  epayload等于dereference_key_locked(key)
927  asciiblob_len等于 length of datablob ivsize加1加undup - round up to the next specified multiple*@x: the value to up*@y: multiple to round up to* Rounds @x up to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_up().( decrypted data length , blksize)加HASH_SIZE乘2
931  如果非bufferbuflen小于asciiblob_len则返回:asciiblob_len
934  mkey等于request_master_key(epayload, & master_key, & master_keylen)
935  如果是错误则返回:错误
938  ret等于Derive authentication/encryption key from trusted key
939  如果ret小于0则转到:out
942  ret等于Before returning data to userspace, encrypt decrypted data.
943  如果ret小于0则转到:out
946  ret等于datablob_hmac_append(epayload, master_key, master_keylen)
947  如果ret小于0则转到:out
950  ascii_buf等于datablob_format - format as an ascii string, before copying to userspace
951  如果非ascii_buf
952  ret等于负ENOMEM
953  转到:out
956  lease a read lock
957  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
958  memzero_explicit - Fill a region of memory (e
960  如果copy_to_user(buffer, ascii_buf, asciiblob_len)不等于0则ret等于负EFAULT
962  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
964  返回:asciiblob_len
965  out :
966  lease a read lock
967  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
968  memzero_explicit - Fill a region of memory (e
969  返回:ret