Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:starting from main bpf function walk all instructions of the function* and recursively walk all callees that given function can call

Proto:static int check_max_stack_depth(struct bpf_verifier_env *env)

Type:int

Parameter:

TypeParameterName
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  If depth > BPF program can access up to 512 bytes of stack space. Then
2682  verbose(env, "combined stack size of %d calls is %d. Too large\n", frame + 1, depth)
2684  Return -EACCES
2686  continue_func :
2687  subprog_end = insn idx of function entry point
2688  When i < subprog_end cycle
2689  If opcode != (BPF_JMP | unction call ) Then Continue
2691  If source register != when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function Then Continue
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  If idx < 0 Then
2701  WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", i)
2703  Return -EFAULT
2705  frame++
2706  If frame >= MAX_CALL_FRAMES Then
2707  verbose(env, "the call stack of %d frames is too deep !\n", frame)
2709  Return -E2BIG
2711  Go to process_func
2716  If frame == 0 Then Return 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  Go to continue_func
Caller
NameDescribe
bpf_check