Lines Matching refs:stack
568 static bool is_spilled_reg(const struct bpf_stack_state *stack) in is_spilled_reg() argument
570 return stack->slot_type[BPF_REG_SIZE - 1] == STACK_SPILL; in is_spilled_reg()
673 if (state->stack[i].slot_type[j] != STACK_INVALID) in print_verifier_state()
676 state->stack[i].slot_type[j]]; in print_verifier_state()
682 print_liveness(env, state->stack[i].spilled_ptr.live); in print_verifier_state()
683 if (is_spilled_reg(&state->stack[i])) { in print_verifier_state()
684 reg = &state->stack[i].spilled_ptr; in print_verifier_state()
722 COPY_STATE_FN(stack, allocated_stack, stack, BPF_REG_SIZE) in COPY_STATE_FN() argument
762 REALLOC_STATE_FN(stack, allocated_stack, stack, BPF_REG_SIZE)
838 kfree(state->stack); in free_func_state()
2045 if (!is_spilled_reg(&func->stack[j])) in mark_all_scalars_precise()
2047 reg = &func->stack[j].spilled_ptr; in mark_all_scalars_precise()
2071 if (!is_spilled_reg(&func->stack[j])) in mark_all_scalars_imprecise()
2073 reg = &func->stack[j].spilled_ptr; in mark_all_scalars_imprecise()
2200 if (!is_spilled_reg(&func->stack[spi])) { in __mark_chain_precision()
2204 reg = &func->stack[spi].spilled_ptr; in __mark_chain_precision()
2325 if (!is_spilled_reg(&func->stack[i])) { in __mark_chain_precision()
2329 reg = &func->stack[i].spilled_ptr; in __mark_chain_precision()
2456 copy_register_state(&state->stack[spi].spilled_ptr, reg); in save_register_state()
2458 state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; in save_register_state()
2461 state->stack[spi].slot_type[i - 1] = STACK_SPILL; in save_register_state()
2465 scrub_spilled_slot(&state->stack[spi].slot_type[i - 1]); in save_register_state()
2496 is_spilled_reg(&state->stack[spi]) && in check_stack_write_fixed_off()
2509 u8 type = state->stack[spi].slot_type[i]; in check_stack_write_fixed_off()
2537 state->stack[spi].spilled_ptr.id = 0; in check_stack_write_fixed_off()
2561 state->stack[spi].spilled_ptr.type = NOT_INIT; in check_stack_write_fixed_off()
2563 if (is_spilled_reg(&state->stack[spi])) in check_stack_write_fixed_off()
2565 scrub_spilled_slot(&state->stack[spi].slot_type[i]); in check_stack_write_fixed_off()
2576 state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; in check_stack_write_fixed_off()
2590 state->stack[spi].slot_type[(slot - i) % BPF_REG_SIZE] = in check_stack_write_fixed_off()
2653 stype = &state->stack[spi].slot_type[slot % BPF_REG_SIZE]; in check_stack_write_var_off()
2673 state->stack[spi].spilled_ptr.type = NOT_INIT; in check_stack_write_var_off()
2727 stype = ptr_state->stack[spi].slot_type; in mark_reg_stack_read()
2775 stype = reg_state->stack[spi].slot_type; in check_stack_read_fixed_off()
2776 reg = ®_state->stack[spi].spilled_ptr; in check_stack_read_fixed_off()
2778 if (is_spilled_reg(®_state->stack[spi])) { in check_stack_read_fixed_off()
3473 u16 stack = env->subprog_info[func->subprogno].stack_depth; in update_stack_depth() local
3475 if (stack >= -off) in update_stack_depth()
4295 stype = &state->stack[spi].slot_type[slot % BPF_REG_SIZE]; in check_stack_range_initialized()
4306 if (is_spilled_reg(&state->stack[spi]) && in check_stack_range_initialized()
4307 state->stack[spi].spilled_ptr.type == PTR_TO_BTF_ID) in check_stack_range_initialized()
4310 if (is_spilled_reg(&state->stack[spi]) && in check_stack_range_initialized()
4311 (state->stack[spi].spilled_ptr.type == SCALAR_VALUE || in check_stack_range_initialized()
4314 __mark_reg_unknown(env, &state->stack[spi].spilled_ptr); in check_stack_range_initialized()
4316 scrub_spilled_slot(&state->stack[spi].slot_type[j]); in check_stack_range_initialized()
4337 mark_reg_read(env, &state->stack[spi].spilled_ptr, in check_stack_range_initialized()
4338 state->stack[spi].spilled_ptr.parent, in check_stack_range_initialized()
9268 live = st->stack[i].spilled_ptr.live; in clean_func_state()
9270 st->stack[i].spilled_ptr.live |= REG_LIVE_DONE; in clean_func_state()
9272 __mark_reg_not_init(env, &st->stack[i].spilled_ptr); in clean_func_state()
9274 st->stack[i].slot_type[j] = STACK_INVALID; in clean_func_state()
9477 if (!(old->stack[spi].spilled_ptr.live & REG_LIVE_READ)) { in stacksafe()
9483 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_INVALID) in stacksafe()
9496 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_MISC && in stacksafe()
9497 cur->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_ZERO) in stacksafe()
9499 if (old->stack[spi].slot_type[i % BPF_REG_SIZE] != in stacksafe()
9500 cur->stack[spi].slot_type[i % BPF_REG_SIZE]) in stacksafe()
9509 if (!is_spilled_reg(&old->stack[spi])) in stacksafe()
9511 if (!regsafe(env, &old->stack[spi].spilled_ptr, in stacksafe()
9512 &cur->stack[spi].spilled_ptr, idmap)) in stacksafe()
9681 parent_reg = &parent->stack[i].spilled_ptr; in propagate_liveness()
9682 state_reg = &state->stack[i].spilled_ptr; in propagate_liveness()
9718 if (!is_spilled_reg(&state->stack[i])) in propagate_precision()
9720 state_reg = &state->stack[i].spilled_ptr; in propagate_precision()
9957 frame->stack[i].spilled_ptr.live = REG_LIVE_NONE; in is_state_visited()
9958 frame->stack[i].spilled_ptr.parent = in is_state_visited()
9959 &newframe->stack[i].spilled_ptr; in is_state_visited()