bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 13 Dec 2021 22:25:23 +0000 (22:25 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Dec 2021 03:33:06 +0000 (19:33 -0800)
commite523102cb719cbad1673b6aa2a4d5c1fa6f13799
treef21d44206c2d92f1d9a433c263b634cf5f065d98
parenta82fe085f344ef20b452cd5f481010ff96b5c4cd
bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer

Fix up unprivileged test case results for 'Dest pointer in r0' verifier tests
given they now need to reject R0 containing a pointer value, and add a couple
of new related ones with 32bit cmpxchg as well.

  root@foo:~/bpf/tools/testing/selftests/bpf# ./test_verifier
  #0/u invalid and of negative number OK
  #0/p invalid and of negative number OK
  [...]
  #1268/p XDP pkt read, pkt_meta' <= pkt_data, bad access 1 OK
  #1269/p XDP pkt read, pkt_meta' <= pkt_data, bad access 2 OK
  #1270/p XDP pkt read, pkt_data <= pkt_meta', good access OK
  #1271/p XDP pkt read, pkt_data <= pkt_meta', bad access 1 OK
  #1272/p XDP pkt read, pkt_data <= pkt_meta', bad access 2 OK
  Summary: 1900 PASSED, 0 SKIPPED, 0 FAILED

Acked-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c