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)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:03:13 +0000 (03:03 +0000)
commit2f179787bc775420f02bda98bb5e32761965637a
treef87d69113726760b18eb29dd86b858f93070b847
parent7a0b2288f3eea986e09621056925533eee004463
net: don't call strlen on non-terminated string in dev_set_alias()

[ Upstream commit c28294b941232931fbd714099798eb7aa7e865d7 ]

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>
net/core/dev.c