summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLevin, Alexander <alexander.levin@verizon.com>2017-07-18 04:23:16 +0000
committerDavid S. Miller <davem@davemloft.net>2017-07-19 13:32:11 -0700
commit98de4e0ea47d106846fc0e30ce4e644283fa7fc2 (patch)
treeba5cff38d9d85c2d9e003c238707a4050dd8b683 /net
parent073dd5ad34b1d3aaadaa7e5e8cbe576d9545f163 (diff)
downloadlinux-98de4e0ea47d106846fc0e30ce4e644283fa7fc2.tar.bz2
wireless: wext: terminate ifr name coming from userspace
ifr name is assumed to be a valid string by the kernel, but nothing was forcing username to pass a valid string. In turn, this would cause panics as we tried to access the string past it's valid memory. Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev_ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 82fd4c9c4a1b..7657ad6bc13d 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -424,6 +424,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
if (copy_from_user(&iwr, arg, sizeof(iwr)))
return -EFAULT;
+ iwr.ifr_name[sizeof(iwr.ifr_name) - 1] = 0;
+
return wext_handle_ioctl(net, &iwr, cmd, arg);
}