Lines Matching refs:kptr_field
297 struct btf_field *kptr_field; member
5984 struct btf_field *kptr_field, in map_kptr_match_type() argument
5987 const char *targ_name = btf_type_name(kptr_field->kptr.btf, kptr_field->kptr.btf_id); in map_kptr_match_type()
5995 if (kptr_field->type == BPF_KPTR_UNREF) in map_kptr_match_type()
5999 if (kptr_field->type == BPF_KPTR_PERCPU) in map_kptr_match_type()
6043 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in map_kptr_match_type()
6044 kptr_field->type != BPF_KPTR_UNREF)) in map_kptr_match_type()
6051 if (kptr_field->type == BPF_KPTR_UNREF) in map_kptr_match_type()
6098 static struct btf_record *kptr_pointee_btf_record(struct btf_field *kptr_field) in kptr_pointee_btf_record() argument
6102 if (btf_is_kernel(kptr_field->kptr.btf)) in kptr_pointee_btf_record()
6105 meta = btf_find_struct_meta(kptr_field->kptr.btf, in kptr_pointee_btf_record()
6106 kptr_field->kptr.btf_id); in kptr_pointee_btf_record()
6119 static u32 btf_ld_kptr_type(struct bpf_verifier_env *env, struct btf_field *kptr_field) in btf_ld_kptr_type() argument
6125 if (rcu_safe_kptr(kptr_field) && in_rcu_cs(env)) { in btf_ld_kptr_type()
6127 if (kptr_field->type == BPF_KPTR_PERCPU) in btf_ld_kptr_type()
6129 else if (!btf_is_kernel(kptr_field->kptr.btf)) in btf_ld_kptr_type()
6132 rec = kptr_pointee_btf_record(kptr_field); in btf_ld_kptr_type()
6160 struct btf_field *kptr_field) in check_map_kptr_access() argument
6183 (kptr_field->type == BPF_KPTR_REF || kptr_field->type == BPF_KPTR_PERCPU)) { in check_map_kptr_access()
6187 if (class != BPF_LDX && kptr_field->type == BPF_UPTR) { in check_map_kptr_access()
6193 if (kptr_field->type == BPF_UPTR) in check_map_kptr_access()
6194 return mark_uptr_ld_reg(env, value_regno, kptr_field); in check_map_kptr_access()
6200 kptr_field->kptr.btf, kptr_field->kptr.btf_id, in check_map_kptr_access()
6201 btf_ld_kptr_type(env, kptr_field)); in check_map_kptr_access()
6207 map_kptr_match_type(env, kptr_field, val_reg, value_regno)) in check_map_kptr_access()
6212 kptr_field->offset); in check_map_kptr_access()
7735 struct btf_field *kptr_field = NULL; in check_mem_access() local
7749 kptr_field = btf_record_find(reg->map_ptr->record, in check_mem_access()
7751 if (kptr_field) { in check_mem_access()
7752 err = check_map_kptr_access(env, regno, value_regno, insn_idx, kptr_field); in check_mem_access()
8779 struct btf_field *kptr_field; in process_kptr_func() local
8810 kptr_field = btf_record_find(rec, kptr_off, BPF_KPTR); in process_kptr_func()
8811 if (!kptr_field) { in process_kptr_func()
8815 if (kptr_field->type != BPF_KPTR_REF && kptr_field->type != BPF_KPTR_PERCPU) { in process_kptr_func()
8819 meta->kptr_field = kptr_field; in process_kptr_func()
9545 if (map_kptr_match_type(env, meta->kptr_field, reg, regno)) in check_reg_type()
9575 if (map_kptr_match_type(env, meta->kptr_field, reg, regno)) in check_reg_type()
12057 ret_btf = meta.kptr_field->kptr.btf; in check_helper_call()
12058 ret_btf_id = meta.kptr_field->kptr.btf_id; in check_helper_call()
12061 if (meta.kptr_field->type == BPF_KPTR_PERCPU) in check_helper_call()