Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__bprm_mm_init

Proto:static int __bprm_mm_init(struct linux_binprm *bprm)

Type:int

Parameter:

TypeParameterName
struct linux_binprm *bprm
245  struct vm_area_struct * vma = NULL
246  mm = mm
248  vma = vma = vm_area_alloc(mm)
249  If Not vma Then Return -ENOMEM
251  vma_set_anonymous(vma)
253  If lock for writing Then
254  err = -EINTR
255  Go to 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  If err Then Go to 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. - size of *
278  Return 0
279  err :
280  lease a write lock
281  err_free :
282  vma = NULL
283  vm_area_free(vma)
284  Return err
Caller
NameDescribe
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().