aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-01-23 15:38:34 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-27 19:31:03 -0500
commit75356a8143426a1301bc66c4fb920dcb1bd5e934 (patch)
tree70ca3cb89b3ab3f91a1fdcae97f3cbe46a67bdbe /net
parentce11ff5e5963e441feb591e76278528f876c332d (diff)
ip6mr: limit IPv6 MRT_TABLE identifiers
We did this for IPv4 in b49d3c1e1c "net: ipmr: limit MRT_TABLE identifiers" but we need to do it for IPv6 as well. On IPv6 the name is "pim6reg" instead of "pimreg" so there is one less digit allowed. The strcpy() is in ip6mr_reg_vif(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6mr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 26dcdec9e3a5..8fd154e5f079 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1710,6 +1710,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
1710 return -EINVAL; 1710 return -EINVAL;
1711 if (get_user(v, (u32 __user *)optval)) 1711 if (get_user(v, (u32 __user *)optval))
1712 return -EFAULT; 1712 return -EFAULT;
1713 /* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
1714 if (v != RT_TABLE_DEFAULT && v >= 100000000)
1715 return -EINVAL;
1713 if (sk == mrt->mroute6_sk) 1716 if (sk == mrt->mroute6_sk)
1714 return -EBUSY; 1717 return -EBUSY;
1715 1718