diff options
author | Alexei Starovoitov <ast@kernel.org> | 2017-12-26 00:15:40 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2017-12-27 20:36:23 +0300 |
commit | 70a87ffea8acc390ae315fa1930e849f656bdb88 (patch) | |
tree | 7a7ce271921b6767965e7c73b30cb4ffb643b404 /include/linux/bpf_verifier.h | |
parent | 6b80ad299208b44ba33cb6df80bdaa3f63cf03e2 (diff) | |
download | linux-70a87ffea8acc390ae315fa1930e849f656bdb88.tar.xz |
bpf: fix maximum stack depth tracking logic
Instead of computing max stack depth for current call chain
during the main verifier pass track stack depth of each
function independently and after do_check() is done do
another pass over all instructions analyzing depth
of all possible call stacks.
Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r-- | include/linux/bpf_verifier.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index aaac589e490c..94a02ceb1246 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -194,6 +194,7 @@ struct bpf_verifier_env { struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ struct bpf_verifer_log log; u32 subprog_starts[BPF_MAX_SUBPROGS]; + /* computes the stack depth of each bpf function */ u16 subprog_stack_depth[BPF_MAX_SUBPROGS + 1]; u32 subprog_cnt; }; |