From 8172475ce1cd34373d669db96d930165b111c443 Mon Sep 17 00:00:00 2001 From: truckman Date: Fri, 13 Sep 2002 09:31:56 +0000 Subject: 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(-) (limited to 'sys/kern/kern_exec.c') 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; /* -- cgit v1.1