From owner-svn-src-head@freebsd.org Fri Mar 15 15:11:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC3E7154B67D for ; Fri, 15 Mar 2019 15:11:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713976C42A for ; Fri, 15 Mar 2019 15:11:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 0C4861CE51 for ; Fri, 15 Mar 2019 15:11:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f182.google.com with SMTP id a17so8263393ljd.4 for ; Fri, 15 Mar 2019 08:11:37 -0700 (PDT) X-Gm-Message-State: APjAAAXO4Zj9ynRFDJOyTFhOzNvIMjg9qF1K3f3vCJ90TmqHy7/PgZPl FfVNiYRgatCx3jjlW80P3Y8z1OE6xZIXdO7GioI= X-Received: by 2002:a2e:8456:: with SMTP id u22mt1833097ljh.108.1552662696499; Fri, 15 Mar 2019 08:11:36 -0700 (PDT) MIME-Version: 1.0 References: <201903151319.x2FDJqdc028407@repo.freebsd.org> In-Reply-To: <201903151319.x2FDJqdc028407@repo.freebsd.org> From: Kyle Evans Date: Fri, 15 Mar 2019 10:11:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r345180 - head/sys/net Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 713976C42A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Mar 2019 15:11:39 -0000 On Fri, Mar 15, 2019 at 8:20 AM Kyle Evans wrote: > > Author: kevans > Date: Fri Mar 15 13:19:52 2019 > New Revision: 345180 > URL: https://svnweb.freebsd.org/changeset/base/345180 > > Log: > if_bridge(4): Fix module teardown > > bridge_rtnode_zone still has outstanding allocations at the time of > destruction in the current model because all of the interface teardown > happens in a VNET_SYSUNINIT, -after- the MOD_UNLOAD has already been > processed. The SYSUNINIT triggers destruction of the interfaces, which then > attempts to free the memory from the zone that's already been destroyed, and > we hit a panic. > > Solve this by virtualizing the uma_zone we allocate the rtnodes from to fix > the ordering. bridge_rtable_fini should also take care to flush any > remaining routes that weren't taken care of when dynamic routes were flushed > in bridge_stop. > > Reviewed by: kp > Differential Revision: https://reviews.freebsd.org/D19578 > > Modified: > head/sys/net/if_bridge.c > > [... snip ...] > @@ -2886,6 +2890,7 @@ bridge_rtable_fini(struct bridge_softc *sc) > > KASSERT(sc->sc_brtcnt == 0, > ("%s: %d bridge routes referenced", __func__, sc->sc_brtcnt)); > + bridge_rtflush(sc, 1); > free(sc->sc_rthash, M_DEVBUF); > } > Now that I read through all of this again, this is wrong. Routes are destroyed as the member interfaces are removed up in bridge_clone_destroy, and that this needs to have been done already is KASSERT'd on the line right above. I will remove this, because that flush will accomplish nothing.