Message ID | 20250331094745.336010-1-chen.dylane@linux.dev (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [bpf-next,1/2] bpf: Check link_create parameter for multi_kprobe | expand |
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 13bef2462..2f206a2a2 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2993,6 +2993,9 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr if (sizeof(u64) != sizeof(void *)) return -EOPNOTSUPP; + if (attr->link_create.target_fd || attr->link_create.flags) + return -EINVAL; + if (!is_kprobe_multi(prog)) return -EINVAL;
The target_fd and flags in link_create no used in multi_kprobe , return -EINVAL if they assigned, keep it same as other link attach apis. Fixes: 0dcac2725406 ("bpf: Add multi kprobe link") Signed-off-by: Tao Chen <chen.dylane@linux.dev> --- kernel/trace/bpf_trace.c | 3 +++ 1 file changed, 3 insertions(+)