tracing: probeevent: Fix to make the type of $comm string
Fix to make the type of $comm "string". If we set the other type to $comm
argument, it shows meaningless value or wrong data. Currently probe events
allow us to set string array type (e.g. ":string[2]"), or other digit types
like x8 on $comm. But since clearly $comm is just a string data, it should
not be fetched by other types including array.
Link: http://lkml.kernel.org/r/155723736241.9149.14582064184468574539.stgit@devnote2
Cc: Andreas Ziegler <andreas.ziegler@fau.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 533059281e
("tracing: probeevent: Introduce new argument fetching code")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
489fe0096b
commit
3dd1f7f24f
1 changed files with 7 additions and 6 deletions
|
@ -533,13 +533,14 @@ static int traceprobe_parse_probe_arg_body(char *arg, ssize_t *size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* The default type of $comm should be "string", and it can't be
|
/* Since $comm can not be dereferred, we can find $comm by strcmp */
|
||||||
* dereferenced.
|
if (strcmp(arg, "$comm") == 0) {
|
||||||
*/
|
/* The type of $comm must be "string", and not an array. */
|
||||||
if (!t && strcmp(arg, "$comm") == 0)
|
if (parg->count || (t && strcmp(t, "string")))
|
||||||
|
return -EINVAL;
|
||||||
parg->type = find_fetch_type("string");
|
parg->type = find_fetch_type("string");
|
||||||
else
|
} else
|
||||||
parg->type = find_fetch_type(t);
|
parg->type = find_fetch_type(t);
|
||||||
if (!parg->type) {
|
if (!parg->type) {
|
||||||
trace_probe_log_err(offset + (t ? (t - arg) : 0), BAD_TYPE);
|
trace_probe_log_err(offset + (t ? (t - arg) : 0), BAD_TYPE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue