Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sys.c Create Date:2022-07-28 09:21:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static int validate_prctl_map_addr(struct prctl_mm_map *prctl_map)

Type:int

Parameter:

TypeParameterName
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  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(offsets) cycle
1906  val = *(prctl_map + offsets[i])
1908  If val >= mmap_max_addr || val < mmap_min_addr Then Go to 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  If error Then Go to out
1928  error = -EINVAL
1933  If heap for brk() syscall <= end_data || brk <= end_data Then Go to out
1940  If check_data_rlimit(rlimit(RLIMIT_DATA), brk, heap for brk() syscall , end_data, data section bounds ) Then Go to out
1945  error = 0
1946  out :
1947  Return error
Caller
NameDescribe
prctl_set_mm