]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add test cases to test narrower ctx field loads
authorYonghong Song <yhs@fb.com>
Tue, 13 Jun 2017 22:52:14 +0000 (15:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Jun 2017 18:56:25 +0000 (14:56 -0400)
commit10dd9b0442f8da83b4a09e1cb54a7f17b33fd44f
treebc04b4c45c52a732e1d92c7348e3a1354bfd47f6
parentea168ec5724234f319563bc180a1bdc06e913839
selftests/bpf: Add test cases to test narrower ctx field loads

Add test cases in test_verifier and test_progs.
Negative tests are added in test_verifier as well.
The test in test_progs will compare the value of narrower ctx field
load result vs. the masked value of normal full-field load result,
and will fail if they are not the same.

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_pkt_md_access.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_verifier.c