]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Use strncpy instead of memcpy when copying comm in trace.c
authorTom Zanussi <tom.zanussi@linux.intel.com>
Tue, 5 Mar 2019 16:12:00 +0000 (10:12 -0600)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 5 Mar 2019 17:14:42 +0000 (12:14 -0500)
commitfbc0178f8bf22177bf08fdb3f084307fabb8045b
tree04c63d599f3d8579bf5f699080238da9b31455f4
parentf7f56bd6c48a1f521d64b342f24fe60b4c74047f
tracing: Use strncpy instead of memcpy when copying comm in trace.c

Because there may be random garbage beyond a string's null terminator,
code that might use the entire comm array e.g. histogram keys, can
give unexpected results if that garbage is copied in too, so avoid
that possibility by using strncpy instead of memcpy.

Link: http://lkml.kernel.org/r/1d6ebac26570c2a29ce9fb575379f17ef5c8b81b.1551802084.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c