Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\kasan\common.c Create Date:2022-07-28 15:51:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kasan_mem_notifier

Proto:static int __meminit kasan_mem_notifier(struct notifier_block *nb, unsigned long action, void *data)

Type:int

Parameter:

TypeParameterName
struct notifier_block *nb
unsigned longaction
void *data
681  mem_data = data
685  nr_shadow_pages = nr_pages >> KASAN_SHADOW_SCALE_SHIFT
686  start_kaddr = pfn_to_kaddr(start_pfn)
687  shadow_start = kasan_mem_to_shadow((void * )start_kaddr)
688  shadow_size = nr_shadow_pages << PAGE_SHIFT determines the page size
689  shadow_end = shadow_start + shadow_size
691  If WARN_ON(nr_pages % KASAN_SHADOW_SCALE_SIZE) || WARN_ON(start_kaddr % (KASAN_SHADOW_SCALE_SIZE << PAGE_SHIFT determines the page size )) Then Return NOTIFY_BAD
696  Case action == MEM_GOING_ONLINE
704  If shadow_mapped(shadow_start) Then Return Suits me
707  ret = __vmalloc_node_range - allocate virtually contiguous memory*@size: allocation size*@align: desired alignment*@start: vm area range start*@end: vm area range end*@gfp_mask: flags for the page level allocator*@prot: protection mask for the allocated pages
712  If Not ret Then Return NOTIFY_BAD
715  kmemleak_ignore(ret)
716  Return Suits me
718  Case action == MEM_CANCEL_ONLINE
719  Case action == xposed to userspace
734  vm = d_vm_area - find a continuous kernel virtual area*@addr: base address* Search for the kernel VM area starting at @addr, and return it
735  If vm Then vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
740  Return Suits me