函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__bprm_mm_init

函数原型:static int __bprm_mm_init(struct linux_binprm *bprm)

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
245  struct vm_area_struct * vma = NULL
246  mm等于mm
248  vma等于vma等于vm_area_alloc(mm)
249  如果非vma则返回:负ENOMEM
251  vma_set_anonymous(vma)
253  如果lock for writing
254  err等于负EINTR
255  转到:err_free
264  BUILD_BUG_ON - break compile if a condition is true(VM_STACK_FLAGS & Bits set in the VMA until the stack is in its final location )
265  The first byte after our end addresswithin vm_mm. 等于STACK_TOP_MAX
266  Our start address within vm_mm. 等于The first byte after our end addresswithin vm_mm. PAGE_SIZE
267  Flags, see mm.h. 等于VM_SOFTDIRTY按位或VM_STACK_FLAGS按位或Bits set in the VMA until the stack is in its final location
268  Access permissions of this VMA. 等于vm_get_page_prot(Flags, see mm.h. )
270  err等于Insert vm structure into process list sorted by address* and into the inode's i_mmap tree. If vm_file is non-NULL* then i_mmap_rwsem is taken here.
271  如果err则转到:err
274  VM_STACK 等于 Total pages mapped 等于1
275  arch_bprm_mm_init(mm, vma)
276  lease a write lock
277  p等于The first byte after our end addresswithin vm_mm. 减*的长度
278  返回:0
279  err :
280  lease a write lock
281  err_free :
282  vma = NULL
283  vm_area_free(vma)
284  返回:err
调用者
名称描述
bprm_mm_initCreate a new mm_struct and populate it with a temporary stack* vm_area_struct. We don't have enough context at this point to set the stack* flags, permissions, and offset, so we use temporary values. We'll update* them later in setup_arg_pages().