Date: Fri, 31 Oct 2014 09:56:00 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273897 - head/sys/kern Message-ID: <201410310956.s9V9u09i021005@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410310956.s9V9u09i021005>