]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bpf: update jmp32 test cases to fix range bound deduction
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 24 Jan 2020 14:21:14 +0000 (14:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 13:09:50 +0000 (15:09 +0200)
[ no upstream commit ]

Since commit f2d67fec0b43 ("bpf: Undo incorrect __reg_bound_offset32 handling")
has been backported to stable, we also need to update related test cases that
started to (expectedly) fail on stable. Given the functionality has been reverted
we need to move the result to REJECT.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/verifier/jmp32.c

index bf0322eb53464d41bb6d38098f8d95fc2c2536a7..e708a3f313f7938f93703d804bc66b16ee53b5d0 100644 (file)
        },
        .prog_type = BPF_PROG_TYPE_SCHED_CLS,
        .fixup_map_hash_48b = { 4 },
-       .result = ACCEPT,
+       .result = REJECT,
+       .errstr = "R8 unbounded memory access",
        .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
 },
 {
        },
        .prog_type = BPF_PROG_TYPE_SCHED_CLS,
        .fixup_map_hash_48b = { 4 },
-       .result = ACCEPT,
+       .result = REJECT,
+       .errstr = "R8 unbounded memory access",
        .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
 },
 {
        },
        .prog_type = BPF_PROG_TYPE_SCHED_CLS,
        .fixup_map_hash_48b = { 4 },
-       .result = ACCEPT,
+       .result = REJECT,
+       .errstr = "R8 unbounded memory access",
        .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
 },