[PATCH 1012/1012] Support for unicode interface names: only '%', ':' and '/' must be avoided

Jason A. Donenfeld Jason at zx2c4.com
Sat Aug 25 07:26:10 CEST 2018


Indeed it looks like we could be slightly more permissive. From net/core/dev.c:

/**
*      dev_valid_name - check if name is okay for network device
*      @name: name string
*
*      Network device names need to be valid file names to
*      to allow sysfs to work.  We also disallow any kind of
*      whitespace.
*/
bool dev_valid_name(const char *name)
{
       if (*name == '\0')
               return false;
       if (strnlen(name, IFNAMSIZ) == IFNAMSIZ)
               return false;
       if (!strcmp(name, ".") || !strcmp(name, ".."))
               return false;

       while (*name) {
               if (*name == '/' || *name == ':' || isspace(*name))
                       return false;
               name++;
       }
       return true;
}

And earlier in the callstack, %d is checked for, which indeed adds %
to the blacklist, as your commit indicates.

But should wg-quick enable insane dev names?


More information about the WireGuard mailing list