Date: Thu, 19 Apr 2007 17:21:02 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 118425 for review Message-ID: <200704191721.l3JHL20a065109@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118425 Change 118425 by rwatson@rwatson_zoo on 2007/04/19 17:20:38 Integrate TrustedBSD base branch from FreeBSD CVS in order to pick up completed OpenBSM 1.0 alpha 14 import -- apparently problems in the CVS importer environment prevented this from completing previously. Also: - Ftp client FEAT support. - More CAM locking. - hwpmc locking fixes. - SCTP lock optimization. - lastcomm text output mode. Affected files ... .. //depot/projects/trustedbsd/base/UPDATING#79 integrate .. //depot/projects/trustedbsd/base/etc/mtree/BSD.include.dist#41 integrate .. //depot/projects/trustedbsd/base/lib/libc/stdio/fputs.3#6 integrate .. //depot/projects/trustedbsd/base/libexec/ftpd/ftpcmd.y#23 integrate .. //depot/projects/trustedbsd/base/libexec/ftpd/ftpd.8#18 integrate .. //depot/projects/trustedbsd/base/libexec/ftpd/ftpd.c#34 integrate .. //depot/projects/trustedbsd/base/share/man/man7/hier.7#32 integrate .. //depot/projects/trustedbsd/base/sys/amd64/linux32/linux32_dummy.c#9 integrate .. //depot/projects/trustedbsd/base/sys/amd64/linux32/linux32_machdep.c#17 integrate .. //depot/projects/trustedbsd/base/sys/bsm/audit.h#8 integrate .. //depot/projects/trustedbsd/base/sys/bsm/audit_internal.h#7 integrate .. //depot/projects/trustedbsd/base/sys/bsm/audit_kevents.h#8 integrate .. //depot/projects/trustedbsd/base/sys/bsm/audit_record.h#8 integrate .. //depot/projects/trustedbsd/base/sys/cam/cam_sim.c#7 integrate .. //depot/projects/trustedbsd/base/sys/cam/cam_sim.h#4 integrate .. //depot/projects/trustedbsd/base/sys/cam/cam_xpt.c#32 integrate .. //depot/projects/trustedbsd/base/sys/compat/opensolaris/kern/opensolaris_vfs.c#3 integrate .. //depot/projects/trustedbsd/base/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c#4 integrate .. //depot/projects/trustedbsd/base/sys/dev/ath/if_ath.c#34 integrate .. //depot/projects/trustedbsd/base/sys/dev/hwpmc/hwpmc_logging.c#5 integrate .. //depot/projects/trustedbsd/base/sys/dev/hwpmc/hwpmc_mod.c#13 integrate .. //depot/projects/trustedbsd/base/sys/dev/hwpmc/hwpmc_piv.c#9 integrate .. //depot/projects/trustedbsd/base/sys/dev/ral/rt2560.c#8 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/isa/ad1816.c#19 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/isa/ess.c#17 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/isa/mss.c#23 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/isa/sb16.c#19 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/isa/sb8.c#16 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/als4000.c#13 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/atiixp.c#8 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/au88x0.c#11 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/aureal.c#12 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/cmi.c#24 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/cs4281.c#11 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/csapcm.c#16 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/ds1.c#17 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/emu10k1.c#22 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/emu10kx-pcm.c#5 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/es137x.c#20 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/fm801.c#16 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/hda/hdac.c#7 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/ich.c#37 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/maestro3.c#18 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/solo.c#15 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/t4dwave.c#18 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/via8233.c#22 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/via82c686.c#19 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pci/vibes.c#10 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/ac97.c#28 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/ac97.h#11 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/ac97_patch.c#7 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/ac97_patch.h#7 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/buffer.c#20 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/buffer.h#12 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/pcm/sound.h#24 integrate .. //depot/projects/trustedbsd/base/sys/dev/sound/sbus/cs4231.c#6 integrate .. //depot/projects/trustedbsd/base/sys/dev/usb/if_ural.c#18 integrate .. //depot/projects/trustedbsd/base/sys/dev/wi/if_wi.c#60 integrate .. //depot/projects/trustedbsd/base/sys/i386/i386/bios.c#22 integrate .. //depot/projects/trustedbsd/base/sys/i386/i386/identcpu.c#43 integrate .. //depot/projects/trustedbsd/base/sys/kern/kern_intr.c#48 integrate .. //depot/projects/trustedbsd/base/sys/kern/subr_witness.c#64 integrate .. //depot/projects/trustedbsd/base/sys/kern/uipc_syscalls.c#63 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_indata.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_input.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_lock_bsd.h#4 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_output.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_pcb.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_structs.h#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_uio.h#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_usrreq.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctp_var.h#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctputil.c#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/sctputil.h#7 integrate .. //depot/projects/trustedbsd/base/sys/netinet/tcp_subr.c#59 integrate .. //depot/projects/trustedbsd/base/sys/sys/interrupt.h#15 integrate .. //depot/projects/trustedbsd/base/sys/sys/socket.h#25 integrate .. //depot/projects/trustedbsd/base/sys/vm/vm_contig.c#37 integrate .. //depot/projects/trustedbsd/base/sys/vm/vm_param.h#8 integrate .. //depot/projects/trustedbsd/base/tools/regression/sockets/sendfile/Makefile#3 integrate .. //depot/projects/trustedbsd/base/tools/regression/sockets/sendfile/sendfile.c#2 integrate .. //depot/projects/trustedbsd/base/usr.bin/lastcomm/lastcomm.1#5 integrate .. //depot/projects/trustedbsd/base/usr.bin/lastcomm/lastcomm.c#10 integrate .. //depot/projects/trustedbsd/base/usr.bin/tar/test/test-basic.sh#2 integrate .. //depot/projects/trustedbsd/base/usr.bin/tar/util.c#10 integrate Differences ... ==== //depot/projects/trustedbsd/base/UPDATING#79 (text+ko) ==== @@ -21,6 +21,17 @@ developers choose to disable these features on build machines to maximize performance. +20070418: + A new acct(5) format is imminent. If you want to maintain access + to your accounting files, use the new lastcomm(1) -X functionality to + export them into text format, and keep around a copy of the lastcomm + binary. An updated lastcomm(1) program will allow you to import + the text files into the new acct(5) format. The change will also + invalidate the condensed summary files /var/account/savacct and + /var/account/usracct. If your process accounting system relies + on them, you will need to save their contents in a readable format + before the switch. + 20070417: The new trunk(4) driver has been renamed to lagg(4) as it better reflects its purpose. ifconfig will need to be recompiled. @@ -767,4 +778,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.486 2007/04/17 00:41:59 thompsa Exp $ +$FreeBSD: src/UPDATING,v 1.487 2007/04/18 17:34:59 dds Exp $ ==== //depot/projects/trustedbsd/base/etc/mtree/BSD.include.dist#41 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.111 2007/02/27 04:01:57 mjacob Exp $ +# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.112 2007/04/18 10:16:42 trhodes Exp $ # # Please see the file src/etc/mtree/README before making changes to this file. # @@ -209,8 +209,6 @@ .. pccard .. - posix4 - .. protocols .. readline ==== //depot/projects/trustedbsd/base/lib/libc/stdio/fputs.3#6 (text+ko) ==== @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.12 2007/01/09 00:28:06 imp Exp $ +.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.13 2007/04/19 09:38:31 phk Exp $ .\" .Dd June 4, 1993 .Dt FPUTS 3 @@ -66,12 +66,9 @@ to the stream .Dv stdout . .Sh RETURN VALUES -The +The functions .Fn fputs -function -returns 0 on success and -.Dv EOF -on error; +and .Fn puts returns a nonnegative integer on success and .Dv EOF ==== //depot/projects/trustedbsd/base/libexec/ftpd/ftpcmd.y#23 (text+ko) ==== @@ -47,7 +47,7 @@ #endif /* not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/libexec/ftpd/ftpcmd.y,v 1.65 2006/06/05 15:50:34 yar Exp $"); +__FBSDID("$FreeBSD: src/libexec/ftpd/ftpcmd.y,v 1.66 2007/04/18 22:43:39 yar Exp $"); #include <sys/param.h> #include <sys/socket.h> @@ -95,6 +95,7 @@ extern int usedefault; extern char tmpline[]; extern int readonly; +extern int assumeutf8; extern int noepsv; extern int noretr; extern int noguestretr; @@ -135,7 +136,7 @@ ABOR DELE CWD LIST NLST SITE STAT HELP NOOP MKD RMD PWD CDUP STOU SMNT SYST SIZE MDTM - LPRT LPSV EPRT EPSV + LPRT LPSV EPRT EPSV FEAT UMASK IDLE CHMOD MDFIVE @@ -687,6 +688,25 @@ if ($4 != NULL) free($4); } + | FEAT CRLF + { + lreply(211, "Extensions supported:"); +#if 0 + /* XXX these two keywords are non-standard */ + printf(" EPRT\r\n"); + if (!noepsv) + printf(" EPSV\r\n"); +#endif + printf(" MDTM\r\n"); + printf(" REST STREAM\r\n"); + printf(" SIZE\r\n"); + if (assumeutf8) { + /* TVFS requires UTF8, see RFC 3659 */ + printf(" TVFS\r\n"); + printf(" UTF8\r\n"); + } + reply(211, "End."); + } | SYST check_login CRLF { if ($2) { @@ -1112,6 +1132,7 @@ { "NLST", NLST, OSTR, 1, "[ <sp> path-name ]" }, { "SITE", SITE, SITECMD, 1, "site-cmd [ <sp> arguments ]" }, { "SYST", SYST, ARGS, 1, "(get type of operating system)" }, + { "FEAT", FEAT, ARGS, 1, "(get extended features)" }, { "STAT", STAT, OSTR, 1, "[ <sp> path-name ]" }, { "HELP", HELP, OSTR, 1, "[ <sp> <string> ]" }, { "NOOP", NOOP, ARGS, 1, "" }, ==== //depot/projects/trustedbsd/base/libexec/ftpd/ftpd.8#18 (text+ko) ==== @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.71 2006/01/29 13:10:38 yar Exp $ +.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.72 2007/04/18 22:43:39 yar Exp $ .\" .Dd January 21, 2006 .Dt FTPD 8 @@ -40,7 +40,7 @@ .Nd Internet File Transfer Protocol server .Sh SYNOPSIS .Nm -.Op Fl 46ADdEhMmOoRrSUvW +.Op Fl 468ADdEhMmOoRrSUvW .Op Fl l Op Fl l .Op Fl a Ar address .Op Fl P Ar port @@ -78,6 +78,21 @@ is specified, accept connections via .Dv AF_INET6 socket. +.It Fl 8 +The server is running in transparent UTF-8 mode. +That is, it just encourages RFC\ 2640 compliant clients to send +paths encoded in UTF-8 in their commands. +In particular, the names of files uploaded by such clients will +have UTF-8 encoding. +The clients will also assume that server replies and existing file +names have UTF-8 encoding, too. +The names of files preloaded to the server should meet this expectation +for the clients to present the correct file names to their users. +Own messages of +.Nm +are always encoded in ASCII, which in fact is a subset of UTF-8. +.Pp +Note that this option does not make the server do any encoding conversion. .It Fl A Allow only anonymous ftp access. .It Fl a @@ -250,6 +265,7 @@ .It DELE Ta "delete a file [RW]" .It EPRT Ta "specify data connection port, multiprotocol" .It EPSV Ta "prepare for server-to-server transfer, multiprotocol" +.It FEAT Ta "give information on extended features of server" .It HELP Ta "give help information" .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" .It LPRT Ta "specify data connection port, multiprotocol" ==== //depot/projects/trustedbsd/base/libexec/ftpd/ftpd.c#34 (text+ko) ==== @@ -46,7 +46,7 @@ #endif /* not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.211 2007/02/09 17:18:39 yar Exp $"); +__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.212 2007/04/18 22:43:39 yar Exp $"); /* * FTP server. @@ -128,6 +128,7 @@ int restricted_data_ports = 1; int paranoid = 1; /* be extra careful about security */ int anon_only = 0; /* Only anonymous ftp allowed */ +int assumeutf8 = 0; /* Assume that server file names are in UTF-8 */ int guest; int dochroot; char *chrootdir; @@ -308,7 +309,7 @@ openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP); while ((ch = getopt(argc, argv, - "46a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) { + "468a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) { switch (ch) { case '4': family = (family == AF_INET6) ? AF_UNSPEC : AF_INET; @@ -318,6 +319,10 @@ family = (family == AF_INET) ? AF_UNSPEC : AF_INET6; break; + case '8': + assumeutf8 = 1; + break; + case 'a': bindname = optarg; break; ==== //depot/projects/trustedbsd/base/share/man/man7/hier.7#32 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 -.\" $FreeBSD: src/share/man/man7/hier.7,v 1.125 2007/04/04 00:14:36 chinsan Exp $ +.\" $FreeBSD: src/share/man/man7/hier.7,v 1.126 2007/04/18 10:16:43 trhodes Exp $ .\" -.Dd April 3, 2007 +.Dd April 18, 2007 .Dt HIER 7 .Os .Sh NAME @@ -349,10 +349,6 @@ OpenSSL (Cryptography/SSL toolkit) headers .It Pa pccard/ PC-CARD controllers -.It Pa posix4/ -POSIX real-time extensions includes; -see -.Xr p1003_1b 9 .It Pa protocols/ C include files for Berkeley service protocols .It Pa readline/ ==== //depot/projects/trustedbsd/base/sys/amd64/linux32/linux32_dummy.c#9 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.8 2007/03/29 02:11:46 julian Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.9 2007/04/18 18:08:12 jkim Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -64,7 +64,6 @@ DUMMY(mincore); DUMMY(fadvise64); DUMMY(ptrace); -DUMMY(settimeofday); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); ==== //depot/projects/trustedbsd/base/sys/amd64/linux32/linux32_machdep.c#17 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.39 2007/03/30 17:27:13 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.42 2007/04/18 20:12:05 jkim Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -252,7 +252,7 @@ if (iovcnt > UIO_MAXIOV) return (EINVAL); iovlen = iovcnt * sizeof(struct iovec); - uio = malloc(iovlen + sizeof *uio, M_IOV, M_WAITOK); + uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK); iov = (struct iovec *)(uio + 1); for (i = 0; i < iovcnt; i++) { error = copyin(&iovp[i], &iov32, sizeof(struct iovec32)); @@ -526,7 +526,9 @@ td2 = FIRST_THREAD_IN_PROC(p2); - /* make it run */ + /* + * Make this runnable after we are finished with it. + */ mtx_lock_spin(&sched_lock); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); @@ -572,8 +574,8 @@ /* * XXX: In Linux, sharing of fs info (chroot/cwd/umask) * and open files is independant. In FreeBSD, its in one - * structure but in reality it does not make any problems - * because both of these flags are set at once usually. + * structure but in reality it does not cause any problems + * because both of these flags are usually set together. */ if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS))) ff |= RFFDG; @@ -660,15 +662,15 @@ if (args->flags & LINUX_CLONE_SETTLS) { struct user_segment_descriptor sd; struct l_user_desc info; - int a[2]; + int a[2]; - error = copyin((void *)td->td_frame->tf_rsi, &info, + error = copyin((void *)td->td_frame->tf_rsi, &info, sizeof(struct l_user_desc)); if (error) { printf(LMSG("copyin failed!")); } else { /* We might copy out the entry_number as GUGS32_SEL. */ - info.entry_number = GUGS32_SEL; + info.entry_number = GUGS32_SEL; error = copyout(&info, (void *)td->td_frame->tf_rsi, sizeof(struct l_user_desc)); if (error) @@ -871,7 +873,7 @@ * * Our mmap with MAP_STACK takes addr as the maximum * downsize limit on BOS, and as len the max size of - * the region. It them maps the top SGROWSIZ bytes, + * the region. It then maps the top SGROWSIZ bytes, * and auto grows the region down, up to the limit * in addr. * @@ -1167,17 +1169,44 @@ microtime(&atv); atv32.tv_sec = atv.tv_sec; atv32.tv_usec = atv.tv_usec; - error = copyout(&atv32, uap->tp, sizeof (atv32)); + error = copyout(&atv32, uap->tp, sizeof(atv32)); } if (error == 0 && uap->tzp != NULL) { rtz.tz_minuteswest = tz_minuteswest; rtz.tz_dsttime = tz_dsttime; - error = copyout(&rtz, uap->tzp, sizeof (rtz)); + error = copyout(&rtz, uap->tzp, sizeof(rtz)); } return (error); } int +linux_settimeofday(struct thread *td, struct linux_settimeofday_args *uap) +{ + l_timeval atv32; + struct timeval atv, *tvp; + struct timezone atz, *tzp; + int error; + + if (uap->tp) { + error = copyin(uap->tp, &atv32, sizeof(atv32)); + if (error) + return (error); + atv.tv_sec = atv32.tv_sec; + atv.tv_usec = atv32.tv_usec; + tvp = &atv; + } else + tvp = NULL; + if (uap->tzp) { + error = copyin(uap->tzp, &atz, sizeof(atz)); + if (error) + return (error); + tzp = &atz; + } else + tzp = NULL; + return (kern_settimeofday(td, tvp, tzp)); +} + +int linux_getrusage(struct thread *td, struct linux_getrusage_args *uap) { struct l_rusage s32; @@ -1242,7 +1271,7 @@ #ifdef DEBUG if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, " + printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, " "%i, %i, %i"), info.entry_number, info.base_addr, info.limit, info.seg_32bit, info.contents, info.read_exec_only, info.limit_in_pages, @@ -1261,9 +1290,10 @@ * The tls_array[] is used only in [gs]et_thread_area() syscalls and * for loading the GDT descriptors. We use just one GDT descriptor * for TLS, so we will load just one. - * XXX: This doesnt work when user-space process tries to use more + * + * XXX: This doesn't work when a user space process tries to use more * than one TLS segment. Comment in the Linux source says wine might - * do that. + * do this. */ /* @@ -1284,8 +1314,9 @@ /* * We have to copy out the GDT entry we use. - * XXX: What if userspace program does not check return value and - * tries to use 6, 7 or 8? + * + * XXX: What if a user space program does not check the return value + * and tries to use 6, 7 or 8? */ error = copyout(&info, args->desc, sizeof(struct l_user_desc)); if (error) ==== //depot/projects/trustedbsd/base/sys/bsm/audit.h#8 (text+ko) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/base/sys/bsm/audit.h#7 $ - * $FreeBSD: src/sys/bsm/audit.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#36 + * $FreeBSD: src/sys/bsm/audit.h,v 1.8 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_H ==== //depot/projects/trustedbsd/base/sys/bsm/audit_internal.h#7 (text) ==== @@ -34,8 +34,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#14 $ - * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.5 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#16 + * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.7 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _AUDIT_INTERNAL_H ==== //depot/projects/trustedbsd/base/sys/bsm/audit_kevents.h#8 (text+ko) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/base/sys/bsm/audit_kevents.h#7 $ - * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.9 2006/09/25 12:22:07 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#32 + * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.11 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -475,6 +475,28 @@ #define AUE_READDIR 43118 /* Linux. */ #define AUE_IOPL 43119 /* Linux. */ #define AUE_VM86 43120 /* Linux. */ +#define AUE_MAC_GET_PROC 43121 /* FreeBSD. */ +#define AUE_MAC_SET_PROC 43122 /* FreeBSD. */ +#define AUE_MAC_GET_FD 43123 /* FreeBSD. */ +#define AUE_MAC_GET_FILE 43124 /* FreeBSD. */ +#define AUE_MAC_SET_FD 43125 /* FreeBSD. */ +#define AUE_MAC_SET_FILE 43126 /* FreeBSD. */ +#define AUE_MAC_SYSCALL 43127 /* FreeBSD. */ +#define AUE_MAC_GET_PID 43128 /* FreeBSD. */ +#define AUE_MAC_GET_LINK 43129 /* FreeBSD. */ +#define AUE_MAC_SET_LINK 43130 /* FreeBSD. */ +#define AUE_MAC_EXECVE 43131 /* FreeBSD. */ +#define AUE_GETPATH_FROMFD 43132 /* FreeBSD. */ +#define AUE_GETPATH_FROMADDR 43133 /* FreeBSD. */ +#define AUE_MQ_OPEN 43134 /* FreeBSD. */ +#define AUE_MQ_SETATTR 43135 /* FreeBSD. */ +#define AUE_MQ_TIMEDRECEIVE 43136 /* FreeBSD. */ +#define AUE_MQ_TIMEDSEND 43137 /* FreeBSD. */ +#define AUE_MQ_NOTIFY 43138 /* FreeBSD. */ +#define AUE_MQ_UNLINK 43139 /* FreeBSD. */ +#define AUE_LISTEN 43140 /* FreeBSD/Darwin/Linux. */ +#define AUE_MLOCKALL 43141 /* FreeBSD. */ +#define AUE_MUNLOCKALL 43142 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the @@ -572,16 +594,13 @@ #define AUE_GETSOCKOPT AUE_NULL #define AUE_GTSOCKOPT AUE_GETSOCKOPT /* XXX: Typo in Darwin. */ #define AUE_ISSETUGID AUE_NULL -#define AUE_LISTEN AUE_NULL #define AUE_LSTATV AUE_NULL #define AUE_MADVISE AUE_NULL #define AUE_MINCORE AUE_NULL #define AUE_MKCOMPLEX AUE_NULL -#define AUE_MLOCKALL AUE_NULL #define AUE_MODWATCH AUE_NULL #define AUE_MSGCL AUE_NULL #define AUE_MSYNC AUE_NULL -#define AUE_MUNLOCKALL AUE_NULL #define AUE_PREAD AUE_NULL #define AUE_PWRITE AUE_NULL #define AUE_PREADV AUE_NULL ==== //depot/projects/trustedbsd/base/sys/bsm/audit_record.h#8 (text) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#21 $ - * $FreeBSD: src/sys/bsm/audit_record.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#24 + * $FreeBSD: src/sys/bsm/audit_record.h,v 1.9 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -86,6 +86,7 @@ /* XXXRW: Additional X11 tokens not defined? */ #define AUT_CMD 0x51 #define AUT_EXIT 0x52 +#define AUT_ZONENAME 0x60 /* XXXRW: OpenBSM AUT_HOST 0x70? */ #define AUT_ARG64 0x71 #define AUT_RETURN64 0x72 @@ -247,6 +248,8 @@ token_t *au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, struct timeval tm); +token_t *au_to_header64_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, + struct timeval tm); #if !defined(KERNEL) && !defined(_KERNEL) token_t *au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod); @@ -329,6 +332,7 @@ token_t *au_to_text(char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_zonename(char *zonename); __END_DECLS ==== //depot/projects/trustedbsd/base/sys/cam/cam_sim.c#7 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/cam_sim.c,v 1.10 2007/04/15 08:49:09 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_sim.c,v 1.11 2007/04/19 14:28:43 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -95,6 +95,7 @@ } SLIST_INIT(&sim->ccb_freeq); + TAILQ_INIT(&sim->sim_doneq); return (sim); } ==== //depot/projects/trustedbsd/base/sys/cam/cam_sim.h#4 (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/cam/cam_sim.h,v 1.7 2007/04/15 08:49:09 scottl Exp $ + * $FreeBSD: src/sys/cam/cam_sim.h,v 1.8 2007/04/19 14:28:43 scottl Exp $ */ #ifndef _CAM_CAM_SIM_H @@ -92,6 +92,8 @@ const char *sim_name; void *softc; struct mtx *mtx; + TAILQ_HEAD(, ccb_hdr) sim_doneq; + TAILQ_ENTRY(cam_sim) links; u_int32_t path_id;/* The Boot device may set this to 0? */ u_int32_t unit_number; u_int32_t bus_id; @@ -100,6 +102,7 @@ u_int32_t flags; #define CAM_SIM_REL_TIMEOUT_PENDING 0x01 #define CAM_SIM_MPSAFE 0x02 +#define CAM_SIM_ON_DONEQ 0x04 struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ ==== //depot/projects/trustedbsd/base/sys/cam/cam_xpt.c#32 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.178 2007/04/18 04:58:52 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.180 2007/04/19 14:45:37 scottl Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -665,8 +665,9 @@ /* Queues for our software interrupt handler */ typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t; -static cam_isrq_t cam_bioq; -static struct mtx cam_bioq_lock; +typedef TAILQ_HEAD(cam_simq, cam_sim) cam_simq_t; +static cam_simq_t cam_simq; +static struct mtx cam_simq_lock; /* Pointers to software interrupt handlers */ static void *cambio_ih; @@ -821,6 +822,7 @@ static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); static void camisr(void *); +static void camisr_runqueue(void *); static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus); static dev_match_ret xptdevicematch(struct dev_match_pattern *patterns, @@ -1472,12 +1474,12 @@ cam_status status; TAILQ_INIT(&xsoftc.xpt_busses); - TAILQ_INIT(&cam_bioq); + TAILQ_INIT(&cam_simq); TAILQ_INIT(&xsoftc.ccb_scanq); STAILQ_INIT(&xsoftc.highpowerq); xsoftc.num_highpower = CAM_MAX_HIGHPOWER; - mtx_init(&cam_bioq_lock, "CAM BIOQ lock", NULL, MTX_DEF); + mtx_init(&cam_simq_lock, "CAM SIMQ lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); @@ -1551,7 +1553,7 @@ printf("xpt_init: failed to create rescan thread\n"); } /* Install our software interrupt handlers */ - swi_add(NULL, "cambio", camisr, &cam_bioq, SWI_CAMBIO, INTR_MPSAFE, &cambio_ih); + swi_add(NULL, "cambio", camisr, NULL, SWI_CAMBIO, INTR_MPSAFE, &cambio_ih); return (0); } @@ -3639,7 +3641,7 @@ dev->ccbq.dev_openings < 0) && (--timeout > 0)) { DELAY(1000); (*(sim->sim_poll))(sim); - camisr(&cam_bioq); + camisr_runqueue(&sim->sim_doneq); } dev->ccbq.devq_openings++; @@ -3649,7 +3651,7 @@ xpt_action(start_ccb); while(--timeout > 0) { (*(sim->sim_poll))(sim); - camisr(&cam_bioq); + camisr_runqueue(&sim->sim_doneq); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; @@ -4490,6 +4492,7 @@ /* The SIM may be gone, so use a dummy SIM for any stray operations. */ devq = bus_path.bus->sim->devq; + ccbsim = bus_path.bus->sim; bus_path.bus->sim = &cam_dead_sim; /* Execute any pending operations now. */ @@ -4504,7 +4507,6 @@ devq->active_dev = device; cam_ccbq_remove_ccb(&device->ccbq, work_ccb); cam_ccbq_send_ccb(&device->ccbq, work_ccb); - ccbsim = work_ccb->ccb_h.path->bus->sim; (*(ccbsim->sim_action))(ccbsim, work_ccb); } @@ -4516,8 +4518,8 @@ } /* Make sure all completed CCBs are processed. */ - while (!TAILQ_EMPTY(&cam_bioq)) { - camisr(&cam_bioq); + while (!TAILQ_EMPTY(&ccbsim->sim_doneq)) { + camisr_runqueue(&ccbsim->sim_doneq); /* Repeat the async's for the benefit of any new devices. */ xpt_async(AC_LOST_DEVICE, &bus_path, NULL); @@ -4528,10 +4530,6 @@ xpt_release_bus(bus_path.bus); xpt_release_path(&bus_path); - /* Recheck for more completed CCBs. */ - while (!TAILQ_EMPTY(&cam_bioq)) - camisr(&cam_bioq); - return (CAM_REQ_CMP); } @@ -4949,6 +4947,7 @@ void xpt_done(union ccb *done_ccb) { + struct cam_sim *sim; int s; s = splcam(); @@ -4959,13 +4958,19 @@ * Queue up the request for handling by our SWI handler * any of the "non-immediate" type of ccbs. */ + sim = done_ccb->ccb_h.path->bus->sim; switch (done_ccb->ccb_h.path->periph->type) { case CAM_PERIPH_BIO: - mtx_lock(&cam_bioq_lock); - TAILQ_INSERT_TAIL(&cam_bioq, &done_ccb->ccb_h, + TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - mtx_unlock(&cam_bioq_lock); + if ((sim->flags & CAM_SIM_ON_DONEQ) == 0) { + mtx_lock(&cam_simq_lock); + TAILQ_INSERT_TAIL(&cam_simq, sim, + links); + sim->flags |= CAM_SIM_ON_DONEQ; + mtx_unlock(&cam_simq_lock); + } if ((done_ccb->ccb_h.path->periph->flags & CAM_PERIPH_POLLED) == 0) swi_sched(cambio_ih, 0); @@ -4983,7 +4988,7 @@ { union ccb *new_ccb; - new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_WAITOK); + new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_ZERO|M_WAITOK); return (new_ccb); } @@ -4992,7 +4997,7 @@ { union ccb *new_ccb; - new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_NOWAIT); + new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_ZERO|M_NOWAIT); return (new_ccb); } @@ -7231,31 +7236,36 @@ } static void -camisr(void *V_queue) +camisr(void *dummy) { - cam_isrq_t *oqueue = V_queue; - cam_isrq_t queue; - int s; - struct ccb_hdr *ccb_h; - struct cam_sim *sim; + cam_simq_t queue; + struct cam_sim *sim; - /* - * Transfer the ccb_bioq list to a temporary list so we can operate - * on it without needing to lock/unlock on every loop. The concat - * function with re-init the real list for us. - */ - s = splcam(); - mtx_lock(&cam_bioq_lock); + mtx_lock(&cam_simq_lock); TAILQ_INIT(&queue); - TAILQ_CONCAT(&queue, oqueue, sim_links.tqe); - mtx_unlock(&cam_bioq_lock); + TAILQ_CONCAT(&queue, &cam_simq, links); + mtx_unlock(&cam_simq_lock); + + while ((sim = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, sim, links); + mtx_lock(sim->mtx); + sim->flags &= ~CAM_SIM_ON_DONEQ; + camisr_runqueue(&sim->sim_doneq); + mtx_unlock(sim->mtx); + } +} + +static void +camisr_runqueue(void *V_queue) +{ + cam_isrq_t *queue = V_queue; + struct ccb_hdr *ccb_h; - while ((ccb_h = TAILQ_FIRST(&queue)) != NULL) { + while ((ccb_h = TAILQ_FIRST(queue)) != NULL) { int runq; - TAILQ_REMOVE(&queue, ccb_h, sim_links.tqe); + TAILQ_REMOVE(queue, ccb_h, sim_links.tqe); ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; - splx(s); CAM_DEBUG(ccb_h->path, CAM_DEBUG_TRACE, ("camisr\n")); @@ -7290,22 +7300,17 @@ mtx_unlock(&xsoftc.xpt_lock); } - sim = ccb_h->path->bus->sim; - mtx_lock(sim->mtx); - if ((ccb_h->func_code & XPT_FC_USER_CCB) == 0) { struct cam_ed *dev; dev = ccb_h->path->device; - s = splcam(); cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h); if (!SIM_DEAD(ccb_h->path->bus->sim)) { ccb_h->path->bus->sim->devq->send_active--; ccb_h->path->bus->sim->devq->send_openings++; } - splx(s); if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 && (ccb_h->status&CAM_STATUS_MASK) != CAM_REQUEUE_REQ) @@ -7346,12 +7351,7 @@ /* Call the peripheral driver's callback */ (*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h); - - /* Raise IPL for while test */ - mtx_unlock(sim->mtx); - s = splcam(); } - splx(s); } static void ==== //depot/projects/trustedbsd/base/sys/compat/opensolaris/kern/opensolaris_vfs.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/opensolaris/kern/opensolaris_vfs.c,v 1.2 2007/04/17 21:16:34 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/opensolaris/kern/opensolaris_vfs.c,v 1.3 2007/04/18 15:24:48 pjd Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -169,9 +169,6 @@ if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN) return (ENAMETOOLONG); - if ((error = priv_check(td, PRIV_VFS_MOUNT)) != 0) - return (error); - vfsp = vfs_byname_kld(fstype, td, &error); if (vfsp == NULL) return (ENODEV); @@ -207,6 +204,13 @@ mp->mnt_flag |= MNT_RDONLY; mp->mnt_flag &=~ MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS); + /* + * Unprivileged user can trigger mounting a snapshot, but we don't want + * him to unmount it, so we switch to privileged credential. + */ + crfree(mp->mnt_cred); + mp->mnt_cred = crdup(kcred); + mp->mnt_stat.f_owner = mp->mnt_cred->cr_uid; MNT_IUNLOCK(mp); /* * Mount the filesystem. @@ -260,12 +264,9 @@ VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0, td); vfs_unbusy(mp, td); vfs_mount_destroy(mp); - if (VOP_ISLOCKED(vp, td) != LK_EXCLUSIVE) { - printf("%s:%u: vnode vp=%p not locked\n", __func__, __LINE__, vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704191721.l3JHL20a065109>