提交 20c61fbd 编写于 作者: Y YOSHIFUJI Hideaki

ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER).

Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
上级 513fd370
...@@ -874,6 +874,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, ...@@ -874,6 +874,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
return -EINVAL; return -EINVAL;
if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0))) if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0)))
return -EFAULT; return -EFAULT;
if (gsf.gf_group.ss_family != AF_INET6)
return -EADDRNOTAVAIL;
lock_sock(sk); lock_sock(sk);
err = ip6_mc_msfget(sk, &gsf, err = ip6_mc_msfget(sk, &gsf,
(struct group_filter __user *)optval, optlen); (struct group_filter __user *)optval, optlen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册