函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:load_script

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

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
42  如果buf[0]不等于'#'或buf[1]不等于'!'则返回:负ENOEXEC
51  如果interp_flags按位与BINPRM_FLAGS_PATH_INACCESSIBLE则返回:负ENOENT
55  allow_write_access(file)
56  fput(file)
57  file = NULL
73  buf_end等于bufbuf的长度减1
74  cp等于在字符串中查找字符
75  如果非cp
76  cp等于next_non_spacetab(buf + 2, buf_end)
77  如果非cp则返回:负ENOEXEC
83  如果非next_terminator(cp, buf_end)则返回:负ENOEXEC
85  cp等于buf_end
88  cp等于'\0'
89 cp大于buf循环
90  cp自减
91  如果cp恒等于' '或cp恒等于'\t'则cp等于'\0'
93  否则退出
96 cp恒等于' '或cp恒等于'\t'循环如果cp恒等于'\0'则
98  返回:负ENOEXEC
99  i_name等于cp
100  i_arg = NULL
101 cpcp不等于' '且cp不等于'\t'循环cp恒等于' '或cp恒等于'\t'循环
104  cp自加等于'\0'
105  如果cpi_arg等于cp
117  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.
118  如果retval则返回:retval
120  retval等于Like copy_strings, but get argv and its values from kernel memory.
121  如果retval小于0则返回:retval
123  argc自加
124  如果i_arg
125  retval等于Like copy_strings, but get argv and its values from kernel memory.
126  如果retval小于0则返回:retval
128  argc自加
130  retval等于Like copy_strings, but get argv and its values from kernel memory.
131  如果retval则返回:retval
133  argc自加
134  retval等于bprm_change_interp(i_name, bprm)
135  如果retval小于0则返回:retval
141  file等于open_exec(i_name)
142  如果是错误则返回:错误
145  file等于file
146  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).
147  如果retval小于0则返回:retval
149  返回:ycle the list of binary formats handler, until one recognizes the image