提交 4f67cca7 编写于 作者: B Beau Belgrave 提交者: Steven Rostedt (VMware)

tracing: Do not let synth_events block other dyn_event systems during create

synth_events is returning -EINVAL if the dyn_event create command does
not contain ' \t'. This prevents other systems from getting called back.
synth_events needs to return -ECANCELED in these cases when the command
is not targeting the synth_event system.

Link: https://lore.kernel.org/linux-trace-devel/20210930223821.11025-1-beaub@linux.microsoft.com

Fixes: c9e759b1 ("tracing: Rework synthetic event command parsing")
Reviewed-by: NMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: NBeau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 e161c6bf
......@@ -2053,6 +2053,13 @@ static int create_synth_event(const char *raw_command)
last_cmd_set(raw_command);
name = raw_command;
/* Don't try to process if not our system */
if (name[0] != 's' || name[1] != ':')
return -ECANCELED;
name += 2;
p = strpbrk(raw_command, " \t");
if (!p) {
synth_err(SYNTH_ERR_INVALID_CMD, 0);
......@@ -2061,12 +2068,6 @@ static int create_synth_event(const char *raw_command)
fields = skip_spaces(p);
name = raw_command;
if (name[0] != 's' || name[1] != ':')
return -ECANCELED;
name += 2;
/* This interface accepts group name prefix */
if (strchr(name, '/')) {
len = str_has_prefix(name, SYNTH_SYSTEM "/");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册