提交 54121053 编写于 作者: A Andrii Nakryiko 提交者: Zheng Zengkai

libbpf: Fix glob_syms memory leak in bpf_linker

mainline inclusion
from mainline-5.17-rc1
commit 8cb12556
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/?id=8cb125566c40b7141d8842c534f0ea5820ee3d5c

-------------------------------------------------

glob_syms array wasn't freed on bpf_link__free(). Fix that.

Fixes: a4634922 ("libbpf: Add linker extern resolution support for functions and global variables")
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211124002325.1737739-6-andrii@kernel.org
(cherry picked from commit 8cb12556)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 587461da
...@@ -210,6 +210,7 @@ void bpf_linker__free(struct bpf_linker *linker) ...@@ -210,6 +210,7 @@ void bpf_linker__free(struct bpf_linker *linker)
} }
free(linker->secs); free(linker->secs);
free(linker->glob_syms);
free(linker); free(linker);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册