Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75356a81 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

ip6mr: limit IPv6 MRT_TABLE identifiers



We did this for IPv4 in b49d3c1e "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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ce11ff5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1710,6 +1710,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
			return -EINVAL;
		if (get_user(v, (u32 __user *)optval))
			return -EFAULT;
		/* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
		if (v != RT_TABLE_DEFAULT && v >= 100000000)
			return -EINVAL;
		if (sk == mrt->mroute6_sk)
			return -EBUSY;