Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Sep 2014 16:05:33 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271317 - head/sys/kern
Message-ID:  <201409091605.s89G5XWf044516@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Sep  9 16:05:33 2014
New Revision: 271317
URL: http://svnweb.freebsd.org/changeset/base/271317

Log:
  Avoid unlocking unlocked mutex in RCTL jail code.  Specific test case
  is attached to PR.
  
  PR:		193457
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_jail.c

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Tue Sep  9 15:19:38 2014	(r271316)
+++ head/sys/kern/kern_jail.c	Tue Sep  9 16:05:33 2014	(r271317)
@@ -1812,9 +1812,11 @@ kern_jail_set(struct thread *td, struct 
 
 #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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409091605.s89G5XWf044516>