函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:he loader itself

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

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
135  struct file * interp_file = NULL
137  fd_binary等于负1
139  retval等于负ENOEXEC
140  如果非enabled则返回:retval
144  read_lock( & entries_lock)
145  fmt等于Check if we support the binfmt* if we do, return the node, else NULL* locking is done in load_misc_binary
146  如果fmt获得目录项引用
148  read_unlock( & entries_lock)
149  如果非fmt则返回:retval
153  retval等于负ENOENT
154  如果interp_flags按位与BINPRM_FLAGS_PATH_INACCESSIBLE则转到:ret
157  如果非 type, status, etc. 按位与MISC_FMT_PRESERVE_ARGV0的值则
158  retval等于Arguments are '\0' separated strings found at the location bprm->p* points to; chop off the first by relocating brpm->p to right after* the first '\0' encountered.
159  如果retval则转到:ret
163  如果 type, status, etc. 按位与MISC_FMT_OPEN_BINARY
169  fd_binary等于get_unused_fd_flags(0)
170  如果fd_binary小于0则
171  retval等于fd_binary
172  转到:ret
174  fd_install(fd_binary, file)
178  would_dump(bprm, file)
180  allow_write_access(file)
181  file = NULL
184  interp_flags或等于BINPRM_FLAGS_EXECFD
185  interp_data等于fd_binary
187  否则
188  allow_write_access(file)
189  fput(file)
190  file = NULL
193  retval等于Like copy_strings, but get argv and its values from kernel memory.
194  如果retval小于0则转到:error
196  argc自加
199  retval等于Like copy_strings, but get argv and its values from kernel memory.
200  如果retval小于0则转到:error
202  argc自加
205  retval等于bprm_change_interp( filename of interpreter , bprm)
206  如果retval小于0则转到:error
209  如果 type, status, etc. 按位与MISC_FMT_OPEN_FILE
210  interp_file等于file_clone_open(interp_file)
211  如果非是错误deny_write_access(interp_file)
213  否则
214  interp_file等于open_exec( filename of interpreter )
216  retval等于错误
217  如果是错误则转到:error
220  file等于interp_file
221  如果 type, status, etc. 按位与MISC_FMT_CREDENTIALS
222  pos等于0
228  memset(buf, 0, sizeof(linux_binprm->buf) )
229  retval等于kernel_read(file, buf, sizeof(linux_binprm->buf) , & pos)
231  否则retval等于Fill the binprm structure from the inode.* Check permissions, then read the first BINPRM_BUF_SIZE bytes* This may be called multiple times for binary chains (scripts for example).
234  如果retval小于0则转到:error
237  retval等于ycle the list of binary formats handler, until one recognizes the image
238  如果retval小于0则转到:error
241  ret :
242  dput - release a dentry*@dentry: dentry to release * Release a dentry. This will drop the usage count and if appropriate* call the dentry unlink method as well as removing it from the queues and* releasing its resources
243  返回:retval
244  error :
245  如果fd_binary大于0则In contrast to sys_close(), this stub does not check whether the syscall* should or should not be restarted, but returns the raw error codes from* __close_fd().
247  interp_flags等于0
248  interp_data等于0
249  转到:ret