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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:35 +0000 (09:32 +0100)
commit2746d3face6532d3d6839ca5a05bb2d10988db72
treea67ef9cc3172fc15bf89230c49734e6101228e18
parentf87a6c160ecc8c7b417d25f508d3f076fe346136
bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer

commit e523102cb719cbad1673b6aa2a4d5c1fa6f13799 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c