]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:53:11 +0000 (13:53 +0100)
commit59f5cfc367ae8efd8a36977490252c7269e311d7
tree7cbd0d92d1d485701d2401c552879928b0e14a9e
parent26dd231990b7d8b17d652af0734f81e93a9df503
libbpf: Fix expected_attach_type set handling in program load callback

[ Upstream commit a400d08b3014a4f4e939366bb6fd769b9caff4c9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/bpf/libbpf.c