Re: git: e3044071dec1 - main - in6p_set_multicast_if(): fix malloc(M_WAITOK) with epoch

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Tue, 07 Dec 2021 07:36:58 UTC
On 12/6/21 23:36, Gleb Smirnoff wrote:
> diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
> index b1b161ace1b8..d0f8186e75c7 100644
> --- a/sys/netinet6/in6_mcast.c
> +++ b/sys/netinet6/in6_mcast.c
> @@ -2454,9 +2454,9 @@ in6p_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
>   			return (EADDRNOTAVAIL);
>   		}
>   	}
> +	NET_EPOCH_EXIT(et);	/* XXXGL: unsafe ifp */
>   	imo = in6p_findmoptions(inp);
> -	imo->im6o_multicast_ifp = ifp;	/* XXXGL: reference?! */
> -	NET_EPOCH_EXIT(et);
> +	imo->im6o_multicast_ifp = ifp;
>   	INP_WUNLOCK(inp);
>   
>   	return (0);
> 

You can ref the ifp before the EPOCH exit?

--HPS