From 28b325aa608a79a5f5de84ca37d9695d5ddd4ee2 Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Fri, 13 Sep 2002 09:31:56 +0000 Subject: [PATCH] Drop the proc lock while calling fdcheckstd() which may block to allocate memory. Reviewed by: jhb --- sys/kern/kern_exec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 8423f626a303..2ac44868a6b6 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; /*