net: don't call strlen on non-terminated string in dev_set_alias()
authorAlexander Potapenko <glider@google.com>
Tue, 6 Jun 2017 13:56:54 +0000 (15:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Jun 2017 16:58:45 +0000 (12:58 -0400)
commitc28294b941232931fbd714099798eb7aa7e865d7
tree34ebac6259d426d260ad707793f17cc3ae8df66b
parentb29794ec95c6856b316c2295904208bf11ffddd9
net: don't call strlen on non-terminated string in dev_set_alias()

KMSAN reported a use of uninitialized memory in dev_set_alias(),
which was caused by calling strlcpy() (which in turn called strlen())
on the user-supplied non-terminated string.

Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c