diff options
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 79bb49061ef6..926ea544f499 100644 --- 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 | |||
1646 | case MRT6_ASSERT: | 1646 | case MRT6_ASSERT: |
1647 | { | 1647 | { |
1648 | int v; | 1648 | int v; |
1649 | |||
1650 | if (optlen != sizeof(v)) | ||
1651 | return -EINVAL; | ||
1649 | if (get_user(v, (int __user *)optval)) | 1652 | if (get_user(v, (int __user *)optval)) |
1650 | return -EFAULT; | 1653 | return -EFAULT; |
1651 | mrt->mroute_do_assert = v; | 1654 | mrt->mroute_do_assert = v; |
@@ -1656,6 +1659,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns | |||
1656 | case MRT6_PIM: | 1659 | case MRT6_PIM: |
1657 | { | 1660 | { |
1658 | int v; | 1661 | int v; |
1662 | |||
1663 | if (optlen != sizeof(v)) | ||
1664 | return -EINVAL; | ||
1659 | if (get_user(v, (int __user *)optval)) | 1665 | if (get_user(v, (int __user *)optval)) |
1660 | return -EFAULT; | 1666 | return -EFAULT; |
1661 | v = !!v; | 1667 | v = !!v; |