Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-28 14:38:06
Last Modify:2020-03-17 21:26:27 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__access_remote_vm

Proto:int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags)

Type:int

Parameter:

TypeParameterName
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  If down_read_killable( & mmap_sem) Then Return 0
1718  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
1719  If vma Then
1721  If addr + len >= The first byte after our end addresswithin vm_mm. Then len = The first byte after our end addresswithin vm_mm. - addr
1725  If write && Flags, see mm.h. & VM_MAYWRITE Then copy_to_user_page(vma, NULL, addr, (void * )addr, buf, len)
1728  Else if Not write && Flags, see mm.h. & limits for mprotect() etc Then copy_from_user_page(vma, NULL, addr, buf, (void * )addr, len)
1731  Else len = 0
1733  Else
1734  len = 0
1737  lease a read lock
1739  Return len
Caller
NameDescribe
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