bpf: sk_msg, fix sk_msg_md access past end test
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 20 Dec 2018 19:35:29 +0000 (11:35 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 20 Dec 2018 22:47:08 +0000 (23:47 +0100)
Currently, the test to ensure reads past the end of the sk_msg_md
data structure fail is incorrectly expecting success. Fix this
typo and use correct expected error.

Fixes: 945a47d87cee ("bpf: sk_msg, add tests for size field")
Reported-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_verifier.c

index b246931..dbd3175 100644 (file)
@@ -1879,7 +1879,7 @@ static struct bpf_test tests[] = {
                                    offsetof(struct sk_msg_md, size) + 4),
                        BPF_EXIT_INSN(),
                },
-               .errstr = "R0 !read_ok",
+               .errstr = "invalid bpf_context access",
                .result = REJECT,
                .prog_type = BPF_PROG_TYPE_SK_MSG,
        },