[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211025083315.4752-2-laoar.shao@gmail.com>
Date: Mon, 25 Oct 2021 08:33:04 +0000
From: Yafang Shao <laoar.shao@...il.com>
To: akpm@...ux-foundation.org, keescook@...omium.org,
rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
arnaldo.melo@...il.com, pmladek@...e.com, peterz@...radead.org,
viro@...iv.linux.org.uk, valentin.schneider@....com,
qiang.zhang@...driver.com, robdclark@...omium.org,
christian@...uner.io, dietmar.eggemann@....com, mingo@...hat.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
davem@...emloft.net, kuba@...nel.org, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, kafai@...com,
songliubraving@...com, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, dennis.dalessandro@...nelisnetworks.com,
mike.marciniszyn@...nelisnetworks.com, dledford@...hat.com,
jgg@...pe.ca
Cc: linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-perf-users@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, oliver.sang@...el.com, lkp@...el.com,
Yafang Shao <laoar.shao@...il.com>,
Andrii Nakryiko <andrii.nakryiko@...il.com>
Subject: [PATCH v6 01/12] fs/exec: make __set_task_comm always set a nul ternimated string
Make sure the string set to task comm is always nul ternimated.
Signed-off-by: Yafang Shao <laoar.shao@...il.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Kees Cook <keescook@...omium.org>
Cc: Petr Mladek <pmladek@...e.com>
---
fs/exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/exec.c b/fs/exec.c
index a098c133d8d7..404156b5b314 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1224,7 +1224,7 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec)
{
task_lock(tsk);
trace_task_rename(tsk, buf);
- strlcpy(tsk->comm, buf, sizeof(tsk->comm));
+ strscpy_pad(tsk->comm, buf, sizeof(tsk->comm));
task_unlock(tsk);
perf_event_comm(tsk, exec);
}
--
2.17.1
Powered by blists - more mailing lists