Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2009 19:41:12 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193393 - head/sys/security/mac
Message-ID:  <200906031941.n53JfDS1064282@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



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