From owner-freebsd-net@FreeBSD.ORG Sun Jan 30 22:00:19 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC5A1106566B for ; Sun, 30 Jan 2011 22:00:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CEB6B8FC16 for ; Sun, 30 Jan 2011 22:00:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p0UM0JAW012685 for ; Sun, 30 Jan 2011 22:00:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0UM0JZ8012684; Sun, 30 Jan 2011 22:00:19 GMT (envelope-from gnats) Date: Sun, 30 Jan 2011 22:00:19 GMT Message-Id: <201101302200.p0UM0JZ8012684@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Juergen Lock Cc: Subject: Re: kern/153938: [run] [panic] [patch] Workaround for use-after-free panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Juergen Lock List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 22:00:20 -0000 The following reply was made to PR kern/153938; it has been noted by GNATS. From: Juergen Lock To: PseudoCylon Cc: bug-followup@freebsd.org, Juergen Lock Subject: Re: kern/153938: [run] [panic] [patch] Workaround for use-after-free panic Date: Sun, 30 Jan 2011 22:50:42 +0100 On Sat, Jan 22, 2011 at 11:35:14PM -0800, PseudoCylon wrote: > >panic > > > > It's possible this was triggered by the first DPRINTFN() in > > run_node_cleanup() (that I turned into a device_printf() and meanwhile > > have disabled, maybe it caused a taskswitch) > > Your bt says no. > I was more thinking the printf might have allowed the other thread to run and grab the lock... > > #5 0xffffffff8117839b in run_node_cleanup (ni=0xffffff8000f83000) > > at > >/data2v/home/nox/src-r81/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:1719 > > > > 1719 RUN_LOCK(sc); > > (kgdb) l > > > run_node_cleanup() was called with node lock held. Happens all the time. > Ok but this time RUN_LOCK was held by the same thread that slept on the node lock and thus there was deadlock... > > - but in any case I'd > > say this is not safe i.e. needs to be fixed. :) > > > > Yes. Here is fix. This one shall work. > http://gitorious.org/run/run/trees/fifo_fix/dev/usb/wlan Anyway, I have been testing this version for maybe a week now and it seems to work at least no worse than the previous one, minus the deadlock. :) So it probably can go in. Thanx! Juergen