Commit 98de4e0e authored by Levin, Alexander's avatar Levin, Alexander Committed by David S. Miller

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: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 073dd5ad
...@@ -424,6 +424,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) ...@@ -424,6 +424,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
if (copy_from_user(&iwr, arg, sizeof(iwr))) if (copy_from_user(&iwr, arg, sizeof(iwr)))
return -EFAULT; return -EFAULT;
iwr.ifr_name[sizeof(iwr.ifr_name) - 1] = 0;
return wext_handle_ioctl(net, &iwr, cmd, arg); return wext_handle_ioctl(net, &iwr, cmd, arg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment