From owner-svn-src-head@FreeBSD.ORG Fri Oct 31 09:56:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A8A9B88; Fri, 31 Oct 2014 09:56:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 467227EF; Fri, 31 Oct 2014 09:56:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9V9u132021010; Fri, 31 Oct 2014 09:56:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9u09i021005; Fri, 31 Oct 2014 09:56:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310956.s9V9u09i021005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 09:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273897 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:56:01 -0000 Author: mjg Date: Fri Oct 31 09:56:00 2014 New Revision: 273897 URL: https://svnweb.freebsd.org/changeset/base/273897 Log: filedesc: fix missed comments about fdsetugidsafety While here just note that both fdsetugidsafety and fdcheckstd take sleepable locks. Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 09:51:54 2014 (r273896) +++ head/sys/kern/kern_descrip.c Fri Oct 31 09:56:00 2014 (r273897) @@ -2088,7 +2088,7 @@ fdescfree(struct thread *td) * otherwise be off-limits to the process. We check for filesystems where * the vnode can change out from under us after execve (like [lin]procfs). * - * Since setugidsafety calls this only for fd 0, 1 and 2, this check is + * Since fdsetugidsafety calls this only for fd 0, 1 and 2, this check is * sufficient. We also don't check for setugidness since we know we are. */ static bool Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Oct 31 09:51:54 2014 (r273896) +++ head/sys/kern/kern_exec.c Fri Oct 31 09:56:00 2014 (r273897) @@ -688,10 +688,8 @@ interpret: * Close any file descriptors 0..2 that reference procfs, * then make sure file descriptors 0..2 are in use. * - * setugidsafety() may call closef() and then pfind() - * which may grab the process lock. - * fdcheckstd() may call falloc() which may block to - * allocate memory, so temporarily drop the process lock. + * Both fdsetugidsafety() and fdcheckstd() may call functions + * taking sleepable locks, so temporarily drop our locks. */ PROC_UNLOCK(p); VOP_UNLOCK(imgp->vp, 0);