函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int validate_prctl_map_addr(struct prctl_mm_map *prctl_map)

返回类型:int

参数:

类型参数名称
struct prctl_mm_map *prctl_map
1884  mmap_max_addr等于TASK_SIZE
1885  error等于负EINVAL
1887  static const unsigned char offsets[] = {offsetof(structprctl_mm_map, start_code), offsetof(structprctl_mm_map, end_code), offsetof(structprctl_mm_map, start_data), offsetof(structprctl_mm_map, end_data), offsetof(structprctl_mm_map, start_brk), offsetof(structprctl_mm_map, brk), offsetof(structprctl_mm_map, start_stack), offsetof(structprctl_mm_map, arg_start), offsetof(structprctl_mm_map, arg_end), offsetof(structprctl_mm_map, env_start), offsetof(structprctl_mm_map, env_end), }
1905 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(offsets)循环
1906  val等于*prctl_mapoffsets[i]的和
1908  如果val大于等于mmap_max_addrval小于mmap_min_addr则转到:out
1919  error等于Make sure the pairs are ordered.(start_code, < , end_code)
1920  error或等于Make sure the pairs are ordered.(start_data, <= , end_data)
1921  error或等于Make sure the pairs are ordered.(start_brk, <= , brk)
1922  error或等于Make sure the pairs are ordered.(arg_start, <= , arg_end)
1923  error或等于Make sure the pairs are ordered.(env_start, <= , env_end)
1924  如果error则转到:out
1928  error等于负EINVAL
1933  如果heap for brk() syscall 小于等于end_databrk小于等于end_data则转到:out
1940  如果check_data_rlimit(rlimit(RLIMIT_DATA), brk, heap for brk() syscall , end_data, data section bounds )则转到:out
1945  error等于0
1946  out :
1947  返回:error
调用者
名称描述
prctl_set_mm