projects
/
platform
/
kernel
/
linux-amlogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a62bc8d
)
net: Zero terminate ifr_name in dev_ifname().
author
David S. Miller
<davem@davemloft.net>
Wed, 19 Jul 2017 20:33:24 +0000
(13:33 -0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 15:49:32 +0000
(08:49 -0700)
[ 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>
net/core/dev_ioctl.c
patch
|
blob
|
history
diff --git
a/net/core/dev_ioctl.c
b/net/core/dev_ioctl.c
index
b94b1d2
..
151e047
100644
(file)
--- 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)