Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\sys_x86_64.c Create Date:2022-07-28 07:42:14
Last Modify:2022-05-18 16:45:21 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:arch_get_unmapped_area_topdown

Proto:unsigned long arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags)

Type:unsigned long

Parameter:

TypeParameterName
struct file *filp
const unsigned longaddr0
const unsigned longlen
const unsigned longpgoff
const unsigned longflags
179  mm = mm
180  addr = addr0
183  addr = mpx_unmapped_area_check(addr, len, flags)
184  If IS_ERR_VALUE(addr) Then Return addr
188  If len > TASK_SIZE Then Return -ENOMEM
192  If flags & Interpret addr exactly Then Return addr
196  If Not in_32bit_syscall() && flags & ly give out 32bit addresses Then Go to bottomup
200  If addr Then
201  addr &= PAGE_MASK
202  If Not mmap_address_hint_valid(addr, len) Then Go to get_unmapped_area
205  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
206  If Not vma || addr + len <= vm_start_gap(vma) Then Return addr
209  get_unmapped_area :
211  flags = VM_UNMAPPED_AREA_TOPDOWN
212  length = len
213  low_limit = PAGE_SIZE
214  high_limit = get_mmap_base(0)
223  If addr > DEFAULT_MAP_WINDOW && Not in_32bit_syscall() Then high_limit += TASK_SIZE_MAX - DEFAULT_MAP_WINDOW
226  align_mask = 0
227  align_offset = pgoff << PAGE_SHIFT determines the page size
228  If filp Then
229  align_mask = Align a virtual address to avoid aliasing in the I$ on AMD F15h.
230  align_offset += To avoid aliasing in the I$ on AMD F15h, the bits defined by the* va_align.bits, [12:upper_bit), are set to a random value instead of* zeroing them. This random value is computed once per boot. This form* of ASLR is known as "per-boot ASLR".
232  addr = Search for an unmapped address range
233  If Not (addr & ~PAGE_MASK) Then Return addr
235  VM_BUG_ON(addr != - ENOMEM)
237  bottomup :
244  Return arch_get_unmapped_area(filp, addr0, len, pgoff, flags)