Lines Matching refs:btf_id

282 	u32 btf_id;  member
414 meta = btf_find_struct_meta(reg->btf, reg->btf_id); in reg_btf_record()
500 static bool is_sync_callback_calling_kfunc(u32 btf_id);
501 static bool is_async_callback_calling_kfunc(u32 btf_id);
502 static bool is_callback_calling_kfunc(u32 btf_id);
505 static bool is_bpf_wq_set_callback_impl_kfunc(u32 btf_id);
1006 struct btf *btf, u32 btf_id, int nr_slots) in mark_stack_slots_iter() argument
1034 st->iter.btf_id = btf_id; in mark_stack_slots_iter()
1106 struct btf *btf, u32 btf_id, int nr_slots) in is_iter_reg_valid_init() argument
1126 if (st->iter.btf != btf || st->iter.btf_id != btf_id) in is_iter_reg_valid_init()
1871 regs[regno].btf_id = ds_head->value_btf_id; in mark_reg_graph_node()
2414 struct btf *btf, u32 btf_id, in mark_btf_ld_reg() argument
2424 regs[regno].btf_id = btf_id; in mark_btf_ld_reg()
5342 const char *targ_name = btf_type_name(kptr_field->kptr.btf, kptr_field->kptr.btf_id); in map_kptr_match_type()
5362 reg_name = btf_type_name(reg->btf, reg->btf_id); in map_kptr_match_type()
5397 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in map_kptr_match_type()
5398 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in map_kptr_match_type()
5443 static bool rcu_protected_object(const struct btf *btf, u32 btf_id) in BTF_ID()
5447 return btf_id_set_contains(&rcu_protected_types, btf_id); in BTF_ID()
5458 kptr_field->kptr.btf_id); in kptr_pointee_btf_record()
5468 (field->type == BPF_KPTR_REF && rcu_protected_object(kptr->btf, kptr->btf_id)); in rcu_safe_kptr()
5529 kptr_field->kptr.btf_id, btf_ld_kptr_type(env, kptr_field)); in check_map_kptr_access()
5699 struct btf **btf, u32 *btf_id, bool *is_retval, bool is_ldsx) in check_ctx_access() argument
5722 *btf_id = info.btf_id; in check_ctx_access()
6543 const char *field_name, u32 btf_id) in type_is_rcu() argument
6549 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_rcu"); in type_is_rcu()
6554 const char *field_name, u32 btf_id) in type_is_rcu_or_null() argument
6560 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_rcu_or_null"); in type_is_rcu_or_null()
6565 const char *field_name, u32 btf_id) in type_is_trusted() argument
6573 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_trusted"); in type_is_trusted()
6578 const char *field_name, u32 btf_id) in type_is_trusted_or_null() argument
6582 return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, in type_is_trusted_or_null()
6593 const struct btf_type *t = btf_type_by_id(reg->btf, reg->btf_id); in check_ptr_to_btf_access()
6597 u32 btf_id = 0; in check_ptr_to_btf_access() local
6664 ret = btf_struct_access(&env->log, reg, off, size, atype, &btf_id, &flag, &field_name); in check_ptr_to_btf_access()
6692 if (type_is_trusted(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6694 } else if (type_is_trusted_or_null(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6697 if (type_is_rcu(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6701 type_is_rcu_or_null(env, reg, field_name, btf_id)) { in check_ptr_to_btf_access()
6706 if (type_is_rcu_or_null(env, reg, field_name, btf_id) && in check_ptr_to_btf_access()
6731 mark_btf_ld_reg(env, regs, value_regno, ret, reg->btf, btf_id, flag); in check_ptr_to_btf_access()
6748 u32 btf_id; in check_ptr_to_map_access() local
6786 ret = btf_struct_access(&env->log, &map_reg, off, size, atype, &btf_id, &flag, NULL); in check_ptr_to_map_access()
6791 mark_btf_ld_reg(env, regs, value_regno, ret, btf_vmlinux, btf_id, flag); in check_ptr_to_map_access()
7006 u32 btf_id = 0; in check_mem_access() local
7019 &btf_id, &is_retval, is_ldsx); in check_mem_access()
7049 regs[value_regno].btf_id = btf_id; in check_mem_access()
7983 int spi, err, i, nr_slots, btf_id; in process_iter_arg() local
7991 btf_id = btf_check_iter_arg(meta->btf, meta->func_proto, regno - 1); in process_iter_arg()
7992 if (btf_id < 0) { in process_iter_arg()
7996 t = btf_type_by_id(meta->btf, btf_id); in process_iter_arg()
8003 iter_type_str(meta->btf, btf_id), regno); in process_iter_arg()
8014 err = mark_stack_slots_iter(env, meta, reg, insn_idx, meta->btf, btf_id, nr_slots); in process_iter_arg()
8021 err = is_iter_reg_valid_init(env, reg, meta->btf, btf_id, nr_slots); in process_iter_arg()
8027 iter_type_str(meta->btf, btf_id), regno); in process_iter_arg()
8330 u32 *btf_id; member
8352 .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
8532 if (!compatible->btf_id) { in check_reg_type()
8536 arg_btf_id = compatible->btf_id; in check_reg_type()
8550 if (!btf_struct_ids_match(&env->log, reg->btf, reg->btf_id, reg->off, in check_reg_type()
8554 regno, btf_type_name(reg->btf, reg->btf_id), in check_reg_type()
8952 if (!reg->btf_id) { in check_func_arg()
8957 meta->ret_btf_id = reg->btf_id; in check_func_arg()
9644 err = check_reg_type(env, regno, arg->arg_type, &arg->btf_id, &meta); in btf_check_func_arg_match()
9670 u32 btf_id; in btf_check_subprog_call() local
9676 btf_id = prog->aux->func_info[subprog].type_id; in btf_check_subprog_call()
9677 if (!btf_id) in btf_check_subprog_call()
9973 callee->regs[BPF_REG_2].btf_id = btf_tracing_ids[BTF_TRACING_TYPE_VMA]; in set_find_vma_callback_state()
10041 static bool is_rbtree_lock_required_kfunc(u32 btf_id);
10717 type = btf_type_by_id(reg->btf, reg->btf_id); in check_helper_call()
10829 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_helper_call()
10842 ret_btf_id = meta.kptr_field->kptr.btf_id; in check_helper_call()
10865 regs[BPF_REG_0].btf_id = ret_btf_id; in check_helper_call()
11458 reg_ref_id = reg->btf_id; in process_kf_arg_ptr_to_btf_id()
11641 static bool is_bpf_list_api_kfunc(u32 btf_id) in is_bpf_list_api_kfunc() argument
11643 return btf_id == special_kfunc_list[KF_bpf_list_push_front_impl] || in is_bpf_list_api_kfunc()
11644 btf_id == special_kfunc_list[KF_bpf_list_push_back_impl] || in is_bpf_list_api_kfunc()
11645 btf_id == special_kfunc_list[KF_bpf_list_pop_front] || in is_bpf_list_api_kfunc()
11646 btf_id == special_kfunc_list[KF_bpf_list_pop_back]; in is_bpf_list_api_kfunc()
11649 static bool is_bpf_rbtree_api_kfunc(u32 btf_id) in is_bpf_rbtree_api_kfunc() argument
11651 return btf_id == special_kfunc_list[KF_bpf_rbtree_add_impl] || in is_bpf_rbtree_api_kfunc()
11652 btf_id == special_kfunc_list[KF_bpf_rbtree_remove] || in is_bpf_rbtree_api_kfunc()
11653 btf_id == special_kfunc_list[KF_bpf_rbtree_first]; in is_bpf_rbtree_api_kfunc()
11656 static bool is_bpf_graph_api_kfunc(u32 btf_id) in is_bpf_graph_api_kfunc() argument
11658 return is_bpf_list_api_kfunc(btf_id) || is_bpf_rbtree_api_kfunc(btf_id) || in is_bpf_graph_api_kfunc()
11659 btf_id == special_kfunc_list[KF_bpf_refcount_acquire_impl]; in is_bpf_graph_api_kfunc()
11662 static bool is_sync_callback_calling_kfunc(u32 btf_id) in is_sync_callback_calling_kfunc() argument
11664 return btf_id == special_kfunc_list[KF_bpf_rbtree_add_impl]; in is_sync_callback_calling_kfunc()
11667 static bool is_async_callback_calling_kfunc(u32 btf_id) in is_async_callback_calling_kfunc() argument
11669 return btf_id == special_kfunc_list[KF_bpf_wq_set_callback_impl]; in is_async_callback_calling_kfunc()
11678 static bool is_bpf_wq_set_callback_impl_kfunc(u32 btf_id) in is_bpf_wq_set_callback_impl_kfunc() argument
11680 return btf_id == special_kfunc_list[KF_bpf_wq_set_callback_impl]; in is_bpf_wq_set_callback_impl_kfunc()
11683 static bool is_callback_calling_kfunc(u32 btf_id) in is_callback_calling_kfunc() argument
11685 return is_sync_callback_calling_kfunc(btf_id) || in is_callback_calling_kfunc()
11686 is_async_callback_calling_kfunc(btf_id); in is_callback_calling_kfunc()
11689 static bool is_rbtree_lock_required_kfunc(u32 btf_id) in is_rbtree_lock_required_kfunc() argument
11691 return is_bpf_rbtree_api_kfunc(btf_id); in is_rbtree_lock_required_kfunc()
11852 t = btf_type_by_id(reg->btf, reg->btf_id); in __process_kf_arg_ptr_to_graph_node()
11853 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()
11865 meta->arg_btf_id = reg->btf_id; in __process_kf_arg_ptr_to_graph_node()
12138 meta->arg_btf_id = reg->btf_id; in check_kfunc_args()
12359 meta->arg_btf_id = reg->btf_id; in check_kfunc_args()
12708 regs[BPF_REG_0].btf_id = ret_btf_id; in check_kfunc_call()
12718 regs[BPF_REG_0].btf_id = meta.arg_btf_id; in check_kfunc_call()
12737 regs[BPF_REG_0].btf_id = meta.ret_btf_id; in check_kfunc_call()
12749 regs[BPF_REG_0].btf_id = meta.arg_constant.value; in check_kfunc_call()
12828 regs[BPF_REG_0].btf_id = ptr_type_id; in check_kfunc_call()
15635 dst_reg->btf_id = aux->btf_var.btf_id; in check_ld_imm()
17489 old_reg->iter.btf_id != cur_reg->iter.btf_id || in stacksafe()
18767 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
18787 aux->btf_var.btf_id = type; in check_pseudo_btf_id()
21587 reg->btf_id = arg->btf_id; in do_check_common()
21744 u32 btf_id, member_idx; in check_struct_ops_btf_id() local
21768 btf_id = prog->aux->attach_btf_id; in check_struct_ops_btf_id()
21769 st_ops_desc = bpf_struct_ops_find(btf, btf_id); in check_struct_ops_btf_id()
21772 btf_id); in check_struct_ops_btf_id()
21851 static int check_non_sleepable_error_inject(u32 btf_id) in BTF_ID()
21853 return btf_id_set_contains(&btf_non_sleepable_error_inject, btf_id); in BTF_ID()
21859 u32 btf_id, in bpf_check_attach_target() argument
21875 if (!btf_id) { in bpf_check_attach_target()
21885 t = btf_type_by_id(btf, btf_id); in bpf_check_attach_target()
21887 bpf_log(log, "attach_btf_id %u is invalid\n", btf_id); in bpf_check_attach_target()
21892 bpf_log(log, "attach_btf_id %u doesn't have a name\n", btf_id); in bpf_check_attach_target()
21905 if (aux->func_info[i].type_id == btf_id) { in bpf_check_attach_target()
21992 btf_id); in bpf_check_attach_target()
21997 btf_id, tname); in bpf_check_attach_target()
22038 btf_id); in bpf_check_attach_target()
22059 btf_id); in bpf_check_attach_target()
22113 if (!check_non_sleepable_error_inject(btf_id) && in bpf_check_attach_target()
22120 u32 *flags = btf_kfunc_is_modify_return(btf, btf_id, in bpf_check_attach_target()
22131 if (bpf_lsm_is_sleepable_hook(btf_id)) in bpf_check_attach_target()
22149 if (btf_kfunc_is_modify_return(btf, btf_id, prog) || in bpf_check_attach_target()
22210 u32 btf_id = prog->aux->attach_btf_id; in check_attach_btf_id() local
22236 ret = bpf_check_attach_target(&env->log, prog, tgt_prog, btf_id, &tgt_info); in check_attach_btf_id()
22273 btf_id_set_contains(&btf_id_deny, btf_id)) { in check_attach_btf_id()
22277 key = bpf_trampoline_compute_key(tgt_prog, prog->aux->attach_btf, btf_id); in check_attach_btf_id()