mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
bpf: Fix potential integer overflow in resolve_btfids
[ Upstream commit44382b3ed6
] 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>
This commit is contained in:
parent
9d75fab2c1
commit
e5138f43c9
1 changed files with 1 additions and 1 deletions
|
@ -643,7 +643,7 @@ static int sets_patch(struct object *obj)
|
|||
|
||||
static int symbols_patch(struct object *obj)
|
||||
{
|
||||
int err;
|
||||
off_t err;
|
||||
|
||||
if (__symbols_patch(obj, &obj->structs) ||
|
||||
__symbols_patch(obj, &obj->unions) ||
|
||||
|
|
Loading…
Reference in a new issue