]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/probes: Reject events which have the same name of existing one
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 19 Aug 2021 10:26:02 +0000 (19:26 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 19 Aug 2021 13:15:19 +0000 (09:15 -0400)
commit6aacb22917453ddc6013bc4aae3c82289eb4d9d6
tree83539c379970633a6fbc3b98a472a7edf0449ef0
parent369320d47e15d3c2b7a8f256644f762f4f85fe37
tracing/probes: Reject events which have the same name of existing one

Since kprobe_events and uprobe_events only check whether the
other same-type probe event has the same name or not, if the
user gives the same name of the existing tracepoint event (or
the other type of probe events), it silently fails to create
the tracefs entry (but registered.) as below.

/sys/kernel/tracing # ls events/task/task_rename
enable   filter   format   hist     id       trigger
/sys/kernel/tracing # echo p:task/task_rename vfs_read >> kprobe_events
[  113.048508] Could not create tracefs 'task_rename' directory
/sys/kernel/tracing # cat kprobe_events
p:task/task_rename vfs_read

To fix this issue, check whether the existing events have the
same name or not in trace_probe_register_event_call(). If exists,
it rejects to register the new event.

Link: https://lkml.kernel.org/r/162936876189.187130.17558311387542061930.stgit@devnote2
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_kprobe.c
kernel/trace/trace_probe.c
kernel/trace/trace_probe.h
kernel/trace/trace_uprobe.c