Skip to content

Commit daf7938

Browse files
mhiramatgregkh
authored andcommitted
tracing: fprobe-event: Sanitize wildcard for fprobe event name
commit ec879e1 upstream. Fprobe event accepts wildcards for the target functions, but unless user specifies its event name, it makes an event with the wildcards. /sys/kernel/tracing # echo 'f mutex*' >> dynamic_events /sys/kernel/tracing # cat dynamic_events f:fprobes/mutex*__entry mutex* /sys/kernel/tracing # ls events/fprobes/ enable filter mutex*__entry To fix this, replace the wildcard ('*') with an underscore. Link: https://lore.kernel.org/all/175535345114.282990.12294108192847938710.stgit@devnote2/ Fixes: 334e551 ("tracing/probes: Add fprobe events for tracing function entry and exit.") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d5ab785 commit daf7938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ static inline bool is_good_system_name(const char *name)
21452145
static inline void sanitize_event_name(char *name)
21462146
{
21472147
while (*name++ != '\0')
2148-
if (*name == ':' || *name == '.')
2148+
if (*name == ':' || *name == '.' || *name == '*')
21492149
*name = '_';
21502150
}
21512151

0 commit comments

Comments
 (0)