]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/memfd: replace deprecated strcpy() with memcpy() in alloc_name()
authorThorsten Blum <thorsten.blum@linux.dev>
Sat, 12 Jul 2025 17:45:17 +0000 (19:45 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:57 +0000 (18:59 -0700)
commit5bd88fef6a0858bc80723de2e63168965054705d
treebdb26a0f70c64795997ff6a7b418eaec2cd845b4
parent5add26c0a18636e8e9fe409d4591c8a36e1bf695
mm/memfd: replace deprecated strcpy() with memcpy() in alloc_name()

strcpy() is deprecated; use memcpy() instead.

Not copying the NUL terminator is safe because strncpy_from_user() would
overwrite it anyway by appending uname to the destination buffer at index
MFD_NAME_PREFIX_LEN.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Link: https://lkml.kernel.org/r/20250712174516.64243-2-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memfd.c