Skip to content

Commit 4f67cca

Browse files
beaubelgraverostedt
authored andcommitted
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/[email protected] Fixes: c9e759b ("tracing: Rework synthetic event command parsing") Reviewed-by: Masami Hiramatsu <[email protected]> Signed-off-by: Beau Belgrave <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent e161c6b commit 4f67cca

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

kernel/trace/trace_events_synth.c

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

20542054
last_cmd_set(raw_command);
20552055

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

20622069
fields = skip_spaces(p);
20632070

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

0 commit comments

Comments
 (0)