]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: tests for jmp to 1st insn
authorAlexei Starovoitov <ast@kernel.org>
Wed, 31 Jul 2019 01:38:27 +0000 (18:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 1 Aug 2019 20:14:29 +0000 (13:14 -0700)
commit99641e105337a88024498592323e5643daa75d55
tree22248cfe429e9b80811f8078af1cb8b5266bd30d
parent8e8dae1e8bf18a8b5f8acc6a9ee7f1bb3cb80366
selftests/bpf: tests for jmp to 1st insn

Add 2 tests that check JIT code generation to jumps to 1st insn.
1st test is similar to syzbot reproducer.
The backwards branch is never taken at runtime.
2nd test has branch to 1st insn that executes.
The test is written as two bpf functions, since it's not possible
to construct valid single bpf program that jumps to 1st insn.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
tools/testing/selftests/bpf/verifier/loops1.c