From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 11 18:00:17 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 751B81065672 for ; Tue, 11 Aug 2009 18:00:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4D96A8FC3E for ; Tue, 11 Aug 2009 18:00:17 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7BI0GKR007178 for ; Tue, 11 Aug 2009 18:00:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7BI0GCw007177; Tue, 11 Aug 2009 18:00:16 GMT (envelope-from gnats) Resent-Date: Tue, 11 Aug 2009 18:00:16 GMT Resent-Message-Id: <200908111800.n7BI0GCw007177@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steve Polyack Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 917A2106566B for ; Tue, 11 Aug 2009 17:51:50 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 8043A8FC58 for ; Tue, 11 Aug 2009 17:51:50 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7BHpoJa082936 for ; Tue, 11 Aug 2009 17:51:50 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7BHpoHI082935; Tue, 11 Aug 2009 17:51:50 GMT (envelope-from nobody) Message-Id: <200908111751.n7BHpoHI082935@www.freebsd.org> Date: Tue, 11 Aug 2009 17:51:50 GMT From: Steve Polyack To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/137677: security.mac.bsdextended.firstmatch_enabled default is incorrect X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 18:00:17 -0000 >Number: 137677 >Category: misc >Synopsis: security.mac.bsdextended.firstmatch_enabled default is incorrect >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 11 18:00:16 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Steve Polyack >Release: 7.2-RELEASE >Organization: Collaborative Fusion, Inc. >Environment: FreeBSD xxxxx 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #0: Tue Aug 11 10:34:08 EDT 2009 root@xxxxx:/usr/obj/usr/src/sys/GENERIC-MAC amd64 >Description: The manpage for the mac_bsdextended kernel module states that the default for the security.mac.bsdextended.firstmatch_enabled is 1. This does not appear to be true, as a recently rebuilt 6.3 machine as well as a fresh 7.2-RELEASE install both have the sysctl set to 0 upon loading the module: $ sysctl security.mac.bsdextended.firstmatch_enabled security.mac.bsdextended.firstmatch_enabled: 0 The source code for the module appears to initialize the sysctl with the (correct) value of 1, so I'm unsure as to where the problem actually is: /* * This tunable is here for compatibility. It will allow the user to switch * between the new mode (first rule matches) and the old functionality (all * rules match). */ static int ugidfw_firstmatch_enabled; SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, firstmatch_enabled, CTLFLAG_RW, &ugidfw_firstmatch_enabled, 1, "Disable/enable match first rule functionality"); >How-To-Repeat: - Build and install a kernel with 'options MAC'. - Reboot and kldload mac_bsdextended. - Observe that the sysctl security.mac.bsdextended.firstmatch_enabled is set to 0 after spending a good amount of time wondering why your ugidfw rules aren't working as expected. >Fix: >Release-Note: >Audit-Trail: >Unformatted: