函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__access_remote_vm

函数原型:int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags)

返回类型:int

参数:

类型参数名称
struct task_struct *tsk
struct mm_struct *mm
unsigned longaddr
void *buf
intlen
unsigned intgup_flags
1712  write等于gup_flags按位与check pte is writable
1714  如果down_read_killable( & mmap_sem)则返回:0
1718  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
1719  如果vma
1721  如果addrlen大于等于The first byte after our end addresswithin vm_mm. len等于The first byte after our end addresswithin vm_mm. addr
1725  如果writeFlags, see mm.h. 按位与VM_MAYWRITEcopy_to_user_page(vma, NULL, addr, (void * )addr, buf, len)
1728  否则如果非writeFlags, see mm.h. 按位与limits for mprotect() etc copy_from_user_page(vma, NULL, addr, buf, (void * )addr, len)
1731  否则len等于0
1733  否则
1734  len等于0
1737  lease a read lock
1739  返回:len
调用者
名称描述
access_remote_vmaccess_remote_vm - access another process' address space*@mm: the mm_struct of the target address space*@addr: start address to access*@buf: source or destination buffer*@len: number of bytes to transfer*@gup_flags: flags modifying lookup behaviour
access_process_vmAccess another process' address space.* - source/target buffer must be kernel space
ptrace_access_vmAccess another process' address space via ptrace.* Source/target buffer must be kernel space,* Do not walk the page table directly, use get_user_pages
access_remote_vmaccess_remote_vm - access another process' address space*@mm: the mm_struct of the target address space*@addr: start address to access*@buf: source or destination buffer*@len: number of bytes to transfer*@gup_flags: flags modifying lookup behaviour
access_process_vmAccess another process' address space.* Source/target buffer must be kernel space,* Do not walk the page table directly, use get_user_pages