The patch titled Subject: tsacct: replace strncpy() with strscpy() has been added to the -mm mm-nonmm-unstable branch. Its filename is tsacct-replace-strncpy-with-strscpy.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/tsacct-replace-strncpy-with-strscpy.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kees Cook <kees@xxxxxxxxxx> Subject: tsacct: replace strncpy() with strscpy() Date: Thu, 11 Jul 2024 10:13:09 -0700 Replace the deprecated[1] use of strncpy() in bacct_add_tsk(). Since this is UAPI, include trailing padding in the copy. Link: https://github.com/KSPP/linux/issues/90 [1] Link: https://lkml.kernel.org/r/20240711171308.work.995-kees@xxxxxxxxxx Signed-off-by: Kees Cook <kees@xxxxxxxxxx> Cc: "Dr. Thomas Orgis" <thomas.orgis@xxxxxxxxxxxxxx> Cc: Eric W. Biederman <ebiederm@xxxxxxxxxxxx> Cc: Ismael Luceno <ismael@xxxxxxxxxxx> Cc: Peng Liu <liupeng256@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/tsacct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/tsacct.c~tsacct-replace-strncpy-with-strscpy +++ a/kernel/tsacct.c @@ -76,7 +76,7 @@ void bacct_add_tsk(struct user_namespace stats->ac_minflt = tsk->min_flt; stats->ac_majflt = tsk->maj_flt; - strncpy(stats->ac_comm, tsk->comm, sizeof(stats->ac_comm)); + strscpy_pad(stats->ac_comm, tsk->comm); } _ Patches currently in -mm which might be from kees@xxxxxxxxxx are tsacct-replace-strncpy-with-strscpy.patch