Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rusted_read - copy the sealed blob data to userspace in hex.* On success, return to userspace the trusted key datablob size.

Proto:static long trusted_read(const struct key *key, char __user *buffer, size_t buflen)

Type:long

Parameter:

TypeParameterName
const struct key *key
char __user *buffer
size_tbuflen
1141  p = dereference_key_locked(key)
1142  If Not p Then Return -EINVAL
1145  If buffer && buflen >= 2 * blob_len Then
1146  ascii_buf = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1147  If Not ascii_buf Then Return -ENOMEM
1150  bufp = ascii_buf
1151  When i < blob_len cycle bufp = hex_byte_pack(bufp, blob[i])
1153  If copy_to_user(buffer, ascii_buf, 2 * blob_len) != 0 Then
1155  Return -EFAULT
1157  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
1159  Return 2 * blob_len