Lines Matching refs:ref_obj_id

195 static int release_reference(struct bpf_verifier_env *env, int ref_obj_id);
273 int ref_obj_id; member
293 u32 ref_obj_id; member
327 u32 ref_obj_id; member
945 state->stack[spi].spilled_ptr.ref_obj_id = id; in mark_stack_slots_dynptr()
946 state->stack[spi - 1].spilled_ptr.ref_obj_id = id; in mark_stack_slots_dynptr()
995 int spi, ref_obj_id, i; in unmark_stack_slots_dynptr() local
1006 ref_obj_id = state->stack[spi].spilled_ptr.ref_obj_id; in unmark_stack_slots_dynptr()
1016 WARN_ON_ONCE(release_reference(env, ref_obj_id)); in unmark_stack_slots_dynptr()
1020 if (state->stack[i].spilled_ptr.ref_obj_id != ref_obj_id) in unmark_stack_slots_dynptr()
1208 st->ref_obj_id = i == 0 ? id : 0; in mark_stack_slots_iter()
1238 WARN_ON_ONCE(release_reference(env, st->ref_obj_id)); in unmark_stack_slots_iter()
1296 if (i == 0 && !st->ref_obj_id) in is_iter_reg_valid_init()
1298 if (i != 0 && st->ref_obj_id) in is_iter_reg_valid_init()
1397 if (reg->ref_obj_id) in print_verifier_state()
1398 verbose_a("ref_obj_id=%d", reg->ref_obj_id); in print_verifier_state()
1487 if (reg->ref_obj_id) in print_verifier_state()
1488 verbose(env, "(ref_id=%d)", reg->ref_obj_id); in print_verifier_state()
1493 if (!reg->ref_obj_id) in print_verifier_state()
1500 reg->ref_obj_id, iter_state_str(reg->iter.state), in print_verifier_state()
2118 reg->ref_obj_id = 0; in __mark_reg_known()
2488 reg->ref_obj_id = 0; in __mark_reg_unknown()
5691 if (reg->ref_obj_id) in is_trusted_reg()
6463 !reg->ref_obj_id) { in check_ptr_to_btf_access()
7673 return state->stack[spi].spilled_ptr.ref_obj_id; in iter_ref_obj_id()
7756 meta->ref_obj_id = iter_ref_obj_id(env, reg, spi); in process_iter_arg()
8410 return reg->ref_obj_id; in dynptr_ref_obj_id()
8414 return state->stack[spi].spilled_ptr.ref_obj_id; in dynptr_ref_obj_id()
8507 if (spi < 0 || !state->stack[spi].spilled_ptr.ref_obj_id) { in check_func_arg()
8515 } else if (!reg->ref_obj_id && !register_is_null(reg)) { in check_func_arg()
8527 if (reg->ref_obj_id) { in check_func_arg()
8528 if (meta->ref_obj_id) { in check_func_arg()
8530 regno, reg->ref_obj_id, in check_func_arg()
8531 meta->ref_obj_id); in check_func_arg()
8534 meta->ref_obj_id = reg->ref_obj_id; in check_func_arg()
9150 int ref_obj_id) in release_reference() argument
9156 err = release_reference_state(cur_func(env), ref_obj_id); in release_reference()
9161 if (reg->ref_obj_id == ref_obj_id) in release_reference()
10057 } else if (meta.ref_obj_id) { in check_helper_call()
10058 err = release_reference(env, meta.ref_obj_id); in check_helper_call()
10144 int id, ref_obj_id; in check_helper_call() local
10155 if (meta.ref_obj_id) { in check_helper_call()
10166 ref_obj_id = dynptr_ref_obj_id(env, reg); in check_helper_call()
10167 if (ref_obj_id < 0) { in check_helper_call()
10169 return ref_obj_id; in check_helper_call()
10173 meta.ref_obj_id = ref_obj_id; in check_helper_call()
10352 regs[BPF_REG_0].ref_obj_id = meta.ref_obj_id; in check_helper_call()
10361 regs[BPF_REG_0].ref_obj_id = id; in check_helper_call()
10884 (is_kfunc_release(meta) && reg->ref_obj_id) || in process_kf_arg_ptr_to_btf_id()
10923 static int ref_convert_owning_non_owning(struct bpf_verifier_env *env, u32 ref_obj_id) in ref_convert_owning_non_owning() argument
10931 if (!ref_obj_id) { in ref_convert_owning_non_owning()
10938 if (state->refs[i].id != ref_obj_id) in ref_convert_owning_non_owning()
10945 if (reg->ref_obj_id == ref_obj_id) { in ref_convert_owning_non_owning()
10946 reg->ref_obj_id = 0; in ref_convert_owning_non_owning()
11353 if (reg->ref_obj_id) { in check_kfunc_args()
11354 if (is_kfunc_release(meta) && meta->ref_obj_id) { in check_kfunc_args()
11356 regno, reg->ref_obj_id, in check_kfunc_args()
11357 meta->ref_obj_id); in check_kfunc_args()
11360 meta->ref_obj_id = reg->ref_obj_id; in check_kfunc_args()
11411 if (is_kfunc_release(meta) && reg->ref_obj_id) in check_kfunc_args()
11436 if (!reg->ref_obj_id) { in check_kfunc_args()
11477 clone_ref_obj_id = meta->initialized_dynptr.ref_obj_id; in check_kfunc_args()
11497 meta->initialized_dynptr.ref_obj_id = dynptr_ref_obj_id(env, reg); in check_kfunc_args()
11513 if (reg->type == (PTR_TO_BTF_ID | MEM_ALLOC) && !reg->ref_obj_id) { in check_kfunc_args()
11527 if (reg->type == (PTR_TO_BTF_ID | MEM_ALLOC) && !reg->ref_obj_id) { in check_kfunc_args()
11540 if (!reg->ref_obj_id) { in check_kfunc_args()
11550 if (!type_is_non_owning_ref(reg->type) || reg->ref_obj_id) { in check_kfunc_args()
11563 if (!reg->ref_obj_id) { in check_kfunc_args()
11807 err = release_reference(env, regs[meta.release_regno].ref_obj_id); in check_kfunc_call()
11818 release_ref_obj_id = regs[BPF_REG_2].ref_obj_id; in check_kfunc_call()
11999 if (meta.ref_obj_id) in check_kfunc_call()
12000 regs[BPF_REG_0].ref_obj_id = meta.ref_obj_id; in check_kfunc_call()
12032 regs[BPF_REG_0].ref_obj_id = id; in check_kfunc_call()
14320 reg->ref_obj_id = 0; in mark_ptr_or_null_reg()
14347 u32 ref_obj_id = regs[regno].ref_obj_id; in mark_ptr_or_null_regs() local
14350 if (ref_obj_id && ref_obj_id == id && is_null) in mark_ptr_or_null_regs()
15983 check_ids(rold->ref_obj_id, rcur->ref_obj_id, idmap); in regs_exact()
16076 check_ids(rold->ref_obj_id, rcur->ref_obj_id, idmap); in regsafe()
16186 !check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap)) in stacksafe()
16202 !check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap)) in stacksafe()