]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Avoid passing out-of-range values to __retval()
authorPeilin Ye <yepeilin@google.com>
Wed, 7 May 2025 03:43:19 +0000 (03:43 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 9 May 2025 17:05:27 +0000 (10:05 -0700)
commit6e492ffcab6064cd7b317dc1f49fb9f92407aaa7
treee9e4643ca8cb9352d6b94dc58955c1bb0898c858
parent13fdecf3456e21f91a4403f989464edcc5d61c22
selftests/bpf: Avoid passing out-of-range values to __retval()

Currently, we pass 0x1234567890abcdef to __retval() for the following
two tests:

  verifier_load_acquire/load_acquire_64
  verifier_store_release/store_release_64

However, the upper 32 bits of that value are being ignored, since
__retval() expects an int.  Actually, the tests would still pass even if
I change '__retval(0x1234567890abcdef)' to e.g. '__retval(0x90abcdef)'.

Restructure the tests a bit to test the entire 64-bit values properly.
Do the same to their 8-, 16- and 32-bit variants as well to keep the
style consistent.

Fixes: ff3afe5da998 ("selftests/bpf: Add selftests for load-acquire and store-release instructions")
Acked-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Pu Lehui <pulehui@huawei.com>
Tested-by: Björn Töpel <bjorn@rivosinc.com> # QEMU/RVA23
Signed-off-by: Peilin Ye <yepeilin@google.com>
Link: https://lore.kernel.org/r/d67f4c6f6ee0d0388cbce1f4892ec4176ee2d604.1746588351.git.yepeilin@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_load_acquire.c
tools/testing/selftests/bpf/progs/verifier_store_release.c