diff --git a/fs/exec.c b/fs/exec.c
index 537d92c41105bcec0c07d7da2eb5a9bef40787e7..51d3cb4e3cdfa20b2b0c4d30330c9120c9e780e5 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1222,7 +1222,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);
 }