Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lf_is_phdr_sane - check that it is safe to use the program header*@buf_len: size of the buffer in which the ELF file is loaded.

Proto:static bool elf_is_phdr_sane(const struct elf64_phdr *phdr, size_t buf_len)

Type:bool

Parameter:

TypeParameterName
const struct elf64_phdr *phdr
size_tbuf_len
188  If Segment file offset + Segment size in file < Segment file offset Then
189  pr_debug("ELF segment location wraps around.\n")
190  Return false
191  Else if Segment file offset + Segment size in file > buf_len Then
192  pr_debug("ELF segment not in file.\n")
193  Return false
194  Else if Segment physical address + Segment size in memory < Segment physical address Then
195  pr_debug("ELF segment address wraps around.\n")
196  Return false
199  Return true
Caller
NameDescribe
elf_read_phdr