Skip to content
Commit 374a8fcb authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Wang Zhaolong
Browse files

NFS: Fix an off by one in root_nfs_cat()

stable inclusion
from stable-v4.19.311
commit 9bb320c5cea50e7fa82a477743a6a0546eaa37b3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IA7XXI
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9bb320c5cea50e7fa82a477743a6a0546eaa37b3



--------------------------------

[ 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: 56463e50 ("NFS: Use super.c for NFSROOT mount option parsing")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWang Zhaolong <wangzhaolong1@huawei.com>
parent 488688e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment