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:
c91f6df
)
ip6mr: Add sizeof verification to MRT6_ASSERT and MT6_PIM
author
Joe Perches
<joe@perches.com>
Sun, 25 Nov 2012 18:26:34 +0000
(18:26 +0000)
committer
David S. Miller
<davem@davemloft.net>
Mon, 26 Nov 2012 22:35:58 +0000
(17:35 -0500)
Verify the length of the user-space arguments.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6mr.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ipv6/ip6mr.c
b/net/ipv6/ip6mr.c
index 79bb49061ef6ddb5398c3213ddb2da14f49b5fc7..926ea544f499e93c895b42e9677d316f7cff481d 100644
(file)
--- a/
net/ipv6/ip6mr.c
+++ b/
net/ipv6/ip6mr.c
@@
-1646,6
+1646,9
@@
int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
case MRT6_ASSERT:
{
int v;
+
+ if (optlen != sizeof(v))
+ return -EINVAL;
if (get_user(v, (int __user *)optval))
return -EFAULT;
mrt->mroute_do_assert = v;
@@
-1656,6
+1659,9
@@
int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
case MRT6_PIM:
{
int v;
+
+ if (optlen != sizeof(v))
+ return -EINVAL;
if (get_user(v, (int __user *)optval))
return -EFAULT;
v = !!v;