函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:reate_flat_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", recording the new stack pointer value.

函数原型:static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start)

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
unsigned longarg_start
125  __userp
126  __usersp
129  p等于arg_start
130  sp等于start_stack
132  sp减等于envc加1
133  sp减等于argc加1
134  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK)则sp减等于2
136  sp减等于1
138  start_stack等于sp按位与负User data (stack) also needs to be aligned.* Here we can be a bit looser than the data sections since this* needs to only meet arch ABI requirements.
139  sp等于start_stack
141  __put_user - Write a simple value into user space, with less checking(argc, sp++)
142  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK)则
144  argv等于sp加2
145  envp等于sp加2加argc加1
146  __put_user - Write a simple value into user space, with less checking(argv, sp++)
147  __put_user - Write a simple value into user space, with less checking(envp, sp++)
150  arg_start等于p
151 i大于0循环
152  __put_user - Write a simple value into user space, with less checking((unsignedlong)p, sp++)
153  len等于用户字符串长度
154  如果非lenlen大于These are the maximum length and maximum number of strings passed to the* execve() system call. MAX_ARG_STRLEN is essentially random but serves to* prevent the kernel from being unduly impacted by misaddressed pointers.则返回:负EINVAL
156  p加等于len
158  __put_user - Write a simple value into user space, with less checking(0, sp++)
159  arg_end等于p
161  env_start等于p
162 i大于0循环
163  __put_user - Write a simple value into user space, with less checking((unsignedlong)p, sp++)
164  len等于用户字符串长度
165  如果非lenlen大于These are the maximum length and maximum number of strings passed to the* execve() system call. MAX_ARG_STRLEN is essentially random but serves to* prevent the kernel from being unduly impacted by misaddressed pointers.则返回:负EINVAL
167  p加等于len
169  __put_user - Write a simple value into user space, with less checking(0, sp++)
170  env_end等于p
172  返回:0
调用者
名称描述
load_flat_binaryThese are the functions used to load flat style executables and shared* libraries. There is no binary dependent code anywhere else.