Lines Matching refs:cur

303 			 const struct bpf_reg_state *cur)  in range_within()  argument
305 return cnum64_is_subset(old->r64, cur->r64) && in range_within()
306 cnum32_is_subset(old->r32, cur->r32); in range_within()
333 return map[i].cur == cur_id; in check_ids()
334 if (map[i].cur == cur_id) in check_ids()
341 map[idmap->cnt].cur = cur_id; in check_ids()
702 struct bpf_func_state *cur, struct bpf_idmap *idmap, in stacksafe() argument
719 u8 cur_type = i < cur->allocated_stack ? in stacksafe()
720 cur->stack[spi].slot_type[i % BPF_REG_SIZE] : STACK_INVALID; in stacksafe()
727 if (i >= cur->allocated_stack || old_type != cur_type) in stacksafe()
742 if (i >= cur->allocated_stack) in stacksafe()
753 cur_reg = scalar_reg_for_stack(env, &cur->stack[spi], im); in stacksafe()
767 cur->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_ZERO) in stacksafe()
770 cur->stack[spi].slot_type[i % BPF_REG_SIZE]) in stacksafe()
793 &cur->stack[spi].spilled_ptr, idmap, exact)) in stacksafe()
798 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
807 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
824 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
847 struct bpf_func_state *cur, struct bpf_idmap *idmap, in stack_arg_safe() argument
852 nslots = max(old->out_stack_arg_cnt, cur->out_stack_arg_cnt); in stack_arg_safe()
859 cur_arg = i < cur->out_stack_arg_cnt ? in stack_arg_safe()
860 &cur->stack_arg_regs[i] : &not_init; in stack_arg_safe()
868 static bool refsafe(struct bpf_verifier_state *old, struct bpf_verifier_state *cur, in refsafe() argument
873 if (old->acquired_refs != cur->acquired_refs) in refsafe()
876 if (old->active_locks != cur->active_locks) in refsafe()
879 if (old->active_preempt_locks != cur->active_preempt_locks) in refsafe()
882 if (old->active_rcu_locks != cur->active_rcu_locks) in refsafe()
885 if (!check_ids(old->active_irq_id, cur->active_irq_id, idmap)) in refsafe()
888 if (!check_ids(old->active_lock_id, cur->active_lock_id, idmap) || in refsafe()
889 old->active_lock_ptr != cur->active_lock_ptr) in refsafe()
893 if (!check_ids(old->refs[i].id, cur->refs[i].id, idmap) || in refsafe()
894 old->refs[i].type != cur->refs[i].type) in refsafe()
898 if (!check_ids(old->refs[i].parent_id, cur->refs[i].parent_id, idmap)) in refsafe()
906 if (old->refs[i].ptr != cur->refs[i].ptr) in refsafe()
945 struct bpf_func_state *cur, u32 insn_idx, enum exact_level exact) in func_states_equal() argument
950 if (old->callback_depth > cur->callback_depth) in func_states_equal()
953 if (!old->no_stack_arg_load && cur->no_stack_arg_load) in func_states_equal()
958 !regsafe(env, &old->regs[i], &cur->regs[i], in func_states_equal()
962 if (!stacksafe(env, old, cur, &env->idmap_scratch, exact)) in func_states_equal()
965 if (!stack_arg_safe(env, old, cur, &env->idmap_scratch, exact)) in func_states_equal()
981 struct bpf_verifier_state *cur, in states_equal() argument
987 if (old->curframe != cur->curframe) in states_equal()
995 if (old->speculative && !cur->speculative) in states_equal()
998 if (old->in_sleepable != cur->in_sleepable) in states_equal()
1001 if (!refsafe(old, cur, &env->idmap_scratch)) in states_equal()
1009 if (old->frame[i]->callsite != cur->frame[i]->callsite) in states_equal()
1011 if (!func_states_equal(env, old->frame[i], cur->frame[i], insn_idx, exact)) in states_equal()
1022 struct bpf_verifier_state *cur, in propagate_precision() argument
1069 err = bpf_mark_chain_precision(env, cur, -1, changed); in propagate_precision()
1114 struct bpf_verifier_state *cur) in states_maybe_looping() argument
1117 int i, fr = cur->curframe; in states_maybe_looping()
1123 fcur = cur->frame[fr]; in states_maybe_looping()
1189 …atic bool iter_active_depths_differ(struct bpf_verifier_state *old, struct bpf_verifier_state *cur) in iter_active_depths_differ() argument
1205 cur_slot = &cur->frame[fr]->stack[i].spilled_ptr; in iter_active_depths_differ()
1242 struct bpf_verifier_state *cur = env->cur_state, *new; in bpf_is_state_visited() local
1249 cur->jmp_history_cnt > 40; in bpf_is_state_visited()
1265 err = clean_verifier_state(env, cur); in bpf_is_state_visited()
1281 frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) { in bpf_is_state_visited()
1332 if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) { in bpf_is_state_visited()
1337 cur_frame = cur->frame[cur->curframe]; in bpf_is_state_visited()
1356 if (sl->state.may_goto_depth != cur->may_goto_depth && in bpf_is_state_visited()
1357 states_equal(env, &sl->state, cur, RANGE_WITHIN)) { in bpf_is_state_visited()
1363 if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) { in bpf_is_state_visited()
1370 if (states_maybe_looping(&sl->state, cur) && in bpf_is_state_visited()
1371 states_equal(env, &sl->state, cur, EXACT) && in bpf_is_state_visited()
1372 !iter_active_depths_differ(&sl->state, cur) && in bpf_is_state_visited()
1373 sl->state.may_goto_depth == cur->may_goto_depth && in bpf_is_state_visited()
1374 sl->state.callback_unroll_depth == cur->callback_unroll_depth) { in bpf_is_state_visited()
1378 print_verifier_state(env, cur, cur->curframe, true); in bpf_is_state_visited()
1380 print_verifier_state(env, &sl->state, cur->curframe, true); in bpf_is_state_visited()
1404 if (states_equal(env, &sl->state, cur, loop ? RANGE_WITHIN : NOT_EXACT)) { in bpf_is_state_visited()
1415 err = bpf_push_jmp_history(env, cur, 0, 0, 0, 0); in bpf_is_state_visited()
1416 err = err ? : propagate_precision(env, &sl->state, cur, NULL); in bpf_is_state_visited()
1498 err = bpf_copy_verifier_state(&backedge->state, cur); in bpf_is_state_visited()
1570 mark_all_scalars_imprecise(env, cur); in bpf_is_state_visited()
1572 bpf_clear_singular_ids(env, cur); in bpf_is_state_visited()
1576 err = bpf_copy_verifier_state(new, cur); in bpf_is_state_visited()
1593 cur->parent = new; in bpf_is_state_visited()
1594 cur->first_insn_idx = insn_idx; in bpf_is_state_visited()
1595 cur->dfs_depth = new->dfs_depth + 1; in bpf_is_state_visited()
1596 bpf_clear_jmp_history(cur); in bpf_is_state_visited()