Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-28 12:56:09
Last Modify:2022-05-19 20:02:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_reference_state()

Proto:static int realloc_reference_state(struct bpf_func_state *state, int size, bool copy_old)

Type:int

Parameter:

TypeParameterName
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  If size <= old_size || Not size Then
649  If copy_old Then Return 0
649  The following fields should be last. See copy_func_state() = slot * 1
649  If Not size && old_size Then
649  kfree(refs)
649  refs = NULL
649  Return 0
649  new_refs = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
649  If Not new_refs Then Return -ENOMEM
649  If copy_old Then
649  If refs Then gcc 内建函数 需要声明
649  __builtin_memset(new_refs + old_size / 1, 0, size of 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  Return 0
Caller
NameDescribe
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