summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_jail.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-09-15 13:01:47 +0000
committertrasz <trasz@FreeBSD.org>2014-09-15 13:01:47 +0000
commit333bfc8652da274d14fe2f1b612d1830dfbb26fa (patch)
treebeec75ff58f0f24cb37ed1dece6ce283d64ad535 /sys/kern/kern_jail.c
parent8f5f705c7e3eff6c2b776113587643af03eae24e (diff)
downloadFreeBSD-src-333bfc8652da274d14fe2f1b612d1830dfbb26fa.zip
FreeBSD-src-333bfc8652da274d14fe2f1b612d1830dfbb26fa.tar.gz
MFC r271317:
Avoid unlocking unlocked mutex in RCTL jail code. Specific test case is attached to PR. PR: 193457 Approved by: re (kib) Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern/kern_jail.c')
-rw-r--r--sys/kern/kern_jail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c
index 2846eca..2d35a1a 100644
--- a/sys/kern/kern_jail.c
+++ b/sys/kern/kern_jail.c
@@ -1811,9 +1811,11 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags)
#ifdef RACCT
if (!created) {
- sx_sunlock(&allprison_lock);
+ if (!(flags & JAIL_ATTACH))
+ sx_sunlock(&allprison_lock);
prison_racct_modify(pr);
- sx_slock(&allprison_lock);
+ if (!(flags & JAIL_ATTACH))
+ sx_slock(&allprison_lock);
}
#endif
OpenPOWER on IntegriCloud