bpf, selftests: Adjust few selftest result_unpriv outcomes
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 4 May 2021 08:58:25 +0000 (08:58 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 25 May 2021 20:08:53 +0000 (22:08 +0200)
Given we don't need to simulate the speculative domain for registers with
immediates anymore since the verifier uses direct imm-based rewrites instead
of having to mask, we can also lift a few cases that were previously rejected.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/stack_ptr.c
tools/testing/selftests/bpf/verifier/value_ptr_arith.c

index 07eaa04..8ab94d6 100644 (file)
        BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_1, 0),
        BPF_EXIT_INSN(),
        },
-       .result_unpriv = REJECT,
-       .errstr_unpriv = "invalid write to stack R1 off=0 size=1",
        .result = ACCEPT,
        .retval = 42,
 },
index e5913fd..7ae2859 100644 (file)
        },
        .fixup_map_array_48b = { 3 },
        .result = ACCEPT,
-       .result_unpriv = REJECT,
-       .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
        .retval = 1,
 },
 {
        },
        .fixup_map_array_48b = { 3 },
        .result = ACCEPT,
-       .result_unpriv = REJECT,
-       .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
        .retval = 1,
 },
 {
        },
        .fixup_map_array_48b = { 3 },
        .result = ACCEPT,
-       .result_unpriv = REJECT,
-       .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
        .retval = 1,
 },
 {
        },
        .fixup_map_array_48b = { 3 },
        .result = ACCEPT,
-       .result_unpriv = REJECT,
-       .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
        .retval = 1,
 },
 {