summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSultan Alsawaf <sultanxda@gmail.com>2018-06-06 15:56:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-08 13:05:05 +0100
commit5569c10858bebe3ac36d313610e11711087ec580 (patch)
treebec4374a0b3015f919ebbbfa786f7a474ebf0d33 /net
parent52fc8c7243f34dc8cd8c6977b92943518b325ccf (diff)
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>
Diffstat (limited to 'net')
-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 d8d99c21a9c1..e6ee6acac80c 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -261,8 +261,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
} else {
if (strlen(ops->kind) > (IFNAMSIZ - 3))
goto failed;
- strlcpy(name, ops->kind, IFNAMSIZ);
- strncat(name, "%d", 2);
+ strcpy(name, ops->kind);
+ strcat(name, "%d");
}
ASSERT_RTNL();