From owner-cvs-src@FreeBSD.ORG Fri Jan 5 19:59:47 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 250FB16A40F; Fri, 5 Jan 2007 19:59:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 16D8113C465; Fri, 5 Jan 2007 19:59:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l05JxkLh014928; Fri, 5 Jan 2007 19:59:46 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l05JxkMI014927; Fri, 5 Jan 2007 19:59:46 GMT (envelope-from jhb) Message-Id: <200701051959.l05JxkMI014927@repoman.freebsd.org> From: John Baldwin Date: Fri, 5 Jan 2007 19:59:46 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_descrip.c uipc_usrreq.c src/sys/sys file.h unpcb.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 19:59:47 -0000 jhb 2007-01-05 19:59:46 UTC FreeBSD src repository Modified files: sys/kern kern_descrip.c uipc_usrreq.c sys/sys file.h unpcb.h Log: - Close a race between enumerating UNIX domain socket pcb structures via sysctl and socket teardown by adding a reference count to the UNIX domain pcb object and fixing the sysctl that enumerates unpcbs to grab a reference on each unpcb while it builds the list to copy out to userland. - Close a race between UNIX domain pcb garbage collection (unp_gc()) and file descriptor teardown (fdrop()) by adding a new garbage collection flag FWAIT. unp_gc() sets FWAIT while it walks the message buffers in a UNIX domain socket looking for nested file descriptor references and clears the flag when it is finished. fdrop() checks to see if the flag is set on a file descriptor whose refcount just dropped to 0 and waits for unp_gc() to clear the flag before completely destroying the file descriptor. MFC after: 1 week Reviewed by: rwatson Submitted by: ups Hopefully makes the panics go away: mx1 Revision Changes Path 1.300 +11 -0 src/sys/kern/kern_descrip.c 1.189 +51 -16 src/sys/kern/uipc_usrreq.c 1.73 +1 -0 src/sys/sys/file.h 1.21 +1 -0 src/sys/sys/unpcb.h