]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:41:33 +0000 (14:41 +0200)
commit3227b51e72f4d8e33cd6274e471c08b2fbec6e2e
tree4e65839f342a7148ceb7fea5d0f0cc9572470aa5
parent8afcfa55e6a7d8c58bdb4355bd544602e6f0c3ad
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