diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-11-22 01:35:27 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-11-25 01:58:46 +0100 |
commit | 1aace10f41adf1080d1cc54de9b3db98b8b8b0fb (patch) | |
tree | 36bcf6fb5bbafede18a029dec609d94c9c67bf30 /COPYING | |
parent | xdp: Fix cleanup on map free for devmap_hash map type (diff) | |
download | linux-1aace10f41adf1080d1cc54de9b3db98b8b8b0fb.tar.xz linux-1aace10f41adf1080d1cc54de9b3db98b8b8b0fb.zip |
libbpf: Fix bpf_object name determination for bpf_object__open_file()
If bpf_object__open_file() gets path like "some/dir/obj.o", it should derive
BPF object's name as "obj" (unless overriden through opts->object_name).
Instead, due to using `path` as a fallback value for opts->obj_name, path is
used as is for object name, so for above example BPF object's name will be
verbatim "some/dir/obj", which leads to all sorts of troubles, especially when
internal maps are concern (they are using up to 8 characters of object name).
Fix that by ensuring object_name stays NULL, unless overriden.
Fixes: 291ee02b5e40 ("libbpf: Refactor bpf_object__open APIs to use common opts")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191122003527.551556-1-andriin@fb.com
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions