projects
/
GitHub
/
moto-9609
/
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:
073dd5a
)
wireless: wext: terminate ifr name coming from userspace
author
Levin, Alexander
<alexander.levin@verizon.com>
Tue, 18 Jul 2017 04:23:16 +0000
(
04:23
+0000)
committer
David S. Miller
<davem@davemloft.net>
Wed, 19 Jul 2017 20:32:11 +0000
(13:32 -0700)
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>
net/core/dev_ioctl.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/dev_ioctl.c
b/net/core/dev_ioctl.c
index 82fd4c9c4a1bf491f094a17c774c3e611c483690..7657ad6bc13d14e16f1775824d229ce8337c21c0 100644
(file)
--- 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);
}