mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ip_tunnel: Fix name string concatenate in __ip_tunnel_create()
commit 000ade8016 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e26457da0c
commit
bb1d0ac3ef
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user