Lines Matching refs:btf_id

266 	u32 btf_id;  member
477 meta = btf_find_struct_meta(reg->btf, reg->btf_id); in reg_btf_record()
1073 verbose(env, "%s", kernel_type_name(reg->btf, reg->btf_id)); in print_verifier_state()
1652 regs[regno].btf_id = ds_head->value_btf_id; in mark_reg_graph_node()
1971 struct btf *btf, u32 btf_id, in mark_btf_ld_reg() argument
1981 regs[regno].btf_id = btf_id; in mark_btf_ld_reg()
4177 const char *targ_name = kernel_type_name(kptr_field->kptr.btf, kptr_field->kptr.btf_id); in map_kptr_match_type()
4193 reg_name = kernel_type_name(reg->btf, reg->btf_id); in map_kptr_match_type()
4228 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in map_kptr_match_type()
4229 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in map_kptr_match_type()
4279 kptr_field->kptr.btf_id, PTR_MAYBE_NULL | PTR_UNTRUSTED); in check_map_kptr_access()
4450 struct btf **btf, u32 *btf_id) in check_ctx_access() argument
4470 *btf_id = info.btf_id; in check_ctx_access()
5028 const struct btf_type *t = btf_type_by_id(reg->btf, reg->btf_id); in check_ptr_to_btf_access()
5031 u32 btf_id; in check_ptr_to_btf_access() local
5081 ret = env->ops->btf_struct_access(&env->log, reg, off, size, atype, &btf_id, &flag); in check_ptr_to_btf_access()
5098 ret = btf_struct_access(&env->log, reg, off, size, atype, &btf_id, &flag); in check_ptr_to_btf_access()
5142 mark_btf_ld_reg(env, regs, value_regno, ret, reg->btf, btf_id, flag); in check_ptr_to_btf_access()
5159 u32 btf_id; in check_ptr_to_map_access() local
5197 ret = btf_struct_access(&env->log, &map_reg, off, size, atype, &btf_id, &flag); in check_ptr_to_map_access()
5202 mark_btf_ld_reg(env, regs, value_regno, ret, btf_vmlinux, btf_id, flag); in check_ptr_to_map_access()
5400 u32 btf_id = 0; in check_mem_access() local
5413 &btf_id); in check_mem_access()
5436 regs[value_regno].btf_id = btf_id; in check_mem_access()
6364 u32 *btf_id; member
6386 .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
6534 if (!compatible->btf_id) { in check_reg_type()
6538 arg_btf_id = compatible->btf_id; in check_reg_type()
6552 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in check_reg_type()
6556 regno, kernel_type_name(reg->btf, reg->btf_id), in check_reg_type()
6617 kernel_type_name(reg->btf, reg->btf_id), reg->off); in check_func_arg_reg_off()
6859 if (!reg->btf_id) { in check_func_arg()
6864 meta->ret_btf_id = reg->btf_id; in check_func_arg()
7454 static bool is_callback_calling_kfunc(u32 btf_id);
7750 callee->regs[BPF_REG_2].btf_id = btf_tracing_ids[BTF_TRACING_TYPE_VMA], in set_find_vma_callback_state()
7818 static bool is_rbtree_lock_required_kfunc(u32 btf_id);
8468 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_helper_call()
8481 ret_btf_id = meta.kptr_field->kptr.btf_id; in check_helper_call()
8499 regs[BPF_REG_0].btf_id = ret_btf_id; in check_helper_call()
8618 u32 btf_id; member
9021 reg_ref_id = reg->btf_id; in process_kf_arg_ptr_to_btf_id()
9095 kptr_field->kptr.btf_id, true)) { in process_kf_arg_ptr_to_kptr()
9228 static bool is_bpf_list_api_kfunc(u32 btf_id) in is_bpf_list_api_kfunc() argument
9230 return btf_id == special_kfunc_list[KF_bpf_list_push_front] || in is_bpf_list_api_kfunc()
9231 btf_id == special_kfunc_list[KF_bpf_list_push_back] || in is_bpf_list_api_kfunc()
9232 btf_id == special_kfunc_list[KF_bpf_list_pop_front] || in is_bpf_list_api_kfunc()
9233 btf_id == special_kfunc_list[KF_bpf_list_pop_back]; in is_bpf_list_api_kfunc()
9236 static bool is_bpf_rbtree_api_kfunc(u32 btf_id) in is_bpf_rbtree_api_kfunc() argument
9238 return btf_id == special_kfunc_list[KF_bpf_rbtree_add] || in is_bpf_rbtree_api_kfunc()
9239 btf_id == special_kfunc_list[KF_bpf_rbtree_remove] || in is_bpf_rbtree_api_kfunc()
9240 btf_id == special_kfunc_list[KF_bpf_rbtree_first]; in is_bpf_rbtree_api_kfunc()
9243 static bool is_bpf_graph_api_kfunc(u32 btf_id) in is_bpf_graph_api_kfunc() argument
9245 return is_bpf_list_api_kfunc(btf_id) || is_bpf_rbtree_api_kfunc(btf_id); in is_bpf_graph_api_kfunc()
9248 static bool is_callback_calling_kfunc(u32 btf_id) in is_callback_calling_kfunc() argument
9250 return btf_id == special_kfunc_list[KF_bpf_rbtree_add]; in is_callback_calling_kfunc()
9253 static bool is_rbtree_lock_required_kfunc(u32 btf_id) in is_rbtree_lock_required_kfunc() argument
9255 return is_bpf_rbtree_api_kfunc(btf_id); in is_rbtree_lock_required_kfunc()
9416 t = btf_type_by_id(reg->btf, reg->btf_id); in __process_kf_arg_ptr_to_graph_node()
9417 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()
9636 meta->arg_obj_drop.btf_id = reg->btf_id; in check_kfunc_args()
9958 regs[BPF_REG_0].btf_id = ret_btf_id; in check_kfunc_call()
9966 meta.arg_obj_drop.btf_id); in check_kfunc_call()
9981 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_kfunc_call()
9993 regs[BPF_REG_0].btf_id = meta.arg_constant.value; in check_kfunc_call()
10025 regs[BPF_REG_0].btf_id = ptr_type_id; in check_kfunc_call()
12679 dst_reg->btf_id = aux->btf_var.btf_id; in check_ld_imm()
14967 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
14987 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
17189 u32 btf_id, member_idx; in check_struct_ops_btf_id() local
17197 btf_id = prog->aux->attach_btf_id; in check_struct_ops_btf_id()
17198 st_ops = bpf_struct_ops_find(btf_id); in check_struct_ops_btf_id()
17201 btf_id); in check_struct_ops_btf_id()
17262 static int check_non_sleepable_error_inject(u32 btf_id) in BTF_ID()
17264 return btf_id_set_contains(&btf_non_sleepable_error_inject, btf_id); in BTF_ID()
17270 u32 btf_id, in bpf_check_attach_target() argument
17282 if (!btf_id) { in bpf_check_attach_target()
17292 t = btf_type_by_id(btf, btf_id); in bpf_check_attach_target()
17294 bpf_log(log, "attach_btf_id %u is invalid\n", btf_id); in bpf_check_attach_target()
17299 bpf_log(log, "attach_btf_id %u doesn't have a name\n", btf_id); in bpf_check_attach_target()
17312 if (aux->func_info[i].type_id == btf_id) { in bpf_check_attach_target()
17383 btf_id); in bpf_check_attach_target()
17388 btf_id, tname); in bpf_check_attach_target()
17405 btf_id); in bpf_check_attach_target()
17426 btf_id); in bpf_check_attach_target()
17471 if (!check_non_sleepable_error_inject(btf_id) && in bpf_check_attach_target()
17478 u32 *flags = btf_kfunc_is_modify_return(btf, btf_id); in bpf_check_attach_target()
17488 if (bpf_lsm_is_sleepable_hook(btf_id)) in bpf_check_attach_target()
17504 if (btf_kfunc_is_modify_return(btf, btf_id) || in bpf_check_attach_target()
17555 u32 btf_id = prog->aux->attach_btf_id; in check_attach_btf_id() local
17581 ret = bpf_check_attach_target(&env->log, prog, tgt_prog, btf_id, &tgt_info); in check_attach_btf_id()
17617 btf_id_set_contains(&btf_id_deny, btf_id)) { in check_attach_btf_id()
17621 key = bpf_trampoline_compute_key(tgt_prog, prog->aux->attach_btf, btf_id); in check_attach_btf_id()