OSDN Git Service

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)
commitf1fc7249dddc0e52d9e805e2e661caa118649509
tree22248cfe429e9b80811f8078af1cb8b5266bd30d
parent7c2e988f400e83501e0a3568250780609b7c8263
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