aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bpf_verifier.h
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2019-01-02 18:58:27 -0500
committerAlexei Starovoitov <ast@kernel.org>2019-01-02 19:01:24 -0500
commitc08435ec7f2bc8f4109401f696fd55159b4b40cb (patch)
tree3e307a1a8967ae960b5110b5972dae885c843681 /include/linux/bpf_verifier.h
parent8b6b25cf93b73e8e399adc55b0ffb9db32b881e0 (diff)
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>
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r--include/linux/bpf_verifier.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index c233efc106c6..3f84f3e87704 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -212,6 +212,8 @@ struct bpf_subprog_info {
212 * one verifier_env per bpf_check() call 212 * one verifier_env per bpf_check() call
213 */ 213 */
214struct bpf_verifier_env { 214struct bpf_verifier_env {
215 u32 insn_idx;
216 u32 prev_insn_idx;
215 struct bpf_prog *prog; /* eBPF program being verified */ 217 struct bpf_prog *prog; /* eBPF program being verified */
216 const struct bpf_verifier_ops *ops; 218 const struct bpf_verifier_ops *ops;
217 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */ 219 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */