summaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorDaniel Borkmann2018-01-20 01:24:36 +0100
committerAlexei Starovoitov2018-01-20 03:37:00 +0100
commit4bd95f4b99e921f51783bfddcd9738e9d3eef2b5 (patch)
tree2a3ee2548cfe25527e1f7d79ca3054028f9d8df8 /kernel/bpf
parentbpf, x86: small optimization in alu ops with imm (diff)
downloadkernel-qcow2-linux-4bd95f4b99e921f51783bfddcd9738e9d3eef2b5.tar.gz
kernel-qcow2-linux-4bd95f4b99e921f51783bfddcd9738e9d3eef2b5.tar.xz
kernel-qcow2-linux-4bd95f4b99e921f51783bfddcd9738e9d3eef2b5.zip
bpf: add upper complexity limit to verifier log
Given the limit could potentially get further adjustments in the future, add it to the log so it becomes obvious what the current limit is w/o having to check the source first. This may also be helpful for debugging complexity related issues on kernels that backport from upstream. 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 'kernel/bpf')
-rw-r--r--kernel/bpf/verifier.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5eeb200e82c4..caae4955fbdb 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -4810,7 +4810,8 @@ process_bpf_exit:
insn_idx++;
}
- verbose(env, "processed %d insns, stack depth ", insn_processed);
+ verbose(env, "processed %d insns (limit %d), stack depth ",
+ insn_processed, BPF_COMPLEXITY_LIMIT_INSNS);
for (i = 0; i < env->subprog_cnt + 1; i++) {
u32 depth = env->subprog_stack_depth[i];