OSDN Git Service

bpf: Adjust F_NEEDS_EFFICIENT_UNALIGNED_ACCESS handling in test_verifier.c
authorDavid Miller <davem@davemloft.net>
Sat, 1 Dec 2018 05:08:26 +0000 (21:08 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 1 Dec 2018 05:38:48 +0000 (21:38 -0800)
commitc7665702d3208b77b8e00f0699b6b88241b04360
tree73d1e878ca47383a15d562a93a19d68240d62787
parente9ee9efc0d176512cdce9d27ff8549d7ffa2bfcd
bpf: Adjust F_NEEDS_EFFICIENT_UNALIGNED_ACCESS handling in test_verifier.c

Make it set the flag argument to bpf_verify_program() which will relax
the alignment restrictions.

Now all such test cases will go properly through the verifier even on
inefficient unaligned access architectures.

On inefficient unaligned access architectures do not try to run such
programs, instead mark the test case as passing but annotate the
result similarly to how it is done now in the presence of this flag.

So, we get complete full coverage for all REJECT test cases, and at
least verifier level coverage for ACCEPT test cases.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_verifier.c