Skip to content
Commit 44382b3e authored by Friedrich Vock's avatar Friedrich Vock Committed by Daniel Borkmann
Browse files

bpf: Fix potential integer overflow in resolve_btfids

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: fbbb68de

 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
Signed-off-by: default avatarFriedrich Vock <friedrich.vock@gmx.de>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240514070931.199694-1-friedrich.vock@gmx.de
parent 8d00547e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment