函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:verbose

函数原型:__printf(2, 3) static void verbose(void *private_data, const char *fmt, ...)

返回类型:void

参数:

类型参数名称
void *private_data
const char *fmt
305  env等于private_data
308  如果非bpf_verifier_log_needed( & log)则返回
311  va_start(args, fmt)
312  bpf_verifier_vlog( & log, fmt, args)
313  va_end(args)
调用者
名称描述
verbose_linfo
print_liveness
print_verifier_state
push_stack
mark_reg_known_zero
mark_reg_unknown
mark_reg_not_init
add_subprog
check_subprogs
mark_reg_readParentage chain of this register (or stack slot) should take care of all* issues like callee-saved registers, stack slot allocation time, etc.
check_reg_arg
backtrack_insnFor given verifier state backtrack_insn() is called from the last insn to* the first insn. Its purpose is to compute a bitmask of registers and* stack slots that needs precision in the parent verifier state.
__mark_chain_precision
check_stack_writeheck_stack_read/write functions track spill/fill of registers,* stack boundary and alignment are checked in check_mem_access()
check_stack_read
check_stack_access
check_map_access_type
__check_map_accessheck read/write into map element returned by bpf_map_lookup_elem()
check_map_accessheck read/write into a map element with possible variable offset
__check_packet_access
check_packet_access
check_ctx_accessheck access to 'struct bpf_context' fields. Supports fixed offsets only
check_flow_keys_access
check_sock_access
check_pkt_ptr_alignment
check_generic_ptr_alignment
check_max_stack_depthstarting from main bpf function walk all instructions of the function* and recursively walk all callees that given function can call
check_ctx_reg
check_tp_buffer_access
check_ptr_to_btf_access
check_mem_accessheck whether memory at (regno + off) is accessible for t = (read | write)* if t==write, value_regno is a register which value is stored into memory* if t==read, value_regno is a register which will receive the value from memory* if t==write &&
check_xadd
__check_stack_boundary
check_stack_boundarywhen register 'regno' is passed into function that will read 'access_size'* bytes from that pointer, make sure that it's within stack boundary* and all elements of stack are initialized
process_spin_lockImplementation details:* bpf_map_lookup returns PTR_TO_MAP_VALUE_OR_NULL* Two bpf_map_lookups (even with the same key) will have different reg->id
check_func_arg
check_map_func_compatibility
check_func_call
prepare_func_exit
record_func_map
record_func_key
check_reference_leak
check_helper_call
check_reg_sane_offset
adjust_ptr_min_max_valsHandles arithmetic on a pointer and a scalar: computes new min/max and var_off.* Caller should also handle BPF_MOV case separately.* If we return -EACCES, caller may want to try again treating pointer as a* scalar
adjust_scalar_min_max_valsWARNING: This function does calculations on 64-bit values, but the actual* execution may occur on 32-bit values. Therefore, things like bitshifts* need extra checks in the 32-bit case.
adjust_reg_min_max_valsHandles ALU ops other than BPF_END, BPF_NEG and BPF_MOV: computes new min/max* and var_off.
check_alu_opheck validity of 32-bit and 64-bit arithmetic operations
check_cond_jmp_op
check_ld_immverify BPF_LD_IMM64 instruction
check_ld_absverify safety of LD_ABS|LD_IND instructions:* - they can only appear in the programs where ctx == skb* - since they are wrappers of function calls, they scratch R1-R5 registers,* preserve R6-R9, and store return value into R0* Implicit input:* ctx == skb
check_return_code
push_insn, w, e - match pseudo-code above:
check_cfg-recursive depth-first-search to detect loops in BPF program* loop == back-edge in directed graph
check_btf_func
check_btf_line
propagate_precisiond precise scalars in the previous equivalent state and* propagate them into the current state
is_state_visited
do_check
check_map_prog_compatibility
replace_map_fd_with_map_ptrlook for pseudo eBPF instructions that access map FDs and* replace them with actual map pointers
bpf_patch_insn_data
convert_ctx_accessesvert load instructions that access fields of a context type into a* sequence of instructions that access fields of the underlying structure:* struct __sk_buff -> struct sk_buff* struct bpf_sock_ops -> struct sock
jit_subprogs
fixup_bpf_callsxup insn->imm field of bpf_call instructions* and inline eligible helpers as explicit sequence of BPF instructions* this function is called after eBPF program passed verification
print_verification_stats
check_attach_btf_id
bpf_check