]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hostfs: fix string handling in __dentry_name()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 11 Jan 2025 06:37:44 +0000 (01:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:16 +0000 (10:02 +0100)
commit67f59bbdb35e74cd4cda9263dd7f78b5993614ae
tree4737c00deded7fe86f200e92d7a3c9f230f87c83
parentf2f7527fec84715772f562dbff1bd69df70f2769
hostfs: fix string handling in __dentry_name()

[ Upstream commit 60a6002432448bb3f291d80768ae98d62efc9c77 ]

strcpy() should not be used with destination potentially overlapping
the source; what's more, strscpy() in there is pointless - we already
know the amount we want to copy; might as well use memcpy().

Fixes: c278e81b8a02 "hostfs: Remove open coded strcpy()"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/hostfs/hostfs_kern.c