diff options
author | Alexei Starovoitov <ast@kernel.org> | 2019-06-15 12:12:22 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-06-19 02:22:52 +0200 |
commit | aeee380ccfc59c05a4c6e8e762fd645c6bdc773a (patch) | |
tree | 62e3dc588583bedd186bca0126e50b50b6ca8762 /tools/testing/selftests/bpf/verifier/cfg.c | |
parent | eea1c227b9e9bad295e8ef984004a9acf12bb68c (diff) | |
download | linux-aeee380ccfc59c05a4c6e8e762fd645c6bdc773a.tar.gz linux-aeee380ccfc59c05a4c6e8e762fd645c6bdc773a.tar.bz2 linux-aeee380ccfc59c05a4c6e8e762fd645c6bdc773a.zip |
selftests/bpf: fix tests
Fix tests that assumed no loops.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/cfg.c')
-rw-r--r-- | tools/testing/selftests/bpf/verifier/cfg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/verifier/cfg.c b/tools/testing/selftests/bpf/verifier/cfg.c index 349c0862fb4c..4eb76ed739ce 100644 --- a/tools/testing/selftests/bpf/verifier/cfg.c +++ b/tools/testing/selftests/bpf/verifier/cfg.c @@ -41,7 +41,8 @@ BPF_JMP_IMM(BPF_JA, 0, 0, -1), BPF_EXIT_INSN(), }, - .errstr = "back-edge", + .errstr = "unreachable insn 1", + .errstr_unpriv = "back-edge", .result = REJECT, }, { @@ -53,18 +54,20 @@ BPF_JMP_IMM(BPF_JA, 0, 0, -4), BPF_EXIT_INSN(), }, - .errstr = "back-edge", + .errstr = "unreachable insn 4", + .errstr_unpriv = "back-edge", .result = REJECT, }, { "conditional loop", .insns = { - BPF_MOV64_REG(BPF_REG_1, BPF_REG_0), + BPF_MOV64_REG(BPF_REG_0, BPF_REG_1), BPF_MOV64_REG(BPF_REG_2, BPF_REG_0), BPF_MOV64_REG(BPF_REG_3, BPF_REG_0), BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, -3), BPF_EXIT_INSN(), }, - .errstr = "back-edge", + .errstr = "infinite loop detected", + .errstr_unpriv = "back-edge", .result = REJECT, }, |