bpf: move {prev_,}insn_idx into verifier env
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jan 2019 23:58:27 +0000 (00:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Jan 2019 00:01:24 +0000 (16:01 -0800)
commitc08435ec7f2bc8f4109401f696fd55159b4b40cb
tree3e307a1a8967ae960b5110b5972dae885c843681
parent8b6b25cf93b73e8e399adc55b0ffb9db32b881e0
bpf: move {prev_,}insn_idx into verifier env

Move prev_insn_idx and insn_idx from the do_check() function into
the verifier environment, so they can be read inside the various
helper functions for handling the instructions. It's easier to put
this into the environment rather than changing all call-sites only
to pass it along. insn_idx is useful in particular since this later
on allows to hold state in env->insn_aux_data[env->insn_idx].

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_verifier.h
kernel/bpf/verifier.c