aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bpf_verifier.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r--include/linux/bpf_verifier.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 7e61c395fddf..8f70dc181e23 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -173,6 +173,11 @@ static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
173 173
174#define BPF_MAX_SUBPROGS 256 174#define BPF_MAX_SUBPROGS 256
175 175
176struct bpf_subprog_info {
177 u32 start; /* insn idx of function entry point */
178 u16 stack_depth; /* max. stack depth used by this function */
179};
180
176/* single container for all structs 181/* single container for all structs
177 * one verifier_env per bpf_check() call 182 * one verifier_env per bpf_check() call
178 */ 183 */
@@ -191,9 +196,7 @@ struct bpf_verifier_env {
191 bool seen_direct_write; 196 bool seen_direct_write;
192 struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ 197 struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */
193 struct bpf_verifier_log log; 198 struct bpf_verifier_log log;
194 u32 subprog_starts[BPF_MAX_SUBPROGS]; 199 struct bpf_subprog_info subprog_info[BPF_MAX_SUBPROGS + 1];
195 /* computes the stack depth of each bpf function */
196 u16 subprog_stack_depth[BPF_MAX_SUBPROGS + 1];
197 u32 subprog_cnt; 200 u32 subprog_cnt;
198}; 201};
199 202