From: Andrii Nakryiko andrii@kernel.org
mainline inclusion from mainline-5.17-rc1 commit 8cb125566c40b7141d8842c534f0ea5820ee3d5c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
-------------------------------------------------
glob_syms array wasn't freed on bpf_link__free(). Fix that.
Fixes: a46349227cd8 ("libbpf: Add linker extern resolution support for functions and global variables") Signed-off-by: Andrii Nakryiko andrii@kernel.org Signed-off-by: Daniel Borkmann daniel@iogearbox.net Link: https://lore.kernel.org/bpf/20211124002325.1737739-6-andrii@kernel.org (cherry picked from commit 8cb125566c40b7141d8842c534f0ea5820ee3d5c) Signed-off-by: Wang Yufen wangyufen@huawei.com --- tools/lib/bpf/linker.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 940eb102f506..61e0c7cfe5ae 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -210,6 +210,7 @@ void bpf_linker__free(struct bpf_linker *linker) } free(linker->secs);
+ free(linker->glob_syms); free(linker); }