Date: Wed, 29 Oct 2008 08:13:59 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 152139 for review Message-ID: <200810290813.m9T8DxJT071566@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152139 Change 152139 by trasz@trasz_victim7 on 2008/10/29 08:13:10 IFC. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/bin/rcp/rcp.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/files#19 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/u3g.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/usbdevs#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_posix1e.c#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/powerpc/powermac/ata_dbdma.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/mac/mac_cred.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/mac/mac_process.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/mac_stub/mac_stub.c#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/pci/schizo.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/param.h#9 integrate Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/bin/rcp/rcp.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #endif /* not lint */ #endif #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/bin/rcp/rcp.c,v 1.46 2007/05/22 04:21:00 cperciva Exp $"); +__FBSDID("$FreeBSD: src/bin/rcp/rcp.c,v 1.47 2008/10/28 17:15:46 rdivacky Exp $"); #include <sys/param.h> #include <sys/stat.h> @@ -789,6 +789,4 @@ vwarnx(fmt, ap); va_end(ap); } - - va_end(ap); } ==== //depot/projects/soc2008/trasz_nfs4acl/sys/conf/files#19 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1341 2008/10/27 17:57:03 bz Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1342 2008/10/28 21:53:10 rwatson Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -2176,6 +2176,7 @@ security/audit/audit_worker.c optional audit security/mac/mac_atalk.c optional mac netatalk security/mac/mac_audit.c optional mac audit +security/mac/mac_cred.c optional mac security/mac/mac_framework.c optional mac security/mac/mac_inet.c optional mac inet security/mac/mac_inet6.c optional mac inet6 ==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/u3g.c#5 (text+ko) ==== @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/usb/u3g.c,v 1.14 2008/10/28 09:45:07 bz Exp $ + * $FreeBSD: src/sys/dev/usb/u3g.c,v 1.15 2008/10/29 08:08:55 n_hibma Exp $ */ /* @@ -51,14 +51,12 @@ #endif #include "usbdevs.h" -//#define U3G_DEBUG +#define U3G_DEBUG #ifdef U3G_DEBUG #define DPRINTF(x...) do { if (u3gdebug) device_printf(sc->sc_dev, ##x); } while (0) -#define DPRINTFN(n, x...) do { if (u3gdebug > (n)) device_printf(self, ##x); } while (0) int u3gdebug = 1; #else #define DPRINTF(x...) /* nop */ -#define DPRINTFN(n, x...) /* nop */ #endif #define U3G_MAXPORTS 4 @@ -135,7 +133,8 @@ {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA }, U3GSP_HSDPA, U3GFL_NONE }, {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, U3GSP_UMTS, U3GFL_NONE }, /* OEM: Qualcomm, Inc. */ - {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_STUB_WAIT }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, /* OEM: Huawei */ {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSPA, U3GFL_HUAWEI_INIT }, ==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/usbdevs#11 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.379 2008/10/17 14:37:58 brooks Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.380 2008/10/29 08:08:55 n_hibma Exp $ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /*- @@ -1996,6 +1996,7 @@ product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem +product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage /* Qtronix products */ product QTRONIX 980N 0x2011 Scorpion-980N keyboard ==== //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_posix1e.c#9 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/subr_acl_posix1e.c,v 1.53 2008/10/28 13:44:11 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_acl_posix1e.c,v 1.54 2008/10/28 21:58:48 trasz Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,7 @@ */ int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *acl, accmode_t acc_mode, struct ucred *cred, int *privused) + struct acl *acl, accmode_t accmode, struct ucred *cred, int *privused) { struct acl_entry *acl_other, *acl_mask; accmode_t dac_granted; @@ -84,23 +84,23 @@ priv_granted = 0; if (type == VDIR) { - if ((acc_mode & VEXEC) && !priv_check_cred(cred, + if ((accmode & VEXEC) && !priv_check_cred(cred, PRIV_VFS_LOOKUP, 0)) priv_granted |= VEXEC; } else { - if ((acc_mode & VEXEC) && !priv_check_cred(cred, + if ((accmode & VEXEC) && !priv_check_cred(cred, PRIV_VFS_EXEC, 0)) priv_granted |= VEXEC; } - if ((acc_mode & VREAD) && !priv_check_cred(cred, PRIV_VFS_READ, 0)) + if ((accmode & VREAD) && !priv_check_cred(cred, PRIV_VFS_READ, 0)) priv_granted |= VREAD; - if (((acc_mode & VWRITE) || (acc_mode & VAPPEND)) && + if (((accmode & VWRITE) || (accmode & VAPPEND)) && !priv_check_cred(cred, PRIV_VFS_WRITE, 0)) priv_granted |= (VWRITE | VAPPEND); - if ((acc_mode & VADMIN) && !priv_check_cred(cred, PRIV_VFS_ADMIN, 0)) + if ((accmode & VADMIN) && !priv_check_cred(cred, PRIV_VFS_ADMIN, 0)) priv_granted |= VADMIN; /* @@ -123,14 +123,14 @@ dac_granted |= VREAD; if (acl->acl_entry[i].ae_perm & ACL_WRITE) dac_granted |= (VWRITE | VAPPEND); - if ((acc_mode & dac_granted) == acc_mode) + if ((accmode & dac_granted) == accmode) return (0); /* * XXXRW: Do privilege lookup here. */ - if ((acc_mode & (dac_granted | priv_granted)) == - acc_mode) { + if ((accmode & (dac_granted | priv_granted)) == + accmode) { if (privused != NULL) *privused = 1; return (0); @@ -200,13 +200,13 @@ if (acl->acl_entry[i].ae_perm & ACL_WRITE) dac_granted |= (VWRITE | VAPPEND); dac_granted &= acl_mask_granted; - if ((acc_mode & dac_granted) == acc_mode) + if ((accmode & dac_granted) == accmode) return (0); /* * XXXRW: Do privilege lookup here. */ - if ((acc_mode & (dac_granted | priv_granted)) != - acc_mode) + if ((accmode & (dac_granted | priv_granted)) != + accmode) goto error; if (privused != NULL) @@ -237,7 +237,7 @@ dac_granted |= (VWRITE | VAPPEND); dac_granted &= acl_mask_granted; - if ((acc_mode & dac_granted) == acc_mode) + if ((accmode & dac_granted) == accmode) return (0); group_matched = 1; @@ -255,7 +255,7 @@ dac_granted |= (VWRITE | VAPPEND); dac_granted &= acl_mask_granted; - if ((acc_mode & dac_granted) == acc_mode) + if ((accmode & dac_granted) == accmode) return (0); group_matched = 1; @@ -288,8 +288,8 @@ /* * XXXRW: Do privilege lookup here. */ - if ((acc_mode & (dac_granted | priv_granted)) - != acc_mode) + if ((accmode & (dac_granted | priv_granted)) + != accmode) break; if (privused != NULL) @@ -312,8 +312,8 @@ /* * XXXRW: Do privilege lookup here. */ - if ((acc_mode & (dac_granted | priv_granted)) - != acc_mode) + if ((accmode & (dac_granted | priv_granted)) + != accmode) break; if (privused != NULL) @@ -342,19 +342,19 @@ if (acl_other->ae_perm & ACL_WRITE) dac_granted |= (VWRITE | VAPPEND); - if ((acc_mode & dac_granted) == acc_mode) + if ((accmode & dac_granted) == accmode) return (0); /* * XXXRW: Do privilege lookup here. */ - if ((acc_mode & (dac_granted | priv_granted)) == acc_mode) { + if ((accmode & (dac_granted | priv_granted)) == accmode) { if (privused != NULL) *privused = 1; return (0); } error: - return ((acc_mode & VADMIN) ? EPERM : EACCES); + return ((accmode & VADMIN) ? EPERM : EACCES); } /* ==== //depot/projects/soc2008/trasz_nfs4acl/sys/powerpc/powermac/ata_dbdma.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/powerpc/powermac/ata_dbdma.c,v 1.1 2008/09/27 15:13:44 nwhitehorn Exp $ + * $FreeBSD: src/sys/powerpc/powermac/ata_dbdma.c,v 1.2 2008/10/28 22:09:30 nwhitehorn Exp $ */ /* @@ -275,6 +275,12 @@ sc->sc_ch.dma.load = ata_dbdma_load; sc->sc_ch.dma.reset = ata_dbdma_reset; + /* + * DBDMA's field for transfer size is 16 bits. This will overflow + * if we try to do a 64K transfer, so stop short of 64K. + */ + sc->sc_ch.dma.segsize = 126 * DEV_BSIZE; + sc->sc_ch.hw.status = ata_dbdma_status; mtx_init(&sc->dbdma_mtx, "ATA DBDMA", NULL, MTX_DEF); ==== //depot/projects/soc2008/trasz_nfs4acl/sys/security/mac/mac_process.c#4 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/security/mac/mac_process.c,v 1.125 2008/10/28 12:49:07 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/security/mac/mac_process.c,v 1.126 2008/10/28 21:53:10 rwatson Exp $"); #include "opt_mac.h" @@ -84,26 +84,6 @@ static void mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred, struct vm_map *map); -struct label * -mac_cred_label_alloc(void) -{ - struct label *label; - - label = mac_labelzone_alloc(M_WAITOK); - MAC_PERFORM(cred_init_label, label); - return (label); -} - -void -mac_cred_init(struct ucred *cred) -{ - - if (mac_labeled & MPC_OBJECT_CRED) - cred->cr_label = mac_cred_label_alloc(); - else - cred->cr_label = NULL; -} - static struct label * mac_proc_label_alloc(void) { @@ -124,24 +104,6 @@ p->p_label = NULL; } -void -mac_cred_label_free(struct label *label) -{ - - MAC_PERFORM(cred_destroy_label, label); - mac_labelzone_free(label); -} - -void -mac_cred_destroy(struct ucred *cred) -{ - - if (cred->cr_label != NULL) { - mac_cred_label_free(cred->cr_label); - cred->cr_label = NULL; - } -} - static void mac_proc_label_free(struct label *label) { @@ -160,84 +122,13 @@ } } -/* - * When a thread becomes an NFS server daemon, its credential may need to be - * updated to reflect this so that policies can recognize when file system - * operations originate from the network. - * - * At some point, it would be desirable if the credential used for each NFS - * RPC could be set based on the RPC context (i.e., source system, etc) to - * provide more fine-grained access control. - */ -void -mac_cred_associate_nfsd(struct ucred *cred) -{ - - MAC_PERFORM(cred_associate_nfsd, cred); -} - -/* - * Initialize MAC label for the first kernel process, from which other kernel - * processes and threads are spawned. - */ -void -mac_cred_create_swapper(struct ucred *cred) -{ - - MAC_PERFORM(cred_create_swapper, cred); -} - -/* - * Initialize MAC label for the first userland process, from which other - * userland processes and threads are spawned. - */ void -mac_cred_create_init(struct ucred *cred) -{ - - MAC_PERFORM(cred_create_init, cred); -} - -int -mac_cred_externalize_label(struct label *label, char *elements, - char *outbuf, size_t outbuflen) -{ - int error; - - MAC_EXTERNALIZE(cred, label, elements, outbuf, outbuflen); - - return (error); -} - -int -mac_cred_internalize_label(struct label *label, char *string) -{ - int error; - - MAC_INTERNALIZE(cred, label, string); - - return (error); -} - -void mac_thread_userret(struct thread *td) { MAC_PERFORM(thread_userret, td); } -/* - * When a new process is created, its label must be initialized. Generally, - * this involves inheritence from the parent process, modulo possible deltas. - * This function allows that processing to take place. - */ -void -mac_cred_copy(struct ucred *src, struct ucred *dest) -{ - - MAC_PERFORM(cred_copy_label, src->cr_label, dest->cr_label); -} - int mac_execve_enter(struct image_params *imgp, struct mac *mac_p) { @@ -484,38 +375,6 @@ vm_map_unlock_read(map); } -/* - * When the subject's label changes, it may require revocation of privilege - * to mapped objects. This can't be done on-the-fly later with a unified - * buffer cache. - */ -void -mac_cred_relabel(struct ucred *cred, struct label *newlabel) -{ - - MAC_PERFORM(cred_relabel, cred, newlabel); -} - -int -mac_cred_check_relabel(struct ucred *cred, struct label *newlabel) -{ - int error; - - MAC_CHECK(cred_check_relabel, cred, newlabel); - - return (error); -} - -int -mac_cred_check_visible(struct ucred *cr1, struct ucred *cr2) -{ - int error; - - MAC_CHECK(cred_check_visible, cr1, cr2); - - return (error); -} - int mac_proc_check_debug(struct ucred *cred, struct proc *p) { ==== //depot/projects/soc2008/trasz_nfs4acl/sys/security/mac_stub/mac_stub.c#9 (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/security/mac_stub/mac_stub.c,v 1.89 2008/10/28 13:44:11 trasz Exp $ + * $FreeBSD: src/sys/security/mac_stub/mac_stub.c,v 1.90 2008/10/28 21:57:32 trasz Exp $ */ /* @@ -1215,7 +1215,7 @@ static int stub_vnode_check_access(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, accmode_t accmode) { return (0); ==== //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/pci/schizo.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/sparc64/pci/schizo.c,v 1.1 2008/09/28 00:07:05 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/pci/schizo.c,v 1.2 2008/10/28 22:05:20 marius Exp $"); /* * Driver for `Schizo' Fireplane/Safari to PCI 2.1 and `Tomatillo' JBus to @@ -175,7 +175,6 @@ driver_filter_t *sds_handler; void *sds_arg; void *sds_cookie; - bus_size_t sds_syncreg; uint64_t sds_syncval; u_int sds_bswar; }; @@ -955,25 +954,25 @@ static u_char buf[VIS_BLOCKSIZE] __aligned(VIS_BLOCKSIZE); struct schizo_dmasync *sds = arg; struct schizo_softc *sc = sds->sds_sc; - uint64_t reg; + register_t reg, s; int timeout; - SCHIZO_PCI_WRITE_8(sc, sds->sds_syncreg, sds->sds_syncval); + SCHIZO_PCI_WRITE_8(sc, TOMXMS_PCI_DMA_SYNC_PEND, sds->sds_syncval); timeout = 1000000; - for (; (SCHIZO_PCI_READ_8(sc, sds->sds_syncreg) & + for (; (SCHIZO_PCI_READ_8(sc, TOMXMS_PCI_DMA_SYNC_PEND) & sds->sds_syncval) != 0;) if (--timeout < 0) panic("%s: DMA does not sync", __func__); if (sds->sds_bswar != 0) { - critical_enter(); + s = intr_disable(); reg = rd(fprs); wr(fprs, reg | FPRS_FEF, 0); - __asm__ __volatile__("stda %%f0, [%0] %1" + __asm __volatile("stda %%f0, [%0] %1" : : "r" (buf), "n" (ASI_BLK_COMMIT_S)); + membar(Sync); wr(fprs, reg, 0); - membar(Sync); - critical_exit(); + intr_restore(s); } return (sds->sds_handler(sds->sds_arg)); } @@ -1039,8 +1038,8 @@ } /* - * Schizo revision >= 2.3 (i.e. version >= 5) and Tomatillo bridges - * need to be manually told to sync DMA writes. + * Tomatillo and XMITS bridges need to be told to sync DMA writes + * based on the INO of the respective device. * Tomatillo revision <= 2.3 (i.e. version <= 4) bridges additionally * need a block store as a workaround for a hardware bug. * XXX setup of the wrapper and the contents of schizo_dmasync() @@ -1049,15 +1048,12 @@ * is newbus'ified, so the wrapper isn't only applied for interrupt * handlers but also for polling(4) callbacks. */ - if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM) { + if (sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { sds = malloc(sizeof(*sds), M_DEVBUF, M_NOWAIT | M_ZERO); if (sds == NULL) return (ENOMEM); sds->sds_sc = sc; sds->sds_arg = arg; - sds->sds_syncreg = sc->sc_mode == SCHIZO_MODE_SCZ ? - SCZ_PCI_DMA_SYNC : TOMXMS_PCI_DMA_SYNC_PEND; sds->sds_syncval = 1ULL << INTINO(vec); if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) sds->sds_bswar = 1; ==== //depot/projects/soc2008/trasz_nfs4acl/sys/sys/param.h#9 (text+ko) ==== @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.3 (Berkeley) 4/4/95 - * $FreeBSD: src/sys/sys/param.h,v 1.370 2008/10/23 15:53:51 des Exp $ + * $FreeBSD: src/sys/sys/param.h,v 1.371 2008/10/28 19:48:58 trasz Exp $ */ #ifndef _SYS_PARAM_H_ @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800051 /* Master, propagated to newvers */ +#define __FreeBSD_version 800052 /* Master, propagated to newvers */ #ifndef LOCORE #include <sys/types.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810290813.m9T8DxJT071566>