Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

Name: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

Proto:int fsverity_ioctl_enable(struct file *filp, const void __user *uarg)

Type:int

Parameter:

TypeParameterName
struct file *filp
const void __user *uarg
301  inode = file_inode(filp)
305  If copy_from_user( & arg, uarg, size of arg ) Then Return -EFAULT
308  If version != 1 Then Return -EINVAL
311  If __reserved1 || 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 Then Return -EINVAL
315  If block_size != PAGE_SIZE Then Return -EINVAL
318  If salt_size > sizeof_field(TYPE, MEMBER)*@TYPE: The structure containing the field of interest*@MEMBER: The field to return the size of(structfsverity_descriptor, salt) Then Return -EMSGSIZE
321  If sig_size > FS_VERITY_MAX_SIGNATURE_SIZE Then Return -EMSGSIZE
331  err = de_permission - Check for access rights to a given inode*@inode: Inode to check permission on*@mask: Right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC)* Check for read/write/execute permissions on an inode
332  If err Then Return err
335  If IS_APPEND(inode) Then Return -EPERM
338  If S_ISDIR(i_mode) Then Return -EISDIR
341  If Not S_ISREG(i_mode) Then Return -EINVAL
344  err = mnt_want_write_file - get write access to a file's mount*@file: the file who's mount on which to take a write* This is like mnt_want_write, but it takes a file and can* do some optimisations if the file is open for write already
345  If err Then Return err
348  err = deny_write_access(filp)
349  If err Then Go to out_drop_write
352  err = enable_verity(filp, & arg)
353  If err Then Go to out_allow_write_access
364  filemap_write_and_wait(i_mapping)
365  validate_inode_pages2 - remove all pages from an address_space*@mapping: the address_space* Any pages which are found to be mapped into pagetables are unmapped prior to* invalidation.* Return: -EBUSY if any pages could not be invalidated.
371  out_allow_write_access :
372  allow_write_access(filp)
373  out_drop_write :
374  mnt_drop_write_file(filp)
375  Return err