summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSultan Alsawaf <sultanxda@gmail.com>2018-06-06 15:56:54 -0700
committerSeung-Woo Kim <sw0312.kim@samsung.com>2019-12-23 16:36:22 +0900
commitd93894e7f35cbd76c54f7439d0a2d8161d6ce5a6 (patch)
tree38181388aff3098c2185cfd0f2852caa21027c0f
parent73276db2fb23064afeeb18f33deff52c35e00164 (diff)
downloadlinux-4.9-exynos9110-d93894e7f35cbd76c54f7439d0a2d8161d6ce5a6.tar.gz
linux-4.9-exynos9110-d93894e7f35cbd76c54f7439d0a2d8161d6ce5a6.tar.bz2
linux-4.9-exynos9110-d93894e7f35cbd76c54f7439d0a2d8161d6ce5a6.zip
ip_tunnel: Fix name string concatenate in __ip_tunnel_create()
commit 000ade8016400d93b4d7c89970d96b8c14773d45 upstream. By passing a limit of 2 bytes to strncat, strncat is limited to writing fewer bytes than what it's supposed to append to the name here. Since the bounds are checked on the line above this, just remove the string bounds checks entirely since they're unneeded. Signed-off-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick stable linux-4.9.y commit 5569c10858be for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ida4f04d469c4d91f12faa5fe46bd443c43bfe333
-rw-r--r--net/ipv4/ip_tunnel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index bd7f1836bb70..7a7a3f58438e 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -260,8 +260,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
err = -E2BIG;
goto failed;
}
- strlcpy(name, ops->kind, IFNAMSIZ);
- strncat(name, "%d", 2);
+ strcpy(name, ops->kind);
+ strcat(name, "%d");
}
ASSERT_RTNL();