]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Fix an off by one in root_nfs_cat()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Feb 2024 21:16:53 +0000 (22:16 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:03 +0000 (18:20 -0400)
commit7f029d2438a0c99cf7e643882969a3dfe873bb53
treecc3dc5330f81ba7071f72368c1efe8e2a63d2eaa
parentad27382f8495f8ef6d2c66c413d756bfd13c0598
NFS: Fix an off by one in root_nfs_cat()

[ Upstream commit 698ad1a538da0b6bf969cfee630b4e3a026afb87 ]

The intent is to check if 'dest' is truncated or not. So, >= should be
used instead of >, because strlcat() returns the length of 'dest' and 'src'
excluding the trailing NULL.

Fixes: 56463e50d1fc ("NFS: Use super.c for NFSROOT mount option parsing")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfsroot.c