函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\exec.c Create Date:2022-07-29 10:33:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Finalizes the stack vm_area_struct. The flags and permissions are updated,* the stack is optionally relocated, and some extra space is added.

函数原型:int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack)

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
unsigned longstack_top
intexecutable_stack
696  mm等于mm
697  vma等于vma
698  struct vm_area_struct * prev = NULL
724  stack_top等于arch_align_stack(stack_top)
725  stack_top等于 align the pointer to the (next) page boundary (stack_top)
727  如果此条件成立可能性小(为编译器优化)(stack_top < mmap_min_addr)或此条件成立可能性小(为编译器优化)(The first byte after our end addresswithin vm_mm. - Our start address within vm_mm. >= stack_top - mmap_min_addr)则返回:负ENOMEM
731  stack_shift等于The first byte after our end addresswithin vm_mm. stack_top
733  p减等于stack_shift
734  arg_start等于p
737  如果loaderloader减等于stack_shift
739  exec减等于stack_shift
741  如果lock for writing则返回:负EINTR
744  vm_flags等于VM_STACK_FLAGS
751  如果此条件成立可能性小(为编译器优化)(executable_stack == Enable executable stacks )则vm_flags或等于VM_EXEC
753  否则如果executable_stack恒等于Disable executable stacks vm_flags与等于VM_EXEC的反
755  vm_flags或等于def_flags
756  vm_flags或等于Bits set in the VMA until the stack is in its final location
758  ret等于mprotect_fixup(vma, & prev, Our start address within vm_mm. , The first byte after our end addresswithin vm_mm. , vm_flags)
760  如果ret则转到:out_unlock
762  BUG_ON(prev != vma)
765  如果stack_shift
766  ret等于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.
767  如果ret则转到:out_unlock
772  Flags, see mm.h. 与等于Bits set in the VMA until the stack is in its final location 的反
774  stack_expand等于131072UL
775  stack_size等于The first byte after our end addresswithin vm_mm. Our start address within vm_mm.
780  rlim_stack等于rlim_cur按位与PAGE_MASK
787  如果stack_sizestack_expand大于rlim_stackstack_base等于The first byte after our end addresswithin vm_mm. rlim_stack
789  否则stack_base等于Our start address within vm_mm. stack_expand
792  start_stack等于p
793  ret等于xpand a stack to a given address* - not supported under NOMMU conditions
794  如果retret等于负EFAULT
797  out_unlock :
798  lease a write lock
799  返回:ret
调用者
名称描述
load_aout_binaryThese are the functions used to load a.out style executables and shared* libraries. There is no binary dependent code anywhere else.
load_elf_binary
load_elf_fdpic_binaryload an fdpic binary into various bits of memory
load_flat_binaryThese are the functions used to load flat style executables and shared* libraries. There is no binary dependent code anywhere else.