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: Ubuntu-5.13.0-19.19~41806^2~5^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=20c61fbd8deb2ada0ac3acecf6156a986dbfff2d;p=mirror_ubuntu-jammy-kernel.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 26b83e512a09..ce794d6acb70 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);