函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_verifier_state

函数原型:static int copy_verifier_state(struct bpf_verifier_state *dst_state, const struct bpf_verifier_state *src)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_state *dst_state
const struct bpf_verifier_state *src
775  jmp_sz等于sizeof(structbpf_idx_pair)乘jmp_history_cnt
778  如果jmp_history_cnt小于jmp_history_cnt
779  kfree( jmp history recorded from first to last. * backtracking is using it to go from last to first. * For most states jmp_history_cnt is [0-3]. * For loops can go up to ~40.)
780  jmp history recorded from first to last. * backtracking is using it to go from last to first. * For most states jmp_history_cnt is [0-3]. * For loops can go up to ~40.等于开辟内存
781  如果非 jmp history recorded from first to last. * backtracking is using it to go from last to first. * For most states jmp_history_cnt is [0-3]. * For loops can go up to ~40.则返回:负ENOMEM
784  内存复制( jmp history recorded from first to last. * backtracking is using it to go from last to first. * For most states jmp_history_cnt is [0-3]. * For loops can go up to ~40., jmp history recorded from first to last. * backtracking is using it to go from last to first. * For most states jmp_history_cnt is [0-3]. * For loops can go up to ~40., jmp_sz)
785  jmp_history_cnt等于jmp_history_cnt
788 i小于等于curframe循环
789  free_func_state( call stack tracking [i])
790  call stack tracking [i] = NULL
792  speculative等于speculative
793  curframe等于curframe
794  active_spin_lock等于active_spin_lock
795  * 'branches' field is the number of branches left to explore: * 0 - all possible paths from this state reached bpf_exit or * were safely pruned * 1 - at least one path is being explored. * This state hasn't reached bpf_exit * 2 - at least two paths are bei等于* 'branches' field is the number of branches left to explore: * 0 - all possible paths from this state reached bpf_exit or * were safely pruned * 1 - at least one path is being explored. * This state hasn't reached bpf_exit * 2 - at least two paths are bei
796  parent等于parent
797  first and last insn idx of this verifier state 等于 first and last insn idx of this verifier state
798  last_insn_idx等于last_insn_idx
799 i小于等于curframe循环
800  dst等于 call stack tracking [i]
801  如果非dst
803  如果非dst则返回:负ENOMEM
807  err等于py verifier state from src to dst growing dst stack space* when necessary to accommodate larger src stack
808  如果err则返回:err
811  返回:0
调用者
名称描述
pop_stack
push_stack
is_state_visited