]> asedeno.scripts.mit.edu Git - linux.git/commit
tracing: uprobes: Re-enable $comm support for uprobe events
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 7 May 2019 13:55:41 +0000 (22:55 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 8 May 2019 16:15:11 +0000 (12:15 -0400)
commit4dd537aca25dd2e0e8aca8b8923930cbe6240003
tree4237d1d2cd0c827fd2d3edd8040b5fd6a9337375
parent9e298e8604088a600d8100a111a532a9d342af09
tracing: uprobes: Re-enable $comm support for uprobe events

Since commit 533059281ee5 ("tracing: probeevent: Introduce new
argument fetching code") dropped the $comm support from uprobe
events, this re-enables it.

For $comm support, uses strlcpy() instead of strncpy_from_user()
to copy current task's comm. Because it is in the kernel space,
strncpy_from_user() always fails to copy the comm.
This also uses strlen() instead of strnlen_user() to measure the
length of the comm.

Note that this uses -ECOMM as a token value to fetch the comm
string. If the user-space pointer points -ECOMM, it will be
translated to task->comm.

Link: http://lkml.kernel.org/r/155723734162.9149.4042756162201097965.stgit@devnote2
Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code")
Reported-by: Andreas Ziegler <andreas.ziegler@fau.de>
Acked-by: Andreas Ziegler <andreas.ziegler@fau.de>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_probe.h
kernel/trace/trace_uprobe.c