Lines Matching refs:btf_id
278 u32 btf_id; member
484 meta = btf_find_struct_meta(reg->btf, reg->btf_id); in reg_btf_record()
545 static bool is_callback_calling_kfunc(u32 btf_id);
756 static const char *iter_type_str(const struct btf *btf, u32 btf_id) in iter_type_str() argument
758 if (!btf || btf_id == 0) in iter_type_str()
762 return btf_type_name(btf, btf_id) + sizeof(ITER_PREFIX) - 1; in iter_type_str()
1177 struct btf *btf, u32 btf_id, int nr_slots) in mark_stack_slots_iter() argument
1199 st->iter.btf_id = btf_id; in mark_stack_slots_iter()
1271 struct btf *btf, u32 btf_id, int nr_slots) in is_iter_reg_valid_init() argument
1289 if (st->iter.btf != btf || st->iter.btf_id != btf_id) in is_iter_reg_valid_init()
1376 verbose(env, "%s", btf_type_name(reg->btf, reg->btf_id)); in print_verifier_state()
1488 iter_type_str(reg->iter.btf, reg->iter.btf_id), in print_verifier_state()
1991 regs[regno].btf_id = ds_head->value_btf_id; in mark_reg_graph_node()
2316 struct btf *btf, u32 btf_id, in mark_btf_ld_reg() argument
2326 regs[regno].btf_id = btf_id; in mark_btf_ld_reg()
4990 const char *targ_name = btf_type_name(kptr_field->kptr.btf, kptr_field->kptr.btf_id); in map_kptr_match_type()
5008 reg_name = btf_type_name(reg->btf, reg->btf_id); in map_kptr_match_type()
5043 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in map_kptr_match_type()
5044 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in map_kptr_match_type()
5078 static bool rcu_protected_object(const struct btf *btf, u32 btf_id) in BTF_ID()
5082 return btf_id_set_contains(&rcu_protected_types, btf_id); in BTF_ID()
5089 return field->type == BPF_KPTR_REF && rcu_protected_object(kptr->btf, kptr->btf_id); in rcu_safe_kptr()
5126 kptr_field->kptr.btf_id, in check_map_kptr_access()
5300 struct btf **btf, u32 *btf_id) in check_ctx_access() argument
5320 *btf_id = info.btf_id; in check_ctx_access()
6103 const char *field_name, u32 btf_id) in type_is_rcu() argument
6109 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_rcu"); in type_is_rcu()
6114 const char *field_name, u32 btf_id) in type_is_rcu_or_null() argument
6120 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_rcu_or_null"); in type_is_rcu_or_null()
6125 const char *field_name, u32 btf_id) in type_is_trusted() argument
6134 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_trusted"); in type_is_trusted()
6144 const struct btf_type *t = btf_type_by_id(reg->btf, reg->btf_id); in check_ptr_to_btf_access()
6148 u32 btf_id = 0; in check_ptr_to_btf_access() local
6215 ret = btf_struct_access(&env->log, reg, off, size, atype, &btf_id, &flag, &field_name); in check_ptr_to_btf_access()
6243 if (type_is_trusted(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6246 if (type_is_rcu(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6250 type_is_rcu_or_null(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6255 if (type_is_rcu_or_null(env, reg, field_name, btf_id) && in check_ptr_to_btf_access()
6280 mark_btf_ld_reg(env, regs, value_regno, ret, reg->btf, btf_id, flag); in check_ptr_to_btf_access()
6297 u32 btf_id; in check_ptr_to_map_access() local
6335 ret = btf_struct_access(&env->log, &map_reg, off, size, atype, &btf_id, &flag, NULL); in check_ptr_to_map_access()
6340 mark_btf_ld_reg(env, regs, value_regno, ret, btf_vmlinux, btf_id, flag); in check_ptr_to_map_access()
6538 u32 btf_id = 0; in check_mem_access() local
6551 &btf_id); in check_mem_access()
6574 regs[value_regno].btf_id = btf_id; in check_mem_access()
7469 u32 btf_id; in process_iter_arg() local
7474 t = btf_type_skip_modifiers(meta->btf, t->type, &btf_id); /* STRUCT */ in process_iter_arg()
7481 iter_type_str(meta->btf, btf_id), regno); in process_iter_arg()
7492 err = mark_stack_slots_iter(env, reg, insn_idx, meta->btf, btf_id, nr_slots); in process_iter_arg()
7497 if (!is_iter_reg_valid_init(env, reg, meta->btf, btf_id, nr_slots)) { in process_iter_arg()
7499 iter_type_str(meta->btf, btf_id), regno); in process_iter_arg()
7682 u32 *btf_id; member
7704 .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
7886 if (!compatible->btf_id) { in check_reg_type()
7890 arg_btf_id = compatible->btf_id; in check_reg_type()
7904 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in check_reg_type()
7908 regno, btf_type_name(reg->btf, reg->btf_id), in check_reg_type()
8255 if (!reg->btf_id) { in check_func_arg()
8260 meta->ret_btf_id = reg->btf_id; in check_func_arg()
9142 callee->regs[BPF_REG_2].btf_id = btf_tracing_ids[BTF_TRACING_TYPE_VMA], in set_find_vma_callback_state()
9210 static bool is_rbtree_lock_required_kfunc(u32 btf_id);
9869 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_helper_call()
9882 ret_btf_id = meta.kptr_field->kptr.btf_id; in check_helper_call()
9902 regs[BPF_REG_0].btf_id = ret_btf_id; in check_helper_call()
10426 reg_ref_id = reg->btf_id; in process_kf_arg_ptr_to_btf_id()
10602 static bool is_bpf_list_api_kfunc(u32 btf_id) in is_bpf_list_api_kfunc() argument
10604 return btf_id == special_kfunc_list[KF_bpf_list_push_front_impl] || in is_bpf_list_api_kfunc()
10605 btf_id == special_kfunc_list[KF_bpf_list_push_back_impl] || in is_bpf_list_api_kfunc()
10606 btf_id == special_kfunc_list[KF_bpf_list_pop_front] || in is_bpf_list_api_kfunc()
10607 btf_id == special_kfunc_list[KF_bpf_list_pop_back]; in is_bpf_list_api_kfunc()
10610 static bool is_bpf_rbtree_api_kfunc(u32 btf_id) in is_bpf_rbtree_api_kfunc() argument
10612 return btf_id == special_kfunc_list[KF_bpf_rbtree_add_impl] || in is_bpf_rbtree_api_kfunc()
10613 btf_id == special_kfunc_list[KF_bpf_rbtree_remove] || in is_bpf_rbtree_api_kfunc()
10614 btf_id == special_kfunc_list[KF_bpf_rbtree_first]; in is_bpf_rbtree_api_kfunc()
10617 static bool is_bpf_graph_api_kfunc(u32 btf_id) in is_bpf_graph_api_kfunc() argument
10619 return is_bpf_list_api_kfunc(btf_id) || is_bpf_rbtree_api_kfunc(btf_id) || in is_bpf_graph_api_kfunc()
10620 btf_id == special_kfunc_list[KF_bpf_refcount_acquire_impl]; in is_bpf_graph_api_kfunc()
10623 static bool is_callback_calling_kfunc(u32 btf_id) in is_callback_calling_kfunc() argument
10625 return btf_id == special_kfunc_list[KF_bpf_rbtree_add_impl]; in is_callback_calling_kfunc()
10628 static bool is_rbtree_lock_required_kfunc(u32 btf_id) in is_rbtree_lock_required_kfunc() argument
10630 return is_bpf_rbtree_api_kfunc(btf_id); in is_rbtree_lock_required_kfunc()
10791 t = btf_type_by_id(reg->btf, reg->btf_id); in __process_kf_arg_ptr_to_graph_node()
10792 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, 0, field->graph_root.btf, in __process_kf_arg_ptr_to_graph_node()
10804 meta->arg_btf_id = reg->btf_id; in __process_kf_arg_ptr_to_graph_node()
11016 meta->arg_btf_id = reg->btf_id; in check_kfunc_args()
11227 meta->arg_btf_id = reg->btf_id; in check_kfunc_args()
11457 regs[BPF_REG_0].btf_id = ret_btf_id; in check_kfunc_call()
11466 regs[BPF_REG_0].btf_id = meta.arg_btf_id; in check_kfunc_call()
11485 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_kfunc_call()
11497 regs[BPF_REG_0].btf_id = meta.arg_constant.value; in check_kfunc_call()
11573 regs[BPF_REG_0].btf_id = ptr_type_id; in check_kfunc_call()
14320 dst_reg->btf_id = aux->btf_var.btf_id; in check_ld_imm()
15728 old_reg->iter.btf_id != cur_reg->iter.btf_id || in stacksafe()
16882 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
16902 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
19183 u32 btf_id, member_idx; in check_struct_ops_btf_id() local
19191 btf_id = prog->aux->attach_btf_id; in check_struct_ops_btf_id()
19192 st_ops = bpf_struct_ops_find(btf_id); in check_struct_ops_btf_id()
19195 btf_id); in check_struct_ops_btf_id()
19256 static int check_non_sleepable_error_inject(u32 btf_id) in BTF_ID()
19258 return btf_id_set_contains(&btf_non_sleepable_error_inject, btf_id); in BTF_ID()
19264 u32 btf_id, in bpf_check_attach_target() argument
19277 if (!btf_id) { in bpf_check_attach_target()
19287 t = btf_type_by_id(btf, btf_id); in bpf_check_attach_target()
19289 bpf_log(log, "attach_btf_id %u is invalid\n", btf_id); in bpf_check_attach_target()
19294 bpf_log(log, "attach_btf_id %u doesn't have a name\n", btf_id); in bpf_check_attach_target()
19307 if (aux->func_info[i].type_id == btf_id) { in bpf_check_attach_target()
19378 btf_id); in bpf_check_attach_target()
19383 btf_id, tname); in bpf_check_attach_target()
19400 btf_id); in bpf_check_attach_target()
19421 btf_id); in bpf_check_attach_target()
19475 if (!check_non_sleepable_error_inject(btf_id) && in bpf_check_attach_target()
19482 u32 *flags = btf_kfunc_is_modify_return(btf, btf_id, in bpf_check_attach_target()
19493 if (bpf_lsm_is_sleepable_hook(btf_id)) in bpf_check_attach_target()
19511 if (btf_kfunc_is_modify_return(btf, btf_id, prog) || in bpf_check_attach_target()
19572 u32 btf_id = prog->aux->attach_btf_id; in check_attach_btf_id() local
19598 ret = bpf_check_attach_target(&env->log, prog, tgt_prog, btf_id, &tgt_info); in check_attach_btf_id()
19635 btf_id_set_contains(&btf_id_deny, btf_id)) { in check_attach_btf_id()
19639 key = bpf_trampoline_compute_key(tgt_prog, prog->aux->attach_btf, btf_id); in check_attach_btf_id()