函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\verity\open.c Create Date:2022-07-29 10:58:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Validate the given fsverity_descriptor and create a new fsverity_info from* it. The signature (if present) is also checked.

函数原型:struct fsverity_info *fsverity_create_info(const struct inode *inode, void *_desc, size_t desc_size)

返回类型:struct fsverity_info

参数:

类型参数名称
const struct inode *inode
void *_desc
size_tdesc_size
150  desc等于_desc
154  如果desc_size小于desc的长度则
155  fsverity_err(inode, "Unrecognized descriptor size: %zu bytes", desc_size)
157  返回:错误号
160  如果must be 1 不等于1则
161  fsverity_err(inode, "Unrecognized descriptor version: %u", must be 1 )
163  返回:错误号
166  如果memchr_inv - Find an unmatching character in an area of memory.*@start: The memory area*@c: Find a character other than c*@bytes: The size of the area.* returns the address of the first character other than @c, or %NULL
167  fsverity_err(inode, "Reserved bits set in descriptor")
168  返回:错误号
171  如果size of salt in bytes; 0 if none 大于salt prepended to each hashed block 的长度则
172  fsverity_err(inode, "Invalid salt_size: %u", size of salt in bytes; 0 if none )
173  返回:错误号
176  如果le64_to_cpu(size of file the Merkle tree is built over )不等于i_size
177  fsverity_err(inode, "Wrong data_size: %llu (desc) != %lld (inode)", le64_to_cpu(size of file the Merkle tree is built over ), i_size)
180  返回:错误号
183  vi等于Shortcuts
184  如果非vi则返回:错误号
186  inode等于inode
188  err等于sverity_init_merkle_tree_params() - initialize Merkle tree parameters*@params: the parameters struct to initialize*@inode: the inode for which the Merkle tree is being built*@hash_algorithm: number of hash algorithm to use*@log_blocksize: log base 2 of
192  如果err
193  fsverity_err(inode, "Error %d initializing Merkle tree parameters", err)
196  转到:out
199  memcpy(root_hash, Merkle tree root hash , same as hash_alg->digest_size )
201  err等于Compute the file measurement by hashing the fsverity_descriptor excluding the* signature and with the sig_size field set to 0.
203  如果err
204  fsverity_err(inode, "Error %d computing file measurement", err)
205  转到:out
207  pr_debug("Computed file measurement: %s:%*phN\n", crypto API name, e.g. sha256 , same as hash_alg->digest_size , measurement)
211  err等于signature.c
212  out :
213  如果err
214  fsverity_free_info(vi)
215  vi等于错误号
217  返回:vi
调用者
名称描述
ensure_verity_infoEnsure the inode has an ->i_verity_info
enable_verity