Commit bb699cbc authored by Michal Ruzicka's avatar Michal Ruzicka Committed by David S. Miller

[IPV4]: Possible leak of multicast source filter sctructure

There is a leak of a socket's multicast source filter list structure
on closing a socket with a multicast source filter set on an interface
that does not exist any more.
Signed-off-by: default avatarMichal Ruzicka <michal.ruzicka@comstar.cz>
Acked-by: default avatarDavid L Stevens <dlstevens@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 640c41c7
...@@ -2199,13 +2199,13 @@ void ip_mc_drop_socket(struct sock *sk) ...@@ -2199,13 +2199,13 @@ void ip_mc_drop_socket(struct sock *sk)
struct in_device *in_dev; struct in_device *in_dev;
inet->mc_list = iml->next; inet->mc_list = iml->next;
if ((in_dev = inetdev_by_index(iml->multi.imr_ifindex)) != NULL) { in_dev = inetdev_by_index(iml->multi.imr_ifindex);
(void) ip_mc_leave_src(sk, iml, in_dev); (void) ip_mc_leave_src(sk, iml, in_dev);
if (in_dev != NULL) {
ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
in_dev_put(in_dev); in_dev_put(in_dev);
} }
sock_kfree_s(sk, iml, sizeof(*iml)); sock_kfree_s(sk, iml, sizeof(*iml));
} }
rtnl_unlock(); rtnl_unlock();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment