Lines Matching defs:cur
301 /* check %cur's range satisfies %old's */
303 const struct bpf_reg_state *cur)
305 return cnum64_is_subset(old->r64, cur->r64) &&
306 cnum32_is_subset(old->r32, cur->r32);
333 return map[i].cur == cur_id;
334 if (map[i].cur == cur_id)
341 map[idmap->cnt].cur = cur_id;
361 * relationships for this register, it's always safe to accept cur regardless
365 * independent registers in cur don't incorrectly satisfy the ID matching
368 * Example: if old has r6.id=X and r7.id=X (linked), but cur has r6.id=0
375 * r2.id=A, r3.id=A|flag (r3 = r2 + delta), cur has r2.id=B, r3.id=C|flag
702 struct bpf_func_state *cur, struct bpf_idmap *idmap,
719 u8 cur_type = i < cur->allocated_stack ?
720 cur->stack[spi].slot_type[i % BPF_REG_SIZE] : STACK_INVALID;
727 if (i >= cur->allocated_stack || old_type != cur_type)
742 if (i >= cur->allocated_stack)
753 cur_reg = scalar_reg_for_stack(env, &cur->stack[spi], im);
767 cur->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_ZERO)
770 cur->stack[spi].slot_type[i % BPF_REG_SIZE])
779 /* Both old and cur are having same slot_type */
793 &cur->stack[spi].spilled_ptr, idmap, exact))
798 cur_reg = &cur->stack[spi].spilled_ptr;
807 cur_reg = &cur->stack[spi].spilled_ptr;
824 cur_reg = &cur->stack[spi].spilled_ptr;
847 struct bpf_func_state *cur, struct bpf_idmap *idmap,
852 nslots = max(old->out_stack_arg_cnt, cur->out_stack_arg_cnt);
859 cur_arg = i < cur->out_stack_arg_cnt ?
860 &cur->stack_arg_regs[i] : ¬_init;
868 static bool refsafe(struct bpf_verifier_state *old, struct bpf_verifier_state *cur,
873 if (old->acquired_refs != cur->acquired_refs)
876 if (old->active_locks != cur->active_locks)
879 if (old->active_preempt_locks != cur->active_preempt_locks)
882 if (old->active_rcu_locks != cur->active_rcu_locks)
885 if (!check_ids(old->active_irq_id, cur->active_irq_id, idmap))
888 if (!check_ids(old->active_lock_id, cur->active_lock_id, idmap) ||
889 old->active_lock_ptr != cur->active_lock_ptr)
893 if (!check_ids(old->refs[i].id, cur->refs[i].id, idmap) ||
894 old->refs[i].type != cur->refs[i].type)
898 if (!check_ids(old->refs[i].parent_id, cur->refs[i].parent_id, idmap))
906 if (old->refs[i].ptr != cur->refs[i].ptr)
945 struct bpf_func_state *cur, u32 insn_idx, enum exact_level exact)
950 if (old->callback_depth > cur->callback_depth)
953 if (!old->no_stack_arg_load && cur->no_stack_arg_load)
958 !regsafe(env, &old->regs[i], &cur->regs[i],
962 if (!stacksafe(env, old, cur, &env->idmap_scratch, exact))
965 if (!stack_arg_safe(env, old, cur, &env->idmap_scratch, exact))
981 struct bpf_verifier_state *cur,
987 if (old->curframe != cur->curframe)
995 if (old->speculative && !cur->speculative)
998 if (old->in_sleepable != cur->in_sleepable)
1001 if (!refsafe(old, cur, &env->idmap_scratch))
1009 if (old->frame[i]->callsite != cur->frame[i]->callsite)
1011 if (!func_states_equal(env, old->frame[i], cur->frame[i], insn_idx, exact))
1022 struct bpf_verifier_state *cur,
1069 err = bpf_mark_chain_precision(env, cur, -1, changed);
1114 struct bpf_verifier_state *cur)
1117 int i, fr = cur->curframe;
1123 fcur = cur->frame[fr];
1189 static bool iter_active_depths_differ(struct bpf_verifier_state *old, struct bpf_verifier_state *cur)
1205 cur_slot = &cur->frame[fr]->stack[i].spilled_ptr;
1242 struct bpf_verifier_state *cur = env->cur_state, *new;
1249 cur->jmp_history_cnt > 40;
1265 err = clean_verifier_state(env, cur);
1281 frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) {
1332 if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) {
1337 cur_frame = cur->frame[cur->curframe];
1356 if (sl->state.may_goto_depth != cur->may_goto_depth &&
1357 states_equal(env, &sl->state, cur, RANGE_WITHIN)) {
1363 if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) {
1370 if (states_maybe_looping(&sl->state, cur) &&
1371 states_equal(env, &sl->state, cur, EXACT) &&
1372 !iter_active_depths_differ(&sl->state, cur) &&
1373 sl->state.may_goto_depth == cur->may_goto_depth &&
1374 sl->state.callback_unroll_depth == cur->callback_unroll_depth) {
1377 verbose(env, "cur state:");
1378 print_verifier_state(env, cur, cur->curframe, true);
1380 print_verifier_state(env, &sl->state, cur->curframe, true);
1404 if (states_equal(env, &sl->state, cur, loop ? RANGE_WITHIN : NOT_EXACT)) {
1415 err = bpf_push_jmp_history(env, cur, 0, 0, 0, 0);
1416 err = err ? : propagate_precision(env, &sl->state, cur, NULL);
1498 err = bpf_copy_verifier_state(&backedge->state, cur);
1570 mark_all_scalars_imprecise(env, cur);
1572 bpf_clear_singular_ids(env, cur);
1576 err = bpf_copy_verifier_state(new, cur);
1593 cur->parent = new;
1594 cur->first_insn_idx = insn_idx;
1595 cur->dfs_depth = new->dfs_depth + 1;
1596 bpf_clear_jmp_history(cur);