Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ad the program headers table into memory

Proto:static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, struct file *file)

Type:int

Parameter:

TypeParameterName
struct elf_fdpic_params *params
struct file *file
144  pos = e_phoff
146  If e_phentsize != size of elf_phdr Then Return -ENOMEM
148  If e_phnum > 65536U / size of elf_phdr Then Return -ENOMEM
151  size = e_phnum * size of elf_phdr
152  copy of PT_PHDR table = Allocation memory
153  If Not copy of PT_PHDR table Then Return -ENOMEM
156  retval = kernel_read(file, copy of PT_PHDR table , size, & pos)
157  If Value for the false possibility is greater at compile time(retval != size) Then Return If retval < 0 Then retval Else -ENOEXEC
161  phdr = copy of PT_PHDR table
162  When loop < e_phnum cycle
163  If p_type != PT_GNU_STACK Then Continue
166  If p_flags & PF_X Then flags |= T if stack to be executable
168  Else flags |= T if stack not to be executable
171  stack size requested (PT_GNU_STACK) = p_memsz
172  Break
175  Return 0
Caller
NameDescribe
load_elf_fdpic_binaryload an fdpic binary into various bits of memory