Skip to content

Commit fda2c64

Browse files
beaubelgravegregkh
authored andcommitted
tracing: Do not let synth_events block other dyn_event systems during create
[ Upstream commit 4f67cca ] 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: c9e759b ("tracing: Rework synthetic event command parsing") Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0e80e3b commit fda2c64

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎kernel/trace/trace_events_synth.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,13 @@ static int create_synth_event(const char *raw_command)
20542054

20552055
last_cmd_set(raw_command);
20562056

2057+
name = raw_command;
2058+
2059+
/* Don't try to process if not our system */
2060+
if (name[0] != 's' || name[1] != ':')
2061+
return -ECANCELED;
2062+
name += 2;
2063+
20572064
p = strpbrk(raw_command, " \t");
20582065
if (!p) {
20592066
synth_err(SYNTH_ERR_INVALID_CMD, 0);
@@ -2062,12 +2069,6 @@ static int create_synth_event(const char *raw_command)
20622069

20632070
fields = skip_spaces(p);
20642071

2065-
name = raw_command;
2066-
2067-
if (name[0] != 's' || name[1] != ':')
2068-
return -ECANCELED;
2069-
name += 2;
2070-
20712072
/* This interface accepts group name prefix */
20722073
if (strchr(name, '/')) {
20732074
len = str_has_prefix(name, SYNTH_SYSTEM "/");

0 commit comments

Comments
 (0)