summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-09-13 09:31:56 +0000
committertruckman <truckman@FreeBSD.org>2002-09-13 09:31:56 +0000
commit8172475ce1cd34373d669db96d930165b111c443 (patch)
tree2f92a8b1b5b9d3384ecc2cf92a714baec267854a /sys/kern/kern_exec.c
parent6a8cbc1cb189fdc633d51faa23b4efe1db976384 (diff)
downloadFreeBSD-src-8172475ce1cd34373d669db96d930165b111c443.zip
FreeBSD-src-8172475ce1cd34373d669db96d930165b111c443.tar.gz
Drop the proc lock while calling fdcheckstd() which may block to allocate
memory. Reviewed by: jhb
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 8423f62..2ac4486 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -437,8 +437,15 @@ interpret:
#endif
/* Close any file descriptors 0..2 that reference procfs */
setugidsafety(td);
- /* Make sure file descriptors 0..2 are in use. */
+ /*
+ * Make sure file descriptors 0..2 are in use.
+ *
+ * fdcheckstd() may call falloc() which may block to
+ * allocate memory, so temporarily drop the process lock.
+ */
+ PROC_UNLOCK(p);
error = fdcheckstd(td);
+ PROC_LOCK(p);
if (error != 0)
goto done1;
/*
OpenPOWER on IntegriCloud