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

Previous thread: dccp: Bug in initial acknowledgment number assignment by Linux Kernel Mailing List on Friday, June 13, 2008 - 5:01 pm. (1 message)

Next thread: ipv6 route: Fix route lifetime in netlink message. by Linux Kernel Mailing List on Friday, June 13, 2008 - 5:01 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, June 13, 2008 - 5:01 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20c61f...
Commit:     20c61fbd8deb2ada0ac3acecf6156a986dbfff2d
Parent:     513fd370e6832f81ab717df4645f5ce679e44f14
Author:     YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
AuthorDate: Mon Apr 28 14:40:55 2008 +0900
Committer:  YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
CommitDate: Thu Jun 12 09:19:08 2008 +0900

    ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER).
    
    Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/ipv6/ipv6_sockglue.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 26b83e5..ce794d6 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);
--

Previous thread: dccp: Bug in initial acknowledgment number assignment by Linux Kernel Mailing List on Friday, June 13, 2008 - 5:01 pm. (1 message)

Next thread: ipv6 route: Fix route lifetime in netlink message. by Linux Kernel Mailing List on Friday, June 13, 2008 - 5:01 pm. (1 message)