PERFORCE change 15239 for review

Robert Watson rwatson at freebsd.org
Tue Jul 30 22:53:54 GMT 2002


http://people.freebsd.org/~peter/p4db/chv.cgi?CH=15239

Change 15239 by rwatson at rwatson_tislabs on 2002/07/30 15:53:52

	Integ MAC changes trickling back from the main FreeBSD tree.

Affected files ...

.. //depot/projects/trustedbsd/mac/sbin/fsck_ffs/Makefile#3 integrate
.. //depot/projects/trustedbsd/mac/sbin/fsck_ffs/pass5.c#8 integrate
.. //depot/projects/trustedbsd/mac/share/examples/isdn/FAQ#3 integrate
.. //depot/projects/trustedbsd/mac/share/man/man7/ports.7#4 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/files#40 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/hme/if_hme.c#6 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#223 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/kern_sig.c#16 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#16 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/syscalls.master#20 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/vnode_if.src#11 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/mac.h#139 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#103 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/mbuf.h#13 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/mount.h#16 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/pipe.h#4 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/socketvar.h#19 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/ucred.h#14 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/vnode.h#36 integrate
.. //depot/projects/trustedbsd/mac/usr.sbin/mergemaster/mergemaster.8#6 integrate
.. //depot/projects/trustedbsd/mac/usr.sbin/ppp/ppp.8.m4#9 integrate

Differences ...

==== //depot/projects/trustedbsd/mac/sbin/fsck_ffs/Makefile#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sbin/fsck_ffs/Makefile,v 1.10 2001/12/04 02:19:46 obrien Exp $
+# $FreeBSD: src/sbin/fsck_ffs/Makefile,v 1.11 2002/07/30 20:49:29 phk Exp $
 #	@(#)Makefile	8.2 (Berkeley) 4/27/95
 
 PROG=	fsck_ffs
@@ -7,7 +7,8 @@
 MAN=	fsck_ffs.8
 SRCS=	dir.c fsutil.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
 	pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c
-WARNS=	0
+WARNS=	2
+CFLAGS+= -I${.CURDIR}
 
 .PATH:	${.CURDIR}/../../sys/ufs/ffs
 

==== //depot/projects/trustedbsd/mac/sbin/fsck_ffs/pass5.c#8 (text+ko) ====

@@ -36,7 +36,7 @@
 static const char sccsid[] = "@(#)pass5.c	8.9 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/fsck_ffs/pass5.c,v 1.29 2002/07/30 13:01:21 phk Exp $";
+  "$FreeBSD: src/sbin/fsck_ffs/pass5.c,v 1.30 2002/07/30 20:49:29 phk Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -382,7 +382,6 @@
 					aend = n;
 					continue;
 				}
-				returntosingle = 1;
 				if (astart == aend)
 					(*msg)("ALLOCATED %s %d MARKED FREE\n",
 					    name, astart);
@@ -419,7 +418,6 @@
 					pwarn("%s %sS %d-%ld MARKED USED\n",
 					    "UNALLOCATED", name, ustart,
 					    ustart + size - 1);
-				returntosingle = 1;
 				if (bkgrdflag != 0) {
 					cmd.value = ustart;
 					cmd.size = size;
@@ -462,7 +460,6 @@
 				pwarn("UNALLOCATED %sS %d-%ld MARKED USED\n",
 				    name, ustart, ustart + size - 1);
 		}
-		returntosingle = 1;
 		if (bkgrdflag != 0) {
 			cmd.value = ustart;
 			cmd.size = size;

==== //depot/projects/trustedbsd/mac/share/examples/isdn/FAQ#3 (text+ko) ====

@@ -5,7 +5,7 @@
 
                 last edit-date: [Wed Nov  1 15:08:03 2000]
 
- $FreeBSD: src/share/examples/isdn/FAQ,v 1.11 2002/05/11 06:06:11 dd Exp $
+ $FreeBSD: src/share/examples/isdn/FAQ,v 1.12 2002/07/30 21:14:15 blackend Exp $
 
 --------------------------------------------------------------------------------
 
@@ -910,8 +910,8 @@
 More information to ppp setup can be found at
 
 	http://www.Awfulhak.org/ppp.html
-	http://www.freebsd.org/handbook/ppp-and-slip.html
-	http://www.freebsd.org/FAQ/userppp.html
+	http://www.freebsd.org/doc/handbook/ppp-and-slip.html
+	http://www.freebsd.org/doc/faq/ppp.html
 
 and in the directory "user-ppp" of the isdn4bsd distribution.
 

==== //depot/projects/trustedbsd/mac/share/man/man7/ports.7#4 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man7/ports.7,v 1.31 2002/03/18 10:07:22 ru Exp $
+.\" $FreeBSD: src/share/man/man7/ports.7,v 1.32 2002/07/30 21:04:26 blackend Exp $
 .\"
 .Dd January 25, 1998
 .Dt PORTS 7
@@ -75,12 +75,12 @@
 .%B "The FreeBSD Handbook" ,
 .Pa ( file:/usr/share/doc/handbook/ports.html
 or
-.Pa http://www.FreeBSD.org/handbook/ports.html ) .
+.Pa http://www.FreeBSD.org/doc/handbook/ports.html ) .
 For information about creating new ports, see
 .%B "The Porter's Handbook"
 .Pa ( file:/usr/share/doc/porters-handbook/index.html
 or
-.Pa http://www.FreeBSD.org/porters-handbook/index.html ) .
+.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ ) .
 .Sh TARGETS
 Some of the targets work recursively through subdirectories.
 This lets you, for example, install all of the

==== //depot/projects/trustedbsd/mac/sys/conf/files#40 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.677 2002/07/30 19:35:20 iwasaki Exp $
+# $FreeBSD: src/sys/conf/files,v 1.678 2002/07/30 22:28:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -985,11 +985,12 @@
 # of the files in libkern/ are only needed on some architectures, e.g.,
 # libkern/divdi3.c is needed by i386 but not alpha.  Also, some of these
 # routines may be optimized for a particular platform.  In either case,
-# the file should be moved to <arch>/conf/files.<arch> from here.
+# the file should be moved to conf/files.<arch> from here.
 #
 libkern/arc4random.c	standard
 libkern/bcd.c		standard
 libkern/bsearch.c	standard
+libkern/crc32.c		standard
 libkern/iconv.c		optional libiconv
 libkern/iconv_converter_if.m	optional libiconv
 libkern/iconv_xlat.c	optional libiconv
@@ -1012,7 +1013,6 @@
 libkern/strtoul.c	standard
 libkern/strtouq.c	standard
 libkern/strvalid.c	standard
-libkern/crc32.c		standard
 net/bpf.c		standard
 net/bpf_filter.c	optional bpf
 bpf.h			standard			\

==== //depot/projects/trustedbsd/mac/sys/dev/hme/if_hme.c#6 (text+ko) ====

@@ -36,7 +36,7 @@
  *
  *	from: NetBSD: hme.c,v 1.20 2000/12/14 06:27:25 thorpej Exp
  *
- * $FreeBSD: src/sys/dev/hme/if_hme.c,v 1.5 2002/07/14 12:09:48 tmm Exp $
+ * $FreeBSD: src/sys/dev/hme/if_hme.c,v 1.6 2002/07/30 21:47:14 fenner Exp $
  */
 
 /*
@@ -70,6 +70,7 @@
 #include <sys/socket.h>
 #include <sys/sockio.h>
 
+#include <net/bpf.h>
 #include <net/ethernet.h>
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -1052,8 +1053,11 @@
 			ifp->if_flags |= IFF_OACTIVE;
 			IF_PREPEND(&ifp->if_snd, m);
 			break;
-		} else
+		} else {
 			enq = 1;
+			if (ifp->if_bpf)
+				bpf_mtap(ifp, m);
+		}
 	}
 
 	if (sc->sc_rb.rb_td_nbusy == HME_NTXDESC || error == -1)

==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#223 (text+ko) ====

@@ -36,7 +36,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: $
+ * $FreeBSD: src/sys/kern/kern_mac.c,v 1.2 2002/07/30 21:36:05 rwatson Exp $
  */
 /*
  * Developed by the TrustedBSD Project.

==== //depot/projects/trustedbsd/mac/sys/kern/kern_sig.c#16 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_sig.c	8.7 (Berkeley) 4/18/94
- * $FreeBSD: src/sys/kern/kern_sig.c,v 1.176 2002/07/24 07:23:41 julian Exp $
+ * $FreeBSD: src/sys/kern/kern_sig.c,v 1.177 2002/07/30 21:13:48 julian Exp $
  */
 
 #include "opt_compat.h"
@@ -1434,9 +1434,7 @@
 			if (!(p->p_pptr->p_procsig->ps_flag & PS_NOCLDSTOP))
 				psignal(p->p_pptr, SIGCHLD);
 			PROC_UNLOCK(p->p_pptr);
-			mtx_lock_spin(&sched_lock);
 			stop(p);
-			mtx_unlock_spin(&sched_lock);
 			goto out;
 		} else
 			goto runfast;
@@ -1598,7 +1596,7 @@
 			psignal(p->p_pptr, SIGCHLD);
 			PROC_UNLOCK(p->p_pptr);
 			mtx_lock_spin(&sched_lock);
-			stop(p);
+			stop(p);	/* uses schedlock too eventually */
 			td->td_state = TDS_UNQUEUED;
 			PROC_UNLOCK(p);
 			DROP_GIANT();
@@ -1676,9 +1674,7 @@
 					psignal(p->p_pptr, SIGCHLD);
 				}
 				PROC_UNLOCK(p->p_pptr);
-				mtx_lock_spin(&sched_lock);
 				stop(p);
-				mtx_unlock_spin(&sched_lock);
 				break;
 			} else
 			     if (prop & SA_IGNORE) {
@@ -1726,7 +1722,6 @@
 {
 
 	PROC_LOCK_ASSERT(p, MA_OWNED);
-	mtx_assert(&sched_lock, MA_OWNED);
 	p->p_flag |= P_STOPPED_SGNL;
 	p->p_flag &= ~P_WAITED;
 	wakeup(p->p_pptr);

==== //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#16 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/kern/subr_mbuf.c,v 1.23 2002/07/24 15:11:23 bmilekic Exp $
+ * $FreeBSD: src/sys/kern/subr_mbuf.c,v 1.24 2002/07/30 21:06:27 bmilekic Exp $
  */
 
 #include "opt_param.h"
@@ -202,6 +202,7 @@
 };
 static struct mb_lstmngr mb_list_mbuf, mb_list_clust;
 static struct mtx mbuf_gen, mbuf_pcpu[NCPU];
+u_int *cl_refcntmap;
 
 /*
  * Local macros for internal allocator structure manipulations.
@@ -341,9 +342,11 @@
 
 	/*
 	 * Set up all the submaps, for each type of object that we deal
-	 * with in this allocator.
+	 * with in this allocator.  We also allocate space for the cluster
+	 * ref. counts in the mbuf map (and not the cluster map) in order to
+	 * give clusters a nice contiguous address space without any holes.
 	 */
-	mb_map_size = (vm_size_t)(nmbufs * MSIZE);
+	mb_map_size = (vm_size_t)(nmbufs * MSIZE + nmbclusters * sizeof(u_int));
 	mb_map_size = rounddown(mb_map_size, PAGE_SIZE);
 	mb_list_mbuf.ml_btable = malloc((unsigned long)mb_map_size / PAGE_SIZE *
 	    sizeof(struct mb_bucket *), M_MBUF, M_NOWAIT);
@@ -413,6 +416,15 @@
 	SLIST_INIT(&(mb_list_clust.ml_genlist->mb_cont.mc_bhead));
 
 	/*
+	 * Allocate all the required counters for clusters.  This makes
+	 * cluster allocations/deallocations much faster.
+	 */
+	cl_refcntmap = (u_int *)kmem_malloc(mb_list_clust.ml_map,
+	    roundup(nmbclusters * sizeof(u_int), MSIZE), M_NOWAIT);
+	if (cl_refcntmap == NULL)
+		goto bad;
+
+	/*
 	 * Initialize general mbuf statistics.
 	 */
 	mbstat.m_msize = MSIZE;
@@ -1043,14 +1055,20 @@
 	(m)->m_ext.ext_type = EXT_CLUSTER;				\
 } while (0)
 
-#define	_mext_init_ref(m) do {						\
-	(m)->m_ext.ref_cnt = malloc(sizeof(u_int), M_MBUF, M_NOWAIT);	\
+#define	_mext_init_ref(m, ref) do {					\
+	if ((ref) == NULL)						\
+		malloc(sizeof(u_int), M_MBUF, M_NOWAIT);		\
+	else								\
+		(m)->m_ext.ref_cnt = (u_int *)(ref);			\
 	if ((m)->m_ext.ref_cnt != NULL) {				\
 		*((m)->m_ext.ref_cnt) = 0;				\
 		MEXT_ADD_REF((m));					\
 	}								\
 } while (0)
 
+#define	cl2ref(cl)							\
+    (((uintptr_t)(cl) - (uintptr_t)cl_refcntmap) >> MCLSHIFT)
+
 #define	_mext_dealloc_ref(m)						\
 	free((m)->m_ext.ref_cnt, M_MBUF)
 
@@ -1065,36 +1083,25 @@
  * - _mext_free(): frees associated storage when the ref. count is
  *   exactly one and we're freeing.
  *
- * - _mclfree(): wraps an mb_free() of a cluster to avoid inlining the
- *   mb_free() in some exported routines.
- *
  * - _mgetm_internal(): common "persistent-lock" routine that allocates
  *   an mbuf and a cluster in one shot, but where the lock is already
  *   held coming in (which is what makes it different from the exported
  *   m_getcl()).  The lock is dropped when done.  This is used by m_getm()
  *   and, therefore, is very m_getm()-specific.
  */
-static void _mclfree(struct mbuf *);
 static struct mbuf *_mgetm_internal(int, short, short, int);
 
 void
 _mext_free(struct mbuf *mb)
 {
 
-	if (mb->m_ext.ext_type == EXT_CLUSTER)
+	if (mb->m_ext.ext_type == EXT_CLUSTER) {
 		mb_free(&mb_list_clust, (caddr_t)mb->m_ext.ext_buf, MT_NOTMBUF,
 		    0, NULL);
-	else
+	} else {
 		(*(mb->m_ext.ext_free))(mb->m_ext.ext_buf, mb->m_ext.ext_args);
-	_mext_dealloc_ref(mb);
-}
-
-static void
-_mclfree(struct mbuf *mb)
-{
-
-	mb_free(&mb_list_clust, (caddr_t)mb->m_ext.ext_buf, MT_NOTMBUF, 0,NULL);
-	mb->m_ext.ext_buf = NULL;
+		_mext_dealloc_ref(mb);
+	}
 }
 
 static struct mbuf *
@@ -1114,13 +1121,8 @@
 			(void)m_free(mb);
 			mb = NULL;
 		}
-		_mext_init_ref(mb);
-		if (mb->m_ext.ref_cnt == NULL) {
-			_mclfree(mb);
-			(void)m_free(mb);
-			return NULL;
-		} else
-			_mcl_setup(mb);
+		_mcl_setup(mb);
+		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 	}
 	return (mb);
 }
@@ -1206,15 +1208,8 @@
 			(void)m_free(mb);
 			goto failed;
 		}
-		_mext_init_ref(mb);
-		if (mb->m_ext.ref_cnt == NULL) {
-			/* XXX: PROBLEM! lock may be held here! */
-			panic("m_getm(): FATAL ERROR! Sorry!");
-			_mclfree(mb);
-			(void)m_free(mb);
-			goto failed;
-		}
 		_mcl_setup(mb);
+		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 		persist = MBP_PERSISTENT;
 
 		if (cur == NULL)
@@ -1356,7 +1351,6 @@
 	if ((mb->m_flags & M_EXT) != 0) {
 		MEXT_REM_REF(mb);
 		if (atomic_cmpset_int(mb->m_ext.ref_cnt, 0, 1)) {
-			_mext_dealloc_ref(mb);
 			if (mb->m_ext.ext_type == EXT_CLUSTER) {
 				mb_free(&mb_list_clust,
 				    (caddr_t)mb->m_ext.ext_buf, MT_NOTMBUF,
@@ -1365,6 +1359,7 @@
 			} else {
 				(*(mb->m_ext.ext_free))(mb->m_ext.ext_buf,
 				    mb->m_ext.ext_args);
+				_mext_dealloc_ref(mb);
 				persist = 0;
 			}
 		}
@@ -1404,7 +1399,6 @@
 		if ((m->m_flags & M_EXT) != 0) {
 			MEXT_REM_REF(m);
 			if (atomic_cmpset_int(m->m_ext.ref_cnt, 0, 1)) {
-				_mext_dealloc_ref(m);
 				if (m->m_ext.ext_type == EXT_CLUSTER) {
 					mb_free(&mb_list_clust,
 					    (caddr_t)m->m_ext.ext_buf,
@@ -1413,6 +1407,7 @@
 				} else {
 					(*(m->m_ext.ext_free))(m->m_ext.ext_buf,
 					    m->m_ext.ext_args);
+					_mext_dealloc_ref(m);
 					persist = 0;
 				}
 			}
@@ -1461,13 +1456,8 @@
 		(void)m_free(mb);
 		mb = NULL;
 	} else {
-		_mext_init_ref(mb);
-		if (mb->m_ext.ref_cnt == NULL) {
-			_mclfree(mb);
-			(void)m_free(mb);
-			mb = NULL;
-		} else
-			_mcl_setup(mb);
+		_mcl_setup(mb);
+		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 	}
 	return (mb);
 }
@@ -1490,11 +1480,8 @@
 	mb->m_ext.ext_buf= (caddr_t)mb_alloc(&mb_list_clust,how,MT_NOTMBUF,
 	    0, NULL);
 	if (mb->m_ext.ext_buf != NULL) {
-		_mext_init_ref(mb);
-		if (mb->m_ext.ref_cnt == NULL)
-			_mclfree(mb);
-		else
-			_mcl_setup(mb);
+		_mcl_setup(mb);
+		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 	}
 }
 
@@ -1520,7 +1507,8 @@
     void (*freef)(void *, void *), void *args, short flags, int type)
 {
 
-	_mext_init_ref(mb);
+	_mext_init_ref(mb, ((type != EXT_CLUSTER) ?
+	    NULL : &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]));
 	if (mb->m_ext.ref_cnt != NULL) {
 		mb->m_flags |= (M_EXT | flags);
 		mb->m_ext.ext_buf = buf;

==== //depot/projects/trustedbsd/mac/sys/kern/syscalls.master#20 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/kern/syscalls.master,v 1.118 2002/07/30 16:50:25 rwatson Exp $
+ $FreeBSD: src/sys/kern/syscalls.master,v 1.119 2002/07/30 22:43:20 rwatson Exp $
 ;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
 ;
 ; System call name/number master file.
@@ -556,9 +556,11 @@
 384	MSTD	BSD	{ int __mac_get_proc(struct mac *mac_p); }
 385	MSTD	BSD	{ int __mac_set_proc(struct mac *mac_p); }
 386	MSTD	BSD	{ int __mac_get_fd(int fd, struct mac *mac_p); }
-387	MSTD	BSD	{ int __mac_get_file(const char *path_p, struct mac *mac_p); }
+387	MSTD	BSD	{ int __mac_get_file(const char *path_p, \
+			    struct mac *mac_p); }
 388	MSTD	BSD	{ int __mac_set_fd(int fd, struct mac *mac_p); }
-389	MSTD	BSD	{ int __mac_set_file(const char *path_p, struct mac *mac_p); }
+389	MSTD	BSD	{ int __mac_set_file(const char *path_p, \
+			    struct mac *mac_p); }
 390	STD	BSD	{ int kenv(int what, const char *name, char *value, \
 			    int len); }
 391	STD	BSD	{ int lchflags(const char *path, int flags); }

==== //depot/projects/trustedbsd/mac/sys/kern/vnode_if.src#11 (text+ko) ====

@@ -31,7 +31,7 @@
 # SUCH DAMAGE.
 #
 #	@(#)vnode_if.src	8.12 (Berkeley) 5/14/95
-# $FreeBSD: src/sys/kern/vnode_if.src,v 1.53 2002/07/30 08:50:52 jeff Exp $
+# $FreeBSD: src/sys/kern/vnode_if.src,v 1.54 2002/07/30 22:15:09 rwatson Exp $
 #
 
 #

==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#139 (text+ko) ====


==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#103 (text+ko) ====


==== //depot/projects/trustedbsd/mac/sys/sys/mbuf.h#13 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)mbuf.h	8.5 (Berkeley) 2/19/95
- * $FreeBSD: src/sys/sys/mbuf.h,v 1.97 2002/07/30 18:28:58 rwatson Exp $
+ * $FreeBSD: src/sys/sys/mbuf.h,v 1.98 2002/07/30 22:03:57 rwatson Exp $
  */
 
 #ifndef _SYS_MBUF_H_
@@ -40,6 +40,12 @@
 #include <sys/mac.h>
 
 /*
+ * XXXMAC: Possibly this recursive include is a bad idea, but a lot
+ * of code exists that assumes it is sufficient to include just mbuf.h
+ */
+#include <sys/mac.h>
+
+/*
  * Mbufs are of a single size, MSIZE (machine/param.h), which
  * includes overhead.  An mbuf may add a single "mbuf cluster" of size
  * MCLBYTES (also in machine/param.h), which has no additional overhead
@@ -87,7 +93,7 @@
 	int	csum_flags;		/* flags regarding checksum */
 	int	csum_data;		/* data field used by csum routines */
 	struct	mbuf *aux;		/* extra data buffer; ipsec/others */
-	struct	label label;		/* label of data in packet */
+	struct	label label;		/* MAC label of data in packet */
 };
 
 /*

==== //depot/projects/trustedbsd/mac/sys/sys/mount.h#16 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)mount.h	8.21 (Berkeley) 5/20/95
- * $FreeBSD: src/sys/sys/mount.h,v 1.132 2002/07/09 22:50:29 mux Exp $
+ * $FreeBSD: src/sys/sys/mount.h,v 1.133 2002/07/30 22:22:35 rwatson Exp $
  */
 
 #ifndef _SYS_MOUNT_H_
@@ -152,6 +152,8 @@
 	time_t		mnt_time;		/* last time written*/
 	u_int		mnt_iosize_max;		/* max IO request size */
 	struct netexport *mnt_export;		/* export list */
+	struct label	mnt_mntlabel;		/* MAC label for the mount */
+	struct label	mnt_fslabel;		/* MAC label for the fs */
 };
 #endif /* _KERNEL */
 

==== //depot/projects/trustedbsd/mac/sys/sys/pipe.h#4 (text+ko) ====

@@ -18,7 +18,7 @@
  * 5. Modifications may be freely made to this file if the above conditions
  *    are met.
  *
- * $FreeBSD: src/sys/sys/pipe.h,v 1.18 2002/02/27 07:35:59 alfred Exp $
+ * $FreeBSD: src/sys/sys/pipe.h,v 1.19 2002/07/30 22:33:28 rwatson Exp $
  */
 
 #ifndef _SYS_PIPE_H_
@@ -28,6 +28,7 @@
 #include <sys/time.h>			/* for struct timespec */
 #include <sys/selinfo.h>		/* for struct selinfo */
 #include <vm/vm.h>			/* for vm_page_t */
+#include <sys/mac.h>			/* for struct label */
 #include <machine/param.h>		/* for PAGE_SIZE */
 #endif /* _KERNEL */
 #include <sys/mac.h>			/* for struct label */
@@ -107,7 +108,7 @@
 	struct	pipe *pipe_peer;	/* link with other direction */
 	u_int	pipe_state;		/* pipe status info */
 	int	pipe_busy;		/* busy flag, mostly to handle rundown sanely */
-	struct	label *pipe_label;	/* pipe MAC label */
+	struct	label *pipe_label;	/* pipe MAC label - shared */
 	struct	mtx *pipe_mtxp;		/* shared mutex between both pipes */
 };
 

==== //depot/projects/trustedbsd/mac/sys/sys/socketvar.h#19 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)socketvar.h	8.3 (Berkeley) 2/19/95
- * $FreeBSD: src/sys/sys/socketvar.h,v 1.88 2002/07/27 19:54:15 rwatson Exp $
+ * $FreeBSD: src/sys/sys/socketvar.h,v 1.89 2002/07/30 22:39:28 rwatson Exp $
  */
 
 #ifndef _SYS_SOCKETVAR_H_
@@ -123,8 +123,8 @@
 	void	(*so_upcall)(struct socket *, void *, int);
 	void	*so_upcallarg;
 	struct	ucred *so_cred;		/* user credentials */
-	struct	label so_label;		/* socket MAC label */
-	struct	label so_peerlabel;	/* socket peer MAC label */
+	struct	label so_label;		/* MAC label for socket */
+	struct	label so_peerlabel;	/* cached MAC label for socket peer */
 	/* NB: generation count must not be first; easiest to make it last. */
 	so_gen_t so_gencnt;		/* generation count */
 	void	*so_emuldata;		/* private data for emulators */

==== //depot/projects/trustedbsd/mac/sys/sys/ucred.h#14 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)ucred.h	8.4 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/sys/ucred.h,v 1.41 2002/07/27 16:51:00 jhb Exp $
+ * $FreeBSD: src/sys/sys/ucred.h,v 1.42 2002/07/30 22:28:28 rwatson Exp $
  */
 
 #ifndef _SYS_UCRED_H_
@@ -40,6 +40,14 @@
 #include <sys/mac.h>
 
 /*
+ * XXXMAC: Recursively include mac.h due to an API assumption that it
+ * it is sufficient to include types.h and ucred.h to have a defined
+ * struct ucred.  This should be changed so that struct ucred is not
+ * exported to userland via _KERNEL.
+ */
+#include <sys/mac.h>
+
+/*
  * Credentials.
  *
  * Please do not inspect cr_uid directly to determine superuserness.
@@ -59,7 +67,7 @@
 	struct uidinfo	*cr_ruidinfo;	/* per ruid resource consumption */
 	struct prison	*cr_prison;	/* jail(4) */
 #define	cr_endcopy	cr_label
-	struct label	cr_label;	/* mandatory access control */
+	struct label	cr_label;	/* MAC label */
 	struct mtx	*cr_mtxp;      	/* protect refcount */
 };
 #define	NOCRED	((struct ucred *)0)	/* no credential available */

==== //depot/projects/trustedbsd/mac/sys/sys/vnode.h#36 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)vnode.h	8.7 (Berkeley) 2/4/94
- * $FreeBSD: src/sys/sys/vnode.h,v 1.195 2002/07/30 09:57:37 jeff Exp $
+ * $FreeBSD: src/sys/sys/vnode.h,v 1.196 2002/07/30 22:08:12 rwatson Exp $
  */
 
 #ifndef _SYS_VNODE_H_

==== //depot/projects/trustedbsd/mac/usr.sbin/mergemaster/mergemaster.8#6 (text+ko) ====

@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/usr.sbin/mergemaster/mergemaster.8,v 1.23 2002/07/14 14:44:15 charnier Exp $
+.\" $FreeBSD: src/usr.sbin/mergemaster/mergemaster.8,v 1.24 2002/07/30 21:04:09 blackend Exp $
 .\"
 .Dd February 5, 2001
 .Dt MERGEMASTER 8
@@ -347,7 +347,7 @@
 .Pp
 .Pa /usr/src/etc/Makefile
 .Rs
-.%O http://www.FreeBSD.org/handbook/makeworld.html
+.%O http://www.FreeBSD.org/doc/handbook/makeworld.html
 .%T The Cutting Edge (using make world)
 .%A Nik Clayton
 .Re

==== //depot/projects/trustedbsd/mac/usr.sbin/ppp/ppp.8.m4#9 (text+ko) ====

@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/usr.sbin/ppp/ppp.8.m4,v 1.297 2002/06/12 23:45:15 brian Exp $
+.\" $FreeBSD: src/usr.sbin/ppp/ppp.8.m4,v 1.298 2002/07/30 21:04:21 blackend Exp $
 .\"
 .Dd September 20, 1995
 .Dt PPP 8
@@ -5774,9 +5774,9 @@
 The following URLs contain useful information:
 .Bl -bullet -compact
 .It
-http://www.FreeBSD.org/FAQ/userppp.html
+http://www.FreeBSD.org/doc/faq/ppp.html
 .It
-http://www.FreeBSD.org/handbook/userppp.html
+http://www.FreeBSD.org/doc/handbook/userppp.html
 .El
 .Pp
 .El
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list