Function report |
Source Code:fs\verity\enable.c |
Create Date:2022-07-28 20:24:32 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:enable_verity
Proto:static int enable_verity(struct file *filp, const struct fsverity_enable_arg *arg)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct file * | filp | |
const struct fsverity_enable_arg * | arg |
160 | inode = file_inode(filp) |
162 | struct merkle_tree_params params = {} |
169 | desc = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
172 | must be 1 = 1 |
177 | If salt_size && copy_from_user(salt prepended to each hashed block , (constu8__user * )(uintptr_t)salt_ptr, salt_size) Then |
187 | If sig_size && copy_from_user(ptional PKCS#7 signature , (constu8__user * )(uintptr_t)sig_ptr, sig_size) Then |
210 | inode_lock(inode) |
213 | Else err = begin_enable_verity(filp) |
215 | inode_unlock(inode) |
228 | pr_debug("Building Merkle tree...\n") |
231 | If err Then |
232 | fsverity_err(inode, "Error %d building Merkle tree", err) |
233 | Go to rollback |
235 | pr_debug("Done building Merkle tree. Root hash is %s:%*phN\n", crypto API name, e.g. sha256 , same as hash_alg->digest_size , Merkle tree root hash ) |
245 | vi = Validate the given fsverity_descriptor and create a new fsverity_info from* it. The signature (if present) is also checked. |
259 | inode_lock(inode) |
260 | err = end_enable_verity(filp, desc, desc_size, Merkle tree size in bytes ) |
261 | inode_unlock(inode) |
262 | If err Then |
263 | fsverity_err(inode, "%ps() failed with err %d", end_enable_verity, err) |
265 | fsverity_free_info(vi) |
268 | fsverity_free_info(vi) |
269 | Else |
277 | fsverity_set_info(inode, vi) |
279 | out : |
282 | Return err |
284 | rollback : |
285 | inode_lock(inode) |
286 | end_enable_verity(filp, NULL, 0, Merkle tree size in bytes ) |
287 | inode_unlock(inode) |
288 | Go to out |
Name | Describe |
---|---|
fsverity_ioctl_enable | sverity_ioctl_enable() - enable verity on a file* Enable fs-verity on a file. See the "FS_IOC_ENABLE_VERITY" section of* Documentation/filesystems/fsverity.rst for the documentation.* Return: 0 on success, -errno on failure |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |