diff options
author | Yonghong Song <yhs@fb.com> | 2018-11-21 11:22:42 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-11-21 22:22:17 +0100 |
commit | 462c124c590fe633564192dbfa26e99af788a67c (patch) | |
tree | 220411837f9cd15fc51a8de1eef1b104e85c526a /tools/testing/scatterlist | |
parent | f6161a8f3036caa45f225486be39783e99e0fa29 (diff) |
bpf: fix a libbpf loader issue
Commit 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections")
added support to read .BTF.ext sections from an object file, create
and pass prog_btf_fd and func_info to the kernel.
The program btf_fd (prog->btf_fd) is initialized to be -1 to please
zclose so we do not need special handling dur prog close.
Passing -1 to the kernel, however, will cause loading error.
Passing btf_fd 0 to the kernel if prog->btf_fd is invalid
fixed the problem.
Fixes: 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections")
Reported-by: Andrey Ignatov <rdna@fb.com>
Reported-by: Emre Cantimur <haydum@fb.com>
Tested-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/scatterlist')
0 files changed, 0 insertions, 0 deletions