]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0dc57db4148cedc7441351d02b87b0e446163a0f
tree3e307a1a8967ae960b5110b5972dae885c843681
parent14ef694f4766e1dc857537db5f0050744697ff51
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