summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-07-19 13:33:24 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-11 09:08:52 -0700
commite9b2f4617a4e631eae1717a6264cbb3e405f377f (patch)
tree98ee6225fa40c769e5226a305c56deaa36115615
parentc10e874bc3a504b3ced84616b52886388f09e0b7 (diff)
net: Zero terminate ifr_name in dev_ifname().
[ Upstream commit 63679112c536289826fec61c917621de95ba2ade ] The ifr.ifr_name is passed around and assumed to be NULL terminated. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/core/dev_ioctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index b94b1d293506..151e047ce072 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -28,6 +28,7 @@ static int dev_ifname(struct net *net, struct ifreq __user *arg)
if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
return -EFAULT;
+ ifr.ifr_name[IFNAMSIZ-1] = 0;
error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex);
if (error)