]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf784df72459a9352fcb631457042713473ffe288
treea67ef9cc3172fc15bf89230c49734e6101228e18
parentee82000b9842689f2a2f867b73c9a68ce2d75ca0
bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer

commit 590e8efd4928a5e539cc79b0f5161e3724212166 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