From owner-svn-src-head@FreeBSD.ORG Tue Sep 9 16:05:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5DB1CBE; Tue, 9 Sep 2014 16:05:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0A3AFFC; Tue, 9 Sep 2014 16:05:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s89G5Xi1044517; Tue, 9 Sep 2014 16:05:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s89G5XWf044516; Tue, 9 Sep 2014 16:05:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409091605.s89G5XWf044516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Sep 2014 16:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271317 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 16:05:33 -0000 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