From owner-svn-src-head@freebsd.org Sat Apr 4 04:03:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D256027D873; Sat, 4 Apr 2020 04:03:22 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48vNSm0XJ0z4Pt4; Sat, 4 Apr 2020 04:03:20 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A86719DD8; Sat, 4 Apr 2020 04:03:11 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03443B4f019169; Sat, 4 Apr 2020 04:03:11 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03443B91019168; Sat, 4 Apr 2020 04:03:11 GMT (envelope-from jah@FreeBSD.org) Message-Id: <202004040403.03443B91019168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 4 Apr 2020 04:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359628 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 359628 X-SVN-Commit-Repository: base 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.29 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: Sat, 04 Apr 2020 04:03:22 -0000 Author: jah Date: Sat Apr 4 04:03:10 2020 New Revision: 359628 URL: https://svnweb.freebsd.org/changeset/base/359628 Log: mac_policy: Remove mac_policy_sx This lock was made unnecessary by the addition of mac_policy_rms in r356120. Reviewed by: mjg, kib Differential Revision: https://reviews.freebsd.org/D24283 Modified: head/sys/security/mac/mac_framework.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Sat Apr 4 00:56:56 2020 (r359627) +++ head/sys/security/mac/mac_framework.c Sat Apr 4 04:03:10 2020 (r359628) @@ -184,7 +184,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab * The dynamic policy list is protected by two locks: modifying the list * requires both locks to be held exclusively. One of the locks, * mac_policy_rm, is acquired over policy entry points that will never sleep; - * the other, mac_policy_sx, is acquire over policy entry points that may + * the other, mac_policy_rms, is acquired over policy entry points that may * sleep. The former category will be used when kernel locks may be held * over calls to the MAC Framework, during network processing in ithreads, * etc. The latter will tend to involve potentially blocking memory @@ -192,8 +192,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab */ #ifndef MAC_STATIC static struct rmlock mac_policy_rm; /* Non-sleeping entry points. */ -static struct sx mac_policy_sx; /* Sleeping entry points. */ -static struct rmslock mac_policy_rms; +static struct rmslock mac_policy_rms; /* Sleeping entry points. */ #endif struct mac_policy_list_head mac_policy_list; @@ -266,7 +265,6 @@ mac_policy_xlock(void) if (!mac_late) return; - sx_xlock(&mac_policy_sx); rms_wlock(&mac_policy_rms); rm_wlock(&mac_policy_rm); #endif @@ -282,7 +280,6 @@ mac_policy_xunlock(void) rm_wunlock(&mac_policy_rm); rms_wunlock(&mac_policy_rms); - sx_xunlock(&mac_policy_sx); #endif } @@ -294,8 +291,7 @@ mac_policy_xlock_assert(void) if (!mac_late) return; - /* XXXRW: rm_assert(&mac_policy_rm, RA_WLOCKED); */ - sx_assert(&mac_policy_sx, SA_XLOCKED); + rm_assert(&mac_policy_rm, RA_WLOCKED); #endif } @@ -313,7 +309,6 @@ mac_init(void) #ifndef MAC_STATIC rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS | RM_RECURSE); - sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS); rms_init(&mac_policy_rms, "mac_policy_rms"); #endif }