Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Tao Chen and committed by
Andrii Nakryiko
24391198 527b33dd

+3
+3
kernel/trace/bpf_trace.c
··· 2987 2987 if (sizeof(u64) != sizeof(void *)) 2988 2988 return -EOPNOTSUPP; 2989 2989 2990 + if (attr->link_create.flags) 2991 + return -EINVAL; 2992 + 2990 2993 if (!is_kprobe_multi(prog)) 2991 2994 return -EINVAL; 2992 2995