]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libbpf: Fix expected_attach_type set handling in program load callback
authorTao Chen <chen.dylane@gmail.com>
Wed, 25 Sep 2024 15:30:12 +0000 (23:30 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Oct 2024 00:47:35 +0000 (17:47 -0700)
commita400d08b3014a4f4e939366bb6fd769b9caff4c9
tree3c576bfa8a49309d50dcc071e826772bba629819
parent8b334d91834666dbc4c1c0b0abed3f855ed16cf3
libbpf: Fix expected_attach_type set handling in program load callback

Referenced commit broke the logic of resetting expected_attach_type to
zero for allowed program types if kernel doesn't yet support such field.
We do need to overwrite and preserve expected_attach_type for
multi-uprobe though, but that can be done explicitly in
libbpf_prepare_prog_load().

Fixes: 5902da6d8a52 ("libbpf: Add uprobe multi link support to bpf_program__attach_usdt")
Suggested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Tao Chen <chen.dylane@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240925153012.212866-1-chen.dylane@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c