svn commit: r193393 - head/sys/security/mac

Robert Watson rwatson at FreeBSD.org
Wed Jun 3 19:41:13 UTC 2009


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);
 


More information about the svn-src-all mailing list