From owner-cvs-all@FreeBSD.ORG Sun Oct 19 18:41:20 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29EB816A4B3 for ; Sun, 19 Oct 2003 18:41:20 -0700 (PDT) Received: from smtp.mho.com (smtp.mho.net [64.58.4.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 79C8743FE1 for ; Sun, 19 Oct 2003 18:41:17 -0700 (PDT) (envelope-from scottl@freebsd.org) Received: (qmail 29978 invoked by uid 1002); 20 Oct 2003 01:41:17 -0000 Received: from unknown (HELO freebsd.org) (64.58.1.252) by smtp.mho.net with SMTP; 20 Oct 2003 01:41:17 -0000 Message-ID: <3F933D37.40906@freebsd.org> Date: Sun, 19 Oct 2003 19:41:11 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Alan L. Cox" References: <200310192041.h9JKf712075632@repoman.freebsd.org> <3F92FA9D.F25F3CFB@imimic.com> In-Reply-To: <3F92FA9D.F25F3CFB@imimic.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: David Malone cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/streams streams.csrc/sys/kernkern_descrip.csrc/sys/opencrypto cryptodev.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2003 01:41:20 -0000 Alan L. Cox wrote: > David Malone wrote: > >>dwmalone 2003/10/19 13:41:07 PDT >> >> FreeBSD src repository >> >> Modified files: >> sys/dev/streams streams.c >> sys/kern kern_descrip.c kern_event.c sys_pipe.c >> uipc_syscalls.c vfs_syscalls.c >> sys/opencrypto cryptodev.c >> Log: >> falloc allocates a file structure and adds it to the file descriptor >> table, acquiring the necessary locks as it works. It usually returns >> two references to the new descriptor: one in the descriptor table >> and one via a pointer argument. >> >> As falloc releases the FILEDESC lock before returning, there is a >> potential for a process to close the reference in the file descriptor >> table before falloc's caller gets to use the file. I don't think this >> can happen in practice at the moment, because Giant indirectly protects >> closes. >> >> To stop the file being completly closed in this situation, this change >> makes falloc set the refcount to two when both references are returned. >> This makes life easier for several of falloc's callers, because the >> first thing they previously did was grab an extra reference on the >> file. >> > > > This reminds me that we still hold Giant around pipe(2) because it isn't > declared MPSAFE in the syscall table. Is this still necessary? I've been suspicious of this too, and I was hoping that you would have an answer. Can we go ahead and correct this? > > Additionally, we declare dup2(2) to be MPSAFE, but not dup(2). Given > their implementations that seems odd. We likely need to do a review through the syscalls and weed out problems like this. Any volunteers? Scott