函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\process_vm_access.c Create Date:2022-07-27 16:31:22
Last Modify:2020-03-17 21:52:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:process_vm_rw_core - core of reading/writing pages from task specified*@pid: PID of process to read/write from/to*@iter: where to copy to/from locally*@rvec: iovec array specifying where to copy to/from in the other process*@riovcnt: size of rvec

函数原型:static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags, int vm_write)

返回类型:ssize_t

参数:

类型参数名称
pid_tpid
struct iov_iter *iter
const struct iovec *rvec
unsigned longriovcnt
unsigned longflags
intvm_write
158  process_pages等于pp_stack
161  rc等于0
162  nr_pages等于0
165  total_len等于iov_iter_count(iter)
171 i小于riovcnt循环
172  iov_len等于 Must be size_t (1003.1g)
173  如果iov_len大于0则
182  如果nr_pages恒等于0则返回:0
185  如果nr_pages大于Maximum number of entries for process pages arraywhich lives on stack
188  process_pages等于kmalloc(min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, Maximum number of pages kmalloc'd to hold struct page's during copy , sizeof(structpages * ) * nr_pages), GFP_KERNEL)
192  如果非process_pages则返回:负ENOMEM
197  task等于find_get_task_by_vpid(pid)
198  如果非task
199  rc等于负ESRCH
200  转到:free_proc_pages
203  mm等于mm_access(task, PTRACE_MODE_ATTACH_REALCREDS)
204  如果非mm是错误
205  rc等于如果是错误错误否则负ESRCH
210  如果rc恒等于负EACCESrc等于负EPERM
212  转到:put_task_struct
215 i小于riovcntiov_iter_count(iter)且非rc循环rc等于process_vm_rw_single_vec - read/write pages from task specified*@addr: start memory address of target process*@len: size of area to copy to/from*@iter: where to copy to/from locally*@process_pages: struct pages area that can store at least*
221  total_len减等于iov_iter_count(iter)
226  如果total_lenrc等于total_len
229  Decrement the use count and release all resources for an mm.
231  put_task_struct :
232  put_task_struct(task)
234  free_proc_pages :
235  如果process_pages不等于pp_stack释放内存
237  返回:rc
调用者
名称描述
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
compat_process_vm_rw