summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/btf_dump.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-11-24 03:23:19 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2021-11-26 02:15:03 +0300
commit486e648cb2f170702fc05f777c7b6b3d8ec662ce (patch)
tree9312bc4266d9c2fb51e405c8fa36eaff39c6e6e9 /tools/testing/selftests/bpf/prog_tests/btf_dump.c
parent593835377f24ca1bb98008ec1dc3baefe491ad6e (diff)
downloadlinux-486e648cb2f170702fc05f777c7b6b3d8ec662ce.tar.xz
selftests/bpf: Fix UBSan complaint about signed __int128 overflow
Test is using __int128 variable as unsigned and highest order bit can be set to 1 after bit shift. Use unsigned __int128 explicitly and prevent UBSan from complaining. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20211124002325.1737739-8-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/btf_dump.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/btf_dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
index af47aeb211e7..9e26903f9170 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
@@ -323,7 +323,7 @@ static void test_btf_dump_int_data(struct btf *btf, struct btf_dump *d,
char *str)
{
#ifdef __SIZEOF_INT128__
- __int128 i = 0xffffffffffffffff;
+ unsigned __int128 i = 0xffffffffffffffff;
/* this dance is required because we cannot directly initialize
* a 128-bit value to anything larger than a 64-bit value.