From 6c18602692a774204701a5fed7b3907f90da61e0 Mon Sep 17 00:00:00 2001 From: rlibby Date: Mon, 25 Nov 2019 22:25:34 +0000 Subject: [PATCH] in_mcast.c: need if_addr_lock around inm_release_deferred Apply a similar fix as for in6_mcast.c. Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20740 --- sys/netinet/in_mcast.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 9def61fca96a..bfc5e3b3869a 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1268,7 +1268,9 @@ in_joingroup_locked(struct ifnet *ifp, const struct in_addr *gina, if (error) { CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); + IF_ADDR_WLOCK(ifp); inm_release_deferred(inm); + IF_ADDR_WUNLOCK(ifp); } else { *pinm = inm; } @@ -2247,7 +2249,9 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt) if (is_new && imf) { if (imf->imf_inm != NULL) { IN_MULTI_LIST_LOCK(); + IF_ADDR_WLOCK(ifp); inm_release_deferred(imf->imf_inm); + IF_ADDR_WUNLOCK(ifp); IN_MULTI_LIST_UNLOCK(); } ip_mfilter_free(imf);