函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_func_call

函数原型:static int check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
struct bpf_insn *insn
int *insn_idx
3951  state等于current verifier state
3955  如果curframe加1大于等于MAX_CALL_FRAMES
3956  verbose(env, "the call stack of %d frames is too deep\n", curframe + 2)
3958  返回:负E2BIG
3961  target_insn等于insn_idx signed immediate constant
3962  subprog等于find_subprog(env, target_insn + 1)
3963  如果subprog小于0则
3964  verbose(env, "verifier bug. No program starts at insn %d\n", target_insn + 1)
3966  返回:负EFAULT
3969  caller等于 call stack tracking [curframe]
3970  如果 call stack tracking [curframe + 1]则
3971  verbose(env, "verifier bug. Frame %d already allocated\n", curframe + 1)
3973  返回:负EFAULT
3976  callee等于分配内存并置零
3977  如果非callee则返回:负ENOMEM
3979  call stack tracking [curframe + 1]等于callee
3985  init_func_state(env, callee, * insn_idx, curframe + 1, subprog)
3992  err等于transfer_reference_state(callee, caller)
3993  如果err则返回:err
3999 i小于等于BPF_REG_5循环regs[i]等于regs[i]
4003 i小于CALLER_SAVED_REGS循环
4004  mark_reg_not_init(env, regs, caller_saved[i])
4005  check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK)
4009  curframe自加
4011  如果btf_check_func_arg_match(env, subprog)则返回:负EINVAL
4015  insn_idx等于target_insn
4017  如果level按位与BPF_LOG_LEVEL
4018  verbose(env, "caller:\n")
4019  print_verifier_state(env, caller)
4020  verbose(env, "callee:\n")
4021  print_verifier_state(env, callee)
4023  返回:0
调用者
名称描述
do_check