WSL2-Linux-Kernel/tools/bpf
Friedrich Vock e5138f43c9 bpf: Fix potential integer overflow in resolve_btfids
[ Upstream commit 44382b3ed6b2787710c8ade06c0e97f5970a47c8 ]

err is a 32-bit integer, but elf_update returns an off_t, which is 64-bit
at least on 64-bit platforms. If symbols_patch is called on a binary between
2-4GB in size, the result will be negative when cast to a 32-bit integer,
which the code assumes means an error occurred. This can wrongly trigger
build failures when building very large kernel images.

Fixes: fbbb68de80 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
Signed-off-by: Friedrich Vock <friedrich.vock@gmx.de>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240514070931.199694-1-friedrich.vock@gmx.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:50 +02:00
..
bpftool bpftool: Silence build warning about calloc() 2024-03-26 18:21:17 -04:00
resolve_btfids bpf: Fix potential integer overflow in resolve_btfids 2024-06-16 13:39:50 +02:00
runqslower
.gitignore
Makefile tools bpf_jit_disasm: Fix compilation error with new binutils 2023-03-17 08:49:04 +01:00
bpf_asm.c
bpf_dbg.c
bpf_exp.l
bpf_exp.y
bpf_jit_disasm.c tools bpf_jit_disasm: Fix compilation error with new binutils 2023-03-17 08:49:04 +01:00