From: YOSHIFUJI Hideaki Date: Mon, 28 Apr 2008 05:40:55 +0000 (+0900) Subject: ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER). X-Git-Tag: v2.6.26-rc7~40^2~5^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=20c61fbd8deb2ada0ac3acecf6156a986dbfff2d;p=linux-2.6-omap-h63xx.git ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER). Signed-off-by: YOSHIFUJI Hideaki --- diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 26b83e512a0..ce794d6acb7 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -874,6 +874,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, return -EINVAL; if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0))) return -EFAULT; + if (gsf.gf_group.ss_family != AF_INET6) + return -EADDRNOTAVAIL; lock_sock(sk); err = ip6_mc_msfget(sk, &gsf, (struct group_filter __user *)optval, optlen);