svn commit: r273897 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Fri Oct 31 09:56:01 UTC 2014


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);


More information about the svn-src-head mailing list