selftests/bpf: add verifier tests for wide stores
authorStanislav Fomichev <sdf@google.com>
Mon, 1 Jul 2019 17:38:41 +0000 (10:38 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Jul 2019 14:22:55 +0000 (16:22 +0200)
commit76d950773cd2a365f492ce973429ae629d58131c
tree86a942c737a700f4d82bd74ab4a8b874d0ffd8ca
parent4cfacbe6df972db4081dd76feb7871fce996118d
selftests/bpf: add verifier tests for wide stores

Make sure that wide stores are allowed at proper (aligned) addresses.
Note that user_ip6 is naturally aligned on 8-byte boundary, so
correct addresses are user_ip6[0] and user_ip6[2]. msg_src_ip6 is,
however, aligned on a 4-byte bondary, so only msg_src_ip6[1]
can be wide-stored.

Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_verifier.c
tools/testing/selftests/bpf/verifier/wide_store.c [new file with mode: 0644]