Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ip6mr: Add sizeof verification to MRT6_ASSERT and MT6_PIM

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>

authored by

Joe Perches and committed by
David S. Miller
03f52a0a c91f6df2

+6
+6
net/ipv6/ip6mr.c
··· 1646 1646 case MRT6_ASSERT: 1647 1647 { 1648 1648 int v; 1649 + 1650 + if (optlen != sizeof(v)) 1651 + return -EINVAL; 1649 1652 if (get_user(v, (int __user *)optval)) 1650 1653 return -EFAULT; 1651 1654 mrt->mroute_do_assert = v; ··· 1659 1656 case MRT6_PIM: 1660 1657 { 1661 1658 int v; 1659 + 1660 + if (optlen != sizeof(v)) 1661 + return -EINVAL; 1662 1662 if (get_user(v, (int __user *)optval)) 1663 1663 return -EFAULT; 1664 1664 v = !!v;