]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix realloc usage in bpf_core_find_cands
authorAndrii Nakryiko <andriin@fb.com>
Fri, 24 Jan 2020 20:18:46 +0000 (12:18 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 24 Jan 2020 21:34:37 +0000 (22:34 +0100)
commitf8490cb5277b3d15ea6d038f0fe3544a0945eb22
tree447a49a6541913091f7183f618de47e83c0c20f2
parentae0fb8057d6547bbb6f1b6cdd3818ff92368ccf4
libbpf: Fix realloc usage in bpf_core_find_cands

Fix bug requesting invalid size of reallocated array when constructing CO-RE
relocation candidate list. This can cause problems if there are many potential
candidates and a very fine-grained memory allocator bucket sizes are used.

Fixes: 299b4e30e1c4 ("libbpf: implement BPF CO-RE offset relocation algorithm")
Reported-by: William Smith <williampsmith@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200124201847.212528-1-andriin@fb.com
tools/lib/bpf/libbpf.c