]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 17 Feb 2020 09:57:53 +0000 (10:57 +0100)
commit99c266261cbfd72b84bf3cba0fc2f1eca47b07f3
tree255123b1e89f63b35da7edce75b5799696c55363
parentcf8ca8526c26ed64ab951362d80905bc1a2fd4b1
libbpf: Fix realloc usage in bpf_core_find_cands

BugLink: https://bugs.launchpad.net/bugs/1863588
commit 35b9211c0a2427e8f39e534f442f43804fc8d5ca upstream.

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: ddc7c3042614 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
tools/lib/bpf/libbpf.c