projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98de4e0
)
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
David S. Miller
<davem@davemloft.net>
Wed, 19 Jul 2017 20:33:24 +0000
(13:33 -0700)
The ifr.ifr_name is passed around and assumed to be NULL terminated.
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_ioctl.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/dev_ioctl.c
b/net/core/dev_ioctl.c
index 7657ad6bc13d14e16f1775824d229ce8337c21c0..06b147d7d9e2e7d8d305dd9b173d9bc1a7e9a676 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)