Lines Matching +full:max +full:- +full:frame +full:- +full:size

1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
13 * ensures that umax_value + (int)off + (int)size cannot overflow a u64.
16 /* Maximum variable size permitted for ARG_CONST_SIZE[_OR_ZERO]. This ensures
21 /* Liveness marks, used for registers and spilled-regs (in stack slots).
26 * straight-line code that reached this state (from its parent) wrote this reg"
37 REG_LIVE_READ64 = 0x2, /* likewise, but full 64-bit content matters */
55 /* Max size from any of the above. */
69 * from a pointer-cast helper, bpf_sk_fullsock() and
82 * 8: snd_cwnd = tp->snd_cwnd; // verifier will complain
87 * the original refcounted ptr id (i.e. sk_reg->id) in ref_obj_id
89 * ref_obj_id matching the sk_reg->id.
91 * sk_reg->ref_obj_id is set to sk_reg->id at line 1.
92 * sk_reg->id will stay as NULL-marking purpose only.
93 * After NULL-marking is done, sk_reg->id can be reset to 0.
96 * fullsock_reg->ref_obj_id is set to sk_reg->ref_obj_id.
99 * tp_reg->ref_obj_id is set to fullsock_reg->ref_obj_id
100 * which is the same as sk_reg->ref_obj_id.
104 * reg->type. In particular, bpf_sk_release(tp) is also
111 * from the pointed-to object, and is shared with all bpf_reg_states
127 * R1=fp-8 and R2=fp-8, but one of them points to this function stack
129 * is used which is an index in bpf_verifier_state->frame[] array
139 /* if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety */
150 #define BPF_REG_SIZE 8 /* size of eBPF register in bytes */
175 /* stack frame number of this function state from pov of
200 struct bpf_func_state *frame[MAX_CALL_FRAMES]; member
204 * 0 - all possible paths from this state reached bpf_exit or
206 * 1 - at least one path is being explored.
208 * 2 - at least two paths are being explored.
216 * 2 -> 1 (first 'if' pushed into stack)
218 * 2 -> 1 (second 'if' pushed into stack)
227 * 2 -> 1 (first 'if' pushed into stack)
229 * 1 -> 1 (second 'if' pushed into stack)
240 * states_maybe_looping() function. It's a stronger pre-check and
258 * For most states jmp_history_cnt is [0-3].
265 #define bpf_get_spilled_reg(slot, frame) \ argument
266 (((slot < frame->allocated_stack / BPF_REG_SIZE) && \
267 (frame->stack[slot].slot_type[0] == STACK_SPILL)) \
268 ? &frame->stack[slot].spilled_ptr : NULL)
270 /* Iterate over 'frame', setting 'reg' to either NULL or a spilled register. */
271 #define bpf_for_each_spilled_reg(iter, frame, reg) \ argument
272 for (iter = 0, reg = bpf_get_spilled_reg(iter, frame); \
273 iter < frame->allocated_stack / BPF_REG_SIZE; \
274 iter++, reg = bpf_get_spilled_reg(iter, frame))
302 int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
311 #define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */
325 return log->len_used >= log->len_total - 1; in bpf_verifier_log_full()
336 return log->level && log->ubuf && !bpf_verifier_log_full(log); in bpf_verifier_log_needed()
343 u32 linfo_idx; /* The idx to the main_prog->aux->linfo */
344 u16 stack_depth; /* max. stack depth used by this function */
367 struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */
403 struct bpf_verifier_state *cur = env->cur_state; in cur_func()
405 return cur->frame[cur->curframe]; in cur_func()
410 return cur_func(env)->regs; in cur_regs()