From 2b39743941004635e56bb11606fe8cdeec70afce Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Fri, 1 Feb 2002 19:19:54 +0000 Subject: [PATCH] Avoid lock order reversal filedesc/Giant when calling FREE() in fdalloc by unlocking the filedesc before calling FREE(). Submitted by: bde --- sys/kern/kern_descrip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 531b67f5dad..7628d5aeef9 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -956,9 +956,11 @@ fdalloc(td, want, result) fdp->fd_nfiles = nfiles; fdexpand++; if (oldofile != NULL) { + FILEDESC_UNLOCK(fdp); mtx_lock(&Giant); FREE(oldofile, M_FILEDESC); mtx_unlock(&Giant); + FILEDESC_LOCK(fdp); } } return (0);