diff options
author | David S. Miller <davem@davemloft.net> | 2017-07-19 13:33:24 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-11 08:49:32 -0700 |
commit | 0b83249a57adc1afd19c7e4818731d61d3a8ce7e (patch) | |
tree | 292e770b561884f849dedb700f1a3030090fadde /net | |
parent | a62bc8d336e3e93538c3c5dd64a36db5efcf2fa8 (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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev_ioctl.c | 1 |
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) |