linux-stable/tools/bpf
Friedrich Vock f58eec1468 bpf: Fix potential integer overflow in resolve_btfids
[ Upstream commit 44382b3ed6 ]

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-12 11:12:54 +02:00
..
bpftool bpftool: Mount bpffs on provided dir instead of parent dir 2024-06-12 11:11:38 +02:00
resolve_btfids bpf: Fix potential integer overflow in resolve_btfids 2024-06-12 11:12:54 +02:00
runqslower bpf: Replace deprecated -target with --target= for Clang 2023-06-29 15:46:17 +02:00
.gitignore
Makefile tools bpf_jit_disasm: Don't display disassembler-four-args feature test 2022-08-01 15:31:51 -03: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 2022-08-01 15:30:48 -03:00