Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-28 20:01:22
Last Modify:2020-03-18 10:18:51 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:compat_rw_copy_check_uvector

Proto:ssize_t compat_rw_copy_check_uvector(int type, const struct compat_iovec __user *uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer, struct iovec **ret_pointer)

Type:ssize_t

Parameter:

TypeParameterName
inttype
const struct compat_iovec __user *uvector
unsigned longnr_segs
unsigned longfast_segs
struct iovec *fast_pointer
struct iovec **ret_pointer
846  iov = ret_pointer = fast_pointer
847  ret = 0
855  If nr_segs == 0 Then Go to out
858  ret = -EINVAL
859  If nr_segs > UIO_MAXIOV Then Go to out
861  If nr_segs > fast_segs Then
862  ret = -ENOMEM
863  iov = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
864  If (iov == NULL) Then Go to out
867  ret_pointer = iov
869  ret = -EFAULT
870  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(uvector, nr_segs * size of uvector ) Then Go to out
881  tot_len = 0
882  ret = -EINVAL
883  When seg < nr_segs cycle
889  ret = -EFAULT
890  Go to out
892  If len < 0 Then Go to out
896  ret = -EFAULT
897  Go to out
899  If len > MAX_RW_COUNT - tot_len Then len = MAX_RW_COUNT - tot_len
901  tot_len += len
902  BSD uses caddr_t (1003.1g requires void *) = A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
903  Must be size_t (1003.1g) = len
904  uvector++
905  iov++
907  ret = tot_len
909  out :
910  Return ret
Caller
NameDescribe
compat_import_iovec