函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:, w, e - match pseudo-code above:

函数原型:static int push_insn(int t, int w, int e, struct bpf_verifier_env *env, bool loop_ok)

返回类型:int

参数:

类型参数名称
intt index of current instruction
intw next instruction
inte edge
struct bpf_verifier_env *env
boolloop_ok
6489  insn_stack等于insn_stack
6490  insn_state等于insn_state
6492  如果 edge恒等于FALLTHROUGHinsn_state[ index of current instruction]大于等于DISCOVERED按位或FALLTHROUGH的值则返回:0
6495  如果 edge恒等于BRANCHinsn_state[ index of current instruction]大于等于DISCOVERED按位或BRANCH的值则返回:0
6498  如果 next instruction小于0或 next instruction大于等于 Number of filter blocks
6499  verbose_linfo(env, index of current instruction, "%d: ", index of current instruction)
6500  verbose(env, "jump out of range from insn %d to %d\n", index of current instruction, next instruction)
6501  返回:负EINVAL
6504  如果 edge恒等于BRANCHinit_explored_state(env, next instruction)
6508  如果insn_state[ next instruction]恒等于0则
6510  insn_state[ index of current instruction]等于DISCOVERED按位或 edge
6511  insn_state[ next instruction]等于DISCOVERED
6512  如果cur_stack大于等于 Number of filter blocks 则返回:负E2BIG
6514  insn_stack[cur_stack++]等于 next instruction
6515  返回:1
6516  否则如果insn_state[ next instruction]按位与0xF0的值恒等于DISCOVERED
6517  如果loop_okallow_ptr_leaks则返回:0
6519  verbose_linfo(env, index of current instruction, "%d: ", index of current instruction)
6520  verbose_linfo(env, next instruction, "%d: ", next instruction)
6521  verbose(env, "back-edge from insn %d to %d\n", index of current instruction, next instruction)
6522  返回:负EINVAL
6523  否则如果insn_state[ next instruction]恒等于EXPLORED
6525  insn_state[ index of current instruction]等于DISCOVERED按位或 edge
6526  否则
6527  verbose(env, "insn state internal bug\n")
6528  返回:负EFAULT
6530  返回:0
调用者
名称描述
check_cfg-recursive depth-first-search to detect loops in BPF program* loop == back-edge in directed graph