Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\exec.c Create Date:2022-07-28 20:03:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:During bprm_mm_init(), we create a temporary stack at STACK_TOP_MAX. Once* the binfmt code determines where the new stack should reside, we shift it to* its final location. The process proceeds as follows:* 1) Use shift to calculate the new vma endpoints.

Proto:static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longshift
627  mm = The address space we belong to.
628  old_start = Our start address within vm_mm.
629  old_end = The first byte after our end addresswithin vm_mm.
630  length = old_end - old_start
631  new_start = old_start - shift
632  new_end = old_end - shift
635  BUG_ON(new_start > new_end)
641  If vma != look up the first VMA in which addr resides, NULL if none* - should be called with mm->mmap_sem at least held readlocked Then Return -EFAULT
647  If vma_adjust(vma, new_start, old_end, Offset (within vm_file) in PAGE_SIZEunits , NULL) Then Return -ENOMEM
654  If length != move_page_tables(vma, old_start, vma, new_start, length, false) Then Return -ENOMEM
658  lru_add_drain()
659  lb_gather_mmu - initialize an mmu_gather structure for page-table tear-down*@tlb: the mmu_gather structure to initialize*@mm: the mm_struct of the target address space*@start: start of the region that will be removed from the page-table*@end: end of the
660  If new_end > old_start Then
664  This function frees user-level page tables of a process.
666  Else
673  This function frees user-level page tables of a process.
676  lb_finish_mmu - finish an mmu_gather structure*@tlb: the mmu_gather structure to finish*@start: start of the region that will be removed from the page-table*@end: end of the region that will be removed from the page-table* Called at the end of the
681  vma_adjust(vma, new_start, new_end, Offset (within vm_file) in PAGE_SIZEunits , NULL)
683  Return 0
Caller
NameDescribe
setup_arg_pagesFinalizes the stack vm_area_struct. The flags and permissions are updated,* the stack is optionally relocated, and some extra space is added.