linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] bpf: Check link_create parameter for multi_kprobe
@ 2025-03-31  9:47 Tao Chen
  2025-03-31  9:47 ` [PATCH bpf-next 2/2] bpf: Check link_create parameter for multi_uprobe Tao Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Tao Chen @ 2025-03-31  9:47 UTC (permalink / raw)
  To: song, jolsa, ast, daniel, andrii, martin.lau, eddyz87,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, rostedt,
	mhiramat, mathieu.desnoyers, laoar.shao
  Cc: bpf, linux-kernel, linux-trace-kernel, Tao Chen

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(+)

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;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-04-05 23:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31  9:47 [PATCH bpf-next 1/2] bpf: Check link_create parameter for multi_kprobe Tao Chen
2025-03-31  9:47 ` [PATCH bpf-next 2/2] bpf: Check link_create parameter for multi_uprobe Tao Chen
2025-04-01 11:03   ` Jiri Olsa
2025-04-01 12:40     ` Tao Chen
2025-04-01 22:06       ` Andrii Nakryiko
2025-04-02  9:01         ` Jiri Olsa
2025-04-02 19:19           ` Jiri Olsa
2025-04-02 19:25             ` Jiri Olsa
2025-04-05 23:05             ` Tao Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).