Date: Sun, 20 Feb 2005 23:06:53 +0100 From: Joerg Sonnenberger <joerg@britannica.bec.de> To: freebsd-hackers@freebsd.org Subject: Re: Small bug fix from DragonFly / review requested Message-ID: <20050220220653.GB5041@britannica.bec.de> In-Reply-To: <Pine.NEB.3.96L.1050220210020.13235B-100000@fledge.watson.org> References: <200502201936.31366.max@love2party.net> <Pine.NEB.3.96L.1050220210020.13235B-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 20, 2005 at 09:02:25PM +0000, Robert Watson wrote: > > On Sun, 20 Feb 2005, Max Laier wrote: > > > Joerg Sonnenberger has discovered a problem in the snc(4) driver that > > might result in packets showing up on bpf multiple times. See the > > changelog for sys/dev/netif/snc/dp83932.c in their source tree[1]. > > > > Attached is a fix for HEAD. I am almost sure that it is right, but I'd > > welcome a review as there might be a chance that sonicput() and the TX > > interrupt free the mbuf before it gets to bpf. From my reading it seems > > that the mbuf is "safe" until sc->mtd_free is altered (see comment). > > This change seems fine -- in the current world order, Giant will prevent > the driver from preempting itself and freeing the mbuf, and if we get > per-softc locking for snc, presumably that locking will provide the same > protection. It may be worth annotating that we rely on non-preemption by > the interrupt handler to avoid the mbuf being freed with a comment. Quite a lot of the network drivers actually fully depend on that. So it might be better to add it to a global list of stuff to keep in mind :) Joerg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050220220653.GB5041>