Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:get_address_stack_frame_info

Proto:static bool __must_check get_address_stack_frame_info(const void *addr, unsigned long *offset, const char **frame_descr, const void **frame_pc)

Type:bool

Parameter:

TypeParameterName
const void *addr
unsigned long *offset
const char **frame_descr
const void **frame_pc
301  BUILD_BUG_ON - break compile if a condition is true(IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_STACK_GROWSUP))
307  If Not object_is_on_stack(addr) Then Return false
310  aligned_addr = und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.((unsignedlong)addr, sizeof(long))
311  mem_ptr = und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.(aligned_addr, KASAN_SHADOW_SCALE_SIZE)
312  shadow_ptr = kasan_mem_to_shadow((void * )aligned_addr)
313  shadow_bottom = kasan_mem_to_shadow(Return the address of the last usable long on the stack.* When the stack grows down, this is just above the thread* info struct. Going any lower will corrupt the threadinfo.* When the stack grows up, this is the highest address.)
315  When shadow_ptr >= shadow_bottom && shadow_ptr != Stack redzone shadow values* (Those are compiler's ABI, don't change them) cycle
316  shadow_ptr--
317  mem_ptr -= KASAN_SHADOW_SCALE_SIZE
320  When shadow_ptr >= shadow_bottom && shadow_ptr == Stack redzone shadow values* (Those are compiler's ABI, don't change them) cycle
321  shadow_ptr--
322  mem_ptr -= KASAN_SHADOW_SCALE_SIZE
325  If shadow_ptr < shadow_bottom Then Return false
328  frame = mem_ptr + KASAN_SHADOW_SCALE_SIZE
329  If frame[0] != Stack frame marker (compiler ABI). Then
330  pr_err("KASAN internal error: frame info validation failed; invalid marker: %lu\n", frame[0])
332  Return false
335  offset = addr - frame
336  frame_descr = frame[1]
337  frame_pc = frame[2]
339  Return true
Caller
NameDescribe
print_address_stack_frame