]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: arm64: Silence "UBSAN: negation-overflow" warning
authorSong Liu <song@kernel.org>
Tue, 18 Feb 2025 08:02:40 +0000 (00:02 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 23 Feb 2025 21:04:02 +0000 (13:04 -0800)
commit239860828f8660e2be487e2fbdae2640cce3fd67
treeecc8125e4d4516b5f1575e107010072c7625b517
parent201b62ccc83153d2925d310a2afe762905e0c455
bpf: arm64: Silence "UBSAN: negation-overflow" warning

With UBSAN, test_bpf.ko triggers warnings like:

UBSAN: negation-overflow in arch/arm64/net/bpf_jit_comp.c:1333:28
negation of -2147483648 cannot be represented in type 's32' (aka 'int'):

Silence these warnings by casting imm to u32 first.

Reported-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Song Liu <song@kernel.org>
Tested-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20250218080240.2431257-1-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/arm64/net/bpf_jit_comp.c