Commit 76c3b6ba authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Dong Chenchen
Browse files

net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr()

stable inclusion
from stable-v4.19.311
commit 867a6a6899a68323d6ef8995ea3765611d67ba1e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IA7YCW
CVE: NA

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



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

[ Upstream commit d6f4de70f73a106986ee315d7d512539f2f3303a ]

The intent is to check if the strings' are truncated or not. So, >= should
be used instead of >, because strlcat() and snprintf() return the length of
the output, excluding the trailing NULL.

Fixes: a02d6926 ("SUNRPC: Provide functions for managing universal addresses")
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 avatarDong Chenchen <dongchenchen2@huawei.com>
parent af07c19b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment