Lines Matching refs:off
341 insn->off, insn->src_reg); in print_bpf_insn()
346 insn->dst_reg, insn->off, in print_bpf_insn()
359 insn->off, insn->imm); in print_bpf_insn()
368 insn->src_reg, insn->off); in print_bpf_insn()
394 insn->code, insn->off); in print_bpf_insn()
401 insn->src_reg, insn->off); in print_bpf_insn()
406 insn->imm, insn->off); in print_bpf_insn()
552 static int check_stack_write(struct verifier_state *state, int off, int size, in check_stack_write() argument
570 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = in check_stack_write()
574 state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_SPILL; in check_stack_write()
577 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = in check_stack_write()
581 state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_MISC; in check_stack_write()
586 static int check_stack_read(struct verifier_state *state, int off, int size, in check_stack_read() argument
592 slot_type = &state->stack_slot_type[MAX_BPF_STACK + off]; in check_stack_read()
609 state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE]; in check_stack_read()
615 off, i, size); in check_stack_read()
627 static int check_map_access(struct verifier_env *env, u32 regno, int off, in check_map_access() argument
632 if (off < 0 || off + size > map->value_size) { in check_map_access()
634 map->value_size, off, size); in check_map_access()
641 static int check_ctx_access(struct verifier_env *env, int off, int size, in check_ctx_access() argument
645 env->prog->aux->ops->is_valid_access(off, size, t)) in check_ctx_access()
648 verbose("invalid bpf_context access off=%d size=%d\n", off, size); in check_ctx_access()
672 static int check_mem_access(struct verifier_env *env, u32 regno, int off, in check_mem_access() argument
680 off += state->regs[regno].imm; in check_mem_access()
686 if (off % size != 0) { in check_mem_access()
687 verbose("misaligned access off %d size %d\n", off, size); in check_mem_access()
697 err = check_map_access(env, regno, off, size); in check_mem_access()
707 err = check_ctx_access(env, off, size, t); in check_mem_access()
713 if (off >= 0 || off < -MAX_BPF_STACK) { in check_mem_access()
714 verbose("invalid stack off=%d size=%d\n", off, size); in check_mem_access()
719 state->stack_slot_type[MAX_BPF_STACK + off] == STACK_SPILL && in check_mem_access()
724 err = check_stack_write(state, off, size, value_regno); in check_mem_access()
726 err = check_stack_read(state, off, size, value_regno); in check_mem_access()
758 err = check_mem_access(env, insn->dst_reg, insn->off, in check_xadd()
764 return check_mem_access(env, insn->dst_reg, insn->off, in check_xadd()
777 int off, i; in check_stack_boundary() local
782 off = regs[regno].imm; in check_stack_boundary()
783 if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 || in check_stack_boundary()
786 regno, off, access_size); in check_stack_boundary()
791 if (state->stack_slot_type[MAX_BPF_STACK + off + i] != STACK_MISC) { in check_stack_boundary()
793 off, i, access_size); in check_stack_boundary()
1025 insn->off != 0 || insn->imm != 0) { in check_alu_op()
1030 if (insn->src_reg != BPF_REG_0 || insn->off != 0 || in check_alu_op()
1056 if (insn->imm != 0 || insn->off != 0) { in check_alu_op()
1066 if (insn->src_reg != BPF_REG_0 || insn->off != 0) { in check_alu_op()
1109 if (insn->imm != 0 || insn->off != 0) { in check_alu_op()
1118 if (insn->src_reg != BPF_REG_0 || insn->off != 0) { in check_alu_op()
1225 *insn_idx += insn->off; in check_cond_jmp_op()
1236 other_branch = push_stack(env, *insn_idx + insn->off + 1, *insn_idx); in check_cond_jmp_op()
1301 if (insn->off != 0) { in check_ld_imm()
1361 if (insn->dst_reg != BPF_REG_0 || insn->off != 0 || in check_ld_abs()
1534 ret = push_insn(t, t + insns[t].off + 1, in check_cfg()
1553 ret = push_insn(t, t + insns[t].off + 1, BRANCH, env); in check_cfg()
1788 err = check_mem_access(env, insn->src_reg, insn->off, in do_check()
1843 err = check_mem_access(env, insn->dst_reg, insn->off, in do_check()
1870 err = check_mem_access(env, insn->dst_reg, insn->off, in do_check()
1881 insn->off != 0 || in do_check()
1901 insn_idx += insn->off + 1; in do_check()
1999 insn[1].off != 0) { in replace_map_fd_with_map_ptr()
2097 if (i < pos && i + insn->off + 1 > pos) in adjust_branches()
2098 insn->off += delta; in adjust_branches()
2099 else if (i > pos + delta && i + insn->off + 1 <= pos + delta) in adjust_branches()
2100 insn->off -= delta; in adjust_branches()
2136 insn->off, insn_buf, env->prog); in convert_ctx_accesses()