Lines Matching refs:kptr_field
289 struct btf_field *kptr_field; member
5722 struct btf_field *kptr_field, in map_kptr_match_type() argument
5725 const char *targ_name = btf_type_name(kptr_field->kptr.btf, kptr_field->kptr.btf_id); in map_kptr_match_type()
5733 if (kptr_field->type == BPF_KPTR_UNREF) in map_kptr_match_type()
5737 if (kptr_field->type == BPF_KPTR_PERCPU) in map_kptr_match_type()
5781 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in map_kptr_match_type()
5782 kptr_field->type != BPF_KPTR_UNREF)) in map_kptr_match_type()
5789 if (kptr_field->type == BPF_KPTR_UNREF) in map_kptr_match_type()
5837 static struct btf_record *kptr_pointee_btf_record(struct btf_field *kptr_field) in kptr_pointee_btf_record() argument
5841 if (btf_is_kernel(kptr_field->kptr.btf)) in kptr_pointee_btf_record()
5844 meta = btf_find_struct_meta(kptr_field->kptr.btf, in kptr_pointee_btf_record()
5845 kptr_field->kptr.btf_id); in kptr_pointee_btf_record()
5858 static u32 btf_ld_kptr_type(struct bpf_verifier_env *env, struct btf_field *kptr_field) in btf_ld_kptr_type() argument
5864 if (rcu_safe_kptr(kptr_field) && in_rcu_cs(env)) { in btf_ld_kptr_type()
5866 if (kptr_field->type == BPF_KPTR_PERCPU) in btf_ld_kptr_type()
5868 else if (!btf_is_kernel(kptr_field->kptr.btf)) in btf_ld_kptr_type()
5871 rec = kptr_pointee_btf_record(kptr_field); in btf_ld_kptr_type()
5899 struct btf_field *kptr_field) in check_map_kptr_access() argument
5921 (kptr_field->type == BPF_KPTR_REF || kptr_field->type == BPF_KPTR_PERCPU)) { in check_map_kptr_access()
5925 if (class != BPF_LDX && kptr_field->type == BPF_UPTR) { in check_map_kptr_access()
5931 if (kptr_field->type == BPF_UPTR) in check_map_kptr_access()
5932 return mark_uptr_ld_reg(env, value_regno, kptr_field); in check_map_kptr_access()
5937 mark_btf_ld_reg(env, cur_regs(env), value_regno, PTR_TO_BTF_ID, kptr_field->kptr.btf, in check_map_kptr_access()
5938 kptr_field->kptr.btf_id, btf_ld_kptr_type(env, kptr_field)); in check_map_kptr_access()
5942 map_kptr_match_type(env, kptr_field, val_reg, value_regno)) in check_map_kptr_access()
5947 kptr_field->offset); in check_map_kptr_access()
7443 struct btf_field *kptr_field = NULL; in check_mem_access() local
7457 kptr_field = btf_record_find(reg->map_ptr->record, in check_mem_access()
7459 if (kptr_field) { in check_mem_access()
7460 err = check_map_kptr_access(env, regno, value_regno, insn_idx, kptr_field); in check_mem_access()
8445 struct btf_field *kptr_field; in process_kptr_func() local
8476 kptr_field = btf_record_find(rec, kptr_off, BPF_KPTR); in process_kptr_func()
8477 if (!kptr_field) { in process_kptr_func()
8481 if (kptr_field->type != BPF_KPTR_REF && kptr_field->type != BPF_KPTR_PERCPU) { in process_kptr_func()
8485 meta->kptr_field = kptr_field; in process_kptr_func()
9203 if (map_kptr_match_type(env, meta->kptr_field, reg, regno)) in check_reg_type()
9233 if (map_kptr_match_type(env, meta->kptr_field, reg, regno)) in check_reg_type()
11658 ret_btf = meta.kptr_field->kptr.btf; in check_helper_call()
11659 ret_btf_id = meta.kptr_field->kptr.btf_id; in check_helper_call()
11662 if (meta.kptr_field->type == BPF_KPTR_PERCPU) in check_helper_call()