From: Pravin B Shelar Date: Thu, 28 Mar 2013 08:21:46 +0000 (+0000) Subject: ip_tunnel: Fix off-by-one error in forming dev name. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54a5d3828995c0df4f8e12a5d91b1c42f0f323d6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ip_tunnel: Fix off-by-one error in forming dev name. As Ben pointed out following patch fixes bug in checking device name length limits while forming tunnel device name. CC: Ben Hutchings Signed-off-by: Pravin B Shelar Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 9d96b6853f21..e4147ec1665a 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -284,7 +284,7 @@ static struct net_device *__ip_tunnel_create(struct net *net, if (parms->name[0]) strlcpy(name, parms->name, IFNAMSIZ); else { - if (strlen(ops->kind) + 3 >= IFNAMSIZ) { + if (strlen(ops->kind) > (IFNAMSIZ - 3)) { err = -E2BIG; goto failed; }