]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
selftests/bpf: add "any alignment" annotation for some tests
authorBjörn Töpel <bjorn.topel@gmail.com>
Wed, 2 Jun 2021 03:27:52 +0000 (11:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:24:08 +0000 (13:24 +0200)
commit e2c6f50e48849298bed694de03cceb537d95cdc4 upstream

RISC-V does, in-general, not have "efficient unaligned access". When
testing the RISC-V BPF JIT, some selftests failed in the verification
due to misaligned access. Annotate these tests with the
F_NEEDS_EFFICIENT_UNALIGNED_ACCESS flag.

Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/test_verifier.c

index 2241e4eefde350c250942545cf1e1053c96ad1fe..b0fd67ce48bd18691b2ef8fec5915b0d9121e76a 100644 (file)
@@ -963,6 +963,7 @@ static struct bpf_test tests[] = {
                .errstr_unpriv = "attempt to corrupt spilled",
                .errstr = "corrupted spill",
                .result = REJECT,
+               .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
        },
        {
                "invalid src register in STX",
@@ -1777,6 +1778,7 @@ static struct bpf_test tests[] = {
                .errstr = "invalid bpf_context access",
                .result = REJECT,
                .prog_type = BPF_PROG_TYPE_SK_MSG,
+               .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
        },
        {
                "invalid read past end of SK_MSG",
@@ -2176,6 +2178,7 @@ static struct bpf_test tests[] = {
                },
                .errstr = "invalid bpf_context access",
                .result = REJECT,
+               .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
        },
        {
                "check skb->hash half load not permitted, unaligned 3",