Lines Matching refs:off

340 				insn->off, insn->src_reg);  in print_bpf_insn()
345 insn->dst_reg, insn->off, in print_bpf_insn()
358 insn->off, insn->imm); in print_bpf_insn()
367 insn->src_reg, insn->off); in print_bpf_insn()
393 insn->code, insn->off); in print_bpf_insn()
400 insn->src_reg, insn->off); in print_bpf_insn()
405 insn->imm, insn->off); in print_bpf_insn()
536 static int check_stack_write(struct verifier_state *state, int off, int size, in check_stack_write() argument
556 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = in check_stack_write()
560 state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_SPILL; in check_stack_write()
563 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = in check_stack_write()
567 state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_MISC; in check_stack_write()
572 static int check_stack_read(struct verifier_state *state, int off, int size, in check_stack_read() argument
578 slot_type = &state->stack_slot_type[MAX_BPF_STACK + off]; in check_stack_read()
595 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE]; in check_stack_read()
601 off, i, size); in check_stack_read()
613 static int check_map_access(struct verifier_env *env, u32 regno, int off, in check_map_access() argument
618 if (off < 0 || off + size > map->value_size) { in check_map_access()
620 map->value_size, off, size); in check_map_access()
627 static int check_ctx_access(struct verifier_env *env, int off, int size, in check_ctx_access() argument
631 env->prog->aux->ops->is_valid_access(off, size, t)) in check_ctx_access()
634 verbose("invalid bpf_context access off=%d size=%d\n", off, size); in check_ctx_access()
644 static int check_mem_access(struct verifier_env *env, u32 regno, int off, in check_mem_access() argument
655 if (off % size != 0) { in check_mem_access()
656 verbose("misaligned access off %d size %d\n", off, size); in check_mem_access()
661 err = check_map_access(env, regno, off, size); in check_mem_access()
666 err = check_ctx_access(env, off, size, t); in check_mem_access()
671 if (off >= 0 || off < -MAX_BPF_STACK) { in check_mem_access()
672 verbose("invalid stack off=%d size=%d\n", off, size); in check_mem_access()
676 err = check_stack_write(state, off, size, value_regno); in check_mem_access()
678 err = check_stack_read(state, off, size, value_regno); in check_mem_access()
709 err = check_mem_access(env, insn->dst_reg, insn->off, in check_xadd()
715 return check_mem_access(env, insn->dst_reg, insn->off, in check_xadd()
728 int off, i; in check_stack_boundary() local
733 off = regs[regno].imm; in check_stack_boundary()
734 if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 || in check_stack_boundary()
737 regno, off, access_size); in check_stack_boundary()
742 if (state->stack_slot_type[MAX_BPF_STACK + off + i] != STACK_MISC) { in check_stack_boundary()
744 off, i, access_size); in check_stack_boundary()
923 insn->off != 0 || insn->imm != 0) { in check_alu_op()
928 if (insn->src_reg != BPF_REG_0 || insn->off != 0 || in check_alu_op()
948 if (insn->imm != 0 || insn->off != 0) { in check_alu_op()
958 if (insn->src_reg != BPF_REG_0 || insn->off != 0) { in check_alu_op()
996 if (insn->imm != 0 || insn->off != 0) { in check_alu_op()
1005 if (insn->src_reg != BPF_REG_0 || insn->off != 0) { in check_alu_op()
1096 *insn_idx += insn->off; in check_cond_jmp_op()
1107 other_branch = push_stack(env, *insn_idx + insn->off + 1, *insn_idx); in check_cond_jmp_op()
1169 if (insn->off != 0) { in check_ld_imm()
1229 if (insn->dst_reg != BPF_REG_0 || insn->off != 0 || in check_ld_abs()
1401 ret = push_insn(t, t + insns[t].off + 1, in check_cfg()
1420 ret = push_insn(t, t + insns[t].off + 1, BRANCH, env); in check_cfg()
1655 err = check_mem_access(env, insn->src_reg, insn->off, in do_check()
1711 err = check_mem_access(env, insn->dst_reg, insn->off, in do_check()
1729 err = check_mem_access(env, insn->dst_reg, insn->off, in do_check()
1740 insn->off != 0 || in do_check()
1760 insn_idx += insn->off + 1; in do_check()
1847 insn[1].off != 0) { in replace_map_fd_with_map_ptr()
1945 if (i < pos && i + insn->off + 1 > pos) in adjust_branches()
1946 insn->off += delta; in adjust_branches()
1947 else if (i > pos + delta && i + insn->off + 1 <= pos + delta) in adjust_branches()
1948 insn->off -= delta; in adjust_branches()
1979 insn->off, insn_buf); in convert_ctx_accesses()