]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Fix potential buffer overflowin nfs_sysfs_link_rpc_client()
authorZichen Xie <zichenxie0106@gmail.com>
Tue, 17 Dec 2024 16:13:12 +0000 (00:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:26 +0000 (14:01 +0100)
commitdd8830779b77f4d1206d28d02ad56a03fc0e78f7
treea8b9f92ffcf49adef05bb1a5a24cb1eaaa95fd88
parent758a5e1dc6db6d5ddf65d0b82b4caffc65efdb2a
NFS: Fix potential buffer overflowin nfs_sysfs_link_rpc_client()

[ Upstream commit 49fd4e34751e90e6df009b70cd0659dc839e7ca8 ]

name is char[64] where the size of clnt->cl_program->name remains
unknown. Invoking strcat() directly will also lead to potential buffer
overflow. Change them to strscpy() and strncat() to fix potential
issues.

Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/sysfs.c