From: Matthew Thode Date: Wed, 18 Feb 2015 00:31:57 +0000 (-0600) Subject: net: reject creation of netdev names with colons X-Git-Tag: v2.6.32.66~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7357ca5c20572ac9609a87be884f1e87bd28185;p=thirdparty%2Fkernel%2Fstable.git net: reject creation of netdev names with colons [ Upstream commit a4176a9391868bfa87705bcd2e3b49e9b9dd2996 ] 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 Signed-off-by: David S. Miller [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings (cherry picked from commit d501ebeb7da7531e92e3c8d194730341c314ff2d) Signed-off-by: Willy Tarreau --- diff --git a/net/core/dev.c b/net/core/dev.c index d25044459af0c..0767b17593e28 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -779,7 +779,7 @@ int dev_valid_name(const char *name) return 0; while (*name) { - if (*name == '/' || isspace(*name)) + if (*name == '/' || *name == ':' || isspace(*name)) return 0; name++; }