From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 1 16:28:19 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D88D16A4E1; Fri, 1 Sep 2006 16:28:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 398F343D58; Fri, 1 Sep 2006 16:28:11 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (rwatson@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k81GSASw029984; Fri, 1 Sep 2006 16:28:10 GMT (envelope-from rwatson@freefall.freebsd.org) Received: (from rwatson@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k81GSAsa029980; Fri, 1 Sep 2006 16:28:10 GMT (envelope-from rwatson) Date: Fri, 1 Sep 2006 16:28:10 GMT From: Robert Watson Message-Id: <200609011628.k81GSAsa029980@freefall.freebsd.org> To: rwatson@FreeBSD.org, freebsd-bugs@FreeBSD.org, rwatson@FreeBSD.org Cc: Subject: Re: kern/102752: malloc(M_WAITOK) of "g_bio", forcing M_NOWAIT with non-sleepable locks held X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Sep 2006 16:28:19 -0000 Synopsis: malloc(M_WAITOK) of "g_bio", forcing M_NOWAIT with non-sleepable locks held Responsible-Changed-From-To: freebsd-bugs->rwatson Responsible-Changed-By: rwatson Responsible-Changed-When: Fri Sep 1 16:26:32 UTC 2006 Responsible-Changed-Why: Grab ownership of this PR, since it is of interest to me. The fix here is to drop the inpcb lock before going near copyin/copyout, but the tricky bit is that the connection may change state while the lock is dropped, so the path from the socket to the inpcb/tcpcb must be re-evaluated, and the timewait state checked for. In HEAD this is easier since the inpcb can't go away, but in -STABLE we need to check that so_pcb is still non-NULL also, as the connection could have been reset. I'll work on a patch for this in the near future. http://www.freebsd.org/cgi/query-pr.cgi?pr=102752