bpf: Update selftests to reflect new error states
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 24 Mar 2021 13:52:31 +0000 (14:52 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 16 Apr 2021 21:52:15 +0000 (23:52 +0200)
commitd7a5091351756d0ae8e63134313c455624e36a13
tree4f9179a6cfdd07b6c82c179a57fe11cedcf50d74
parent7fedb63a8307dda0ec3b8969a3b233a1dd7ea8e0
bpf: Update selftests to reflect new error states

Update various selftest error messages:

 * The 'Rx tried to sub from different maps, paths, or prohibited types'
   is reworked into more specific/differentiated error messages for better
   guidance.

 * The change into 'value -4294967168 makes map_value pointer be out of
   bounds' is due to moving the mixed bounds check into the speculation
   handling and thus occuring slightly later than above mentioned sanity
   check.

 * The change into 'math between map_value pointer and register with
   unbounded min value' is similarly due to register sanity check coming
   before the mixed bounds check.

 * The case of 'map access: known scalar += value_ptr from different maps'
   now loads fine given masks are the same from the different paths (despite
   max map value size being different).

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/bounds.c
tools/testing/selftests/bpf/verifier/bounds_deduction.c
tools/testing/selftests/bpf/verifier/bounds_mix_sign_unsign.c
tools/testing/selftests/bpf/verifier/map_ptr.c
tools/testing/selftests/bpf/verifier/unpriv.c
tools/testing/selftests/bpf/verifier/value_ptr_arith.c