函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-27 14:09:26
Last Modify:2022-05-19 20:02:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alloc_reference_state()

函数原型:static int realloc_reference_state(struct bpf_func_state *state, int size, bool copy_old)

返回类型:int

参数:

类型参数名称
struct bpf_func_state *state
intsize
boolcopy_old
649  old_size等于The following fields should be last. See copy_func_state()
649  slot等于size除1
649  如果size小于等于old_size或非size
649  如果copy_old则返回:0
649  The following fields should be last. See copy_func_state() 等于slot乘1
649  如果非sizeold_size
649  kfree(refs)
649  refs = NULL
649  返回:0
649  new_refs等于分配数组内存
649  如果非new_refs则返回:负ENOMEM
649  如果copy_old
649  如果refsgcc 内建函数 需要声明
649  __builtin_memset(new_refs + old_size / 1, 0, new_refs的长度 * (size - old_size) / 1)
649  The following fields should be last. See copy_func_state() 等于slot乘1
649  kfree(refs)
649  refs等于new_refs
649  返回:0
调用者
名称描述
realloc_func_statedo_check() starts with zero-sized stack in struct bpf_verifier_state to* make it consume minimal amount of memory
acquire_reference_stateAcquire a pointer id from the env and update the state->refs to include* this new pointer reference.* On success, returns a valid pointer id to associate with the register* On failure, returns a negative errno.
transfer_reference_state