bpf, selftests: Fix up some test_verifier cases for unprivileged
authorPiotr Krysiuk <piotras@gmail.com>
Mon, 31 May 2021 18:25:40 +0000 (18:25 +0000)
committerCosmin Tanislav <demonsingur@gmail.com>
Thu, 16 May 2024 07:58:24 +0000 (10:58 +0300)
commit88fe8aa9a4819c2998434c8f795ce9b28cb6f0ce
tree61d6d6df1d0d304063a546a2a0d673f515b56ccf
parentdc1dc86d4153cbbbed2878c9c2ef55a7d0f9581f
bpf, selftests: Fix up some test_verifier cases for unprivileged

commit 0a13e3537ea67452d549a6a80da3776d6b7dedb3 upstream.

Fix up test_verifier error messages for the case where the original error
message changed, or for the case where pointer alu errors differ between
privileged and unprivileged tests. Also, add alternative tests for keeping
coverage of the original verifier rejection error message (fp alu), and
newly reject map_ptr += rX where rX == 0 given we now forbid alu on these
types for unprivileged. All test_verifier cases pass after the change. The
test case fixups were kept separate to ease backporting of core changes.

Signed-off-by: Piotr Krysiuk <piotras@gmail.com>
Co-developed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
[fllinden@amazon.com: backport to 4.14, skipping non-existent tests]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/test_verifier.c