函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:starting from main bpf function walk all instructions of the function* and recursively walk all callees that given function can call

函数原型:static int check_max_stack_depth(struct bpf_verifier_env *env)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
2670  depth等于0, frame等于0, idx等于0, i等于0
2671  subprog等于subprog_info
2672  insn等于insnsi
2676  process_func :
2680  depth加等于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.(max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, max. stack depth used by this function , 1), 32)
2681  如果depth大于BPF program can access up to 512 bytes of stack space.
2682  verbose(env, "combined stack size of %d calls is %d. Too large\n", frame + 1, depth)
2684  返回:负EACCES
2686  continue_func :
2687  subprog_end等于 insn idx of function entry point
2688 i小于subprog_end循环
2689  如果 opcode 不等于BPF_JMP按位或unction call 的值则继续下一循环
2691  如果 source register 不等于when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function则继续下一循环
2694  ret_insn[frame]等于i加1
2695  ret_prog[frame]等于idx
2698  i等于i signed immediate constant 加1
2699  idx等于find_subprog(env, i)
2700  如果idx小于0则
2701  WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", i)
2703  返回:负EFAULT
2705  frame自加
2706  如果frame大于等于MAX_CALL_FRAMES
2707  verbose(env, "the call stack of %d frames is too deep !\n", frame)
2709  返回:负E2BIG
2711  转到:process_func
2716  如果frame恒等于0则返回:0
2718  depth减等于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.(max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, max. stack depth used by this function , 1), 32)
2719  frame自减
2720  i等于ret_insn[frame]
2721  idx等于ret_prog[frame]
2722  转到:continue_func
调用者
名称描述
bpf_check