Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Parse build ID of ELF file mapped to vma

Proto:static int stack_map_get_build_id(struct vm_area_struct *vma, unsigned char *build_id)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned char *build_id
253  If Not File we map to (can be NULL). Then Return -EINVAL
256  page = d_get_page - find and get a page reference*@mapping: the address_space to search*@offset: the page index* Looks up the page cache slot at @mapping & @offset. If there is a* page cache page, it is returned with an increased refcount.
257  If Not page Then Return -EFAULT
260  ret = -EINVAL
261  page_addr = kmap_atomic(page)
262  ehdr = page_addr
265  If memcmp(e_ident, ELFMAG, SELFMAG) != 0 Then Go to out
269  If e_type != ET_EXEC && e_type != ET_DYN Then Go to out
272  If e_ident[EI_CLASS] == ELFCLASS32 Then ret = Parse build ID from 32-bit ELF
274  Else if e_ident[EI_CLASS] == ELFCLASS64 Then ret = Parse build ID from 64-bit ELF
276  out :
277  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(page_addr)
278  put_page(page)
279  Return ret
Caller
NameDescribe
stack_map_get_build_id_offset