函数逻辑报告 |
Source Code:kernel\kexec_elf.c |
Create Date:2022-07-27 12:06:22 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:lf_is_ehdr_sane - check that it is safe to use the ELF header*@buf_len: size of the buffer in which the ELF file is loaded.
函数原型:static bool elf_is_ehdr_sane(const struct elf64_hdr *ehdr, size_t buf_len)
返回类型:bool
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| const struct elf64_hdr * | ehdr | |
| size_t | buf_len |
| 65 | 如果e_phnum大于0且e_phentsize不等于elf_phdr的长度则 |
| 66 | pr_debug("Bad program header size.\n") |
| 67 | 返回:false |
| 68 | 否则如果e_shnum大于0且e_shentsize不等于elf_shdr的长度则 |
| 70 | pr_debug("Bad section header size.\n") |
| 71 | 返回:false |
| 72 | 否则如果 ELF "magic number" [EI_VERSION]不等于EV_CURRENT或e_version不等于EV_CURRENT则 |
| 74 | pr_debug("Unknown ELF version.\n") |
| 75 | 返回:false |
| 78 | 如果 Program header table file offset 大于0且e_phnum大于0则 |
| 89 | pr_debug("Program headers at invalid location.\n") |
| 90 | 返回:false |
| 91 | 否则如果 Program header table file offset 加phdr_size大于buf_len则 |
| 92 | pr_debug("Program headers truncated.\n") |
| 93 | 返回:false |
| 97 | 如果 Section header table file offset 大于0且e_shnum大于0则 |
| 108 | pr_debug("Section headers at invalid location.\n") |
| 109 | 返回:false |
| 110 | 否则如果 Section header table file offset 加shdr_size大于buf_len则 |
| 111 | pr_debug("Section headers truncated.\n") |
| 112 | 返回:false |
| 116 | 返回:true |
| 名称 | 描述 |
|---|---|
| elf_read_ehdr |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |