diff options
author | trasz <trasz@FreeBSD.org> | 2014-09-15 13:01:47 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-09-15 13:01:47 +0000 |
commit | 333bfc8652da274d14fe2f1b612d1830dfbb26fa (patch) | |
tree | beec75ff58f0f24cb37ed1dece6ce283d64ad535 /sys/kern/kern_jail.c | |
parent | 8f5f705c7e3eff6c2b776113587643af03eae24e (diff) | |
download | FreeBSD-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.c | 6 |
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 |