From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:41:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8DC1065672; Wed, 3 Jun 2009 19:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0718FC2C; Wed, 3 Jun 2009 19:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n53JfDNt064283; Wed, 3 Jun 2009 19:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n53JfDS1064282; Wed, 3 Jun 2009 19:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906031941.n53JfDS1064282@svn.freebsd.org> From: Robert Watson Date: Wed, 3 Jun 2009 19:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193393 - head/sys/security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 03 Jun 2009 19:41:13 -0000 Author: rwatson Date: Wed Jun 3 19:41:12 2009 New Revision: 193393 URL: http://svn.freebsd.org/changeset/base/193393 Log: Add one further check with mac_policy_count to an mbuf copying case (limited to netatalk) to avoid MAC label lookup on both mbufs if no policies are registered. Obtained from: TrustedBSD Project Modified: head/sys/security/mac/mac_net.c Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Wed Jun 3 19:31:26 2009 (r193392) +++ head/sys/security/mac/mac_net.c Wed Jun 3 19:41:12 2009 (r193393) @@ -258,6 +258,9 @@ mac_mbuf_copy(struct mbuf *m_from, struc { struct label *src_label, *dest_label; + if (mac_policy_count == 0) + return; + src_label = mac_mbuf_to_label(m_from); dest_label = mac_mbuf_to_label(m_to);