Lines Matching refs:bpf_verifier_env
272 find_linfo(const struct bpf_verifier_env *env, u32 insn_off) in find_linfo()
331 __printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env, in bpf_verifier_log_write()
347 struct bpf_verifier_env *env = private_data; in verbose()
379 __printf(3, 4) static void verbose_linfo(struct bpf_verifier_env *env, in verbose_linfo()
407 static void verbose_invalid_scalar(struct bpf_verifier_env *env, in verbose_invalid_scalar()
589 static void print_liveness(struct bpf_verifier_env *env, in print_liveness()
602 static struct bpf_func_state *func(struct bpf_verifier_env *env, in func()
615 static void print_verifier_state(struct bpf_verifier_env *env, in print_verifier_state()
850 static int acquire_reference_state(struct bpf_verifier_env *env, int insn_idx) in acquire_reference_state()
970 static void update_branch_counts(struct bpf_verifier_env *env, struct bpf_verifier_state *st) in update_branch_counts()
987 static int pop_stack(struct bpf_verifier_env *env, int *prev_insn_idx, in pop_stack()
1016 static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, in push_stack()
1069 static void __mark_reg_not_init(const struct bpf_verifier_env *env,
1121 static void mark_reg_known_zero(struct bpf_verifier_env *env, in mark_reg_known_zero()
1440 static void __mark_reg_unknown(const struct bpf_verifier_env *env, in __mark_reg_unknown()
1455 static void mark_reg_unknown(struct bpf_verifier_env *env, in mark_reg_unknown()
1468 static void __mark_reg_not_init(const struct bpf_verifier_env *env, in __mark_reg_not_init()
1475 static void mark_reg_not_init(struct bpf_verifier_env *env, in mark_reg_not_init()
1488 static void mark_btf_ld_reg(struct bpf_verifier_env *env, in mark_btf_ld_reg()
1504 static void init_reg_state(struct bpf_verifier_env *env, in init_reg_state()
1524 static void init_func_state(struct bpf_verifier_env *env, in init_func_state()
1535 static struct bpf_verifier_state *push_async_cb(struct bpf_verifier_env *env, in push_async_cb()
1594 static int find_subprog(struct bpf_verifier_env *env, int off) in find_subprog()
1606 static int add_subprog(struct bpf_verifier_env *env, int off) in add_subprog()
1663 static int add_kfunc_call(struct bpf_verifier_env *env, u32 func_id) in add_kfunc_call()
1789 static int add_subprog_and_kfunc(struct bpf_verifier_env *env) in add_subprog_and_kfunc()
1837 static int check_subprogs(struct bpf_verifier_env *env) in check_subprogs()
1889 static int mark_reg_read(struct bpf_verifier_env *env, in mark_reg_read()
1941 static bool is_reg64(struct bpf_verifier_env *env, struct bpf_insn *insn, in is_reg64()
2049 static bool insn_has_def32(struct bpf_verifier_env *env, struct bpf_insn *insn) in insn_has_def32()
2059 static void mark_insn_zext(struct bpf_verifier_env *env, in mark_insn_zext()
2072 static int check_reg_arg(struct bpf_verifier_env *env, u32 regno, in check_reg_arg()
2118 static int push_jmp_history(struct bpf_verifier_env *env, in push_jmp_history()
2167 static int backtrack_insn(struct bpf_verifier_env *env, int idx, in backtrack_insn()
2356 static void mark_all_scalars_precise(struct bpf_verifier_env *env, in mark_all_scalars_precise()
2386 static int __mark_chain_precision(struct bpf_verifier_env *env, int regno, in __mark_chain_precision()
2548 static int mark_chain_precision(struct bpf_verifier_env *env, int regno) in mark_chain_precision()
2553 static int mark_chain_precision_stack(struct bpf_verifier_env *env, int spi) in mark_chain_precision_stack()
2643 static int check_stack_write_fixed_off(struct bpf_verifier_env *env, in check_stack_write_fixed_off()
2767 static int check_stack_write_var_off(struct bpf_verifier_env *env, in check_stack_write_var_off()
2861 static void mark_reg_stack_read(struct bpf_verifier_env *env, in mark_reg_stack_read()
2912 static int check_stack_read_fixed_off(struct bpf_verifier_env *env, in check_stack_read_fixed_off()
2992 static int check_stack_range_initialized(struct bpf_verifier_env *env,
2998 static struct bpf_reg_state *reg_state(struct bpf_verifier_env *env, int regno) in reg_state()
3016 static int check_stack_read_var_off(struct bpf_verifier_env *env, in check_stack_read_var_off()
3047 static int check_stack_read(struct bpf_verifier_env *env, in check_stack_read()
3108 static int check_stack_write(struct bpf_verifier_env *env, in check_stack_write()
3131 static int check_map_access_type(struct bpf_verifier_env *env, u32 regno, in check_map_access_type()
3154 static int __check_mem_access(struct bpf_verifier_env *env, int regno, in __check_mem_access()
3190 static int check_mem_region_access(struct bpf_verifier_env *env, u32 regno, in check_mem_region_access()
3249 static int check_map_access(struct bpf_verifier_env *env, u32 regno, in check_map_access()
3296 static bool may_access_direct_pkt_data(struct bpf_verifier_env *env, in may_access_direct_pkt_data()
3338 static int check_packet_access(struct bpf_verifier_env *env, u32 regno, int off, in check_packet_access()
3381 static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, in check_ctx_access()
3417 static int check_flow_keys_access(struct bpf_verifier_env *env, int off, in check_flow_keys_access()
3429 static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, in check_sock_access()
3474 static bool is_pointer_value(struct bpf_verifier_env *env, int regno) in is_pointer_value()
3479 static bool is_ctx_reg(struct bpf_verifier_env *env, int regno) in is_ctx_reg()
3486 static bool is_sk_reg(struct bpf_verifier_env *env, int regno) in is_sk_reg()
3493 static bool is_pkt_reg(struct bpf_verifier_env *env, int regno) in is_pkt_reg()
3500 static bool is_flow_key_reg(struct bpf_verifier_env *env, int regno) in is_flow_key_reg()
3508 static int check_pkt_ptr_alignment(struct bpf_verifier_env *env, in check_pkt_ptr_alignment()
3543 static int check_generic_ptr_alignment(struct bpf_verifier_env *env, in check_generic_ptr_alignment()
3567 static int check_ptr_alignment(struct bpf_verifier_env *env, in check_ptr_alignment()
3620 static int update_stack_depth(struct bpf_verifier_env *env, in update_stack_depth()
3640 static int check_max_stack_depth(struct bpf_verifier_env *env) in check_max_stack_depth()
3749 static int get_callee_stack_depth(struct bpf_verifier_env *env, in get_callee_stack_depth()
3764 int check_ctx_reg(struct bpf_verifier_env *env, in check_ctx_reg()
3788 static int __check_buffer_access(struct bpf_verifier_env *env, in __check_buffer_access()
3812 static int check_tp_buffer_access(struct bpf_verifier_env *env, in check_tp_buffer_access()
3828 static int check_buffer_access(struct bpf_verifier_env *env, in check_buffer_access()
3920 static int check_ptr_to_btf_access(struct bpf_verifier_env *env, in check_ptr_to_btf_access()
3970 static int check_ptr_to_map_access(struct bpf_verifier_env *env, in check_ptr_to_map_access()
4053 struct bpf_verifier_env *env, in check_stack_access_within_bounds()
4117 static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, in check_mem_access()
4328 static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) in check_atomic()
4429 struct bpf_verifier_env *env, int regno, int off, in check_stack_range_initialized()
4555 static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, in check_helper_mem_access()
4610 int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, in check_mem_reg()
4652 static int process_spin_lock(struct bpf_verifier_env *env, int regno, in process_spin_lock()
4714 static int process_timer_func(struct bpf_verifier_env *env, int regno, in process_timer_func()
4796 static int resolve_map_arg_type(struct bpf_verifier_env *env, in resolve_map_arg_type()
4929 static int check_reg_type(struct bpf_verifier_env *env, u32 regno, in check_reg_type()
4987 static int check_func_arg(struct bpf_verifier_env *env, u32 arg, in check_func_arg()
5245 static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id) in may_update_sockmap()
5277 static bool allow_tail_call_in_subprogs(struct bpf_verifier_env *env) in allow_tail_call_in_subprogs()
5282 static int check_map_func_compatibility(struct bpf_verifier_env *env, in check_map_func_compatibility()
5593 static void __clear_all_pkt_pointers(struct bpf_verifier_env *env, in __clear_all_pkt_pointers()
5611 static void clear_all_pkt_pointers(struct bpf_verifier_env *env) in clear_all_pkt_pointers()
5646 static void release_reg_references(struct bpf_verifier_env *env, in release_reg_references()
5668 static int release_reference(struct bpf_verifier_env *env, in release_reference()
5685 static void clear_caller_saved_regs(struct bpf_verifier_env *env, in clear_caller_saved_regs()
5697 typedef int (*set_callee_state_fn)(struct bpf_verifier_env *env,
5702 static int __check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn, in __check_func_call()
5818 int map_set_for_each_callback_args(struct bpf_verifier_env *env, in map_set_for_each_callback_args()
5845 static int set_callee_state(struct bpf_verifier_env *env, in set_callee_state()
5859 static int check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn, in check_func_call()
5875 static int set_map_elem_callback_state(struct bpf_verifier_env *env, in set_map_elem_callback_state()
5904 static int set_timer_callback_state(struct bpf_verifier_env *env, in set_timer_callback_state()
5933 static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx) in prepare_func_exit()
6014 record_func_map(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, in record_func_map()
6059 record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, in record_func_key()
6097 static int check_reference_leak(struct bpf_verifier_env *env) in check_reference_leak()
6109 static int check_bpf_snprintf_call(struct bpf_verifier_env *env, in check_bpf_snprintf_call()
6146 static int check_get_func_ip(struct bpf_verifier_env *env) in check_get_func_ip()
6169 static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, in check_helper_call()
6461 static void mark_btf_func_reg_size(struct bpf_verifier_env *env, u32 regno, in mark_btf_func_reg_size()
6482 static int check_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn) in check_kfunc_call()
6590 static bool check_reg_sane_offset(struct bpf_verifier_env *env, in check_reg_sane_offset()
6625 static struct bpf_insn_aux_data *cur_aux(struct bpf_verifier_env *env) in cur_aux()
6669 static bool can_skip_alu_sanitation(const struct bpf_verifier_env *env, in can_skip_alu_sanitation()
6692 static int sanitize_val_alu(struct bpf_verifier_env *env, in sanitize_val_alu()
6714 sanitize_speculative_path(struct bpf_verifier_env *env, in sanitize_speculative_path()
6734 static int sanitize_ptr_alu(struct bpf_verifier_env *env, in sanitize_ptr_alu()
6830 static void sanitize_mark_insn_seen(struct bpf_verifier_env *env) in sanitize_mark_insn_seen()
6843 static int sanitize_err(struct bpf_verifier_env *env, in sanitize_err()
6893 struct bpf_verifier_env *env, in check_stack_access_for_ptr_arithmetic()
6916 static int sanitize_check_bounds(struct bpf_verifier_env *env, in sanitize_check_bounds()
6953 static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, in adjust_ptr_min_max_vals()
7755 static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, in adjust_scalar_min_max_vals()
7919 static int adjust_reg_min_max_vals(struct bpf_verifier_env *env, in adjust_reg_min_max_vals()
8000 static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) in check_alu_op()
8939 static int check_cond_jmp_op(struct bpf_verifier_env *env, in check_cond_jmp_op()
9132 static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn) in check_ld_imm()
9248 static int check_ld_abs(struct bpf_verifier_env *env, struct bpf_insn *insn) in check_ld_abs()
9325 static int check_return_code(struct bpf_verifier_env *env) in check_return_code()
9497 static u32 state_htab_size(struct bpf_verifier_env *env) in state_htab_size()
9503 struct bpf_verifier_env *env, in explored_state()
9512 static void init_explored_state(struct bpf_verifier_env *env, int idx) in init_explored_state()
9527 static int push_insn(int t, int w, int e, struct bpf_verifier_env *env, in push_insn()
9576 struct bpf_verifier_env *env, in visit_func_call_insn()
9604 static int visit_insn(int t, int insn_cnt, struct bpf_verifier_env *env) in visit_insn()
9669 static int check_cfg(struct bpf_verifier_env *env) in check_cfg()
9732 static int check_abnormal_return(struct bpf_verifier_env *env) in check_abnormal_return()
9753 static int check_btf_func(struct bpf_verifier_env *env, in check_btf_func()
9884 static void adjust_btf_func(struct bpf_verifier_env *env) in adjust_btf_func()
9900 static int check_btf_line(struct bpf_verifier_env *env, in check_btf_line()
10025 static int check_btf_info(struct bpf_verifier_env *env, in check_btf_info()
10101 static void clean_func_state(struct bpf_verifier_env *env, in clean_func_state()
10130 static void clean_verifier_state(struct bpf_verifier_env *env, in clean_verifier_state()
10175 static void clean_live_states(struct bpf_verifier_env *env, int insn, in clean_live_states()
10198 static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, in regsafe()
10317 static bool stacksafe(struct bpf_verifier_env *env, struct bpf_func_state *old, in stacksafe()
10414 static bool func_states_equal(struct bpf_verifier_env *env, struct bpf_func_state *old, in func_states_equal()
10434 static bool states_equal(struct bpf_verifier_env *env, in states_equal()
10467 static int propagate_liveness_reg(struct bpf_verifier_env *env, in propagate_liveness_reg()
10500 static int propagate_liveness(struct bpf_verifier_env *env, in propagate_liveness()
10547 static int propagate_precision(struct bpf_verifier_env *env, in propagate_precision()
10603 static int is_state_visited(struct bpf_verifier_env *env, int insn_idx) in is_state_visited()
10863 static int do_check(struct bpf_verifier_env *env) in do_check()
11225 static int check_pseudo_btf_id(struct bpf_verifier_env *env, in check_pseudo_btf_id()
11385 static int check_map_prog_compatibility(struct bpf_verifier_env *env, in check_map_prog_compatibility()
11489 static int resolve_pseudo_ldimm64(struct bpf_verifier_env *env) in resolve_pseudo_ldimm64()
11673 static void release_maps(struct bpf_verifier_env *env) in release_maps()
11680 static void release_btfs(struct bpf_verifier_env *env) in release_btfs()
11687 static void convert_pseudo_ld_imm64(struct bpf_verifier_env *env) in convert_pseudo_ld_imm64()
11706 static void adjust_insn_aux_data(struct bpf_verifier_env *env, in adjust_insn_aux_data()
11738 static void adjust_subprog_starts(struct bpf_verifier_env *env, u32 off, u32 len) in adjust_subprog_starts()
11766 static struct bpf_prog *bpf_patch_insn_data(struct bpf_verifier_env *env, u32 off, in bpf_patch_insn_data()
11794 static int adjust_subprog_starts_after_remove(struct bpf_verifier_env *env, in adjust_subprog_starts_after_remove()
11850 static int bpf_adj_linfo_after_remove(struct bpf_verifier_env *env, u32 off, in bpf_adj_linfo_after_remove()
11914 static int verifier_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt) in verifier_remove_insns()
11952 static void sanitize_dead_code(struct bpf_verifier_env *env) in sanitize_dead_code()
11982 static void opt_hard_wire_dead_code_branches(struct bpf_verifier_env *env) in opt_hard_wire_dead_code_branches()
12008 static int opt_remove_dead_code(struct bpf_verifier_env *env) in opt_remove_dead_code()
12032 static int opt_remove_nops(struct bpf_verifier_env *env) in opt_remove_nops()
12053 static int opt_subreg_zext_lo32_rnd_hi32(struct bpf_verifier_env *env, in opt_subreg_zext_lo32_rnd_hi32()
12153 static int convert_ctx_accesses(struct bpf_verifier_env *env) in convert_ctx_accesses()
12340 static int jit_subprogs(struct bpf_verifier_env *env) in jit_subprogs()
12565 static int fixup_call_args(struct bpf_verifier_env *env) in fixup_call_args()
12616 static int fixup_kfunc_call(struct bpf_verifier_env *env, in fixup_kfunc_call()
12639 static int do_misc_fixups(struct bpf_verifier_env *env) in do_misc_fixups()
13061 static void free_states(struct bpf_verifier_env *env) in free_states()
13091 static int do_check_common(struct bpf_verifier_env *env, int subprog) in do_check_common()
13187 static int do_check_subprogs(struct bpf_verifier_env *env) in do_check_subprogs()
13212 static int do_check_main(struct bpf_verifier_env *env) in do_check_main()
13224 static void print_verification_stats(struct bpf_verifier_env *env) in print_verification_stats()
13248 static int check_struct_ops_btf_id(struct bpf_verifier_env *env) in check_struct_ops_btf_id()
13577 static int check_attach_btf_id(struct bpf_verifier_env *env) in BTF_SET_START()
13672 struct bpf_verifier_env *env; in bpf_check()
13684 env = kzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL); in bpf_check()