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>
This commit is contained in:

committed by
Alexei Starovoitov

parent
8b6b25cf93
commit
c08435ec7f
@@ -212,6 +212,8 @@ struct bpf_subprog_info {
|
||||
* one verifier_env per bpf_check() call
|
||||
*/
|
||||
struct bpf_verifier_env {
|
||||
u32 insn_idx;
|
||||
u32 prev_insn_idx;
|
||||
struct bpf_prog *prog; /* eBPF program being verified */
|
||||
const struct bpf_verifier_ops *ops;
|
||||
struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */
|
||||
|
Reference in New Issue
Block a user