summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2015-08-28 07:06:58 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-08-31 10:47:14 -0400
commitf0a515780393dffbb363e6d1567da46af6f3c5f3 (patch)
treecad3408ace5cb1542a4eca314eaa847436ab0ff3 /include
parent9f61668073a8d80650622e792aff876db9ca23c6 (diff)
tracing: Don't make assumptions about length of string on task rename
While the dest comm string size is assured to be at least TASK_COMM_LEN long, doing a memcpy() also adds the assumption that the source is at least that long as well, which isn't assured, and isn't true in cases such as: set_task_comm(worker->task, "kworker/dying"); This leads to accessing invalid memory. Link: http://lkml.kernel.org/r/1440760018-1557-1-git-send-email-sasha.levin@oracle.com Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/task.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/trace/events/task.h b/include/trace/events/task.h
index dee3bb1d5a6b..2cca6cd342d8 100644
--- a/include/trace/events/task.h
+++ b/include/trace/events/task.h
@@ -46,7 +46,7 @@ TRACE_EVENT(task_rename,
TP_fast_assign(
__entry->pid = task->pid;
memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
- memcpy(entry->newcomm, comm, TASK_COMM_LEN);
+ strlcpy(entry->newcomm, comm, TASK_COMM_LEN);
__entry->oom_score_adj = task->signal->oom_score_adj;
),