aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bpf_verifier.h
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2018-05-02 16:17:17 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-05-04 05:58:35 -0400
commitf910cefa32b6cdabc96b126bcfc46d8940b1dc45 (patch)
tree9749a7702e13b451ed514d4d8711bb28af91c8ea /include/linux/bpf_verifier.h
parent5234ccf2be0e51b2cd052fe5e2fcc978e67aebc7 (diff)
bpf: unify main prog and subprog
Currently, verifier treat main prog and subprog differently. All subprogs detected are kept in env->subprog_starts while main prog is not kept there. Instead, main prog is implicitly defined as the prog start at 0. There is actually no difference between main prog and subprog, it is better to unify them, and register all progs detected into env->subprog_starts. This could also help simplifying some code logic. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r--include/linux/bpf_verifier.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 7e61c395fddf..f655b926e432 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -191,7 +191,7 @@ struct bpf_verifier_env {
191 bool seen_direct_write; 191 bool seen_direct_write;
192 struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ 192 struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */
193 struct bpf_verifier_log log; 193 struct bpf_verifier_log log;
194 u32 subprog_starts[BPF_MAX_SUBPROGS]; 194 u32 subprog_starts[BPF_MAX_SUBPROGS + 1];
195 /* computes the stack depth of each bpf function */ 195 /* computes the stack depth of each bpf function */
196 u16 subprog_stack_depth[BPF_MAX_SUBPROGS + 1]; 196 u16 subprog_stack_depth[BPF_MAX_SUBPROGS + 1];
197 u32 subprog_cnt; 197 u32 subprog_cnt;