函数逻辑报告 |
Source Code:fs\binfmt_elf_fdpic.c |
Create Date:2022-07-29 11:03:50 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:load an fdpic binary into various bits of memory
函数原型:static int load_elf_fdpic_binary(struct linux_binprm *bprm)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct linux_binprm * | bprm |
185 | regs等于current_pt_regs() |
194 | struct file * interpreter = NULL |
195 | char * interpreter_name = NULL |
202 | memset( & exec_params, 0, exec_params的长度) |
203 | memset( & interp_params, 0, interp_params的长度) |
205 | copy of ELF header 等于buf |
210 | 如果非is_elf( & copy of ELF header , file)则转到:error |
212 | 如果非That's for binfmt_elf_fdpic to deal with ( & copy of ELF header )则 |
215 | 转到:error |
229 | phdr等于 copy of PT_PHDR table |
235 | 如果p_filesz大于# chars in a path name including nul 则转到:error |
242 | interpreter_name等于开辟内存 |
243 | 如果非interpreter_name则转到:error |
247 | retval等于kernel_read(file, interpreter_name, p_filesz, & pos) |
249 | 如果此条件成立可能性小(为编译器优化)(retval != p_filesz)则 |
256 | 如果interpreter_name[p_filesz - 1]不等于'\0'则转到:error |
259 | kdebug("Using ELF interpreter %s", interpreter_name) |
264 | 如果是错误则 |
265 | interpreter = NULL |
266 | 转到:error |
274 | would_dump(bprm, interpreter) |
276 | pos等于0 |
277 | retval等于kernel_read(interpreter, buf, sizeof(linux_binprm->buf) , & pos) |
279 | 如果此条件成立可能性小(为编译器优化)(retval != sizeof(linux_binprm->buf) )则 |
285 | copy of ELF header 等于*buf |
286 | 退出 |
293 | 退出 |
302 | 如果interpreter_name则 |
304 | 如果非is_elf( & copy of ELF header , interpreter)则转到:error |
323 | 如果stack_size恒等于0则 |
334 | 如果stack_size恒等于0则stack_size等于131072UL |
348 | 如果That's for binfmt_elf_fdpic to deal with ( & copy of ELF header )则Change personality of the currently running process.(PER_LINUX_FDPIC) |
355 | setup_new_exec(bprm) |
357 | set_binfmt( & elf_fdpic_format) |
359 | start_code等于0 |
360 | end_code等于0 |
361 | start_stack等于0 |
362 | start_data等于0 |
363 | end_data等于0 |
364 | exec_fdpic_loadmap等于0 |
365 | interp_fdpic_loadmap等于0 |
368 | elf_fdpic_arch_lay_out_mm( & exec_params, & interp_params, & start_stack, & start_brk) |
373 | retval等于Finalizes the stack vm_area_struct. The flags and permissions are updated,* the stack is optionally relocated, and some extra space is added. |
390 | 如果interpreter_name则 |
393 | 如果retval小于0则 |
395 | 转到:error |
399 | fput(interpreter) |
400 | interpreter = NULL |
438 | 如果present useful information to the program by shovelling it onto the new* process's stack小于0则转到:error |
442 | kdebug("- start_code %lx", start_code) |
444 | kdebug("- start_data %lx", start_data) |
448 | kdebug("- start_stack %lx", start_stack) |
465 | start_thread(regs, entryaddr, start_stack) |
467 | retval等于0 |
469 | error : |
470 | 如果interpreter则 |
472 | fput(interpreter) |
474 | 释放内存 |
475 | 释放内存 |
476 | 释放内存 |
477 | 释放内存 |
478 | 释放内存 |
479 | 返回:retval |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |