[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364494906-9818-1-git-send-email-pshelar@nicira.com>
Date: Thu, 28 Mar 2013 11:21:46 -0700
From: Pravin B Shelar <pshelar@...ira.com>
To: netdev@...r.kernel.org
Cc: Pravin B Shelar <pshelar@...ira.com>,
Ben Hutchings <bhutchings@...arflare.com>
Subject: [PATCH net-next] 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 <bhutchings@...arflare.com>
Signed-off-by: Pravin B Shelar <pshelar@...ira.com>
---
net/ipv4/ip_tunnel.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 9d96b68..e4147ec 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;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists