mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
net: Zero terminate ifr_name in dev_ifname().
[ Upstream commit 63679112c5 ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c42851f218
commit
f236da93df
@@ -28,6 +28,7 @@ static int dev_ifname(struct net *net, struct ifreq __user *arg)
|
|||||||
|
|
||||||
if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
|
if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
ifr.ifr_name[IFNAMSIZ-1] = 0;
|
||||||
|
|
||||||
error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex);
|
error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
Reference in New Issue
Block a user