PERFORCE change 19889 for review

Robert Watson rwatson at freebsd.org
Tue Oct 22 16:10:35 GMT 2002


http://perforce.freebsd.org/chv.cgi?CH=19889

Change 19889 by rwatson at rwatson_tislabs on 2002/10/22 09:10:25

	Further loopback of MAC stuff from the main FreeBSD tree:
	swapon checks, VM checks, userland library synchronization.

Affected files ...

.. //depot/projects/trustedbsd/base/etc/Makefile#22 integrate
.. //depot/projects/trustedbsd/base/etc/mac.conf#1 branch
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/Makefile.inc#6 integrate
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac.c#1 branch
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_free.c#2 delete
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_get.c#2 integrate
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_is_present_np.c#2 delete
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_set.c#2 integrate
.. //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_text.c#4 delete
.. //depot/projects/trustedbsd/base/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c#2 integrate
.. //depot/projects/trustedbsd/base/lib/libc/sparc64/sys/sigcode.S#2 integrate
.. //depot/projects/trustedbsd/base/lib/libdisk/create_chunk.c#9 integrate
.. //depot/projects/trustedbsd/base/lib/libdisk/disklabel.c#4 delete
.. //depot/projects/trustedbsd/base/lib/libdisk/libdisk.h#6 integrate
.. //depot/projects/trustedbsd/base/share/examples/etc/make.conf#16 integrate
.. //depot/projects/trustedbsd/base/share/man/man4/umass.4#2 integrate
.. //depot/projects/trustedbsd/base/share/man/man5/make.conf.5#13 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_mac.c#22 integrate
.. //depot/projects/trustedbsd/base/sys/pc98/i386/machdep.c#21 integrate
.. //depot/projects/trustedbsd/base/sys/pc98/pc98/clock.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/pc98/pc98/syscons_pc98.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/sys/mac.h#12 integrate
.. //depot/projects/trustedbsd/base/sys/sys/mac_policy.h#13 integrate
.. //depot/projects/trustedbsd/base/sys/vm/vm_mmap.c#11 integrate
.. //depot/projects/trustedbsd/base/sys/vm/vm_swap.c#10 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/jail/jail.8#8 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/mergemaster/mergemaster.sh#8 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/sysinstall/install.c#11 integrate

Differences ...

==== //depot/projects/trustedbsd/base/etc/Makefile#22 (text+ko) ====

@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
-# $FreeBSD: src/etc/Makefile,v 1.295 2002/10/20 11:18:55 markm Exp $
+# $FreeBSD: src/etc/Makefile,v 1.297 2002/10/22 15:01:50 phk Exp $
 
 .if !defined(NO_SENDMAIL)
 SUBDIR=	sendmail
@@ -10,7 +10,7 @@
 	dhclient.conf fbtab ftpusers gettytab group \
 	hosts hosts.allow hosts.equiv hosts.lpd \
 	inetd.conf login.access login.conf \
-	motd modems netconfig networks newsyslog.conf \
+	mac.conf motd modems netconfig networks newsyslog.conf \
 	phones printcap profile protocols \
 	rc rc.atm rc.devfs rc.diskless1 rc.diskless2 rc.firewall rc.firewall6 \
 	rc.network rc.network6 rc.pccard rc.sendmail rc.serial rc.shutdown \
@@ -95,10 +95,10 @@
 	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
 	    ${SSL} ${DESTDIR}/etc/ssl
 .endif
-.if !defined(NO_MAKEDEV_INSTALL)
+.if defined(MAKEDEV_INSTALL)
 	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
 	    MAKEDEV.local MAKEDEV ${DESTDIR}/dev
-.if !defined(NO_MAKEDEV_RUN)
+.if defined(MAKEDEV_RUN)
 	cd ${DESTDIR}/dev; sh MAKEDEV all
 .endif
 .endif

==== //depot/projects/trustedbsd/base/lib/libc/posix1e/Makefile.inc#6 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/libc/posix1e/Makefile.inc,v 1.10 2002/10/21 03:54:24 rwatson Exp $
+# $FreeBSD: src/lib/libc/posix1e/Makefile.inc,v 1.11 2002/10/22 14:36:11 rwatson Exp $
 
 MAINTAINER=	rwatson at FreeBSD.org
 
@@ -19,11 +19,9 @@
 	acl_to_text.c			\
 	acl_valid.c			\
 	extattr.c			\
-	mac_free.c			\
-	mac_is_present_np.c		\
+	mac.c				\
 	mac_get.c			\
-	mac_set.c			\
-	mac_text.c
+	mac_set.c
 
 .if ${LIB} == "c"
 

==== //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_get.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/posix1e/mac_get.c,v 1.1 2002/08/02 21:14:42 rwatson Exp $
+ * $FreeBSD: src/lib/libc/posix1e/mac_get.c,v 1.2 2002/10/22 14:36:11 rwatson Exp $
  */
 
 #include <sys/types.h>
@@ -37,65 +37,37 @@
 #include <errno.h>
 #include <stdlib.h>
 
-mac_t
-mac_get_file(const char *path_p)
+int
+mac_get_fd(int fd, struct mac *label)
 {
-	struct mac *label;
-	int error;
 
-	label = (mac_t) malloc(sizeof(*label));
-	if (label == NULL) {
-		errno = ENOMEM;
-		return (NULL);
-	}
+	return (__mac_get_fd(fd, label));
+}
 
-	error = __mac_get_file(path_p, label);
-	if (error) {
-		mac_free(label);
-		return (NULL);
-	}
+int
+mac_get_file(const char *path, struct mac *label)
+{
 
-	return (label);
+	return (__mac_get_file(path, label));
 }
 
-mac_t
-mac_get_fd(int fd)
+int
+mac_get_link(const char *path, struct mac *label)
 {
-	struct mac *label;
-	int error;
 
-	label = (mac_t) malloc(sizeof(*label));
-	if (label == NULL) {
-		errno = ENOMEM;
-		return (NULL);
-	}
+	return (__mac_get_link(path, label));
+}
 
-	error = __mac_get_fd(fd, label);
-	if (error) {
-		mac_free(label);
-		return (NULL);
-	}
+int
+mac_get_pid(pid_t pid, struct mac *label)
+{
 
-	return (label);
+	return (__mac_get_pid(pid, label));
 }
 
-mac_t
-mac_get_proc()
+int
+mac_get_proc(struct mac *label)
 {
-	struct mac *label;
-	int error;
 
-	label = (mac_t) malloc(sizeof(*label));
-	if (label == NULL) {
-		errno = ENOMEM;
-		return (NULL);
-	}
-
-	error = __mac_get_proc(label);
-	if (error) {
-		mac_free(label);
-		return (NULL);
-	}
-
-	return (label);
+	return (__mac_get_proc(label));
 }

==== //depot/projects/trustedbsd/base/lib/libc/posix1e/mac_set.c#2 (text+ko) ====

@@ -28,28 +28,35 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/posix1e/mac_set.c,v 1.1 2002/08/02 21:14:42 rwatson Exp $
+ * $FreeBSD: src/lib/libc/posix1e/mac_set.c,v 1.2 2002/10/22 14:36:11 rwatson Exp $
  */
 
 #include <sys/types.h>
 #include <sys/mac.h>
 
 int
-mac_set_file(const char *path_p, mac_t label)
+mac_set_fd(int fd, struct mac *label)
+{
+
+	return (__mac_set_fd(fd, label));
+}
+
+int
+mac_set_file(const char *path, struct mac *label)
 {
 
-	return (__mac_set_file(path_p, label));
+	return (__mac_set_file(path, label));
 }
 
 int
-mac_set_fd(int fd, mac_t label)
+mac_set_link(const char *path, struct mac *label)
 {
 
-	return (__mac_set_fd(fd, label));
+	return (__mac_set_link(path, label));
 }
 
 int
-mac_set_proc(mac_t label)
+mac_set_proc(struct mac *label)
 {
 
 	return (__mac_set_proc(label));

==== //depot/projects/trustedbsd/base/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c,v 1.1 2002/04/29 18:14:44 jake Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c,v 1.2 2002/10/22 15:15:39 jake Exp $");
 
 #include <sys/types.h>
 
@@ -34,9 +34,9 @@
 
 #include <stdlib.h>
 
-extern char __sigcode[];
+extern char __sigtramp[];
 
-static const struct sparc_sigtramp_install_args sia = { __sigcode, NULL };
+static const struct sparc_sigtramp_install_args sia = { __sigtramp, NULL };
 
 void
 __sparc_sigtramp_setup(void)

==== //depot/projects/trustedbsd/base/lib/libc/sparc64/sys/sigcode.S#2 (text+ko) ====

@@ -25,11 +25,11 @@
  */
 
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/sparc64/sys/sigcode.S,v 1.1 2002/04/29 18:14:44 jake Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/sparc64/sys/sigcode.S,v 1.2 2002/10/22 15:15:39 jake Exp $");
 
 #include "assym.s"
 
-ENTRY(__sigcode)
+ENTRY(__sigtramp)
 	call	%o4
 	 nop
 	call	sigreturn
@@ -37,4 +37,4 @@
 	call	exit
 	 mov	1, %o0
 	illtrap
-END(__sigcode)
+END(__sigtramp)

==== //depot/projects/trustedbsd/base/lib/libdisk/create_chunk.c#9 (text+ko) ====

@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libdisk/create_chunk.c,v 1.72 2002/10/22 10:51:58 phk Exp $");
+__FBSDID("$FreeBSD: src/lib/libdisk/create_chunk.c,v 1.73 2002/10/22 15:07:50 phk Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -233,20 +233,3 @@
 	/* barfout(1, "Serious internal trouble"); */
 	return 0;
 }
-
-int
-MakeDevChunk(const struct chunk *c1, const char *path)
-{
-
-	if (c1->next)
-		MakeDevChunk(c1->next, path);
-	if (c1->part)
-		MakeDevChunk(c1->part, path);
-	return 1;
-}
-
-int
-MakeDevDisk(struct disk *d, const char *path)
-{
-	return MakeDevChunk(d->chunks, path);
-}

==== //depot/projects/trustedbsd/base/lib/libdisk/libdisk.h#6 (text+ko) ====

@@ -6,7 +6,7 @@
 * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
 * ----------------------------------------------------------------------------
 *
-* $FreeBSD: src/lib/libdisk/libdisk.h,v 1.44 2002/10/22 10:51:58 phk Exp $
+* $FreeBSD: src/lib/libdisk/libdisk.h,v 1.45 2002/10/22 15:07:50 phk Exp $
 *
 */
 
@@ -238,13 +238,6 @@
  * enough is used.
  */
 
-int
-MakeDev(struct chunk *c, const char *path);
-
-int
-MakeDevDisk(struct disk *d, const char *path);
-/* Make device nodes for all chunks on this disk */
-
 char *
 ShowChunkFlags(struct chunk *c);
 /* Return string to show flags. */

==== //depot/projects/trustedbsd/base/share/examples/etc/make.conf#16 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/share/examples/etc/make.conf,v 1.202 2002/09/29 00:09:22 jmallett Exp $
+# $FreeBSD: src/share/examples/etc/make.conf,v 1.203 2002/10/22 15:02:53 phk Exp $
 #
 # NOTE:  Please would any committer updating this file also update the
 # make.conf(5) manual page, if necessary, which is located in
@@ -150,11 +150,10 @@
 # be OK to use for any non-commercial use.  This is optional.
 #MAKE_IDEA=	YES	# IDEA (128 bit symmetric encryption)
 #
-# To avoid running MAKEDEV all on /dev during install set NO_MAKEDEV_RUN.
-# If you don't want to install MAKEDEV set NO_MAKEDEV_INSTALL, this implies
-# NO_MAKEDEV_RUN.
-#NO_MAKEDEV_INSTALL=	true
-#NO_MAKEDEV_RUN=	true
+# If you want to install MAKEDEV set MAKEDEV_INSTALL.
+# To run MAKEDEV all on /dev during install set MAKEDEV_RUN.
+#MAKEDEV_INSTALL=	true
+#MAKEDEV_RUN=	true
 #
 # If you do not want unformatted manual pages to be compressed
 # when they are installed:

==== //depot/projects/trustedbsd/base/share/man/man4/umass.4#2 (text+ko) ====

@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"	$FreeBSD: src/share/man/man4/umass.4,v 1.21 2001/07/10 15:30:40 ru Exp $
+.\"	$FreeBSD: src/share/man/man4/umass.4,v 1.22 2002/10/22 15:23:13 luigi Exp $
 .\"
 .Dd May 3, 1999
 .Dt UMASS 4
@@ -53,6 +53,14 @@
 .It VAIO floppy drive (includes Y-E Data Flashbuster-U)
 .El
 .Pp
+The driver also supports some USB adapters for removable media.
+Among the supported models are:
+.Pp
+.Bl -tag -compact -width xxxxxx
+.It SanDisk SDDR-31 (Compact Flash)
+.It SanDisk SDDR-75 (only Compact Flash port works)
+.El
+.Pp
 .Nm usb
 and one of
 .Nm uhci

==== //depot/projects/trustedbsd/base/share/man/man5/make.conf.5#13 (text+ko) ====

@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.56 2002/08/13 14:25:53 ru Exp $
+.\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.57 2002/10/22 15:02:53 phk Exp $
 .\"
 .Dd November 3, 2000
 .Dt MAKE.CONF 5
@@ -391,18 +391,18 @@
 Set to not build the
 .Xr mailwrapper 8
 MTA selector.
-.It Va NO_MAKEDEV_INSTALL
+.It Va MAKEDEV_INSTALL
 .Pq Vt bool
-Set to avoid installing
+Set to install
 .Pa MAKEDEV
 in
 .Pa /dev .
-This implies the
-.Va NO_MAKEDEV_RUN
-variable.
-.It Va NO_MAKEDEV_RUN
+This is needed for the
+.Va MAKEDEV_RUN
+variable to have an effect.
+.It Va MAKEDEV_RUN
 .Pq Vt bool
-Set to avoid running
+Set to run
 .Dq Li "MAKEDEV all"
 on
 .Pa /dev

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

@@ -36,7 +36,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/kern/kern_mac.c,v 1.45 2002/10/22 14:29:47 rwatson Exp $
+ * $FreeBSD: src/sys/kern/kern_mac.c,v 1.47 2002/10/22 15:53:43 rwatson Exp $
  */
 /*
  * Developed by the TrustedBSD Project.
@@ -140,7 +140,7 @@
     &mac_enforce_vm, 0, "Enforce MAC policy on vm operations");
 TUNABLE_INT("security.mac.enforce_vm", &mac_enforce_vm);
 
-static int	mac_label_size = sizeof(struct mac);
+static int	mac_label_size = sizeof(struct oldmac);
 SYSCTL_INT(_security_mac, OID_AUTO, label_size, CTLFLAG_RD,
     &mac_label_size, 0, "Pre-compiled MAC label size");
 
@@ -1026,6 +1026,10 @@
 			mpc->mpc_ops->mpo_check_vnode_stat =
 			    mpe->mpe_function;
 			break;
+		case MAC_CHECK_VNODE_SWAPON:
+			mpc->mpc_ops->mpo_check_vnode_swapon =
+			    mpe->mpe_function;
+			break;
 		case MAC_CHECK_VNODE_WRITE:
 			mpc->mpc_ops->mpo_check_vnode_write =
 			    mpe->mpe_function;
@@ -2604,6 +2608,24 @@
 }
 
 int
+mac_check_vnode_swapon(struct ucred *cred, struct vnode *vp)
+{
+	int error;
+
+	ASSERT_VOP_LOCKED(vp, "mac_check_vnode_swapon");
+
+	if (!mac_enforce_fs)  
+		return (0);
+
+	error = vn_refreshlabel(vp, cred);
+	if (error)
+		return (error);
+
+	MAC_CHECK(check_vnode_swapon, cred, vp, &vp->v_label);
+	return (error);
+}
+
+int
 mac_check_vnode_write(struct ucred *active_cred, struct ucred *file_cred,
     struct vnode *vp)
 {

==== //depot/projects/trustedbsd/base/sys/pc98/i386/machdep.c#21 (text+ko) ====

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)machdep.c	7.4 (Berkeley) 6/3/91
- * $FreeBSD: src/sys/pc98/i386/machdep.c,v 1.298 2002/10/12 05:37:26 jeff Exp $
+ * $FreeBSD: src/sys/pc98/i386/machdep.c,v 1.299 2002/10/22 15:25:25 nyan Exp $
  */
 
 #include "opt_atalk.h"
@@ -2338,24 +2338,24 @@
 	struct pcb *pcb;
 
 	if (td == NULL) {
-		dbregs->dr0 = rdr0();
-		dbregs->dr1 = rdr1();
-		dbregs->dr2 = rdr2();
-		dbregs->dr3 = rdr3();
-		dbregs->dr4 = rdr4();
-		dbregs->dr5 = rdr5();
-		dbregs->dr6 = rdr6();
-		dbregs->dr7 = rdr7();
+		dbregs->dr[0] = rdr0();
+		dbregs->dr[1] = rdr1();
+		dbregs->dr[2] = rdr2();
+		dbregs->dr[3] = rdr3();
+		dbregs->dr[4] = rdr4();
+		dbregs->dr[5] = rdr5();
+		dbregs->dr[6] = rdr6();
+		dbregs->dr[7] = rdr7();
 	} else {
 		pcb = td->td_pcb;
-		dbregs->dr0 = pcb->pcb_dr0;
-		dbregs->dr1 = pcb->pcb_dr1;
-		dbregs->dr2 = pcb->pcb_dr2;
-		dbregs->dr3 = pcb->pcb_dr3;
-		dbregs->dr4 = 0;
-		dbregs->dr5 = 0;
-		dbregs->dr6 = pcb->pcb_dr6;
-		dbregs->dr7 = pcb->pcb_dr7;
+		dbregs->dr[0] = pcb->pcb_dr0;
+		dbregs->dr[1] = pcb->pcb_dr1;
+		dbregs->dr[2] = pcb->pcb_dr2;
+		dbregs->dr[3] = pcb->pcb_dr3;
+		dbregs->dr[4] = 0;
+		dbregs->dr[5] = 0;
+		dbregs->dr[6] = pcb->pcb_dr6;
+		dbregs->dr[7] = pcb->pcb_dr7;
 	}
 	return (0);
 }
@@ -2368,14 +2368,14 @@
 	u_int32_t mask1, mask2;
 
 	if (td == NULL) {
-		load_dr0(dbregs->dr0);
-		load_dr1(dbregs->dr1);
-		load_dr2(dbregs->dr2);
-		load_dr3(dbregs->dr3);
-		load_dr4(dbregs->dr4);
-		load_dr5(dbregs->dr5);
-		load_dr6(dbregs->dr6);
-		load_dr7(dbregs->dr7);
+		load_dr0(dbregs->dr[0]);
+		load_dr1(dbregs->dr[1]);
+		load_dr2(dbregs->dr[2]);
+		load_dr3(dbregs->dr[3]);
+		load_dr4(dbregs->dr[4]);
+		load_dr5(dbregs->dr[5]);
+		load_dr6(dbregs->dr[6]);
+		load_dr7(dbregs->dr[7]);
 	} else {
 		/*
 		 * Don't let an illegal value for dr7 get set.	Specifically,
@@ -2385,7 +2385,7 @@
 		 */
 		for (i = 0, mask1 = 0x3<<16, mask2 = 0x2<<16; i < 8; 
 		     i++, mask1 <<= 2, mask2 <<= 2)
-			if ((dbregs->dr7 & mask1) == mask2)
+			if ((dbregs->dr[7] & mask1) == mask2)
 				return (EINVAL);
 		
 		pcb = td->td_pcb;
@@ -2406,37 +2406,37 @@
 		 */
 
 		if (suser(td) != 0) {
-			if (dbregs->dr7 & 0x3) {
+			if (dbregs->dr[7] & 0x3) {
 				/* dr0 is enabled */
-				if (dbregs->dr0 >= VM_MAXUSER_ADDRESS)
+				if (dbregs->dr[0] >= VM_MAXUSER_ADDRESS)
 					return (EINVAL);
 			}
 			
-			if (dbregs->dr7 & (0x3<<2)) {
+			if (dbregs->dr[7] & (0x3<<2)) {
 				/* dr1 is enabled */
-				if (dbregs->dr1 >= VM_MAXUSER_ADDRESS)
+				if (dbregs->dr[1] >= VM_MAXUSER_ADDRESS)
 					return (EINVAL);
 			}
 			
-			if (dbregs->dr7 & (0x3<<4)) {
+			if (dbregs->dr[7] & (0x3<<4)) {
 				/* dr2 is enabled */
-				if (dbregs->dr2 >= VM_MAXUSER_ADDRESS)
+				if (dbregs->dr[2] >= VM_MAXUSER_ADDRESS)
 					return (EINVAL);
 			}
 			
-			if (dbregs->dr7 & (0x3<<6)) {
+			if (dbregs->dr[7] & (0x3<<6)) {
 				/* dr3 is enabled */
-				if (dbregs->dr3 >= VM_MAXUSER_ADDRESS)
+				if (dbregs->dr[3] >= VM_MAXUSER_ADDRESS)
 					return (EINVAL);
 			}
 		}
 
-		pcb->pcb_dr0 = dbregs->dr0;
-		pcb->pcb_dr1 = dbregs->dr1;
-		pcb->pcb_dr2 = dbregs->dr2;
-		pcb->pcb_dr3 = dbregs->dr3;
-		pcb->pcb_dr6 = dbregs->dr6;
-		pcb->pcb_dr7 = dbregs->dr7;
+		pcb->pcb_dr0 = dbregs->dr[0];
+		pcb->pcb_dr1 = dbregs->dr[1];
+		pcb->pcb_dr2 = dbregs->dr[2];
+		pcb->pcb_dr3 = dbregs->dr[3];
+		pcb->pcb_dr6 = dbregs->dr[6];
+		pcb->pcb_dr7 = dbregs->dr[7];
 
 		pcb->pcb_flags |= PCB_DBREGS;
 	}

==== //depot/projects/trustedbsd/base/sys/pc98/pc98/clock.c#10 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)clock.c	7.2 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/pc98/pc98/clock.c,v 1.115 2002/09/21 08:00:01 phk Exp $
+ * $FreeBSD: src/sys/pc98/pc98/clock.c,v 1.116 2002/10/22 15:19:46 nyan Exp $
  */
 
 /*
@@ -874,14 +874,6 @@
 	mtx_unlock_spin(&clock_lock);
 }
 
-/*
- * i8254_restore is called from apm_default_resume() to reload
- * the countdown register.
- * this should not be necessary but there are broken laptops that
- * do not restore the countdown register on resume.
- * when it happnes, it messes up the hardclock interval and system clock,
- * which leads to the infamous "calcru: negative time" problem.
- */
 static void
 i8254_restore(void)
 {
@@ -898,15 +890,20 @@
 rtc_restore(void)
 {
 
-	/* Reenable RTC updates and interrupts. */
-	/* XXX locking is needed for RTC access? */
-	writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
+	/* Restore all of the RTC's "status" (actually, control) registers. */
+	/* XXX locking is needed for RTC access. */
+	writertc(RTC_STATUSB, RTCSB_24HR);
+	writertc(RTC_STATUSA, rtc_statusa);
 	writertc(RTC_STATUSB, rtc_statusb);
 }
 #endif
 
 /*
- * Restore all the timers atomically.
+ * Restore all the timers non-atomically (XXX: should be atomically).
+ *
+ * This function is called from pmtimer_resume() to restore all the timers.
+ * This should not be necessary, but there are broken laptops that do not
+ * restore all the timers on resume.
  */
 void
 timer_restore(void)
@@ -1431,6 +1428,7 @@
 			 * on the IO APIC.
 			 * Workaround: Limited variant of mixed mode.
 			 */
+
 			crit = intr_disable();
 			mtx_lock_spin(&icu_lock);
 			INTRDIS(1 << apic_8254_intr);

==== //depot/projects/trustedbsd/base/sys/pc98/pc98/syscons_pc98.c#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/sys/pc98/pc98/syscons_pc98.c,v 1.16 2002/10/17 12:54:51 nyan Exp $
+ * $FreeBSD: src/sys/pc98/pc98/syscons_pc98.c,v 1.17 2002/10/22 15:22:49 nyan Exp $
  */
 
 #include "opt_syscons.h"
@@ -74,7 +74,9 @@
 	return sc_attach_unit(device_get_unit(dev), device_get_flags(dev));
 }
 
+#ifndef SC_NO_SUSPEND_VTYSWITCH
 static int	sc_cur_scr;
+#endif
 
 static int
 scsuspend(device_t dev)

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

@@ -34,7 +34,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/mac.h,v 1.16 2002/10/22 14:27:44 rwatson Exp $
+ * $FreeBSD: src/sys/sys/mac.h,v 1.17 2002/10/22 15:53:43 rwatson Exp $
  */
 /*
  * Userland/kernel interface for Mandatory Access Control.
@@ -348,6 +348,7 @@
 	    struct timespec atime, struct timespec mtime);
 int	mac_check_vnode_stat(struct ucred *active_cred,
 	    struct ucred *file_cred, struct vnode *vp);
+int	mac_check_vnode_swapon(struct ucred *cred, struct vnode *vp);
 int	mac_check_vnode_write(struct ucred *active_cred,
 	    struct ucred *file_cred, struct vnode *vp);
 int	mac_getsockopt_label_get(struct ucred *cred, struct socket *so,

==== //depot/projects/trustedbsd/base/sys/sys/mac_policy.h#13 (text+ko) ====

@@ -34,7 +34,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/mac_policy.h,v 1.17 2002/10/22 14:27:44 rwatson Exp $
+ * $FreeBSD: src/sys/sys/mac_policy.h,v 1.18 2002/10/22 15:53:43 rwatson Exp $
  */
 /*
  * Kernel interface for MAC policy modules.
@@ -385,6 +385,8 @@
 	int	(*mpo_check_vnode_stat)(struct ucred *active_cred,
 		    struct ucred *file_cred, struct vnode *vp,
 		    struct label *label);
+	int	(*mpo_check_vnode_swapon)(struct ucred *cred,
+		    struct vnode *vp, struct label *label);
 	int	(*mpo_check_vnode_write)(struct ucred *active_cred,
 		    struct ucred *file_cred, struct vnode *vp,
 		    struct label *label);
@@ -531,6 +533,7 @@
 	MAC_CHECK_VNODE_SETOWNER,
 	MAC_CHECK_VNODE_SETUTIMES,
 	MAC_CHECK_VNODE_STAT,
+	MAC_CHECK_VNODE_SWAPON,
 	MAC_CHECK_VNODE_WRITE,
 };
 

==== //depot/projects/trustedbsd/base/sys/vm/vm_mmap.c#11 (text+ko) ====

@@ -38,7 +38,7 @@
  * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
  *
  *	@(#)vm_mmap.c	8.4 (Berkeley) 1/12/94
- * $FreeBSD: src/sys/vm/vm_mmap.c,v 1.151 2002/09/21 22:07:17 jake Exp $
+ * $FreeBSD: src/sys/vm/vm_mmap.c,v 1.152 2002/10/22 15:56:44 rwatson Exp $
  */
 
 /*
@@ -46,6 +46,7 @@
  */
 
 #include "opt_compat.h"
+#include "opt_mac.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,6 +61,7 @@
 #include <sys/vnode.h>
 #include <sys/fcntl.h>
 #include <sys/file.h>
+#include <sys/mac.h>
 #include <sys/mman.h>
 #include <sys/conf.h>
 #include <sys/stat.h>
@@ -426,8 +428,16 @@
 	}
 
 	mtx_unlock(&Giant);
-	error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot,
-	    flags, handle, pos);
+	error = 0;
+#ifdef MAC
+	if (handle != NULL && (flags & MAP_SHARED) != 0) {
+		error = mac_check_vnode_mmap(td->td_ucred,
+		    (struct vnode *)handle, prot);
+	}
+#endif
+	if (error == 0)
+		error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot,
+		    flags, handle, pos);
 	mtx_lock(&Giant);
 	if (error == 0)
 		td->td_retval[0] = (register_t) (addr + pageoff);

==== //depot/projects/trustedbsd/base/sys/vm/vm_swap.c#10 (text+ko) ====

@@ -31,9 +31,10 @@
  * SUCH DAMAGE.
  *
  *	@(#)vm_swap.c	8.5 (Berkeley) 2/17/94
- * $FreeBSD: src/sys/vm/vm_swap.c,v 1.122 2002/09/25 01:24:17 jeff Exp $
+ * $FreeBSD: src/sys/vm/vm_swap.c,v 1.123 2002/10/22 15:53:43 rwatson Exp $
  */
 
+#include "opt_mac.h"
 #include "opt_swap.h"
 
 #include <sys/param.h>
@@ -52,6 +53,7 @@
 #include <sys/conf.h>
 #include <sys/stat.h>
 #include <sys/sysctl.h>
+#include <sys/mac.h>
 #include <sys/mount.h>
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
@@ -287,7 +289,11 @@
 	return EINVAL;
     found:
 	(void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
-	error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td);
+#ifdef MAC
+	error = mac_check_vnode_swapon(td->td_ucred, vp);
+	if (error == 0)
+#endif
+		error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td);
 	(void) VOP_UNLOCK(vp, 0, td);
 	if (error)
 		return (error);

==== //depot/projects/trustedbsd/base/usr.sbin/jail/jail.8#8 (text+ko) ====

@@ -31,7 +31,7 @@
 .\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
 .\" ----------------------------------------------------------------------------
 .\"
-.\" $FreeBSD: src/usr.sbin/jail/jail.8,v 1.38 2002/07/14 14:43:40 charnier Exp $
+.\" $FreeBSD: src/usr.sbin/jail/jail.8,v 1.39 2002/10/22 15:03:51 phk Exp $
 .\"
 .Dd December 12, 2001
 .Dt JAIL 8
@@ -62,7 +62,7 @@
 mkdir -p $D
 make world DESTDIR=$D
 cd etc
-make distribution DESTDIR=$D -DNO_MAKEDEV_RUN
+make distribution DESTDIR=$D
 cd $D/dev
 sh MAKEDEV jail
 cd $D

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

@@ -8,7 +8,7 @@
 # Copyright 1998-2002 Douglas Barton
 # DougB at FreeBSD.org
 
-# $FreeBSD: src/usr.sbin/mergemaster/mergemaster.sh,v 1.37 2002/08/05 08:47:52 dougb Exp $
+# $FreeBSD: src/usr.sbin/mergemaster/mergemaster.sh,v 1.38 2002/10/22 15:04:32 phk Exp $
 
 PATH=/bin:/usr/bin:/usr/sbin
 
@@ -500,7 +500,7 @@
       make DESTDIR=${TEMPROOT} distrib-dirs &&
       make MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj obj &&
       make MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj DESTDIR=${TEMPROOT} \
-          -DNO_MAKEDEV_RUN distribution;} ||
+          distribution;} ||
     { echo '';
      echo "  *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
       echo "      the temproot environment";

==== //depot/projects/trustedbsd/base/usr.sbin/sysinstall/install.c#11 (text+ko) ====

@@ -4,7 +4,7 @@
  * This is probably the last program in the `sysinstall' line - the next
  * generation being essentially a complete rewrite.
  *
- * $FreeBSD: src/usr.sbin/sysinstall/install.c,v 1.325 2002/10/22 09:13:27 phk Exp $
+ * $FreeBSD: src/usr.sbin/sysinstall/install.c,v 1.327 2002/10/22 15:25:19 phk Exp $
  *
  * Copyright (c) 1995
  *	Jordan Hubbard.  All rights reserved.
@@ -914,7 +914,7 @@
 int
 installFilesystems(dialogMenuItem *self)
 {
-    int i, mountfailed;
+    int i;
     Disk *disk;
     Chunk *c1, *c2, *rootdev, *swapdev;
     Device **devs;
@@ -939,8 +939,8 @@
     if (swapdev && RunningAsInit) {
 	/* As the very first thing, try to get ourselves some swap space */
 	sprintf(dname, "/dev/%s", swapdev->name);
-	if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) {
-	    msgConfirm("Unable to make device node for %s in /dev!\n"
+	if (!Fake && !file_readable(dname)) {
+	    msgConfirm("Unable to find device node for %s in /dev!\n"
 		       "The creation of filesystems will be aborted.", dname);
 	    return DITEM_FAILURE;
 	}
@@ -961,7 +961,7 @@
     if (rootdev && RunningAsInit) {
 	/* Next, create and/or mount the root device */
 	sprintf(dname, "/dev/%s", rootdev->name);
-	if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) {
+	if (!Fake && !file_readable(dname)) {
 	    msgConfirm("Unable to make device node for %s in /dev!\n"
 		       "The creation of filesystems will be aborted.", dname);
 	    return DITEM_FAILURE | DITEM_RESTORE;
@@ -1019,15 +1019,11 @@
 	    iov[1].iov_len = strlen(iov[2].iov_base) + 1;
 	    iov[3].iov_base = "/mnt/dev";
 	    iov[1].iov_len = strlen(iov[3].iov_base) + 1;
-	    mountfailed = nmount(iov, 4, 0);
-	}
+	    i = nmount(iov, 4, 0);
 
-	if (mountfailed) {
-	    dialog_clear_norefresh();
-	    msgNotify("Copying initial device files..");
-	    /* Copy the boot floppy's dev files */
-	    if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) {
-		msgConfirm("Couldn't clone the /dev files!");
+	    if (i) {
+		dialog_clear_norefresh();
+		msgConfirm("Unable to mount DEVFS (error %d)", errno);
 		return DITEM_FAILURE | DITEM_RESTORE;
 	    }
 	}
@@ -1044,16 +1040,6 @@
 	    msgConfirm("No chunk list found for %s!", disk->name);
 	    return DITEM_FAILURE | DITEM_RESTORE;
 	}
-	if (mountfailed) {
-	    if (RunningAsInit && root && (root->newfs || upgrade)) {
-		Mkdir("/mnt/dev");
-		if (!Fake)
-		    MakeDevDisk(disk, "/mnt/dev");
-	    }
-	    else if (!RunningAsInit && !Fake)
-		MakeDevDisk(disk, "/dev");
-	}
-
 	for (c1 = disk->chunks->part; c1; c1 = c1->next) {
 	    if (c1->type == freebsd) {
 		for (c2 = c1->part; c2; c2 = c2->next) {
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