From c4884ffa6faf71057c81ac78a42037d4e192415e Mon Sep 17 00:00:00 2001 From: Jamie Gritton Date: Thu, 27 Aug 2009 16:15:51 +0000 Subject: [PATCH] Fix a LOR between allprison_lock and vnode locks by releasing allprison_lock before releasing a prison's root vnode. PR: kern/138004 Reviewed by: kib Approved by: bz (mentor) MFC after: 3 days --- sys/kern/kern_jail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 892d2111bed8..47201d2b8df6 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2453,7 +2453,7 @@ prison_deref(struct prison *pr, int flags) ppr = pr->pr_parent; for (tpr = ppr; tpr != NULL; tpr = tpr->pr_parent) tpr->pr_childcount--; - sx_downgrade(&allprison_lock); + sx_xunlock(&allprison_lock); #ifdef VIMAGE if (pr->pr_vnet != ppr->pr_vnet) @@ -2479,7 +2479,7 @@ prison_deref(struct prison *pr, int flags) /* Removing a prison frees a reference on its parent. */ pr = ppr; mtx_lock(&pr->pr_mtx); - flags = PD_DEREF | PD_LIST_SLOCKED; + flags = PD_DEREF; } }