Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kasan_module_alloc

Proto:int kasan_module_alloc(void *addr, size_t size)

Type:int

Parameter:

TypeParameterName
void *addr
size_tsize
604  shadow_start = kasan_mem_to_shadow(addr)
605  scaled_size = size + KASAN_SHADOW_MASK >> KASAN_SHADOW_SCALE_SHIFT
606  shadow_size = und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(scaled_size, PAGE_SIZE)
608  If WARN_ON(!st whether an address (unsigned long or pointer) is aligned to PAGE_SIZE (shadow_start)) Then Return -EINVAL
611  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
617  If ret Then
618  __memset(ret, KASAN_SHADOW_INIT, shadow_size)
619  flags |= has allocated kasan shadow memory
620  kmemleak_ignore(ret)
621  Return 0
624  Return -ENOMEM