net: don't call strlen on non-terminated string in dev_set_alias()

[ Upstream commit c28294b941 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexander Potapenko 2017-06-06 15:56:54 +02:00 • committed by Greg Kroah-Hartman
commit d2f459e3fe