]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Check link_create.flags parameter for multi_kprobe
authorTao Chen <chen.dylane@linux.dev>
Mon, 7 Apr 2025 03:57:51 +0000 (11:57 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 9 Apr 2025 23:28:22 +0000 (16:28 -0700)
commit243911982aa9faf4361aa952f879331ad66933fe
treea6b8cf34ed446026895428a28dbf0304ad30e065
parent527b33dda1b564ff09fe330928f08b653bff1514
bpf: Check link_create.flags parameter for multi_kprobe

The link_create.flags are currently not used for multi-kprobes, so return
-EINVAL if it is set, same as for other attach APIs.

We allow target_fd, on the other hand, to have an arbitrary value for
multi-kprobe, as there are existing users (libbpf) relying on this.

Fixes: 0dcac2725406 ("bpf: Add multi kprobe link")
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250407035752.1108927-1-chen.dylane@linux.dev
kernel/trace/bpf_trace.c