Lines Matching refs:stack
425 u8 stype = st->stack[i].slot_type[7]; in __clean_func_state()
445 struct bpf_reg_state *spill = &st->stack[i].spilled_ptr; in __clean_func_state()
457 u8 *t = &st->stack[i].slot_type[j]; in __clean_func_state()
466 st->stack[i].slot_type[j] = STACK_POISON; in __clean_func_state()
667 static bool is_spilled_scalar_after(const struct bpf_stack_state *stack, int im) in is_spilled_scalar_after() argument
669 return stack->slot_type[im] == STACK_SPILL && in is_spilled_scalar_after()
670 stack->spilled_ptr.type == SCALAR_VALUE; in is_spilled_scalar_after()
674 struct bpf_stack_state *stack, int im) in is_stack_misc_after() argument
678 for (i = im; i < ARRAY_SIZE(stack->slot_type); ++i) { in is_stack_misc_after()
679 if ((stack->slot_type[i] == STACK_MISC) || in is_stack_misc_after()
680 ((stack->slot_type[i] == STACK_INVALID || stack->slot_type[i] == STACK_POISON) && in is_stack_misc_after()
690 struct bpf_stack_state *stack, int im) in scalar_reg_for_stack() argument
692 if (is_spilled_scalar_after(stack, im)) in scalar_reg_for_stack()
693 return &stack->spilled_ptr; in scalar_reg_for_stack()
695 if (is_stack_misc_after(env, stack, im)) in scalar_reg_for_stack()
718 u8 old_type = old->stack[spi].slot_type[i % BPF_REG_SIZE]; in stacksafe()
720 cur->stack[spi].slot_type[i % BPF_REG_SIZE] : STACK_INVALID; in stacksafe()
731 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_INVALID || in stacksafe()
732 old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_POISON) in stacksafe()
736 old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_MISC) in stacksafe()
752 old_reg = scalar_reg_for_stack(env, &old->stack[spi], im); in stacksafe()
753 cur_reg = scalar_reg_for_stack(env, &cur->stack[spi], im); in stacksafe()
766 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_MISC && in stacksafe()
767 cur->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_ZERO) in stacksafe()
769 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] != in stacksafe()
770 cur->stack[spi].slot_type[i % BPF_REG_SIZE]) in stacksafe()
780 switch (old->stack[spi].slot_type[BPF_REG_SIZE - 1]) { in stacksafe()
792 if (!regsafe(env, &old->stack[spi].spilled_ptr, in stacksafe()
793 &cur->stack[spi].spilled_ptr, idmap, exact)) in stacksafe()
797 old_reg = &old->stack[spi].spilled_ptr; in stacksafe()
798 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
806 old_reg = &old->stack[spi].spilled_ptr; in stacksafe()
807 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
823 old_reg = &old->stack[spi].spilled_ptr; in stacksafe()
824 cur_reg = &cur->stack[spi].spilled_ptr; in stacksafe()
1049 if (!bpf_is_spilled_reg(&state->stack[i])) in propagate_precision()
1051 state_reg = &state->stack[i].spilled_ptr; in propagate_precision()
1198 if (state->stack[i].slot_type[0] != STACK_ITER) in iter_active_depths_differ()
1201 slot = &state->stack[i].spilled_ptr; in iter_active_depths_differ()
1205 cur_slot = &cur->frame[fr]->stack[i].spilled_ptr; in iter_active_depths_differ()
1228 if (!bpf_is_spilled_reg(&func->stack[j])) in mark_all_scalars_imprecise()
1230 reg = &func->stack[j].spilled_ptr; in mark_all_scalars_imprecise()
1347 iter_state = &bpf_func(env, iter_reg)->stack[spi].spilled_ptr; in bpf_is_state_visited()