函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sys.c Create Date:2022-07-27 10:21:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:prctl_set_mm

函数原型:static int prctl_set_mm(int opt, unsigned long addr, unsigned long arg4, unsigned long arg5)

返回类型:int

参数:

类型参数名称
intopt
unsigned longaddr
unsigned longarg4
unsigned longarg5
2089  mm等于mm
2090  struct prctl_mm_map prctl_map = {auxiliary vector = NULL, vector size = 0, /proc/$pid/exe link file = - 1, }
2098  如果arg5arg4opt不等于PR_SET_MM_AUXVopt不等于PR_SET_MM_MAPopt不等于PR_SET_MM_MAP_SIZE则返回:负EINVAL
2108  如果非操作权限检查则返回:负EPERM
2111  如果opt恒等于PR_SET_MM_EXE_FILE则返回:prctl_set_mm_exe_file(mm, (unsignedint)addr)
2114  如果opt恒等于PR_SET_MM_AUXV则返回:prctl_set_auxv(mm, addr, arg4)
2117  如果addr大于等于TASK_SIZEaddr小于mmap_min_addr则返回:负EINVAL
2120  error等于负EINVAL
2127  lock for reading
2128  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
2130  加自旋锁
2131  code section bounds 等于start_code
2132  end_code等于end_code
2133  data section bounds 等于start_data
2134  end_data等于end_data
2135  heap for brk() syscall 等于start_brk
2136  brk等于brk
2137  stack starts at 等于start_stack
2138  command line arguments bounds 等于arg_start
2139  arg_end等于arg_end
2140  vironment variables bounds 等于env_start
2141  env_end等于env_end
2144  :opt恒等于PR_SET_MM_START_CODE
2145  code section bounds 等于addr
2146  退出
2147  :opt恒等于PR_SET_MM_END_CODE
2148  end_code等于addr
2149  退出
2150  :opt恒等于PR_SET_MM_START_DATA
2151  data section bounds 等于addr
2152  退出
2153  :opt恒等于PR_SET_MM_END_DATA
2154  end_data等于addr
2155  退出
2156  :opt恒等于PR_SET_MM_START_STACK
2157  stack starts at 等于addr
2158  退出
2159  :opt恒等于PR_SET_MM_START_BRK
2160  heap for brk() syscall 等于addr
2161  退出
2162  :opt恒等于PR_SET_MM_BRK
2163  brk等于addr
2164  退出
2165  :opt恒等于PR_SET_MM_ARG_START
2166  command line arguments bounds 等于addr
2167  退出
2168  :opt恒等于PR_SET_MM_ARG_END
2169  arg_end等于addr
2170  退出
2171  :opt恒等于PR_SET_MM_ENV_START
2172  vironment variables bounds 等于addr
2173  退出
2174  :opt恒等于PR_SET_MM_ENV_END
2175  env_end等于addr
2176  退出
2177  默认
2178  转到:out
2181  error等于Check arithmetic relations of passed addresses.* WARNING: we don't require any capability here so be very careful* in what is allowed for modification from userspace.
2182  如果error则转到:out
2193  :opt恒等于PR_SET_MM_START_STACK
2194  :opt恒等于PR_SET_MM_ARG_START
2195  :opt恒等于PR_SET_MM_ARG_END
2196  :opt恒等于PR_SET_MM_ENV_START
2197  :opt恒等于PR_SET_MM_ENV_END
2198  如果非vma
2199  error等于负EFAULT
2200  转到:out
2204  start_code等于code section bounds
2205  end_code等于end_code
2206  start_data等于data section bounds
2207  end_data等于end_data
2208  start_brk等于heap for brk() syscall
2209  brk等于brk
2210  start_stack等于stack starts at
2211  arg_start等于command line arguments bounds
2212  arg_end等于arg_end
2213  env_start等于vironment variables bounds
2214  env_end等于env_end
2216  error等于0
2217  out :
2218  自旋锁解锁
2219  lease a read lock
2220  返回:error
调用者
名称描述
SYSCALL_DEFINE5