函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:14:01 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:check_helper_call
函数原型:static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn_idx)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
int | func_id | |
int | insn_idx |
4182 | const struct bpf_func_proto * fn = NULL |
4189 | 如果func_id小于0或func_id大于等于__BPF_FUNC_MAX_ID则 |
4197 | 如果非fn则 |
4204 | 如果非 Is filter GPL compatible? 且gpl_only则 |
4206 | 返回:负EINVAL |
4211 | 如果changes_data且arg1_type不等于pointer to context 则 |
4212 | verbose(env, "kernel subsystem misconfigured func %s#%d: r1 != ctx\n", func_id_name(func_id), func_id) |
4214 | 返回:负EINVAL |
4218 | pkt_access等于pkt_access |
4220 | err等于check_func_proto(fn, func_id) |
4221 | 如果err则 |
4222 | verbose(env, "kernel subsystem misconfigured func %s#%d\n", func_id_name(func_id), func_id) |
4224 | 返回:err |
4230 | err等于btf_resolve_helper_id( & log, fn, i) |
4249 | 以i小于access_size循环 |
4256 | 如果func_id恒等于BPF_FUNC_tail_call则 |
4257 | err等于check_reference_leak(env) |
4258 | 如果err则 |
4263 | err等于The pointer with the specified id has released its reference to kernel* resources. Identify all copies of the same pointer and clear the reference. |
4264 | 如果err则 |
4283 | 以i小于CALLER_SAVED_REGS循环 |
4284 | mark_reg_not_init(env, regs, caller_saved[i]) |
4285 | check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK) |
4292 | 如果ret_type恒等于RET_INTEGER则 |
4294 | mark_reg_unknown(env, regs, BPF_REG_0) |
4297 | 否则如果ret_type恒等于RET_PTR_TO_MAP_VALUE_OR_NULL或ret_type恒等于RET_PTR_TO_MAP_VALUE则 |
4300 | mark_reg_known_zero(env, regs, BPF_REG_0) |
4305 | 如果(map_ptr == NULL)则 |
4311 | 如果ret_type恒等于RET_PTR_TO_MAP_VALUE则 |
4315 | 否则 |
4319 | 否则如果ret_type恒等于RET_PTR_TO_SOCKET_OR_NULL则 |
4320 | mark_reg_known_zero(env, regs, BPF_REG_0) |
4323 | 否则如果ret_type恒等于RET_PTR_TO_SOCK_COMMON_OR_NULL则 |
4324 | mark_reg_known_zero(env, regs, BPF_REG_0) |
4327 | 否则如果ret_type恒等于RET_PTR_TO_TCP_SOCK_OR_NULL则 |
4328 | mark_reg_known_zero(env, regs, BPF_REG_0) |
4331 | 否则 |
4332 | verbose(env, "unknown return type %d of func %s#%d\n", ret_type, func_id_name(func_id), func_id) |
4334 | 返回:负EINVAL |
4337 | 如果is_ptr_cast_function(func_id)则 |
4340 | 否则如果is_acquire_function(func_id)则 |
4351 | do_refine_retval_range(regs, ret_type, func_id, & meta) |
4353 | err等于check_map_func_compatibility(env, map_ptr, func_id) |
4357 | 如果func_id恒等于BPF_FUNC_get_stack且非 callchain buffer allocated? 则 |
4364 | err等于负Operation is not supported |
4365 | err_str等于"func %s#%d not supported without CONFIG_PERF_EVENTS\n" |
4367 | 如果err则 |
4372 | callchain buffer allocated? = true |
4375 | 如果changes_data则clear_all_pkt_pointers(env) |
4377 | 返回:0 |
名称 | 描述 |
---|---|
do_check |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |