函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\binfmt_aout.c Create Date:2022-07-29 11:01:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:These are the functions used to load a.out style executables and shared* libraries. There is no binary dependent code anywhere else.

函数原型:static int load_aout_binary(struct linux_binprm *bprm)

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
119  regs等于current_pt_regs()
126  ex等于*buf
127  如果N_MAGIC(ex)不等于Code indicating demand-paged executable. N_MAGIC(ex)不等于Code indicating object file or impure executable. N_MAGIC(ex)不等于This indicates a demand-paged executable with the header in the text. The first page is unmapped to help trap NULL pointer references N_MAGIC(ex)不等于Code indicating pure executable. N_TRSIZE(ex)或N_DRSIZE(ex)或NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they 小于 length of text, in bytes length of data, in bytes N_SYMSIZE(ex)加N_TXTOFF(ex)则
131  返回:负ENOEXEC
138  如果非mmap则返回:负ENOEXEC
141  fd_offset等于N_TXTOFF(ex)
147  rlim等于rlimit(RLIMIT_DATA)
148  如果rlim大于等于RLIM_INFINITYrlim等于0的反
150  如果 length of data, in bytes length of uninitialized data area for file, in bytes 大于rlim则返回:负ENOMEM
154  retval等于Calling this is the point of no return. None of the failures will be* seen by userspace since either the process is already taking a fatal* signal (via de_thread() or coredump), or will have SEGV raised
155  如果retval则返回:retval
162  Change personality of the currently running process.(PER_LINUX)
164  setup_new_exec(bprm)
166  end_code等于 length of text, in bytes start_code等于Address of text segment in memory after it is loaded. (ex)
168  end_data等于 length of data, in bytes start_data等于N_DATADDR(ex)
170  brk等于 length of uninitialized data area for file, in bytes start_brk等于Address of bss segment in memory after it is loaded. (ex)
173  retval等于Finalizes the stack vm_area_struct. The flags and permissions are updated,* the stack is optionally relocated, and some extra space is added.
174  如果retval小于0则返回:retval
177  stall the new credentials for this executable
179  如果N_MAGIC(ex)恒等于Code indicating object file or impure executable.
183  text_addr等于Address of text segment in memory after it is loaded. (ex)
189  pos等于32
190  map_size等于 length of text, in bytes length of data, in bytes
192  error等于vm_brk(text_addr & PAGE_MASK, map_size)
193  如果error则返回:error
196  error等于read_code(file, text_addr, pos, length of text, in bytes + length of data, in bytes )
198  如果error小于0则返回:error
200  否则
207  如果fd_offset按位与PAGE_MASK的反的值不等于0且printk_ratelimit()则
214  如果非mmapfd_offset按位与PAGE_MASK的反的值不等于0则
216  如果error则返回:error
221  转到:beyond_if
224  error等于vm_mmap(file, Address of text segment in memory after it is loaded. (ex), length of text, in bytes , page can be read | page can be executed , Interpret addr exactly | Changes are private | ETXTBSY | mark it as an executable , fd_offset)
229  如果error不等于Address of text segment in memory after it is loaded. (ex)则返回:error
232  error等于vm_mmap(file, N_DATADDR(ex), length of data, in bytes , page can be read | page can be written | page can be executed , Interpret addr exactly | Changes are private | ETXTBSY | mark it as an executable , fd_offset + length of text, in bytes )
236  如果error不等于N_DATADDR(ex)则返回:error
239  beyond_if :
240  set_binfmt( & aout_format)
242  retval等于set_brk(start_brk, brk)
243  如果retval小于0则返回:retval
246  start_stack等于reate_aout_tables() parses the env- and arg-strings in new user* memory and creates the pointer tables from them, and puts their* addresses on the "stack", returning the new stack pointer value.
251  Runs immediately before start_thread() takes over.
252  start_thread(regs, start address , start_stack)
253  返回:0