net: fool proof dev_valid_name()
authorEric Dumazet <edumazet@google.com>
Thu, 5 Apr 2018 13:39:26 +0000 (06:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:48:34 +0000 (19:48 +0200)
commit0d1c057dd6f373d8bfb168ee33f5ef8ee9e92e1b
treec2a5aa1b14920e297c4fb392997f6c8627bed00f
parent359d6e35786b3aafc4dea0d5cf59ff62c1eb126c
net: fool proof dev_valid_name()

[ Upstream commit a9d48205d0aedda021fc3728972a9e9934c2b9de ]

We want to use dev_valid_name() to validate tunnel names,
so better use strnlen(name, IFNAMSIZ) than strlen(name) to make
sure to not upset KASAN.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/dev.c