diff --git a/sys/net/if.c b/sys/net/if.c --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1453,6 +1453,11 @@ ifgl->ifgl_group = ifg; ifgm->ifgm_ifp = ifp; + /* + * Ensure that all pointed-to objects are visible to readers before the + * holding structures are added to the lists under the lock. + */ + atomic_thread_fence_seq_cst(); IF_ADDR_WLOCK(ifp); CK_STAILQ_INSERT_TAIL(&ifg->ifg_members, ifgm, ifgm_next); CK_STAILQ_INSERT_TAIL(&ifp->if_groups, ifgl, ifgl_next);