diff mbox

reject creation of netdev names with colons

Message ID 1424219517-9386-1-git-send-email-mthode@mthode.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Matthew Thode Feb. 18, 2015, 12:31 a.m. UTC
colons are used as a separator in netdev device lookup in dev_ioctl.c

Specific functions are SIOCGIFTXQLEN SIOCETHTOOL SIOCSIFNAME

Signed-off-by: Matthew Thode <mthode@mthode.org>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Feb. 22, 2015, 2:46 a.m. UTC | #1
From: Matthew Thode <mthode@mthode.org>
Date: Tue, 17 Feb 2015 18:31:57 -0600

> colons are used as a separator in netdev device lookup in dev_ioctl.c
> 
> Specific functions are SIOCGIFTXQLEN SIOCETHTOOL SIOCSIFNAME
> 
> Signed-off-by: Matthew Thode <mthode@mthode.org>

Applied thanks.

Please put a proper subsystem prefix in your Subject line
for future patches.  In this case an appropriate prefix
would have been "net: reject..."
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index d030575..efbad386 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -946,7 +946,7 @@  bool dev_valid_name(const char *name)
 		return false;
 
 	while (*name) {
-		if (*name == '/' || isspace(*name))
+		if (*name == '/' || *name == ':' || isspace(*name))
 			return false;
 		name++;
 	}