函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-29 10:31:24
Last Modify:2020-03-18 10:18:51 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:w_copy_check_uvector() - Copy an array of &struct iovec from userspace* into the kernel and check that it is valid.*@type: One of %CHECK_IOVEC_ONLY, %READ, or %WRITE.*@uvector: Pointer to the userspace array.

函数原型:ssize_t rw_copy_check_uvector(int type, const struct iovec __user *uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer, struct iovec **ret_pointer)

返回类型:ssize_t

参数:

类型参数名称
inttype
const struct iovec __user *uvector
unsigned longnr_segs
unsigned longfast_segs
struct iovec *fast_pointer
struct iovec **ret_pointer
771  iov等于fast_pointer
778  如果nr_segs恒等于0则
779  ret等于0
780  转到:out
787  如果nr_segs大于UIO_MAXIOV
788  ret等于负EINVAL
789  转到:out
791  如果nr_segs大于fast_segs
792  iov等于分配数组内存
793  如果(iov == NULL)则
794  ret等于负ENOMEM
795  转到:out
798  如果copy_from_user(iov, uvector, nr_segs * uvector的长度)则
799  ret等于负EFAULT
800  转到:out
812  ret等于0
813 seg小于nr_segs循环
814  __userbuf等于 BSD uses caddr_t (1003.1g requires void *)
815  len等于 Must be size_t (1003.1g)
819  如果len小于0则
820  ret等于负EINVAL
821  转到:out
825  ret等于负EFAULT
826  转到:out
828  如果len大于MAX_RW_COUNTret
829  len等于MAX_RW_COUNTret
832  ret加等于len
834  out :
835  ret_pointer等于iov
836  返回:ret
调用者
名称描述
import_iovecmport_iovec() - Copy an array of &struct iovec from userspace* into the kernel, check that it is valid, and initialize a new* &struct iov_iter iterator to access it.*@type: One of %READ or %WRITE.*@uvector: Pointer to the userspace array.
process_vm_rwprocess_vm_rw - check iovecs before calling core routine*@pid: PID of process to read/write from/to*@lvec: iovec array specifying where to copy to/from locally*@liovcnt: size of lvec array*@rvec: iovec array specifying where to copy to/from in the other