From owner-svn-src-projects@freebsd.org Sun Apr 28 02:27:10 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 807CB1566A74 for ; Sun, 28 Apr 2019 02:27:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2277C77816; Sun, 28 Apr 2019 02:27:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDB934323; Sun, 28 Apr 2019 02:27:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S2R9Vw068207; Sun, 28 Apr 2019 02:27:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S2R4xi068181; Sun, 28 Apr 2019 02:27:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904280227.x3S2R4xi068181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 28 Apr 2019 02:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346801 - in projects/runtime-coverage-v2: lib/libc/gen lib/libvgl libexec/rc stand stand/common stand/efi/loader stand/i386/loader sys/arm/allwinner sys/arm/allwinner/a10 sys/arm/allwi... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage-v2: lib/libc/gen lib/libvgl libexec/rc stand stand/common stand/efi/loader stand/i386/loader sys/arm/allwinner sys/arm/allwinner/a10 sys/arm/allwinner/clkng sys/cddl/contr... X-SVN-Commit-Revision: 346801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2277C77816 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 02:27:11 -0000 Author: ngie Date: Sun Apr 28 02:27:04 2019 New Revision: 346801 URL: https://svnweb.freebsd.org/changeset/base/346801 Log: MFhead@r346800 Added: projects/runtime-coverage-v2/lib/libc/gen/auxv.3 - copied unchanged from r346800, head/lib/libc/gen/auxv.3 projects/runtime-coverage-v2/stand/common/vdisk.c - copied unchanged from r346800, head/stand/common/vdisk.c Modified: projects/runtime-coverage-v2/lib/libc/gen/Makefile.inc projects/runtime-coverage-v2/lib/libvgl/bitmap.c projects/runtime-coverage-v2/lib/libvgl/main.c projects/runtime-coverage-v2/lib/libvgl/mouse.c projects/runtime-coverage-v2/lib/libvgl/simple.c projects/runtime-coverage-v2/libexec/rc/rc.initdiskless projects/runtime-coverage-v2/stand/common/help.common projects/runtime-coverage-v2/stand/efi/loader/conf.c projects/runtime-coverage-v2/stand/i386/loader/conf.c projects/runtime-coverage-v2/stand/loader.mk projects/runtime-coverage-v2/sys/arm/allwinner/a10/a10_padconf.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_rtc.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_syscon.c projects/runtime-coverage-v2/sys/arm/allwinner/clkng/ccu_de2.c projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_systrace_args.c projects/runtime-coverage-v2/sys/kern/systrace_args.c projects/runtime-coverage-v2/sys/kern/vfs_bio.c projects/runtime-coverage-v2/sys/modules/fusefs/Makefile projects/runtime-coverage-v2/sys/powerpc/aim/aim_machdep.c projects/runtime-coverage-v2/sys/powerpc/aim/mp_cpudep.c projects/runtime-coverage-v2/sys/powerpc/include/pcb.h projects/runtime-coverage-v2/sys/powerpc/include/spr.h projects/runtime-coverage-v2/sys/powerpc/powerpc/cpu.c projects/runtime-coverage-v2/sys/powerpc/powerpc/exec_machdep.c projects/runtime-coverage-v2/sys/powerpc/powerpc/genassym.c projects/runtime-coverage-v2/sys/powerpc/powerpc/swtch32.S projects/runtime-coverage-v2/sys/powerpc/powerpc/swtch64.S projects/runtime-coverage-v2/sys/powerpc/powerpc/trap.c projects/runtime-coverage-v2/tools/boot/ci-qemu-test.sh Directory Properties: projects/runtime-coverage-v2/ (props changed) projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/runtime-coverage-v2/lib/libc/gen/Makefile.inc ============================================================================== --- projects/runtime-coverage-v2/lib/libc/gen/Makefile.inc Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/lib/libc/gen/Makefile.inc Sun Apr 28 02:27:04 2019 (r346801) @@ -193,6 +193,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map MAN+= alarm.3 \ arc4random.3 \ + auxv.3 \ basename.3 \ cap_rights_get.3 \ cap_sandboxed.3 \ @@ -321,6 +322,7 @@ MAN+= alarm.3 \ MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 +MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 Copied: projects/runtime-coverage-v2/lib/libc/gen/auxv.3 (from r346800, head/lib/libc/gen/auxv.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage-v2/lib/libc/gen/auxv.3 Sun Apr 28 02:27:04 2019 (r346801, copy of r346800, head/lib/libc/gen/auxv.3) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (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$ +.\" +.Dd April 25, 2019 +.Dt ELF_AUX_INFO 3 +.Os +.Sh NAME +.Nm elf_aux_info +.Nd extract data from the elf auxiliary vector of the current process +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/auxv.h +.Ft int +.Fn elf_aux_info "int aux" "void *buf" "int buflen" +.Sh DESCRIPTION +The +.Fn elf_aux_info +function retrieves the auxiliary info vector requested in +.Va aux . +The information is stored into the provided buffer if it will fit. +The following values, defined in +.In sys/elf_common.h +can be requested: +.Bl -tag -width AT_OSRELDATE +.It AT_CANARY +The canary value for SSP. +.It AT_HWCAP +CPU / hardware feature flags. +.It AT_HWCAP2 +CPU / hardware feature flags. +.It AT_NCPUS +Number of CPUs. +.It AT_OSRELDATE +Kernel OSRELDATE. +.It AT_PAGESIZES +Vector of page sizes. +.It AT_PAGESZ +Page size in bytes. +.It AT_TIMEKEEP +Pointer to VDSO timehands (for library internal use). +.El +.Sh RETURN VALUES +Returns zero on success, or an error number on failure. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +An unknown item was requested. +.It Bq Er EINVAL +The provided buffer was not the right size for the requested item. +.It Bq Er ENOENT +The requested item is not available. +.El +.Sh HISTORY +The +.Fn elf_aux_info +function appeared in +.Fx 12.0 . +.Sh BUGS +Only a small subset of available auxiliary info vector items are +accessible with this function. +Some items require a "right-sized" buffer while others just require a +"big enough" buffer. Modified: projects/runtime-coverage-v2/lib/libvgl/bitmap.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/bitmap.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/lib/libvgl/bitmap.c Sun Apr 28 02:27:04 2019 (r346801) @@ -207,7 +207,7 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, yextra = 0; ystep = 1; if (src->Bitmap == dst->Bitmap && srcy < dsty) { - yend = srcy; + yend = srcy - 1; yextra = hight - 1; ystep = -1; } Modified: projects/runtime-coverage-v2/lib/libvgl/main.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/main.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/lib/libvgl/main.c Sun Apr 28 02:27:04 2019 (r346801) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" -/* XXX Direct Color 24bits modes unsupported */ - #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) @@ -64,6 +62,7 @@ static unsigned int VGLCurWindow; static int VGLInitDone = 0; static video_info_t VGLOldModeInfo; static vid_info_t VGLOldVInfo; +static int VGLOldVXsize; void VGLEnd() @@ -85,6 +84,8 @@ struct vt_mode smode; munmap(VGLMem, VGLAdpInfo.va_window_size); } + ioctl(0, FBIO_SETLINEWIDTH, &VGLOldVXsize); + if (VGLOldMode >= M_VESA_BASE) ioctl(0, _IO('V', VGLOldMode - M_VESA_BASE), 0); else @@ -220,11 +221,9 @@ VGLInit(int mode) case 2: VGLDisplay->Type = VIDBUF16; break; -#if notyet case 3: VGLDisplay->Type = VIDBUF24; break; -#endif case 4: VGLDisplay->Type = VIDBUF32; break; @@ -322,6 +321,7 @@ VGLInit(int mode) depth = VGLModeInfo.vi_depth; if (depth == 15) depth = 16; + VGLOldVXsize = VGLDisplay->VXsize = VGLAdpInfo.va_line_width *8/(depth/VGLModeInfo.vi_planes); VGLDisplay->VYsize = VGLBufSize/VGLModeInfo.vi_planes/VGLAdpInfo.va_line_width; Modified: projects/runtime-coverage-v2/lib/libvgl/mouse.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/mouse.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/lib/libvgl/mouse.c Sun Apr 28 02:27:04 2019 (r346801) @@ -105,37 +105,11 @@ static volatile sig_atomic_t VGLMsuppressint; void VGLMousePointerShow() { - byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4]; - VGLBitmap buffer = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf); - byte crtcidx, crtcval, gdcidx, gdcval; - int pos; - if (!VGLMouseVisible) { INTOFF(); VGLMouseVisible = 1; - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - crtcidx = inb(0x3c4); - crtcval = inb(0x3c5); - gdcidx = inb(0x3ce); - gdcval = inb(0x3cf); - } - buffer.PixelBytes = VGLDisplay->PixelBytes; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, - &buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - for (pos = 0; pos < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; pos++) - if (VGLMouseAndMask->Bitmap[pos]) - bcopy(&VGLMouseOrMask->Bitmap[pos*VGLDisplay->PixelBytes], - &buffer.Bitmap[pos*VGLDisplay->PixelBytes], - VGLDisplay->PixelBytes); - __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - outb(0x3c4, crtcidx); - outb(0x3c5, crtcval); - outb(0x3ce, gdcidx); - outb(0x3cf, gdcval); - } + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); INTON(); } } @@ -143,25 +117,11 @@ VGLMousePointerShow() void VGLMousePointerHide() { - byte crtcidx, crtcval, gdcidx, gdcval; - if (VGLMouseVisible) { INTOFF(); VGLMouseVisible = 0; - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - crtcidx = inb(0x3c4); - crtcval = inb(0x3c5); - gdcidx = inb(0x3ce); - gdcval = inb(0x3cf); - } __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - outb(0x3c4, crtcidx); - outb(0x3c5, crtcval); - outb(0x3ce, gdcidx); - outb(0x3cf, gdcval); - } INTON(); } } Modified: projects/runtime-coverage-v2/lib/libvgl/simple.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/simple.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/lib/libvgl/simple.c Sun Apr 28 02:27:04 2019 (r346801) @@ -51,7 +51,7 @@ static byte VGLSavePaletteBlue[256]; void VGLSetXY(VGLBitmap *object, int x, int y, u_long color) { - int offset, undermouse; + int offset, soffset, undermouse; VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { @@ -67,7 +67,6 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color switch (object->Type) { case VIDBUF8S: case VIDBUF16S: - case VIDBUF24S: case VIDBUF32S: offset = VGLSetSegment(offset); /* FALLTHROUGH */ @@ -92,6 +91,25 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color break; } break; + case VIDBUF24S: + soffset = VGLSetSegment(offset); + color = htole32(color); + switch (VGLAdpInfo.va_window_size - soffset) { + case 1: + memcpy(&object->Bitmap[soffset], &color, 1); + soffset = VGLSetSegment(offset + 1); + memcpy(&object->Bitmap[soffset], (byte *)&color + 1, 2); + break; + case 2: + memcpy(&object->Bitmap[soffset], &color, 2); + soffset = VGLSetSegment(offset + 2); + memcpy(&object->Bitmap[soffset], (byte *)&color + 2, 1); + break; + default: + memcpy(&object->Bitmap[soffset], &color, 3); + break; + } + break; case VIDBUF8X: outb(0x3c4, 0x02); outb(0x3c5, 0x01 << (x&0x3)); @@ -115,12 +133,19 @@ set_planar: } } -static u_long -__VGLGetXY(VGLBitmap *object, int x, int y) +u_long +VGLGetXY(VGLBitmap *object, int x, int y) { - int offset; u_long color; + int offset; + VGLCheckSwitch(); + if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) + return 0; + if (object == VGLDisplay) + object = &VGLVDisplay; + else if (object->Type != MEMBUF) + return 0; /* invalid */ offset = (y * object->VXsize + x) * object->PixelBytes; switch (object->PixelBytes) { case 1: @@ -139,19 +164,6 @@ __VGLGetXY(VGLBitmap *object, int x, int y) return 0; /* invalid */ } -u_long -VGLGetXY(VGLBitmap *object, int x, int y) -{ - VGLCheckSwitch(); - if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) - return 0; - if (object == VGLDisplay) - object = &VGLVDisplay; - else if (object->Type != MEMBUF) - return 0; /* invalid */ - return __VGLGetXY(object, x, y); -} - /* * Symmetric Double Step Line Algorithm by Brian Wyvill from * "Graphics Gems", Academic Press, 1990. @@ -458,7 +470,7 @@ VGLClear(VGLBitmap *object, u_long color) VGLCheckSwitch(); if (object == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(0, 0, object->Xsize, object->Ysize); + mouseoverlap = VGLMouseOverlap(0, 0, object->VXsize, object->VYsize); if (mouseoverlap) VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); Modified: projects/runtime-coverage-v2/libexec/rc/rc.initdiskless ============================================================================== --- projects/runtime-coverage-v2/libexec/rc/rc.initdiskless Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/libexec/rc/rc.initdiskless Sun Apr 28 02:27:04 2019 (r346801) @@ -208,7 +208,11 @@ handle_remount() { # $1 = mount point # The 'auto' parameter will attempt to use tmpfs(5), falls back to md(4). # $1 is size in 512-byte sectors, $2 is the mount point. mount_md() { - /sbin/mdmfs -s $1 auto $2 + if [ ${o_verbose} -gt 0 ] ; then + /sbin/mdmfs -XL -s $1 auto $2 + else + /sbin/mdmfs -s $1 auto $2 + fi } # Create the memory filesystem if it has not already been created Modified: projects/runtime-coverage-v2/stand/common/help.common ============================================================================== --- projects/runtime-coverage-v2/stand/common/help.common Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/stand/common/help.common Sun Apr 28 02:27:04 2019 (r346801) @@ -99,6 +99,13 @@ List loaded modules. If [-v] is specified, print more details. ################################################################################ +# Tmap-vdisk DMap virtual disk + + map-vdisk filename + + Map file as virtual disk. + +################################################################################ # Tmore DPage files more [ ...] @@ -395,6 +402,13 @@ unload This command removes any kernel and all loaded modules from memory. + +################################################################################ +# Tunmap-vdisk DUnmap virtual disk + + unmap-vdisk diskname + + Delete virtual disk mapping. ################################################################################ # Tunset DUnset a variable Copied: projects/runtime-coverage-v2/stand/common/vdisk.c (from r346800, head/stand/common/vdisk.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage-v2/stand/common/vdisk.c Sun Apr 28 02:27:04 2019 (r346801, copy of r346800, head/stand/common/vdisk.c) @@ -0,0 +1,417 @@ +/*- + * Copyright 2019 Toomas Soome + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int vdisk_init(void); +static int vdisk_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int vdisk_open(struct open_file *, ...); +static int vdisk_close(struct open_file *); +static int vdisk_ioctl(struct open_file *, u_long, void *); +static int vdisk_print(int); + +struct devsw vdisk_dev = { + .dv_name = "vdisk", + .dv_type = DEVT_DISK, + .dv_init = vdisk_init, + .dv_strategy = vdisk_strategy, + .dv_open = vdisk_open, + .dv_close = vdisk_close, + .dv_ioctl = vdisk_ioctl, + .dv_print = vdisk_print, + .dv_cleanup = NULL +}; + +typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t; + +typedef struct vdisk_info +{ + STAILQ_ENTRY(vdisk_info) vdisk_link; /* link in device list */ + char *vdisk_path; + int vdisk_unit; + int vdisk_fd; + uint64_t vdisk_size; /* size in bytes */ + uint32_t vdisk_sectorsz; + uint32_t vdisk_open; /* reference counter */ +} vdisk_info_t; + +static vdisk_info_list_t vdisk_list; /* list of mapped vdisks. */ + +static vdisk_info_t * +vdisk_get_info(struct devdesc *dev) +{ + vdisk_info_t *vd; + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (vd->vdisk_unit == dev->d_unit) + return (vd); + } + return (vd); +} + +COMMAND_SET(map_vdisk, "map-vdisk", "map file as virtual disk", command_mapvd); + +static int +command_mapvd(int argc, char *argv[]) +{ + vdisk_info_t *vd, *p; + struct stat sb; + + if (argc != 2) { + printf("usage: %s filename\n", argv[0]); + return (CMD_ERROR); + } + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (strcmp(vd->vdisk_path, argv[1]) == 0) { + printf("%s: file %s is already mapped as %s%d\n", + argv[0], argv[1], vdisk_dev.dv_name, + vd->vdisk_unit); + return (CMD_ERROR); + } + } + + if (stat(argv[1], &sb) < 0) { + /* + * ENOSYS is really ENOENT because we did try to walk + * through devsw list to try to open this file. + */ + if (errno == ENOSYS) + errno = ENOENT; + + printf("%s: stat failed: %s\n", argv[0], strerror(errno)); + return (CMD_ERROR); + } + + /* + * Avoid mapping small files. + */ + if (sb.st_size < 1024 * 1024) { + printf("%s: file %s is too small.\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + vd = calloc(1, sizeof (*vd)); + if (vd == NULL) { + printf("%s: out of memory\n", argv[0]); + return (CMD_ERROR); + } + vd->vdisk_path = strdup(argv[1]); + if (vd->vdisk_path == NULL) { + free (vd); + printf("%s: out of memory\n", argv[0]); + return (CMD_ERROR); + } + vd->vdisk_fd = open(vd->vdisk_path, O_RDONLY); + if (vd->vdisk_fd < 0) { + printf("%s: open failed: %s\n", argv[0], strerror(errno)); + free(vd->vdisk_path); + free(vd); + return (CMD_ERROR); + } + + vd->vdisk_size = sb.st_size; + vd->vdisk_sectorsz = DEV_BSIZE; + STAILQ_FOREACH(p, &vdisk_list, vdisk_link) { + vdisk_info_t *n; + if (p->vdisk_unit == vd->vdisk_unit) { + vd->vdisk_unit++; + continue; + } + n = STAILQ_NEXT(p, vdisk_link); + if (p->vdisk_unit < vd->vdisk_unit) { + if (n == NULL) { + /* p is last elem */ + STAILQ_INSERT_TAIL(&vdisk_list, vd, vdisk_link); + break; + } + if (n->vdisk_unit > vd->vdisk_unit) { + /* p < vd < n */ + STAILQ_INSERT_AFTER(&vdisk_list, p, vd, + vdisk_link); + break; + } + /* else n < vd or n == vd */ + vd->vdisk_unit++; + continue; + } + /* p > vd only if p is the first element */ + STAILQ_INSERT_HEAD(&vdisk_list, vd, vdisk_link); + break; + } + + /* if the list was empty or contiguous */ + if (p == NULL) + STAILQ_INSERT_TAIL(&vdisk_list, vd, vdisk_link); + + printf("%s: file %s is mapped as %s%d\n", argv[0], vd->vdisk_path, + vdisk_dev.dv_name, vd->vdisk_unit); + return (CMD_OK); +} + +COMMAND_SET(unmap_vdisk, "unmap-vdisk", "unmap virtual disk", command_unmapvd); + +/* + * unmap-vdisk vdiskX + */ +static int +command_unmapvd(int argc, char *argv[]) +{ + size_t len; + vdisk_info_t *vd; + long unit; + char *end; + + if (argc != 2) { + printf("usage: %s %sN\n", argv[0], vdisk_dev.dv_name); + return (CMD_ERROR); + } + + len = strlen(vdisk_dev.dv_name); + if (strncmp(vdisk_dev.dv_name, argv[1], len) != 0) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + errno = 0; + unit = strtol(argv[1] + len, &end, 10); + if (errno != 0 || (*end != '\0' && strcmp(end, ":") != 0)) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (vd->vdisk_unit == unit) + break; + } + + if (vd == NULL) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + if (vd->vdisk_open != 0) { + printf("%s: %s is in use, unable to unmap.\n", + argv[0], argv[1]); + return (CMD_ERROR); + } + + STAILQ_REMOVE(&vdisk_list, vd, vdisk_info, vdisk_link); + close(vd->vdisk_fd); + free(vd->vdisk_path); + free(vd); + printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path); + + return (CMD_OK); +} + +static int +vdisk_init(void) +{ + STAILQ_INIT(&vdisk_list); + return (0); +} + +static int +vdisk_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + ssize_t rv; + + dev = devdata; + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (size == 0 || (size % 512) != 0) + return (EIO); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + daddr_t offset; + + offset = dev->d_offset * vd->vdisk_sectorsz; + offset /= 512; + blk += offset; + } + if (lseek(vd->vdisk_fd, blk << 9, SEEK_SET) == -1) + return (EIO); + + errno = 0; + switch (rw & F_MASK) { + case F_READ: + rv = read(vd->vdisk_fd, buf, size); + break; + case F_WRITE: + rv = write(vd->vdisk_fd, buf, size); + break; + default: + return (ENOSYS); + } + + if (errno == 0 && rsize != NULL) { + *rsize = rv; + } + return (errno); +} + +static int +vdisk_open(struct open_file *f, ...) +{ + va_list args; + struct disk_devdesc *dev; + vdisk_info_t *vd; + int rc = 0; + + va_start(args, f); + dev = va_arg(args, struct disk_devdesc *); + va_end(args); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_open(dev, vd->vdisk_size, vd->vdisk_sectorsz); + } + if (rc == 0) + vd->vdisk_open++; + return (rc); +} + +static int +vdisk_close(struct open_file *f) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + + dev = (struct disk_devdesc *)(f->f_devdata); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + vd->vdisk_open--; + if (dev->dd.d_dev->dv_type == DEVT_DISK) + return (disk_close(dev)); + return (0); +} + +static int +vdisk_ioctl(struct open_file *f, u_long cmd, void *data) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + int rc; + + dev = (struct disk_devdesc *)(f->f_devdata); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + } + + switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *)data = vd->vdisk_sectorsz; + break; + case DIOCGMEDIASIZE: + *(uint64_t *)data = vd->vdisk_size; + break; + default: + return (ENOTTY); + } + return (0); +} + +static int +vdisk_print(int verbose) +{ + int ret = 0; + vdisk_info_t *vd; + char line[80]; + + if (STAILQ_EMPTY(&vdisk_list)) + return (ret); + + printf("%s devices:", vdisk_dev.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + struct disk_devdesc vd_dev; + + if (verbose) { + printf(" %s", vd->vdisk_path); + if ((ret = pager_output("\n")) != 0) + break; + } + snprintf(line, sizeof(line), + " %s%d", vdisk_dev.dv_name, vd->vdisk_unit); + printf("%s: %" PRIu64 " X %u blocks", line, + vd->vdisk_size / vd->vdisk_sectorsz, + vd->vdisk_sectorsz); + if ((ret = pager_output("\n")) != 0) + break; + + vd_dev.dd.d_dev = &vdisk_dev; + vd_dev.dd.d_unit = vd->vdisk_unit; + vd_dev.d_slice = -1; + vd_dev.d_partition = -1; + + ret = disk_open(&vd_dev, vd->vdisk_size, vd->vdisk_sectorsz); + if (ret == 0) { + ret = disk_print(&vd_dev, line, verbose); + disk_close(&vd_dev); + if (ret != 0) + break; + } else { + ret = 0; + } + } + + return (ret); +} Modified: projects/runtime-coverage-v2/stand/efi/loader/conf.c ============================================================================== --- projects/runtime-coverage-v2/stand/efi/loader/conf.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/stand/efi/loader/conf.c Sun Apr 28 02:27:04 2019 (r346801) @@ -33,11 +33,14 @@ __FBSDID("$FreeBSD$"); #include #include +extern struct devsw vdisk_dev; + struct devsw *devsw[] = { &efipart_fddev, &efipart_cddev, &efipart_hddev, &efinet_dev, + &vdisk_dev, #ifdef EFI_ZFS_BOOT &zfs_dev, #endif Modified: projects/runtime-coverage-v2/stand/i386/loader/conf.c ============================================================================== --- projects/runtime-coverage-v2/stand/i386/loader/conf.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/stand/i386/loader/conf.c Sun Apr 28 02:27:04 2019 (r346801) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #if defined(LOADER_FIREWIRE_SUPPORT) extern struct devsw fwohci; #endif +extern struct devsw vdisk_dev; /* Exported for libstand */ struct devsw *devsw[] = { @@ -60,6 +61,7 @@ struct devsw *devsw[] = { #if defined(LOADER_FIREWIRE_SUPPORT) &fwohci, #endif + &vdisk_dev, #if defined(LOADER_ZFS_SUPPORT) &zfs_dev, #endif Modified: projects/runtime-coverage-v2/stand/loader.mk ============================================================================== --- projects/runtime-coverage-v2/stand/loader.mk Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/stand/loader.mk Sun Apr 28 02:27:04 2019 (r346801) @@ -31,7 +31,7 @@ SRCS+= metadata.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -SRCS+= disk.c part.c +SRCS+= disk.c part.c vdisk.c .endif .if ${LOADER_NET_SUPPORT:Uno} == "yes" Modified: projects/runtime-coverage-v2/sys/arm/allwinner/a10/a10_padconf.c ============================================================================== --- projects/runtime-coverage-v2/sys/arm/allwinner/a10/a10_padconf.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/arm/allwinner/a10/a10_padconf.c Sun Apr 28 02:27:04 2019 (r346801) @@ -77,8 +77,8 @@ const static struct allwinner_pins a10_pins[] = { {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, Modified: projects/runtime-coverage-v2/sys/arm/allwinner/aw_rtc.c ============================================================================== --- projects/runtime-coverage-v2/sys/arm/allwinner/aw_rtc.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/arm/allwinner/aw_rtc.c Sun Apr 28 02:27:04 2019 (r346801) @@ -137,6 +137,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, + { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; Modified: projects/runtime-coverage-v2/sys/arm/allwinner/aw_syscon.c ============================================================================== --- projects/runtime-coverage-v2/sys/arm/allwinner/aw_syscon.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/arm/allwinner/aw_syscon.c Sun Apr 28 02:27:04 2019 (r346801) @@ -53,6 +53,7 @@ static struct ofw_compat_data compat_data[] = { {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, {"allwinner,sun8i-h3-system-control", 1}, + {"allwinner,sun50i-h5-system-control", 1}, {NULL, 0} }; Modified: projects/runtime-coverage-v2/sys/arm/allwinner/clkng/ccu_de2.c ============================================================================== --- projects/runtime-coverage-v2/sys/arm/allwinner/clkng/ccu_de2.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/arm/allwinner/clkng/ccu_de2.c Sun Apr 28 02:27:04 2019 (r346801) @@ -115,7 +115,6 @@ static struct aw_ccung_clk de2_ccu_clks[] = { static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-de2-clk", 1}, - {"allwinner,sun50i-h5-de2-clk", 1}, {NULL, 0} }; Modified: projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Apr 28 02:27:04 2019 (r346801) @@ -498,8 +498,10 @@ dsl_pool_close(dsl_pool_t *dp) rrw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); taskq_destroy(dp->dp_vnrele_taskq); - if (dp->dp_blkstats != NULL) + if (dp->dp_blkstats != NULL) { + mutex_destroy(&dp->dp_blkstats->zab_lock); kmem_free(dp->dp_blkstats, sizeof (zfs_all_blkstats_t)); + } kmem_free(dp, sizeof (dsl_pool_t)); } Modified: projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Sun Apr 28 02:27:04 2019 (r346801) @@ -84,7 +84,7 @@ void range_tree_init(void); void range_tree_fini(void); range_tree_t *range_tree_create_impl(range_tree_ops_t *ops, void *arg, int (*avl_compare)(const void*, const void*), uint64_t gap); - range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); void range_tree_destroy(range_tree_t *rt); boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); range_seg_t *range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size); @@ -108,13 +108,6 @@ void range_tree_clear(range_tree_t *rt, uint64_t start void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); range_seg_t *range_tree_first(range_tree_t *rt); - -void rt_avl_create(range_tree_t *rt, void *arg); -void rt_avl_destroy(range_tree_t *rt, void *arg); -void rt_avl_add(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_remove(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_vacate(range_tree_t *rt, void *arg); -extern struct range_tree_ops rt_avl_ops; void rt_avl_create(range_tree_t *rt, void *arg); void rt_avl_destroy(range_tree_t *rt, void *arg); Modified: projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Apr 28 02:27:04 2019 (r346801) @@ -10460,7 +10460,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* readlinkat */ case 500: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* renameat */ case 501: Modified: projects/runtime-coverage-v2/sys/kern/systrace_args.c ============================================================================== --- projects/runtime-coverage-v2/sys/kern/systrace_args.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/kern/systrace_args.c Sun Apr 28 02:27:04 2019 (r346801) @@ -10421,7 +10421,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* readlinkat */ case 500: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* renameat */ case 501: Modified: projects/runtime-coverage-v2/sys/kern/vfs_bio.c ============================================================================== --- projects/runtime-coverage-v2/sys/kern/vfs_bio.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/kern/vfs_bio.c Sun Apr 28 02:27:04 2019 (r346801) @@ -4424,7 +4424,7 @@ bufwait(struct buf *bp) * read error occurred, or if the op was a write. B_CACHE is never * set if the buffer is invalid or otherwise uncacheable. * - * biodone does not mess with B_INVAL, allowing the I/O routine or the + * bufdone does not mess with B_INVAL, allowing the I/O routine or the * initiator to leave B_INVAL set to brelse the buffer out of existence * in the biodone routine. */ Modified: projects/runtime-coverage-v2/sys/modules/fusefs/Makefile ============================================================================== --- projects/runtime-coverage-v2/sys/modules/fusefs/Makefile Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/modules/fusefs/Makefile Sun Apr 28 02:27:04 2019 (r346801) @@ -8,6 +8,22 @@ SRCS= vnode_if.h \ fuse_vfsops.c fuse_vnops.c fuse_internal.c fuse_main.c # Symlink for backwards compatibility with systems installed at 12.0 or older +.if ${MACHINE_CPUARCH} != "powerpc" SYMLINKS= ${KMOD}.ko ${KMODDIR}/fuse.ko +.else +# Some PPC systems use msdosfs for /boot, which can't handle links or symlinks +afterinstall: alias alias_debug +alias: .PHONY + ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/fuse.ko +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && "${MK_KERNEL_SYMBOLS}" != "no" +alias_debug: .PHONY + ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG}.debug \ + ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/fuse.ko +.else +alias_debug: .PHONY +.endif +.endif .include Modified: projects/runtime-coverage-v2/sys/powerpc/aim/aim_machdep.c ============================================================================== --- projects/runtime-coverage-v2/sys/powerpc/aim/aim_machdep.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/powerpc/aim/aim_machdep.c Sun Apr 28 02:27:04 2019 (r346801) @@ -213,6 +213,7 @@ aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_of case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: /* XXX: get from ibm,slb-size in device tree */ n_slbs = 32; Modified: projects/runtime-coverage-v2/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- projects/runtime-coverage-v2/sys/powerpc/aim/mp_cpudep.c Sun Apr 28 02:24:22 2019 (r346800) +++ projects/runtime-coverage-v2/sys/powerpc/aim/mp_cpudep.c Sun Apr 28 02:27:04 2019 (r346801) @@ -85,6 +85,7 @@ cpudep_ap_early_bootstrap(void) break; case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sun Apr 28 02:24:23 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286931566A16 for ; Sun, 28 Apr 2019 02:24:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C155277710; Sun, 28 Apr 2019 02:24:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96A204321; Sun, 28 Apr 2019 02:24:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S2OMgZ068011; Sun, 28 Apr 2019 02:24:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S2OM1W068010; Sun, 28 Apr 2019 02:24:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904280224.x3S2OM1W068010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 28 Apr 2019 02:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346800 - projects/runtime-coverage-v2 X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2 X-SVN-Commit-Revision: 346800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C155277710 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 02:24:23 -0000 Author: ngie Date: Sun Apr 28 02:24:22 2019 New Revision: 346800 URL: https://svnweb.freebsd.org/changeset/base/346800 Log: Handle installing the coverage libraries to the directory used by "make universe" Modified: projects/runtime-coverage-v2/Makefile.inc1 Modified: projects/runtime-coverage-v2/Makefile.inc1 ============================================================================== --- projects/runtime-coverage-v2/Makefile.inc1 Sat Apr 27 23:47:14 2019 (r346799) +++ projects/runtime-coverage-v2/Makefile.inc1 Sun Apr 28 02:24:22 2019 (r346800) @@ -2724,13 +2724,16 @@ _coverage_libs+= lib/libclang_rt/profile .endif _target_toolchain_libs: .PHONY .MAKE -.for _tool in \ +.for _lib in \ ${_coverage_libs} - ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ - cd ${.CURDIR}/${_tool}; \ - if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ - ${MAKE} DIRPRFX=${_tool}/ all; \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP} install + ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ + cd ${.CURDIR}/${_lib}; \ + if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_lib}/ obj; fi; \ + ${MAKE} DIRPRFX=${_lib}/ all; \ + ${MAKE} DIRPRFX=${_lib}/ DESTDIR=${WORLDTMP} install; \ + if [ -d "${HOST_OBJTOP}" ]; then \ + ${MAKE} DIRPRFX=${_lib}/ DESTDIR=${HOST_OBJTOP} install; \ + fi .endfor # From owner-svn-src-projects@freebsd.org Sun Apr 28 09:41:47 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C704E1578A16 for ; Sun, 28 Apr 2019 09:41:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D3D18BFD8; Sun, 28 Apr 2019 09:41:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C268DB6; Sun, 28 Apr 2019 09:41:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9flIu098986; Sun, 28 Apr 2019 09:41:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9flF8098985; Sun, 28 Apr 2019 09:41:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904280941.x3S9flF8098985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 28 Apr 2019 09:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346809 - projects/runtime-coverage-v2 X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2 X-SVN-Commit-Revision: 346809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D3D18BFD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:41:47 -0000 Author: ngie Date: Sun Apr 28 09:41:46 2019 New Revision: 346809 URL: https://svnweb.freebsd.org/changeset/base/346809 Log: Fix "make universe" pathing by adding a missing tmp path component Modified: projects/runtime-coverage-v2/Makefile.inc1 Modified: projects/runtime-coverage-v2/Makefile.inc1 ============================================================================== --- projects/runtime-coverage-v2/Makefile.inc1 Sun Apr 28 09:38:41 2019 (r346808) +++ projects/runtime-coverage-v2/Makefile.inc1 Sun Apr 28 09:41:46 2019 (r346809) @@ -2731,8 +2731,9 @@ _target_toolchain_libs: .PHONY .MAKE if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_lib}/ obj; fi; \ ${MAKE} DIRPRFX=${_lib}/ all; \ ${MAKE} DIRPRFX=${_lib}/ DESTDIR=${WORLDTMP} install; \ - if [ -d "${HOST_OBJTOP}" ]; then \ - ${MAKE} DIRPRFX=${_lib}/ DESTDIR=${HOST_OBJTOP} install; \ + if [ -d "${HOST_OBJTOP}/tmp" ]; then \ + ${MAKE} DIRPRFX=${_lib}/ DESTDIR="${HOST_OBJTOP}/tmp" \ + install; \ fi .endfor From owner-svn-src-projects@freebsd.org Sun Apr 28 23:39:20 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BECA5158D594 for ; Sun, 28 Apr 2019 23:39:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61EAF82374; Sun, 28 Apr 2019 23:39:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3865E19C8C; Sun, 28 Apr 2019 23:39:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SNdJP3045798; Sun, 28 Apr 2019 23:39:19 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SNdJXd045797; Sun, 28 Apr 2019 23:39:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904282339.x3SNdJXd045797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 28 Apr 2019 23:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346857 - projects/nfsv42/sys/fs/nfsclient X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfsv42/sys/fs/nfsclient X-SVN-Commit-Revision: 346857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61EAF82374 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 23:39:20 -0000 Author: rmacklem Date: Sun Apr 28 23:39:19 2019 New Revision: 346857 URL: https://svnweb.freebsd.org/changeset/base/346857 Log: Delete some debug printfs. Modified: projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c Modified: projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c Sun Apr 28 22:37:59 2019 (r346856) +++ projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c Sun Apr 28 23:39:19 2019 (r346857) @@ -3501,10 +3501,8 @@ nfs_allocate(struct vop_allocate_args *ap) attrflag = 0; nmp = VFSTONFS(vp->v_mount); if (NFSHASNFSV4(nmp) && nmp->nm_minorvers >= NFSV42_MINORVERSION) { -printf("at alloc\n"); error = nfsrpc_allocate(vp, *ap->a_offset, *ap->a_len, &nfsva, &attrflag, td->td_ucred, td, NULL); -printf("aft alloc=%d\n", error); if (error == 0) { *ap->a_offset += *ap->a_len; *ap->a_len = 0; @@ -3517,7 +3515,6 @@ printf("aft alloc=%d\n", error); */ if (error != 0) error = vop_stdallocate(ap); -printf("aft stdalloc=%d af=%d\n", error, attrflag); if (attrflag != 0) { ret = nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); if (error == 0 && ret != 0) @@ -3525,7 +3522,6 @@ printf("aft stdalloc=%d af=%d\n", error, attrflag); } if (error != 0) error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); -printf("eo alloc=%d\n", error); return (error); } From owner-svn-src-projects@freebsd.org Sun Apr 28 23:46:02 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9D4158D9F4 for ; Sun, 28 Apr 2019 23:46:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC708293B; Sun, 28 Apr 2019 23:46:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7B8219E33; Sun, 28 Apr 2019 23:46:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SNk1cc050770; Sun, 28 Apr 2019 23:46:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SNk1ad050769; Sun, 28 Apr 2019 23:46:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904282346.x3SNk1ad050769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 28 Apr 2019 23:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346858 - projects/nfsv42/sys/fs/nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfsv42/sys/fs/nfsserver X-SVN-Commit-Revision: 346858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CC708293B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 23:46:02 -0000 Author: rmacklem Date: Sun Apr 28 23:46:01 2019 New Revision: 346858 URL: https://svnweb.freebsd.org/changeset/base/346858 Log: Add the standard check for V4 root security to nfsrvd_allocate(). Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sun Apr 28 23:39:19 2019 (r346857) +++ projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sun Apr 28 23:46:01 2019 (r346858) @@ -5108,6 +5108,10 @@ nfsrvd_allocate(struct nfsrv_descript *nd, __unused in nfsquad_t clientid; nfsattrbit_t attrbits; + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { + nd->nd_repstat = NFSERR_WRONGSEC; + goto nfsmout; + } NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID + 2 * NFSX_HYPER); stp->ls_flags = (NFSLCK_CHECK | NFSLCK_WRITEACCESS); lop->lo_flags = NFSLCK_WRITE; From owner-svn-src-projects@freebsd.org Mon Apr 29 01:40:37 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0F18159002D for ; Mon, 29 Apr 2019 01:40:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C4685CFA; Mon, 29 Apr 2019 01:40:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BBF01B0D5; Mon, 29 Apr 2019 01:40:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T1ebaZ008476; Mon, 29 Apr 2019 01:40:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T1eZCF008471; Mon, 29 Apr 2019 01:40:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904290140.x3T1eZCF008471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 29 Apr 2019 01:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346868 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 346868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51C4685CFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 01:40:37 -0000 Author: asomers Date: Mon Apr 29 01:40:35 2019 New Revision: 346868 URL: https://svnweb.freebsd.org/changeset/base/346868 Log: fusefs: FIFO support Sponsored by: The FreeBSD Foundation Added: projects/fuse2/tests/sys/fs/fusefs/fifo.cc (contents, props changed) Modified: projects/fuse2/sys/fs/fuse/fuse_main.c projects/fuse2/sys/fs/fuse/fuse_node.c projects/fuse2/sys/fs/fuse/fuse_node.h projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/Makefile Modified: projects/fuse2/sys/fs/fuse/fuse_main.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_main.c Mon Apr 29 01:22:58 2019 (r346867) +++ projects/fuse2/sys/fs/fuse/fuse_main.c Mon Apr 29 01:40:35 2019 (r346868) @@ -85,6 +85,7 @@ struct mtx fuse_mtx; extern struct vfsops fuse_vfsops; extern struct cdevsw fuse_cdevsw; +extern struct vop_vector fuse_fifonops; extern struct vop_vector fuse_vnops; extern uma_zone_t fuse_pbuf_zone; Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Mon Apr 29 01:22:58 2019 (r346867) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Mon Apr 29 01:40:35 2019 (r346868) @@ -248,7 +248,14 @@ fuse_vnode_alloc(struct mount *mp, return (0); } fvdat = malloc(sizeof(*fvdat), M_FUSEVN, M_WAITOK | M_ZERO); - err = getnewvnode("fuse", mp, &fuse_vnops, vpp); + switch (vtyp) { + case VFIFO: + err = getnewvnode("fuse", mp, &fuse_fifoops, vpp); + break; + default: + err = getnewvnode("fuse", mp, &fuse_vnops, vpp); + break; + } if (err) { free(fvdat, M_FUSEVN); return (err); Modified: projects/fuse2/sys/fs/fuse/fuse_node.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.h Mon Apr 29 01:22:58 2019 (r346867) +++ projects/fuse2/sys/fs/fuse/fuse_node.h Mon Apr 29 01:40:35 2019 (r346868) @@ -114,6 +114,7 @@ VTOVA(struct vnode *vp) #define FUSE_NULL_ID 0 +extern struct vop_vector fuse_fifoops; extern struct vop_vector fuse_vnops; static inline void Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 29 01:22:58 2019 (r346867) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 29 01:40:35 2019 (r346868) @@ -120,6 +120,7 @@ SDT_PROBE_DEFINE2(fusefs, , vnops, trace, "int", "char /* vnode ops */ static vop_access_t fuse_vnop_access; static vop_advlock_t fuse_vnop_advlock; +static vop_close_t fuse_fifo_close; static vop_close_t fuse_vnop_close; static vop_create_t fuse_vnop_create; static vop_deleteextattr_t fuse_vnop_deleteextattr; @@ -151,6 +152,21 @@ static vop_getpages_t fuse_vnop_getpages; static vop_putpages_t fuse_vnop_putpages; static vop_print_t fuse_vnop_print; +struct vop_vector fuse_fifoops = { + .vop_default = &fifo_specops, + .vop_access = fuse_vnop_access, + .vop_close = fuse_fifo_close, + .vop_fsync = fuse_vnop_fsync, + .vop_getattr = fuse_vnop_getattr, + .vop_inactive = fuse_vnop_inactive, + .vop_pathconf = fuse_vnop_pathconf, + .vop_print = fuse_vnop_print, + .vop_read = VOP_PANIC, + .vop_reclaim = fuse_vnop_reclaim, + .vop_setattr = fuse_vnop_setattr, + .vop_write = VOP_PANIC, +}; + struct vop_vector fuse_vnops = { .vop_default = &default_vnodeops, .vop_access = fuse_vnop_access, @@ -290,6 +306,13 @@ fuse_flush(struct vnode *vp, struct ucred *cred, pid_t } fdisp_destroy(&fdi); return err; +} + +/* Close wrapper for fifos. */ +static int +fuse_fifo_close(struct vop_close_args *ap) +{ + return (fifo_specops.vop_close(ap)); } /* Modified: projects/fuse2/tests/sys/fs/fusefs/Makefile ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/Makefile Mon Apr 29 01:22:58 2019 (r346867) +++ projects/fuse2/tests/sys/fs/fusefs/Makefile Mon Apr 29 01:40:35 2019 (r346868) @@ -12,6 +12,7 @@ GTESTS+= allow_other GTESTS+= create GTESTS+= default_permissions GTESTS+= destroy +GTESTS+= fifo GTESTS+= flush GTESTS+= fsync GTESTS+= fsyncdir Added: projects/fuse2/tests/sys/fs/fusefs/fifo.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/fuse2/tests/sys/fs/fusefs/fifo.cc Mon Apr 29 01:40:35 2019 (r346868) @@ -0,0 +1,96 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by BFF Storage Systems, LLC under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +extern "C" { +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +const char FULLPATH[] = "mountpoint/some_fifo"; +const char RELPATH[] = "some_fifo"; +const char MESSAGE[] = "Hello, World!\n"; +const int msgsize = sizeof(MESSAGE); + +class Fifo: public FuseTest { +}; + +/* Writer thread */ +static void* writer(void* arg) { + ssize_t sent = 0; + int fd; + + fd = *(int*)arg; + while (sent < msgsize) { + ssize_t r; + + r = write(fd, MESSAGE + sent, msgsize - sent); + if (r < 0) + return (void*)(intptr_t)errno; + else + sent += r; + + } + return 0; +} + +/* + * Reading and writing FIFOs works. None of the I/O actually goes through FUSE + */ +TEST_F(Fifo, read_write) +{ + pthread_t th0; + mode_t mode = S_IFIFO | 0755; + const int bufsize = 80; + char message[bufsize]; + ssize_t recvd = 0, r; + uint64_t ino = 42; + int fd; + + expect_lookup(RELPATH, ino, mode, 0, 1); + + fd = open(FULLPATH, O_RDWR); + ASSERT_LE(0, fd) << strerror(errno); + ASSERT_EQ(0, pthread_create(&th0, NULL, writer, &fd)) + << strerror(errno); + while (recvd < msgsize) { + r = read(fd, message + recvd, bufsize - recvd); + ASSERT_LE(0, r) << strerror(errno); + ASSERT_LT(0, r) << "unexpected EOF"; + recvd += r; + } + ASSERT_STREQ(message, MESSAGE); + + /* Deliberately leak fd */ +} From owner-svn-src-projects@freebsd.org Mon Apr 29 16:23:30 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 046301595A47 for ; Mon, 29 Apr 2019 16:23:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A03E38B117; Mon, 29 Apr 2019 16:23:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96ADC24840; Mon, 29 Apr 2019 16:23:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGNTWH076246; Mon, 29 Apr 2019 16:23:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGNTxn076245; Mon, 29 Apr 2019 16:23:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904291623.x3TGNTxn076245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 29 Apr 2019 16:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346893 - projects/fuse2/tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/tests/sys/fs/fusefs X-SVN-Commit-Revision: 346893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A03E38B117 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:23:30 -0000 Author: asomers Date: Mon Apr 29 16:23:29 2019 New Revision: 346893 URL: https://svnweb.freebsd.org/changeset/base/346893 Log: fusefs: remove an obsolete fifo test This should've been part of r346868 Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/tests/sys/fs/fusefs/open.cc Modified: projects/fuse2/tests/sys/fs/fusefs/open.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/open.cc Mon Apr 29 16:16:00 2019 (r346892) +++ projects/fuse2/tests/sys/fs/fusefs/open.cc Mon Apr 29 16:23:29 2019 (r346893) @@ -138,26 +138,6 @@ TEST_F(Open, eperm) EXPECT_EQ(EPERM, errno); } -/* fusefs(5) does not yet support I/O on fifos. But it shouldn't crash. */ -TEST_F(Open, fifo) -{ - const char FULLPATH[] = "mountpoint/zero"; - const char RELPATH[] = "zero"; - uint64_t ino = 42; - - EXPECT_LOOKUP(1, RELPATH) - .WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto out) { - SET_OUT_HEADER_LEN(out, entry); - out->body.entry.attr.mode = S_IFIFO | 0644; - out->body.entry.nodeid = ino; - out->body.entry.attr.nlink = 1; - out->body.entry.attr_valid = UINT64_MAX; - }))); - - ASSERT_EQ(-1, open(FULLPATH, O_RDONLY)); - EXPECT_EQ(EOPNOTSUPP, errno); -} - /* * fusefs must issue multiple FUSE_OPEN operations if clients with different * credentials open the same file, even if they use the same mode. This is From owner-svn-src-projects@freebsd.org Mon Apr 29 16:24:53 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA591595B2D for ; Mon, 29 Apr 2019 16:24:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55BB68B33F; Mon, 29 Apr 2019 16:24:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181F024847; Mon, 29 Apr 2019 16:24:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGOp5H076345; Mon, 29 Apr 2019 16:24:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGOpEf076342; Mon, 29 Apr 2019 16:24:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904291624.x3TGOpEf076342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 29 Apr 2019 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346894 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 346894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55BB68B33F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:24:53 -0000 Author: asomers Date: Mon Apr 29 16:24:51 2019 New Revision: 346894 URL: https://svnweb.freebsd.org/changeset/base/346894 Log: fusefs: support unix-domain sockets Also, fix the teardown of the Fifo.read_write test Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/create.cc projects/fuse2/tests/sys/fs/fusefs/fifo.cc Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 29 16:23:29 2019 (r346893) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon Apr 29 16:24:51 2019 (r346894) @@ -548,7 +548,7 @@ fuse_vnop_create(struct vop_create_args *ap) } bzero(&fdi, sizeof(fdi)); - if ((vap->va_type != VREG)) + if ((vap->va_type != VREG && vap->va_type != VSOCK)) return (EINVAL); if (!fsess_isimpl(mp, FUSE_CREATE)) { @@ -583,7 +583,7 @@ fuse_vnop_create(struct vop_create_args *ap) feo = fdip->answ; - if ((err = fuse_internal_checkentry(feo, VREG))) { + if ((err = fuse_internal_checkentry(feo, vap->va_type))) { goto out; } @@ -603,7 +603,7 @@ fuse_vnop_create(struct vop_create_args *ap) goto out; foo = fdip2->answ; } - err = fuse_vnode_get(mp, feo, feo->nodeid, dvp, vpp, cnp, VREG); + err = fuse_vnode_get(mp, feo, feo->nodeid, dvp, vpp, cnp, vap->va_type); if (err) { struct fuse_release_in *fri; uint64_t nodeid = feo->nodeid; Modified: projects/fuse2/tests/sys/fs/fusefs/create.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/create.cc Mon Apr 29 16:23:29 2019 (r346893) +++ projects/fuse2/tests/sys/fs/fusefs/create.cc Mon Apr 29 16:24:51 2019 (r346894) @@ -30,6 +30,8 @@ extern "C" { #include +#include +#include } #include "mockfs.hh" @@ -40,13 +42,14 @@ using namespace testing; class Create: public FuseTest { public: -void expect_create(const char *relpath, ProcessMockerT r) +void expect_create(const char *relpath, mode_t mode, ProcessMockerT r) { EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { const char *name = (const char*)in->body.bytes + sizeof(fuse_open_in); return (in->header.opcode == FUSE_CREATE && + in->body.open.mode == mode && (0 == strcmp(relpath, name))); }, Eq(true)), _) @@ -63,14 +66,15 @@ TEST_F(Create, attr_cache) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; uint64_t ino = 42; int fd; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnImmediate([=](auto in __unused, auto out) { + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, create); - out->body.create.entry.attr.mode = S_IFREG | mode; + out->body.create.entry.attr.mode = mode; out->body.create.entry.nodeid = ino; out->body.create.entry.entry_valid = UINT64_MAX; out->body.create.entry.attr_valid = UINT64_MAX; @@ -98,10 +102,10 @@ TEST_F(Create, eexist) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnErrno(EEXIST)); + expect_create(RELPATH, mode, ReturnErrno(EEXIST)); EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EEXIST, errno); } @@ -114,12 +118,12 @@ TEST_F(Create, Enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; uint64_t ino = 42; int fd; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnErrno(ENOSYS)); + expect_create(RELPATH, mode, ReturnErrno(ENOSYS)); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -133,7 +137,7 @@ TEST_F(Create, Enosys) _) ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, entry); - out->body.entry.attr.mode = S_IFREG | mode; + out->body.entry.attr.mode = mode; out->body.entry.nodeid = ino; out->body.entry.entry_valid = UINT64_MAX; out->body.entry.attr_valid = UINT64_MAX; @@ -162,7 +166,7 @@ TEST_F(Create, entry_cache_negative) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; uint64_t ino = 42; int fd; /* @@ -174,9 +178,10 @@ TEST_F(Create, entry_cache_negative) /* create will first do a LOOKUP, adding a negative cache entry */ EXPECT_LOOKUP(1, RELPATH).WillOnce(ReturnNegativeCache(&entry_valid)); - expect_create(RELPATH, ReturnImmediate([=](auto in __unused, auto out) { + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, create); - out->body.create.entry.attr.mode = S_IFREG | mode; + out->body.create.entry.attr.mode = mode; out->body.create.entry.nodeid = ino; out->body.create.entry.entry_valid = UINT64_MAX; out->body.create.entry.attr_valid = UINT64_MAX; @@ -194,7 +199,7 @@ TEST_F(Create, entry_cache_negative_purge) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; uint64_t ino = 42; int fd; struct timespec entry_valid = {.tv_sec = TIME_T_MAX, .tv_nsec = 0}; @@ -205,9 +210,10 @@ TEST_F(Create, entry_cache_negative_purge) .RetiresOnSaturation(); /* Then the CREATE should purge the negative cache entry */ - expect_create(RELPATH, ReturnImmediate([=](auto in __unused, auto out) { + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, create); - out->body.create.entry.attr.mode = S_IFREG | mode; + out->body.create.entry.attr.mode = mode; out->body.create.entry.nodeid = ino; out->body.create.entry.attr_valid = UINT64_MAX; })); @@ -230,10 +236,10 @@ TEST_F(Create, eperm) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnErrno(EPERM)); + expect_create(RELPATH, mode, ReturnErrno(EPERM)); EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EPERM, errno); @@ -243,14 +249,15 @@ TEST_F(Create, ok) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0755; + mode_t mode = S_IFREG | 0755; uint64_t ino = 42; int fd; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnImmediate([=](auto in __unused, auto out) { + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, create); - out->body.create.entry.attr.mode = S_IFREG | mode; + out->body.create.entry.attr.mode = mode; out->body.create.entry.nodeid = ino; out->body.create.entry.entry_valid = UINT64_MAX; out->body.create.entry.attr_valid = UINT64_MAX; @@ -261,6 +268,34 @@ TEST_F(Create, ok) /* Deliberately leak fd. close(2) will be tested in release.cc */ } +/* Create a unix-domain socket */ +TEST_F(Create, socket) +{ + const char FULLPATH[] = "mountpoint/some_sock"; + const char RELPATH[] = "some_sock"; + mode_t mode = S_IFSOCK | 0755; + struct sockaddr_un sa; + uint64_t ino = 42; + int fd; + + EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, create); + out->body.create.entry.attr.mode = mode; + out->body.create.entry.nodeid = ino; + out->body.create.entry.entry_valid = UINT64_MAX; + out->body.create.entry.attr_valid = UINT64_MAX; + })); + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + ASSERT_LE(0, fd) << strerror(errno); + sa.sun_family = AF_UNIX; + strlcpy(sa.sun_path, FULLPATH, sizeof(sa.sun_path)); + ASSERT_EQ(0, bind(fd, (struct sockaddr*)&sa, sizeof(sa))) + << strerror(errno); +} + /* * A regression test for a bug that affected old FUSE implementations: * open(..., O_WRONLY | O_CREAT, 0444) should work despite the seeming @@ -273,14 +308,15 @@ TEST_F(Create, wronly_0444) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - mode_t mode = 0444; + mode_t mode = S_IFREG | 0444; uint64_t ino = 42; int fd; EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); - expect_create(RELPATH, ReturnImmediate([=](auto in __unused, auto out) { + expect_create(RELPATH, mode, + ReturnImmediate([=](auto in __unused, auto out) { SET_OUT_HEADER_LEN(out, create); - out->body.create.entry.attr.mode = S_IFREG | mode; + out->body.create.entry.attr.mode = mode; out->body.create.entry.nodeid = ino; out->body.create.entry.entry_valid = UINT64_MAX; out->body.create.entry.attr_valid = UINT64_MAX; Modified: projects/fuse2/tests/sys/fs/fusefs/fifo.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/fifo.cc Mon Apr 29 16:23:29 2019 (r346893) +++ projects/fuse2/tests/sys/fs/fusefs/fifo.cc Mon Apr 29 16:24:51 2019 (r346894) @@ -30,6 +30,8 @@ extern "C" { #include +#include +#include #include } @@ -44,8 +46,21 @@ const char MESSAGE[] = "Hello, World!\n"; const int msgsize = sizeof(MESSAGE); class Fifo: public FuseTest { +public: +pthread_t m_child; + +Fifo(): m_child(NULL) {}; + +void TearDown() { + if (m_child != NULL) { + pthread_join(m_child, NULL); + } + FuseTest::TearDown(); +} }; +class Socket: public Fifo {}; + /* Writer thread */ static void* writer(void* arg) { ssize_t sent = 0; @@ -70,7 +85,6 @@ static void* writer(void* arg) { */ TEST_F(Fifo, read_write) { - pthread_t th0; mode_t mode = S_IFIFO | 0755; const int bufsize = 80; char message[bufsize]; @@ -82,10 +96,105 @@ TEST_F(Fifo, read_write) fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); - ASSERT_EQ(0, pthread_create(&th0, NULL, writer, &fd)) + ASSERT_EQ(0, pthread_create(&m_child, NULL, writer, &fd)) << strerror(errno); while (recvd < msgsize) { r = read(fd, message + recvd, bufsize - recvd); + ASSERT_LE(0, r) << strerror(errno); + ASSERT_LT(0, r) << "unexpected EOF"; + recvd += r; + } + ASSERT_STREQ(message, MESSAGE); + + /* Deliberately leak fd */ +} + +/* Writer thread */ +static void* socket_writer(void* arg __unused) { + ssize_t sent = 0; + int fd, err; + struct sockaddr_un sa; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) { + perror("socket"); + return (void*)(intptr_t)errno; + } + sa.sun_family = AF_UNIX; + strlcpy(sa.sun_path, FULLPATH, sizeof(sa.sun_path)); + err = connect(fd, (struct sockaddr*)&sa, sizeof(sa)); + if (err < 0) { + perror("connect"); + return (void*)(intptr_t)errno; + } + + while (sent < msgsize) { + ssize_t r; + + r = write(fd, MESSAGE + sent, msgsize - sent); + if (r < 0) + return (void*)(intptr_t)errno; + else + sent += r; + + } + return 0; +} + +/* + * Reading and writing unix-domain sockets works. None of the I/O actually + * goes through FUSE. + */ +TEST_F(Socket, read_write) +{ + mode_t mode = S_IFSOCK | 0755; + const int bufsize = 80; + char message[bufsize]; + struct sockaddr_un sa; + ssize_t recvd = 0, r; + uint64_t ino = 42; + int fd, connected; + Sequence seq; + + EXPECT_LOOKUP(1, RELPATH).WillOnce(Invoke(ReturnErrno(ENOENT))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in->header.opcode == FUSE_CREATE); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, create); + out->body.create.entry.attr.mode = mode; + out->body.create.entry.nodeid = ino; + out->body.create.entry.entry_valid = UINT64_MAX; + out->body.create.entry.attr_valid = UINT64_MAX; + }))); + EXPECT_LOOKUP(1, RELPATH) + .InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.attr.nlink = 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = UINT64_MAX; + }))); + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + ASSERT_LE(0, fd) << strerror(errno); + sa.sun_family = AF_UNIX; + strlcpy(sa.sun_path, FULLPATH, sizeof(sa.sun_path)); + ASSERT_EQ(0, bind(fd, (struct sockaddr*)&sa, sizeof(sa))) + << strerror(errno); + listen(fd, 5); + ASSERT_EQ(0, pthread_create(&m_child, NULL, socket_writer, NULL)) + << strerror(errno); + connected = accept(fd, 0, 0); + ASSERT_LE(0, connected) << strerror(errno); + + while (recvd < msgsize) { + r = read(connected, message + recvd, bufsize - recvd); ASSERT_LE(0, r) << strerror(errno); ASSERT_LT(0, r) << "unexpected EOF"; recvd += r; From owner-svn-src-projects@freebsd.org Mon Apr 29 20:17:54 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEFBE159C7C4 for ; Mon, 29 Apr 2019 20:17:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 750BE71593; Mon, 29 Apr 2019 20:17:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49EDF27094; Mon, 29 Apr 2019 20:17:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TKHsQr099787; Mon, 29 Apr 2019 20:17:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TKHsST099786; Mon, 29 Apr 2019 20:17:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904292017.x3TKHsST099786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 20:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346924 - projects/runtime-coverage-v2 X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2 X-SVN-Commit-Revision: 346924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 750BE71593 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 20:17:55 -0000 Author: ngie Date: Mon Apr 29 20:17:53 2019 New Revision: 346924 URL: https://svnweb.freebsd.org/changeset/base/346924 Log: Pass `MK_COVERAGE_SUPPORT` from _libraries instead of libraries This matches more of the pattern used by libraries and I suspect will result in more correct behavior when building `_coverage_libs` as part of the `_target_toolchain_libs` target. Modified: projects/runtime-coverage-v2/Makefile.inc1 Modified: projects/runtime-coverage-v2/Makefile.inc1 ============================================================================== --- projects/runtime-coverage-v2/Makefile.inc1 Mon Apr 29 20:10:28 2019 (r346923) +++ projects/runtime-coverage-v2/Makefile.inc1 Mon Apr 29 20:17:53 2019 (r346924) @@ -1115,7 +1115,8 @@ _libraries: @echo ">>> stage 4.2: building libraries" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ - ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \ + ${WMAKE} -DNO_FSCHG -DNO_LINT \ + MK_COVERAGE_SUPPORT=${MK_COVERAGE} MK_HTML=no MK_MAN=no \ MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} \ libraries everything: .PHONY @@ -2707,8 +2708,7 @@ hierarchy hier: .MAKE .PHONY # libraries: .MAKE .PHONY ${_+_}cd ${.CURDIR}; \ - ${MAKE} -f Makefile.inc1 _target_toolchain_libs MK_COVERAGE=no \ - MK_COVERAGE_SUPPORT=${MK_COVERAGE}; \ + ${MAKE} -f Makefile.inc1 _target_toolchain_libs; \ ${MAKE} -f Makefile.inc1 _prereq_libs; \ ${MAKE} -f Makefile.inc1 _startup_libs; \ ${MAKE} -f Makefile.inc1 _prebuild_libs; \ From owner-svn-src-projects@freebsd.org Mon Apr 29 20:19:24 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A2CC159C8D9 for ; Mon, 29 Apr 2019 20:19:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A96C716F4; Mon, 29 Apr 2019 20:19:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 228F627096; Mon, 29 Apr 2019 20:19:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TKJOds099923; Mon, 29 Apr 2019 20:19:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TKJL2L099906; Mon, 29 Apr 2019 20:19:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904292019.x3TKJL2L099906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 20:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346925 - in projects/runtime-coverage-v2: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip lib/libvgl sbin/ipfw share/man/man4 stand/efi/loader sys/conf sys/contrib/ipfilter/ne... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage-v2: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip lib/libvgl sbin/ipfw share/man/man4 stand/efi/loader sys/conf sys/contrib/ipfilter/netinet sys/dev/altera/atse... X-SVN-Commit-Revision: 346925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A96C716F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 20:19:25 -0000 Author: ngie Date: Mon Apr 29 20:19:21 2019 New Revision: 346925 URL: https://svnweb.freebsd.org/changeset/base/346925 Log: MFhead@r346924 Added: projects/runtime-coverage-v2/share/man/man4/dtrace_audit.4 - copied unchanged from r346924, head/share/man/man4/dtrace_audit.4 Modified: projects/runtime-coverage-v2/MAINTAINERS (contents, props changed) projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out projects/runtime-coverage-v2/lib/libvgl/main.c projects/runtime-coverage-v2/lib/libvgl/mouse.c projects/runtime-coverage-v2/lib/libvgl/simple.c projects/runtime-coverage-v2/lib/libvgl/vgl.h projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c projects/runtime-coverage-v2/share/man/man4/Makefile projects/runtime-coverage-v2/share/man/man4/audit.4 projects/runtime-coverage-v2/share/man/man4/auditpipe.4 projects/runtime-coverage-v2/stand/efi/loader/main.c projects/runtime-coverage-v2/sys/conf/files.powerpc projects/runtime-coverage-v2/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/runtime-coverage-v2/sys/dev/altera/atse/if_atse.c projects/runtime-coverage-v2/sys/dev/altera/softdma/softdma.c projects/runtime-coverage-v2/sys/dev/isp/isp_pci.c projects/runtime-coverage-v2/sys/dev/xdma/xdma.h projects/runtime-coverage-v2/sys/dev/xdma/xdma_mbuf.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_sg.c projects/runtime-coverage-v2/sys/kern/vfs_bio.c projects/runtime-coverage-v2/sys/netinet/in_mcast.c projects/runtime-coverage-v2/sys/netpfil/ipfw/ip_fw2.c projects/runtime-coverage-v2/sys/powerpc/conf/GENERIC64 projects/runtime-coverage-v2/sys/powerpc/powernv/opal_dev.c projects/runtime-coverage-v2/sys/x86/x86/busdma_bounce.c projects/runtime-coverage-v2/tools/regression/fsx/fsx.c projects/runtime-coverage-v2/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: projects/runtime-coverage-v2/ (props changed) projects/runtime-coverage-v2/cddl/ (props changed) projects/runtime-coverage-v2/cddl/contrib/opensolaris/ (props changed) projects/runtime-coverage-v2/sys/contrib/ipfilter/ (props changed) Modified: projects/runtime-coverage-v2/MAINTAINERS ============================================================================== --- projects/runtime-coverage-v2/MAINTAINERS Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/MAINTAINERS Mon Apr 29 20:19:21 2019 (r346925) @@ -35,17 +35,19 @@ makes a commit to the specified subtree. subsystem login notes ----------------------------- -atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +contrib/atf ngie,#test Pre-commit review requested. +contrib/capsicum-test ngie,#capsicum,#test Pre-commit review requested. contrib/compiler-rt dim Pre-commit review preferred. +contrib/googletest ngie,#test Pre-commit review requested. contrib/ipfilter cy Pre-commit review requested. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. contrib/libunwind dim,emaste,jhb Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb dim,emaste Pre-commit review preferred. -contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. -contrib/pjdfstest freebsd-testing,asomers,ngie,pjd Pre-commit review requested. +contrib/netbsd-tests ngie,#test Pre-commit review requested. +contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit review requested. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. @@ -86,10 +88,15 @@ sh(1) jilles Pre-commit review requested. This also to kill(1), printf(1) and test(1) which are compiled in as builtins. share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. -share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. +share/mk/*.test.mk imp,bapt,bdrewery, Pre-commit review requested. + emaste,ngie,sjg,#test stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested -sys/compat/linuxkpi hselasky If in doubt, ask. +sys/compat/linuxkpi hselasky If in doubt, ask. + zeising, johalun pre-commit review requested via + #x11 phabricator group. + (to avoid drm graphics drivers + impact) sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. @@ -101,7 +108,7 @@ sys/netinet/ip_carp.c glebius Pre-commit review recomm sys/netpfil/pf kp,glebius Pre-commit review recommended. sys/x86/xen royger Pre-commit review recommended. sys/xen royger Pre-commit review recommended. -tests freebsd-testing,ngie Pre-commit review requested. +tests ngie,#test Pre-commit review requested. tools/build imp Pre-commit review requested, especially to fix bootstrap issues. top(1) eadler Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. Modified: projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh ============================================================================== --- projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Mon Apr 29 20:19:21 2019 (r346925) @@ -58,36 +58,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <= 7 ? "yes" : "no"); - printf("ip:::receive (%d) - %s\n", ipreceive, ipreceive >= 7 ? "yes" : "no"); - printf("sctp:::send (%d) - %s\n", sctpsend, sctpsend >= 7 ? "yes" : "no"); - printf("sctp:::receive (%d) - %s\n", sctpreceive, sctpreceive >= 7 ? "yes" : "no"); + printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); + printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no"); + printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no"); } EODTRACE Modified: projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh ============================================================================== --- projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Mon Apr 29 20:19:21 2019 (r346925) @@ -61,36 +61,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin < #include "vgl.h" +static void VGLMouseAction(int dummy); + #define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ #define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ +#define LARGE_MOUSE_IMG_XSIZE 19 +#define LARGE_MOUSE_IMG_YSIZE 32 +#define SMALL_MOUSE_IMG_XSIZE 10 +#define SMALL_MOUSE_IMG_YSIZE 16 #define X 0xff /* any nonzero in And mask means part of cursor */ #define B BORDER #define I INTERIOR -static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,0,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,0,0,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,0,X,X,0,0,0,0,0,0,0,0, +static byte LargeAndMask[] = { + X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,0,0,0, }; -static byte StdOrMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, - B,I,I,I,I,I,B,B,B,B,0,0,0,0,0,0, - B,I,I,B,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,B,0,B,I,I,B,0,0,0,0,0,0,0,0, - B,B,0,0,B,I,I,B,0,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,0,B,B,0,0,0,0,0,0,0,0, +static byte LargeOrMask[] = { + B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,I,I,I,I,I,B,B,B,B,B,B,B,B, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,I,B,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,B,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,B,B,B,B,0,0,0, }; +static byte SmallAndMask[] = { + X,X,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,0,0,0, + X,X,X,0,X,X,X,X,0,0, + X,X,0,0,X,X,X,X,0,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,0,X,X,0,0, +}; +static byte SmallOrMask[] = { + B,B,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,B,B,B,B, + B,I,I,B,I,I,B,0,0,0, + B,I,B,0,B,I,I,B,0,0, + B,B,0,0,B,I,I,B,0,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,0,B,B,0,0, +}; #undef X #undef B #undef I -static VGLBitmap VGLMouseStdAndMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask); -static VGLBitmap VGLMouseStdOrMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); +static VGLBitmap VGLMouseLargeAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeAndMask); +static VGLBitmap VGLMouseLargeOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeOrMask); +static VGLBitmap VGLMouseSmallAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallAndMask); +static VGLBitmap VGLMouseSmallOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; -static int VGLMouseVisible = 0; static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; static int VGLMouseYpos = 0; @@ -102,51 +183,44 @@ static volatile sig_atomic_t VGLMsuppressint; VGLMouseAction(0); \ } while (0) -void -VGLMousePointerShow() +int +__VGLMouseMode(int mode) { - if (!VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 1; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); - INTON(); - } -} + int oldmode; -void -VGLMousePointerHide() -{ - if (VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 0; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - INTON(); - } -} - -void -VGLMouseMode(int mode) -{ + INTOFF(); + oldmode = VGLMouseShown; if (mode == VGL_MOUSESHOW) { if (VGLMouseShown == VGL_MOUSEHIDE) { - VGLMousePointerShow(); VGLMouseShown = VGL_MOUSESHOW; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, -VGLMouseAndMask->VYsize); } } else { if (VGLMouseShown == VGL_MOUSESHOW) { - VGLMousePointerHide(); VGLMouseShown = VGL_MOUSEHIDE; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, VGLMouseAndMask->VYsize); } } + INTON(); + return oldmode; } void +VGLMouseMode(int mode) +{ + __VGLMouseMode(mode); +} + +static void VGLMouseAction(int dummy) { struct mouse_info mouseinfo; + int mousemode; if (VGLMsuppressint) { VGLMintpending = 1; @@ -157,13 +231,14 @@ again: VGLMintpending = 0; mouseinfo.operation = MOUSE_GETINFO; ioctl(0, CONS_MOUSECTL, &mouseinfo); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); - VGLMouseXpos = mouseinfo.u.data.x; - VGLMouseYpos = mouseinfo.u.data.y; + if (VGLMouseXpos != mouseinfo.u.data.x || + VGLMouseYpos != mouseinfo.u.data.y) { + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseXpos = mouseinfo.u.data.x; + VGLMouseYpos = mouseinfo.u.data.y; + __VGLMouseMode(mousemode); + } VGLMouseButtons = mouseinfo.u.data.buttons; - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); /* * Loop to handle any new (suppressed) signals. This is INTON() without @@ -178,9 +253,10 @@ again: void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask) { - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); + int mousemode; + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseAndMask = AndMask; if (VGLMouseOrMask != NULL) { @@ -191,20 +267,23 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask VGLBitmapAllocateBits(VGLMouseOrMask); VGLBitmapCvt(OrMask, VGLMouseOrMask); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); + __VGLMouseMode(mousemode); } void VGLMouseSetStdImage() { - VGLMouseSetImage(&VGLMouseStdAndMask, &VGLMouseStdOrMask); + if (VGLDisplay->VXsize > 800) + VGLMouseSetImage(&VGLMouseLargeAndMask, &VGLMouseLargeOrMask); + else + VGLMouseSetImage(&VGLMouseSmallAndMask, &VGLMouseSmallOrMask); } int VGLMouseInit(int mode) { struct mouse_info mouseinfo; + VGLBitmap *ormask; int andmask, border, error, i, interior; switch (VGLModeInfo.vi_mem_model) { @@ -231,9 +310,14 @@ VGLMouseInit(int mode) border = strtoul(getenv("VGLMOUSEBORDERCOLOR"), NULL, 0); if (getenv("VGLMOUSEINTERIORCOLOR") != NULL) interior = strtoul(getenv("VGLMOUSEINTERIORCOLOR"), NULL, 0); - for (i = 0; i < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; i++) - VGLMouseStdOrMask.Bitmap[i] = VGLMouseStdOrMask.Bitmap[i] == BORDER ? - border : VGLMouseStdOrMask.Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseLargeOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseSmallOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; VGLMouseSetStdImage(); mouseinfo.operation = MOUSE_MODE; mouseinfo.u.mode.signal = SIGUSR2; @@ -288,9 +372,10 @@ VGLMouseFreezeXY(int x, int y) INTOFF(); if (VGLMouseShown != VGL_MOUSESHOW) return 0; - if (x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && - y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE && - VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) + if (x >= VGLMouseXpos && x < VGLMouseXpos + VGLMouseAndMask->VXsize && + y >= VGLMouseYpos && y < VGLMouseYpos + VGLMouseAndMask->VYsize && + VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*VGLMouseAndMask->VXsize+ + (x-VGLMouseXpos)]) return 1; return 0; } @@ -303,13 +388,13 @@ VGLMouseOverlap(int x, int y, int width, int hight) if (VGLMouseShown != VGL_MOUSESHOW) return 0; if (x > VGLMouseXpos) - overlap = (VGLMouseXpos + MOUSE_IMG_SIZE) - x; + overlap = (VGLMouseXpos + VGLMouseAndMask->VXsize) - x; else overlap = (x + width) - VGLMouseXpos; if (overlap <= 0) return 0; if (y > VGLMouseYpos) - overlap = (VGLMouseYpos + MOUSE_IMG_SIZE) - y; + overlap = (VGLMouseYpos + VGLMouseAndMask->VYsize) - y; else overlap = (y + hight) - VGLMouseYpos; return overlap > 0; @@ -324,10 +409,10 @@ VGLMouseMerge(int x, int y, int width, byte *line) if (xstart < VGLMouseXpos) xstart = VGLMouseXpos; xend = x + width; - if (xend > VGLMouseXpos + MOUSE_IMG_SIZE) - xend = VGLMouseXpos + MOUSE_IMG_SIZE; + if (xend > VGLMouseXpos + VGLMouseAndMask->VXsize) + xend = VGLMouseXpos + VGLMouseAndMask->VXsize; for (x1 = xstart; x1 < xend; x1++) { - pos = (y - VGLMouseYpos) * MOUSE_IMG_SIZE + x1 - VGLMouseXpos; + pos = (y - VGLMouseYpos) * VGLMouseAndMask->VXsize + x1 - VGLMouseXpos; if (VGLMouseAndMask->Bitmap[pos]) bcopy(&VGLMouseOrMask->Bitmap[pos * VGLDisplay->PixelBytes], &line[(x1 - x) * VGLDisplay->PixelBytes], VGLDisplay->PixelBytes); Modified: projects/runtime-coverage-v2/lib/libvgl/simple.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/simple.c Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/lib/libvgl/simple.c Mon Apr 29 20:19:21 2019 (r346925) @@ -465,14 +465,11 @@ void VGLClear(VGLBitmap *object, u_long color) { VGLBitmap src; - int i, len, mouseoverlap, offset; + int i, len, mousemode, offset; VGLCheckSwitch(); if (object == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(0, 0, object->VXsize, object->VYsize); - if (mouseoverlap) - VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); } else if (object->Type != MEMBUF) return; /* invalid */ @@ -499,18 +496,21 @@ VGLClear(VGLBitmap *object, u_long color) for (i = 0; i < object->VXsize; i++) bcopy(&color, src.Bitmap + i * object->PixelBytes, object->PixelBytes); for (i = 0; i < object->VYsize; i++) - __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, 1); + __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, -1); break; case VIDBUF8X: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 4 = 0 */ outb(0x3c6, 0xff); outb(0x3c4, 0x02); outb(0x3c5, 0x0f); memset(object->Bitmap, (byte)color, VGLAdpInfo.va_line_width*object->VYsize); + __VGLMouseMode(mousemode); break; case VIDBUF4: case VIDBUF4S: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 8 = 0 */ outb(0x3c4, 0x02); outb(0x3c5, 0x0f); outb(0x3ce, 0x05); outb(0x3cf, 0x02); /* mode 2 */ @@ -524,13 +524,11 @@ VGLClear(VGLBitmap *object, u_long color) offset += len; } outb(0x3ce, 0x05); outb(0x3cf, 0x00); + __VGLMouseMode(mousemode); break; } - if (object == VGLDisplay) { - if (mouseoverlap) - VGLMousePointerShow(); + if (object == VGLDisplay) VGLMouseUnFreeze(); - } } static inline u_long Modified: projects/runtime-coverage-v2/lib/libvgl/vgl.h ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/vgl.h Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/lib/libvgl/vgl.h Mon Apr 29 20:19:21 2019 (r346925) @@ -125,10 +125,8 @@ int VGLSetVScreenSize(VGLBitmap *object, int VXsize, i int VGLPanScreen(VGLBitmap *object, int x, int y); int VGLSetSegment(unsigned int offset); /* mouse.c */ -void VGLMousePointerShow(void); -void VGLMousePointerHide(void); +int __VGLMouseMode(int mode); void VGLMouseMode(int mode); -void VGLMouseAction(int dummy); void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); Modified: projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c ============================================================================== --- projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c Mon Apr 29 20:19:21 2019 (r346925) @@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct form IPFW_TLV_STATE_NAME)); break; case O_IP6: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip6"); break; case O_IP4: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip4"); break; case O_ICMP6TYPE: Modified: projects/runtime-coverage-v2/share/man/man4/Makefile ============================================================================== --- projects/runtime-coverage-v2/share/man/man4/Makefile Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/share/man/man4/Makefile Mon Apr 29 20:19:21 2019 (r346925) @@ -887,7 +887,8 @@ _ccd.4= ccd.4 .endif .if ${MK_CDDL} != "no" -_dtrace_provs= dtrace_io.4 \ +_dtrace_provs= dtrace_audit.4 \ + dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ @@ -896,6 +897,8 @@ _dtrace_provs= dtrace_io.4 \ dtrace_tcp.4 \ dtrace_udp.4 \ dtrace_udplite.4 + +MLINKS+= dtrace_audit.4 dtaudit.4 .endif .if ${MK_EFI} != "no" Modified: projects/runtime-coverage-v2/share/man/man4/audit.4 ============================================================================== --- projects/runtime-coverage-v2/share/man/man4/audit.4 Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/share/man/man4/audit.4 Mon Apr 29 20:19:21 2019 (r346925) @@ -1,6 +1,11 @@ -.\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2006, 2019 Robert N. M. Watson .\" All rights reserved. .\" +.\" This software was developed in part by BAE Systems, the University of +.\" Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL +.\" contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent +.\" Computing (TC) research program. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd April 28, 2019 .Dt AUDIT 4 .Os .Sh NAME @@ -74,6 +79,12 @@ Audit pipe special devices, discussed in provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. +.Ss DTrace Audit Provider +The DTrace Audit Provider, +.Xr dtaudit 4 , +allows D scripts to enable capture of in-kernel audit records for kernel audit +event types, and then process their contents during audit commit or BSM +generation. .Sh SEE ALSO .Xr auditreduce 1 , .Xr praudit 1 , @@ -88,6 +99,7 @@ to track users and events in a fine-grained manner. .Xr setauid 2 , .Xr libbsm 3 , .Xr auditpipe 4 , +.Xr dtaudit 4 , .Xr audit.log 5 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: projects/runtime-coverage-v2/share/man/man4/auditpipe.4 ============================================================================== --- projects/runtime-coverage-v2/share/man/man4/auditpipe.4 Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/share/man/man4/auditpipe.4 Mon Apr 29 20:19:21 2019 (r346925) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2018 +.Dd April 28, 2019 .Dt AUDITPIPE 4 .Os .Sh NAME @@ -221,6 +221,7 @@ to review the default audit trail. .Xr poll 2 , .Xr select 2 , .Xr audit 4 , +.Xr dtaudit 4 , .Xr audit_control 5 , .Xr audit 8 , .Xr auditd 8 Copied: projects/runtime-coverage-v2/share/man/man4/dtrace_audit.4 (from r346924, head/share/man/man4/dtrace_audit.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage-v2/share/man/man4/dtrace_audit.4 Mon Apr 29 20:19:21 2019 (r346925, copy of r346924, head/share/man/man4/dtrace_audit.4) @@ -0,0 +1,178 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Robert N. M. Watson +.\" +.\" This software was developed by BAE Systems, the University of Cambridge +.\" Computer Laboratory, and Memorial University under DARPA/AFRL contract +.\" FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing +.\" (TC) research program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (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$ +.\" +.Dd April 28, 2019 +.Dt DTRACE_AUDIT 4 +.Os +.Sh NAME +.Nm dtrace_audit +.Nd A DTrace provider for tracing +.Xr audit 4 +events +.Sh SYNOPSIS +.Pp +.Fn audit:event:aue_*:commit "char *eventname" "struct audit_record *ar" +.Fn audit:event:aue_*:bsm "char *eventname" "struct audit_record *ar" "const void *" "size_t" +.Pp +To compile this module into the kernel, place the following in your kernel +configuration file: +.Pp +.Bd -literal -offset indent +.Cd "options DTAUDIT" +.Ed +.Pp +Alternatively, to load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dtaudit_load="YES" +.Ed +.Sh DESCRIPTION +The DTrace +.Nm dtaudit +provider allows users to trace events in the kernel security auditing +subsystem, +.Xr audit 4 . +.Xr audit 4 +provides detailed logging of a configurable set of security-relevant system +calls, including key arguments (such as file paths) and return values that are +copied race-free as the system call proceeds. +The +.Nm dtaudit +provider allows DTrace scripts to selectively enable in-kernel audit-record +capture for system calls, and then access those records in either the +in-kernel format or BSM format (\c +.Xr audit.log 5 ) +when the system call completes. +While the in-kernel audit record data structure is subject to change as the +kernel changes over time, it is a much more friendly interface for use in D +scripts than either those available via the DTrace system-call provider or the +BSM trail itself. +.Ss Configuration +The +.Nm dtaudit +provider relies on +.Xr audit 4 +being compiled into the kernel. +.Nm dtaudit +probes become available only once there is an event-to-name mapping installed +in the kernel, normally done by +.Xr auditd 8 +during the boot process, if audit is enabled in +.Xr rc.conf 5 : +.Bd -literal -offset indent +auditd_enable="YES" +.Ed +.Pp +If +.Nm dtaudit +probes are required earlier in boot -- for example, in single-user mode -- or +without enabling +.Xr audit 4 , +they can be preloaded in the boot loader by adding this line to +.Xr loader.conf 5 . +.Bd -literal -offset indent +audit_event_load="YES" +.Ed +.Ss Probes +The +.Fn audit:event:aue_*:commit +probes fire synchronously during system-call return, giving access to two +arguments: a +.Vt char * +audit event name, and +the +.Vt struct audit_record * +in-kernel audit record. +Because the probe fires in system-call return, the user thread has not yet +regained control, and additional information from the thread and process +remains available for capture by the script. +.Pp +The +.Fn audit:event:aue_*:bsm +probes fire asynchonously from system-call return, following BSM conversion +and just prior to being written to disk, giving access to four arguments: a +.Vt char * +audit event name, the +.Vt struct audit_record * +in-kernel audit record, a +.Vt const void * +pointer to the converted BSM record, and a +.Vt size_t +for the length of the BSM record. +.Sh IMPLEMENTATION NOTES +When a set of +.Nm dtaudit +probes are registered, corresponding in-kernel audit records will be captured +and their probes will fire regardless of whether the +.Xr audit 4 +subsystem itself would have captured the record for the purposes of writing it +to the audit trail, or for delivery to a +.Xr auditpipe 4 . +In-kernel audit records allocated only because of enabled +.Xr dtaudit 4 +probes will not be unnecessarily written to the audit trail or enabled pipes. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr audit 4 , +.Xr audit.log 5 , +.Xr loader.conf 5 , +.Xr rc.conf 5 , +.Xr auditd 8 +.Sh HISTORY +The +.Nm dtaudit +provider first appeared in +.Fx 12.0 . +.Sh AUTHORS +This software and this manual page were developed by BAE Systems, the +University of Cambridge Computer Laboratory, and Memorial University under +DARPA/AFRL contract +.Pq FA8650-15-C-7558 +.Pq Do CADETS Dc , +as part of the DARPA Transparent Computing (TC) research program. +The +.Nm dtaudit +provider and this manual page were written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.Sh BUGS +Because +.Xr audit 4 +maintains its primary event-to-name mapping database in userspace, that +database must be loaded into the kernel before +.Nm dtaudit +probes become available. +.Pp +.Nm dtaudit +is only able to provide access to system-call audit events, not the full +scope of userspace events, such as those relating to login, password change, +and so on. Modified: projects/runtime-coverage-v2/stand/efi/loader/main.c ============================================================================== --- projects/runtime-coverage-v2/stand/efi/loader/main.c Mon Apr 29 20:17:53 2019 (r346924) +++ projects/runtime-coverage-v2/stand/efi/loader/main.c Mon Apr 29 20:19:21 2019 (r346925) @@ -472,13 +472,35 @@ find_currdev(bool do_bootmgr, bool is_last, */ rootdev = getenv("rootdev"); if (rootdev != NULL) { - printf("Setting currdev to configured rootdev %s\n", rootdev); + printf(" Setting currdev to configured rootdev %s\n", + rootdev); set_currdev(rootdev); return (0); } /* - * Second choice: If we can find out image boot_info, and there's + * Second choice: If uefi_rootdev is set, translate that UEFI device + * path to the loader's internal name and use that. + */ + do { + rootdev = getenv("uefi_rootdev"); + if (rootdev == NULL) + break; + devpath = efi_name_to_devpath(rootdev); + if (devpath == NULL) + break; + dp = efiblk_get_pdinfo_by_device_path(devpath); + efi_devpath_free(devpath); + if (dp == NULL) + break; + printf(" Setting currdev to UEFI path %s\n", + rootdev); + set_currdev_pdinfo(dp); + return (0); + } while (0); + + /* + * Third choice: If we can find out image boot_info, and there's * a follow-on boot image in that boot_info, use that. In this * case root will be the partition specified in that image and * we'll load the kernel specified by the file path. Should there @@ -742,6 +764,80 @@ out: return (how); } +void +parse_loader_efi_config(EFI_HANDLE h, const char *env_fn) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Wed May 1 00:00:50 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A5415A2163 for ; Wed, 1 May 2019 00:00:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3719A6DA9C; Wed, 1 May 2019 00:00:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 119AA1940A; Wed, 1 May 2019 00:00:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4100nIq085081; Wed, 1 May 2019 00:00:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4100nVs085078; Wed, 1 May 2019 00:00:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905010000.x4100nVs085078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 May 2019 00:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346979 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 346979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3719A6DA9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 00:00:50 -0000 Author: asomers Date: Wed May 1 00:00:49 2019 New Revision: 346979 URL: https://svnweb.freebsd.org/changeset/base/346979 Log: fusefs: fix some permission checks with -o default_permissions When mounted with -o default_permissions fusefs is supposed to validate all permissions in the kernel, not the file system. This commit fixes two permissions that I had previously overlooked. * Only root may chown a file * Non-root users may only chgrp a file to a group to which they belong PR: 216391 Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc projects/fuse2/tests/sys/fs/fusefs/utils.cc projects/fuse2/tests/sys/fs/fusefs/utils.hh Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Tue Apr 30 23:53:54 2019 (r346978) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Wed May 1 00:00:49 2019 (r346979) @@ -1518,14 +1518,20 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) struct thread *td = curthread; struct fuse_dispatcher fdi; struct fuse_setattr_in *fsai; + struct mount *mp; pid_t pid = td->td_proc->p_pid; - + struct fuse_data *data; + int dataflags; int err = 0; enum vtype vtyp; int sizechanged = 0; uint64_t newsize = 0; accmode_t accmode = 0; + mp = vnode_mount(vp); + data = fuse_get_mpdata(mp); + dataflags = data->dataflags; + if (fuse_isdeadfs(vp)) { return ENXIO; } @@ -1535,11 +1541,28 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) fsai->valid = 0; if (vap->va_uid != (uid_t)VNOVAL) { + if (dataflags & FSESS_DEFAULT_PERMISSIONS) { + /* Only root may change a file's owner */ + err = priv_check_cred(cred, PRIV_VFS_CHOWN); + if (err) + return err; + } fsai->uid = vap->va_uid; fsai->valid |= FATTR_UID; accmode |= VADMIN; } if (vap->va_gid != (gid_t)VNOVAL) { + if (dataflags & FSESS_DEFAULT_PERMISSIONS && + !groupmember(vap->va_gid, cred)) + { + /* + * Non-root users may only chgrp to one of their own + * groups + */ + err = priv_check_cred(cred, PRIV_VFS_CHOWN); + if (err) + return err; + } fsai->gid = vap->va_gid; fsai->valid |= FATTR_GID; accmode |= VADMIN; Modified: projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Tue Apr 30 23:53:54 2019 (r346978) +++ projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Wed May 1 00:00:49 2019 (r346979) @@ -69,7 +69,7 @@ virtual void SetUp() { public: void expect_getattr(uint64_t ino, mode_t mode, uint64_t attr_valid, int times, - uid_t uid = 0) + uid_t uid = 0, gid_t gid = 0) { EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -84,19 +84,22 @@ void expect_getattr(uint64_t ino, mode_t mode, uint64_ out->body.attr.attr.mode = mode; out->body.attr.attr.size = 0; out->body.attr.attr.uid = uid; + out->body.attr.attr.uid = gid; out->body.attr.attr_valid = attr_valid; }))); } void expect_lookup(const char *relpath, uint64_t ino, mode_t mode, - uint64_t attr_valid, uid_t uid = 0) + uint64_t attr_valid, uid_t uid = 0, gid_t gid = 0) { - FuseTest::expect_lookup(relpath, ino, mode, 0, 1, attr_valid, uid); + FuseTest::expect_lookup(relpath, ino, mode, 0, 1, attr_valid, uid, gid); } }; class Access: public DefaultPermissions {}; +class Chown: public DefaultPermissions {}; +class Chgrp: public DefaultPermissions {}; class Lookup: public DefaultPermissions {}; class Open: public DefaultPermissions {}; class Setattr: public DefaultPermissions {}; @@ -252,6 +255,105 @@ TEST_F(Access, ok) */ ASSERT_EQ(0, access(FULLPATH, access_mode)) << strerror(errno); +} + +/* Only root may change a file's owner */ +TEST_F(Chown, eperm) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t mode = 0755; + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1, geteuid()); + expect_lookup(RELPATH, ino, S_IFREG | mode, UINT64_MAX, geteuid()); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR); + }, Eq(true)), + _) + ).Times(0); + + EXPECT_NE(0, chown(FULLPATH, 0, -1)); + EXPECT_EQ(EPERM, errno); +} + +/* non-root users may only chgrp a file to a group they belong to */ +TEST_F(Chgrp, eperm) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t mode = 0755; + int ngroups = 64; + gid_t groups[ngroups]; + uid_t uid; + gid_t gid, newgid; + int i; + + uid = geteuid(); + gid = getegid(); + getgrouplist(getlogin(), getegid(), groups, &ngroups); + for (newgid = 0; newgid >= 0; newgid++) { + bool belongs = false; + + for (i = 0; i < ngroups; i++) { + if (groups[i] == newgid) + belongs = true; + } + if (!belongs) + break; + } + /* newgid is now a group to which the current user does not belong */ + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1, uid, gid); + expect_lookup(RELPATH, ino, S_IFREG | mode, UINT64_MAX, uid, gid); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR); + }, Eq(true)), + _) + ).Times(0); + + EXPECT_NE(0, chown(FULLPATH, -1, newgid)); + EXPECT_EQ(EPERM, errno); +} + +TEST_F(Chgrp, ok) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t mode = 0755; + uid_t uid; + gid_t gid, newgid; + + uid = geteuid(); + gid = 0; + newgid = getegid(); + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1, uid, gid); + expect_lookup(RELPATH, ino, S_IFREG | mode, UINT64_MAX, uid, gid); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR); + }, Eq(true)), + _) + ).Times(0); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR && + in->header.nodeid == ino); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, attr); + out->body.attr.attr.mode = S_IFREG | mode; + out->body.attr.attr.uid = uid; + out->body.attr.attr.gid = newgid; + }))); + + EXPECT_EQ(0, chown(FULLPATH, -1, newgid)) << strerror(errno); } TEST_F(Create, ok) Modified: projects/fuse2/tests/sys/fs/fusefs/utils.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.cc Tue Apr 30 23:53:54 2019 (r346978) +++ projects/fuse2/tests/sys/fs/fusefs/utils.cc Wed May 1 00:00:49 2019 (r346979) @@ -175,7 +175,7 @@ void FuseTest::expect_getattr(uint64_t ino, uint64_t s } void FuseTest::expect_lookup(const char *relpath, uint64_t ino, mode_t mode, - uint64_t size, int times, uint64_t attr_valid, uid_t uid) + uint64_t size, int times, uint64_t attr_valid, uid_t uid, gid_t gid) { EXPECT_LOOKUP(1, relpath) .Times(times) @@ -187,6 +187,7 @@ void FuseTest::expect_lookup(const char *relpath, uint out->body.entry.attr_valid = attr_valid; out->body.entry.attr.size = size; out->body.entry.attr.uid = uid; + out->body.entry.attr.gid = gid; }))); } Modified: projects/fuse2/tests/sys/fs/fusefs/utils.hh ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.hh Tue Apr 30 23:53:54 2019 (r346978) +++ projects/fuse2/tests/sys/fs/fusefs/utils.hh Wed May 1 00:00:49 2019 (r346979) @@ -103,7 +103,7 @@ class FuseTest : public ::testing::Test { */ void expect_lookup(const char *relpath, uint64_t ino, mode_t mode, uint64_t size, int times, uint64_t attr_valid = UINT64_MAX, - uid_t uid = 0); + uid_t uid = 0, gid_t gid = 0); /* * Create an expectation that FUSE_OPEN will be called for the given From owner-svn-src-projects@freebsd.org Wed May 1 17:24:54 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20657159C375 for ; Wed, 1 May 2019 17:24:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBBB986014; Wed, 1 May 2019 17:24:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1486249AF; Wed, 1 May 2019 17:24:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HOrJ0033505; Wed, 1 May 2019 17:24:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HOrj6033504; Wed, 1 May 2019 17:24:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905011724.x41HOrj6033504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 May 2019 17:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346997 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 346997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBBB986014 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:24:54 -0000 Author: asomers Date: Wed May 1 17:24:53 2019 New Revision: 346997 URL: https://svnweb.freebsd.org/changeset/base/346997 Log: fusefs: fix a memory leak from r346979 PR: 216391 Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Wed May 1 17:12:49 2019 (r346996) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Wed May 1 17:24:53 2019 (r346997) @@ -1545,7 +1545,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) /* Only root may change a file's owner */ err = priv_check_cred(cred, PRIV_VFS_CHOWN); if (err) - return err; + goto out; } fsai->uid = vap->va_uid; fsai->valid |= FATTR_UID; @@ -1561,7 +1561,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) */ err = priv_check_cred(cred, PRIV_VFS_CHOWN); if (err) - return err; + goto out; } fsai->gid = vap->va_gid; fsai->valid |= FATTR_GID; From owner-svn-src-projects@freebsd.org Wed May 1 17:27:06 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF6A3159C398 for ; Wed, 1 May 2019 17:27:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA758612B; Wed, 1 May 2019 17:27:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65EFD249C5; Wed, 1 May 2019 17:27:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HR5mP033668; Wed, 1 May 2019 17:27:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HR53t033667; Wed, 1 May 2019 17:27:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905011727.x41HR53t033667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 May 2019 17:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346998 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 346998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CA758612B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:27:06 -0000 Author: asomers Date: Wed May 1 17:27:04 2019 New Revision: 346998 URL: https://svnweb.freebsd.org/changeset/base/346998 Log: fusefs: fix "returning with lock held" panics in fuse_vnode_alloc These panics all lie in the error path. The only one I've hit is caused by a buggy FUSE server unexpectedly changing the type of a vnode. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_node.c Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Wed May 1 17:24:53 2019 (r346997) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Wed May 1 17:27:04 2019 (r346998) @@ -212,6 +212,7 @@ fuse_vnode_hash(uint64_t id) return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); } +SDT_PROBE_DEFINE2(fusefs, , node, stale_vnode, "struct vnode*", "enum vtype"); static int fuse_vnode_alloc(struct mount *mp, struct thread *td, @@ -240,7 +241,10 @@ fuse_vnode_alloc(struct mount *mp, * between FUSE_LOOKUP and another client's * FUSE_UNLINK/FUSE_CREATE */ + SDT_PROBE2(fusefs, , node, stale_vnode, *vpp, vtyp); fuse_internal_vnode_disappear(*vpp); + lockmgr((*vpp)->v_vnlock, LK_RELEASE, NULL); + *vpp = NULL; return (EAGAIN); } MPASS((*vpp)->v_data != NULL); @@ -265,14 +269,19 @@ fuse_vnode_alloc(struct mount *mp, err = insmntque(*vpp, mp); ASSERT_VOP_ELOCKED(*vpp, "fuse_vnode_alloc"); if (err) { + lockmgr((*vpp)->v_vnlock, LK_RELEASE, NULL); free(fvdat, M_FUSEVN); *vpp = NULL; return (err); } err = vfs_hash_insert(*vpp, fuse_vnode_hash(nodeid), LK_EXCLUSIVE, td, &vp2, fuse_vnode_cmp, &nodeid); - if (err) + if (err) { + lockmgr((*vpp)->v_vnlock, LK_RELEASE, NULL); + free(fvdat, M_FUSEVN); + *vpp = NULL; return (err); + } if (vp2 != NULL) { *vpp = vp2; return (0); From owner-svn-src-projects@freebsd.org Thu May 2 02:08:27 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0D8C158523A for ; Thu, 2 May 2019 02:08:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68FE770347; Thu, 2 May 2019 02:08:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BAAD2513; Thu, 2 May 2019 02:08:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4228REE012446; Thu, 2 May 2019 02:08:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4228Rc6012445; Thu, 2 May 2019 02:08:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905020208.x4228Rc6012445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 2 May 2019 02:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347011 - projects/runtime-coverage-v2 X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2 X-SVN-Commit-Revision: 347011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68FE770347 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 02:08:28 -0000 Author: ngie Date: Thu May 2 02:08:26 2019 New Revision: 347011 URL: https://svnweb.freebsd.org/changeset/base/347011 Log: Compile lib/libclang_rt/profile if MK_CLANG == no This might fix "make tinderbox". We'll see :)! Modified: projects/runtime-coverage-v2/Makefile.inc1 Modified: projects/runtime-coverage-v2/Makefile.inc1 ============================================================================== --- projects/runtime-coverage-v2/Makefile.inc1 Thu May 2 01:17:55 2019 (r347010) +++ projects/runtime-coverage-v2/Makefile.inc1 Thu May 2 02:08:26 2019 (r347011) @@ -2717,7 +2717,7 @@ libraries: .MAKE .PHONY # Build coverage libraries for the target. This must be done here in # order for the cross-toolchain to be able to find them with # `make libraries` and the rest of buildworld. -.if ${MK_CLANG_BOOTSTRAP} != "no" +.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" .if ${MK_COVERAGE_SUPPORT} != "no" _coverage_libs+= lib/libclang_rt/profile .endif From owner-svn-src-projects@freebsd.org Thu May 2 04:16:47 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 527401588082 for ; Thu, 2 May 2019 04:16:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECE1D74754; Thu, 2 May 2019 04:16:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C065D3DEF; Thu, 2 May 2019 04:16:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x424GkZV081360; Thu, 2 May 2019 04:16:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x424GkKS081359; Thu, 2 May 2019 04:16:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905020416.x424GkKS081359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 2 May 2019 04:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347014 - projects/runtime-coverage-v2/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2/share/mk X-SVN-Commit-Revision: 347014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECE1D74754 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 04:16:47 -0000 Author: ngie Date: Thu May 2 04:16:46 2019 New Revision: 347014 URL: https://svnweb.freebsd.org/changeset/base/347014 Log: Don't try building coverage binaries with crunchgen This adds parity with not building tests by specifying MK_COVERAGE=no. Modified: projects/runtime-coverage-v2/share/mk/bsd.crunchgen.mk Modified: projects/runtime-coverage-v2/share/mk/bsd.crunchgen.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.crunchgen.mk Thu May 2 03:39:03 2019 (r347013) +++ projects/runtime-coverage-v2/share/mk/bsd.crunchgen.mk Thu May 2 04:16:46 2019 (r347014) @@ -110,7 +110,8 @@ ${CONF}: Makefile .endfor CRUNCHGEN?= crunchgen -CRUNCHENV+= MK_TESTS=no \ +CRUNCHENV+= MK_COVERAGE=no \ + MK_TESTS=no \ UPDATE_DEPENDFILE=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs From owner-svn-src-projects@freebsd.org Thu May 2 14:40:22 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 881FD15976F0 for ; Thu, 2 May 2019 14:40:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1D391831; Thu, 2 May 2019 14:40:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE14A88B; Thu, 2 May 2019 14:40:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42EeLsH010663; Thu, 2 May 2019 14:40:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42EeLkp010661; Thu, 2 May 2019 14:40:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905021440.x42EeLkp010661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 2 May 2019 14:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347018 - projects/runtime-coverage-v2/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2/share/mk X-SVN-Commit-Revision: 347018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B1D391831 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 14:40:22 -0000 Author: ngie Date: Thu May 2 14:40:21 2019 New Revision: 347018 URL: https://svnweb.freebsd.org/changeset/base/347018 Log: Guard against cases where GCNOS would be empty, resulting in failed builds There are some Makefiles that install headers explicitly, without creating programs, e.g., `usr.sbin/amd/include`. In order to support this case moving forward, specifically test for _GCNO_SRCS being non-empty, then set GCNOS appropriately. Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk projects/runtime-coverage-v2/share/mk/bsd.prog.mk Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.lib.mk Thu May 2 12:56:13 2019 (r347017) +++ projects/runtime-coverage-v2/share/mk/bsd.lib.mk Thu May 2 14:40:21 2019 (r347018) @@ -517,7 +517,9 @@ _libinstall: .if defined(_COV_FLAG) && !empty(SRCS) _GCNO_SRCS= ${SRCS:M*.c} ${SRCS:M*.cc} ${SRCS:M*.cpp} ${SRCS:M*.cxx} ${SRCS:M*.C} ${SRCS:M*.y} +.if !empty(_GCNO_SRCS) GCNOS:= ${_GCNO_SRCS:R:S/$/.gcno/g} +.endif .undef _GCNO_SRCS .for _gcno in ${GCNOS} ${_gcno}: ${_gcno:R}.o Modified: projects/runtime-coverage-v2/share/mk/bsd.prog.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.prog.mk Thu May 2 12:56:13 2019 (r347017) +++ projects/runtime-coverage-v2/share/mk/bsd.prog.mk Thu May 2 14:40:21 2019 (r347018) @@ -330,7 +330,9 @@ NLSNAME?= ${PROG} .include .if defined(_COV_FLAG) && !empty(SRCS) _GCNO_SRCS= ${SRCS:M*.c} ${SRCS:M*.cc} ${SRCS:M*.cpp} ${SRCS:M*.cxx} ${SRCS:M*.C} ${SRCS:M*.y} +.if !empty(_GCNO_SRCS) GCNOS:= ${_GCNO_SRCS:R:S/$/.gcno/g} +.endif .undef _GCNO_SRCS .for _gcno in ${GCNOS} ${_gcno}: ${_gcno:R}.o From owner-svn-src-projects@freebsd.org Sat May 4 02:10:53 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7A815A223A for ; Sat, 4 May 2019 02:10:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5AB6BB94; Sat, 4 May 2019 02:10:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3AF317A8; Sat, 4 May 2019 02:10:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x442AqxG041458; Sat, 4 May 2019 02:10:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442Am6j041431; Sat, 4 May 2019 02:10:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905040210.x442Am6j041431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 4 May 2019 02:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347076 - in projects/runtime-coverage-v2: lib/atf/libatf-c lib/libbe lib/libc/gen lib/libfetch lib/libvgl libexec/rtld-elf release release/tools sbin/fsck_ffs sbin/ifconfig sbin/reboot... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage-v2: lib/atf/libatf-c lib/libbe lib/libc/gen lib/libfetch lib/libvgl libexec/rtld-elf release release/tools sbin/fsck_ffs sbin/ifconfig sbin/reboot share/man/man4 share/man... X-SVN-Commit-Revision: 347076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C5AB6BB94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:10:54 -0000 Author: ngie Date: Sat May 4 02:10:47 2019 New Revision: 347076 URL: https://svnweb.freebsd.org/changeset/base/347076 Log: MFhead@r347075 Added: projects/runtime-coverage-v2/sys/compat/linux/linux_common.h - copied unchanged from r347075, head/sys/compat/linux/linux_common.h projects/runtime-coverage-v2/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso - copied unchanged from r347075, head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso projects/runtime-coverage-v2/sys/dts/arm64/overlays/sun50i-h5-opp.dtso - copied unchanged from r347075, head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso projects/runtime-coverage-v2/sys/dts/arm64/overlays/sun50i-h5-sid.dtso - copied unchanged from r347075, head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso projects/runtime-coverage-v2/sys/dts/arm64/overlays/sun50i-h5-ths.dtso - copied unchanged from r347075, head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso projects/runtime-coverage-v2/tests/sys/vm/mlock_test.c - copied unchanged from r347075, head/tests/sys/vm/mlock_test.c Modified: projects/runtime-coverage-v2/lib/atf/libatf-c/Makefile projects/runtime-coverage-v2/lib/libbe/be.c projects/runtime-coverage-v2/lib/libbe/be_access.c projects/runtime-coverage-v2/lib/libc/gen/directory.3 projects/runtime-coverage-v2/lib/libfetch/common.c projects/runtime-coverage-v2/lib/libvgl/bitmap.c projects/runtime-coverage-v2/libexec/rtld-elf/rtld_malloc.c projects/runtime-coverage-v2/release/Makefile.vm projects/runtime-coverage-v2/release/tools/gce.conf projects/runtime-coverage-v2/release/tools/vmimage.subr projects/runtime-coverage-v2/sbin/fsck_ffs/dir.c projects/runtime-coverage-v2/sbin/fsck_ffs/fsck.h projects/runtime-coverage-v2/sbin/fsck_ffs/fsck_ffs.8 projects/runtime-coverage-v2/sbin/fsck_ffs/globs.c projects/runtime-coverage-v2/sbin/fsck_ffs/main.c projects/runtime-coverage-v2/sbin/ifconfig/ifconfig.8 projects/runtime-coverage-v2/sbin/ifconfig/iflagg.c projects/runtime-coverage-v2/sbin/reboot/boot_i386.8 projects/runtime-coverage-v2/share/man/man4/ccr.4 projects/runtime-coverage-v2/share/man/man7/development.7 projects/runtime-coverage-v2/share/misc/committers-src.dot projects/runtime-coverage-v2/stand/common/disk.c projects/runtime-coverage-v2/stand/efi/boot1/Makefile projects/runtime-coverage-v2/stand/efi/boot1/boot1.c projects/runtime-coverage-v2/stand/efi/boot1/boot_module.h projects/runtime-coverage-v2/stand/efi/loader/main.c projects/runtime-coverage-v2/stand/i386/gptboot/gptboot.8 projects/runtime-coverage-v2/stand/i386/zfsboot/zfsboot.c projects/runtime-coverage-v2/sys/amd64/conf/GENERIC projects/runtime-coverage-v2/sys/amd64/conf/MINIMAL projects/runtime-coverage-v2/sys/amd64/linux/linux.h projects/runtime-coverage-v2/sys/amd64/linux32/linux.h projects/runtime-coverage-v2/sys/amd64/vmm/vmm_instruction_emul.c projects/runtime-coverage-v2/sys/arm/conf/std.arm projects/runtime-coverage-v2/sys/arm/conf/std.armv6 projects/runtime-coverage-v2/sys/arm/conf/std.armv7 projects/runtime-coverage-v2/sys/arm64/arm64/efirt_machdep.c projects/runtime-coverage-v2/sys/arm64/arm64/identcpu.c projects/runtime-coverage-v2/sys/arm64/conf/GENERIC projects/runtime-coverage-v2/sys/arm64/linux/linux.h projects/runtime-coverage-v2/sys/compat/linprocfs/linprocfs.c projects/runtime-coverage-v2/sys/compat/linsysfs/linsysfs.c projects/runtime-coverage-v2/sys/compat/linux/linux.c projects/runtime-coverage-v2/sys/compat/linux/linux.h projects/runtime-coverage-v2/sys/compat/linux/linux_emul.c projects/runtime-coverage-v2/sys/compat/linux/linux_emul.h projects/runtime-coverage-v2/sys/compat/linux/linux_ioctl.c projects/runtime-coverage-v2/sys/compat/linux/linux_misc.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/dmapool.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_pci.c projects/runtime-coverage-v2/sys/conf/NOTES projects/runtime-coverage-v2/sys/conf/dtb.build.mk projects/runtime-coverage-v2/sys/conf/files.arm64 projects/runtime-coverage-v2/sys/conf/options projects/runtime-coverage-v2/sys/i386/conf/GENERIC projects/runtime-coverage-v2/sys/i386/conf/MINIMAL projects/runtime-coverage-v2/sys/i386/linux/linux.h projects/runtime-coverage-v2/sys/kern/kern_time.c projects/runtime-coverage-v2/sys/mips/conf/ERL projects/runtime-coverage-v2/sys/mips/conf/JZ4780 projects/runtime-coverage-v2/sys/mips/conf/X1000 projects/runtime-coverage-v2/sys/mips/conf/std.BERI projects/runtime-coverage-v2/sys/modules/dtb/allwinner/Makefile projects/runtime-coverage-v2/sys/modules/dtb/rockchip/Makefile projects/runtime-coverage-v2/sys/net/ieee8023ad_lacp.c projects/runtime-coverage-v2/sys/net/ieee8023ad_lacp.h projects/runtime-coverage-v2/sys/net/if_lagg.c projects/runtime-coverage-v2/sys/net/if_lagg.h projects/runtime-coverage-v2/sys/net/iflib.c projects/runtime-coverage-v2/sys/net/iflib.h projects/runtime-coverage-v2/sys/powerpc/booke/locore.S projects/runtime-coverage-v2/sys/powerpc/booke/trap_subr.S projects/runtime-coverage-v2/sys/powerpc/conf/GENERIC projects/runtime-coverage-v2/sys/powerpc/conf/GENERIC64 projects/runtime-coverage-v2/sys/powerpc/conf/MPC85XX projects/runtime-coverage-v2/sys/powerpc/conf/MPC85XXSPE projects/runtime-coverage-v2/sys/powerpc/powernv/opal_hmi.c projects/runtime-coverage-v2/sys/powerpc/powerpc/swtch64.S projects/runtime-coverage-v2/sys/riscv/riscv/nexus.c projects/runtime-coverage-v2/sys/security/mac/mac_inet.c projects/runtime-coverage-v2/sys/security/mac/mac_internal.h projects/runtime-coverage-v2/sys/security/mac/mac_net.c projects/runtime-coverage-v2/sys/sparc64/conf/GENERIC projects/runtime-coverage-v2/sys/ufs/ufs/dir.h projects/runtime-coverage-v2/sys/ufs/ufs/ufs_bmap.c projects/runtime-coverage-v2/sys/ufs/ufs/ufs_extern.h projects/runtime-coverage-v2/sys/ufs/ufs/ufs_lookup.c projects/runtime-coverage-v2/sys/ufs/ufs/ufs_vnops.c projects/runtime-coverage-v2/sys/vm/vm_map.c projects/runtime-coverage-v2/sys/vm/vm_pageout.c projects/runtime-coverage-v2/tests/sys/vm/Makefile projects/runtime-coverage-v2/tools/boot/ci-qemu-test.sh projects/runtime-coverage-v2/usr.bin/stat/stat.c projects/runtime-coverage-v2/usr.bin/stat/tests/stat_test.sh projects/runtime-coverage-v2/usr.sbin/bhyve/block_if.c projects/runtime-coverage-v2/usr.sbin/bhyve/block_if.h projects/runtime-coverage-v2/usr.sbin/bhyve/pci_virtio_block.c projects/runtime-coverage-v2/usr.sbin/lpr/common_source/printcap.c projects/runtime-coverage-v2/usr.sbin/mountd/mountd.c projects/runtime-coverage-v2/usr.sbin/rtadvd/if.c Directory Properties: projects/runtime-coverage-v2/ (props changed) Modified: projects/runtime-coverage-v2/lib/atf/libatf-c/Makefile ============================================================================== --- projects/runtime-coverage-v2/lib/atf/libatf-c/Makefile Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/atf/libatf-c/Makefile Sat May 4 02:10:47 2019 (r347076) @@ -95,6 +95,65 @@ INCS+= atf-c.h INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c.3 +MLINKS+= atf-c.3 ATF_CHECK.3 \ + atf-c.3 ATF_CHECK_MSG.3 \ + atf-c.3 ATF_CHECK_EQ.3 \ + atf-c.3 ATF_CHECK_EQ_MSG.3 \ + atf-c.3 ATF_CHECK_MATCH.3 \ + atf-c.3 ATF_CHECK_MATCH_MSG.3 \ + atf-c.3 ATF_CHECK_STREQ.3 \ + atf-c.3 ATF_CHECK_STREQ_MSG.3 \ + atf-c.3 ATF_CHECK_ERRNO.3 \ + atf-c.3 ATF_REQUIRE.3 \ + atf-c.3 ATF_REQUIRE_MSG.3 \ + atf-c.3 ATF_REQUIRE_EQ.3 \ + atf-c.3 ATF_REQUIRE_EQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_MATCH.3 \ + atf-c.3 ATF_REQUIRE_MATCH_MSG.3 \ + atf-c.3 ATF_REQUIRE_STREQ.3 \ + atf-c.3 ATF_REQUIRE_STREQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_ERRNO.3 \ + atf-c.3 ATF_TC.3 \ + atf-c.3 ATF_TC_BODY.3 \ + atf-c.3 ATF_TC_BODY_NAME.3 \ + atf-c.3 ATF_TC_CLEANUP.3 \ + atf-c.3 ATF_TC_CLEANUP_NAME.3 \ + atf-c.3 ATF_TC_HEAD.3 \ + atf-c.3 ATF_TC_HEAD_NAME.3 \ + atf-c.3 ATF_TC_NAME.3 \ + atf-c.3 ATF_TC_WITH_CLEANUP.3 \ + atf-c.3 ATF_TC_WITHOUT_HEAD.3 \ + atf-c.3 ATF_TP_ADD_TC.3 \ + atf-c.3 ATF_TP_ADD_TCS.3 \ + atf-c.3 atf_tc_get_config_var.3 \ + atf-c.3 atf_tc_get_config_var_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_bool.3 \ + atf-c.3 atf_tc_get_config_var_as_bool_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_long.3 \ + atf-c.3 atf_tc_get_config_var_as_long_wd.3 \ + atf-c.3 atf_no_error.3 \ + atf-c.3 atf_tc_expect_death.3 \ + atf-c.3 atf_tc_expect_exit.3 \ + atf-c.3 atf_tc_expect_fail.3 \ + atf-c.3 atf_tc_expect_pass.3 \ + atf-c.3 atf_tc_expect_signal.3 \ + atf-c.3 atf_tc_expect_timeout.3 \ + atf-c.3 atf_tc_fail.3 \ + atf-c.3 atf_tc_fail_nonfatal.3 \ + atf-c.3 atf_tc_pass.3 \ + atf-c.3 atf_tc_skip.3 \ + atf-c.3 atf_utils_cat_file.3 \ + atf-c.3 atf_utils_compare_file.3 \ + atf-c.3 atf_utils_copy_file.3 \ + atf-c.3 atf_utils_create_file.3 \ + atf-c.3 atf_utils_file_exists.3 \ + atf-c.3 atf_utils_fork.3 \ + atf-c.3 atf_utils_free_charpp.3 \ + atf-c.3 atf_utils_grep_file.3 \ + atf-c.3 atf_utils_grep_string.3 \ + atf-c.3 atf_utils_readline.3 \ + atf-c.3 atf_utils_redirect.3 \ + atf-c.3 atf_utils_wait.3 MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= Modified: projects/runtime-coverage-v2/lib/libbe/be.c ============================================================================== --- projects/runtime-coverage-v2/lib/libbe/be.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/libbe/be.c Sat May 4 02:10:47 2019 (r347076) @@ -822,7 +822,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", "/"); + nvlist_add_string(props, "mountpoint", "none"); err = zfs_prop_set_list(zfs, props); nvlist_free(props); Modified: projects/runtime-coverage-v2/lib/libbe/be_access.c ============================================================================== --- projects/runtime-coverage-v2/lib/libbe/be_access.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/libbe/be_access.c Sat May 4 02:10:47 2019 (r347076) @@ -45,6 +45,7 @@ struct be_mount_info { const char *mountpoint; int mntflags; int deepmount; + int depth; }; static int @@ -79,6 +80,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) char *mountpoint; char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; struct be_mount_info *info; + char opt; info = (struct be_mount_info *)data; @@ -94,37 +96,50 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) != 0) { - char opt = '\0'; + if (strcmp("none", zfs_mnt) == 0) { + /* + * mountpoint=none; we'll mount it at info->mountpoint assuming + * we're at the root. If we're not at the root... that's less + * than stellar and not entirely sure what to do with that. + * For now, we won't treat it as an error condition -- we just + * won't mount it, and we'll continue on. + */ + if (info->depth > 0) + return (0); + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); - snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); + } - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(info->lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(info->lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(info->lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(info->lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(info->lbh, BE_ERR_UNKNOWN)); - } + opt = '\0'; + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); } } if (!info->deepmount) return (0); - return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); + ++info->depth; + err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); + --info->depth; + return (err); } @@ -138,9 +153,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data) info = (struct be_mount_info *)data; + ++info->depth; if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { return (err); } + --info->depth; if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { return (0); @@ -248,6 +265,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; info.mntflags = mntflags; info.deepmount = mntdeep; + info.depth = 0; if((err = be_mount_iter(zhdl, &info) != 0)) { zfs_close(zhdl); @@ -283,6 +301,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla info.be = be; info.mountpoint = NULL; info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.depth = 0; if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); Modified: projects/runtime-coverage-v2/lib/libc/gen/directory.3 ============================================================================== --- projects/runtime-coverage-v2/lib/libc/gen/directory.3 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/libc/gen/directory.3 Sat May 4 02:10:47 2019 (r347076) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 22, 2017 +.Dd April 30, 2019 .Dt DIRECTORY 3 .Os .Sh NAME @@ -264,6 +264,30 @@ return (NOT_FOUND); .Xr open 2 , .Xr read 2 , .Xr dir 5 +.Sh STANDARDS +The +.Fn closedir , +.Fn dirfd , +.Fn fdopendir , +.Fn opendir , +.Fn readdir , +.Fn readdir_r , +.Fn rewinddir , +.Fn seekdir +and +.Fn telldir +functions are expected to conform to +.St -p1003.1-2008 . +The +.Fn fdclosedir +function and the +.Fa d_off , +.Fa d_reclen +and +.Fa d_type +fields of +.Vt struct dirent +are non-standard, and should not be used in portable programs. .Sh HISTORY The .Fn opendir , Modified: projects/runtime-coverage-v2/lib/libfetch/common.c ============================================================================== --- projects/runtime-coverage-v2/lib/libfetch/common.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/libfetch/common.c Sat May 4 02:10:47 2019 (r347076) @@ -994,6 +994,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int ver #else (void)conn; (void)verbose; + (void)URL; fprintf(stderr, "SSL support disabled\n"); return (-1); #endif Modified: projects/runtime-coverage-v2/lib/libvgl/bitmap.c ============================================================================== --- projects/runtime-coverage-v2/lib/libvgl/bitmap.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/lib/libvgl/bitmap.c Sat May 4 02:10:47 2019 (r347076) @@ -47,7 +47,7 @@ static int color2bit[16] = {0x00000000, 0x00000001, 0x static void WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line) { - int i, pos, last, planepos, start_offset, end_offset, offset; + int bwidth, i, pos, last, planepos, start_offset, end_offset, offset; int len; unsigned int word = 0; byte *address; @@ -58,13 +58,13 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi case VIDBUF4S: start_offset = (x & 0x07); end_offset = (x + width) & 0x07; - i = (width + start_offset) / 8; + bwidth = (width + start_offset) / 8; if (end_offset) - i++; + bwidth++; VGLPlane[0] = VGLBuf; - VGLPlane[1] = VGLPlane[0] + i; - VGLPlane[2] = VGLPlane[1] + i; - VGLPlane[3] = VGLPlane[2] + i; + VGLPlane[1] = VGLPlane[0] + bwidth; + VGLPlane[2] = VGLPlane[1] + bwidth; + VGLPlane[3] = VGLPlane[2] + bwidth; pos = 0; planepos = 0; last = 8 - start_offset; @@ -87,9 +87,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[2][planepos] = word>>16; VGLPlane[3][planepos] = word>>24; } - if (start_offset || end_offset) - width+=8; - width /= 8; outb(0x3ce, 0x01); outb(0x3cf, 0x00); /* set/reset enable */ outb(0x3ce, 0x08); outb(0x3cf, 0xff); /* bit mask */ for (i=0; i<4; i++) { @@ -103,7 +100,7 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[i][planepos] |= dst->Bitmap[pos+planepos] & mask[end_offset]; if (start_offset) VGLPlane[i][0] |= dst->Bitmap[pos] & ~mask[start_offset]; - bcopy(&VGLPlane[i][0], dst->Bitmap + pos, width); + bcopy(&VGLPlane[i][0], dst->Bitmap + pos, bwidth); } else { /* VIDBUF4S */ if (end_offset) { offset = VGLSetSegment(pos + planepos); @@ -112,9 +109,9 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi offset = VGLSetSegment(pos); if (start_offset) VGLPlane[i][0] |= dst->Bitmap[offset] & ~mask[start_offset]; - for (last = width; ; ) { + for (last = bwidth; ; ) { len = min(VGLAdpInfo.va_window_size - offset, last); - bcopy(&VGLPlane[i][width - last], dst->Bitmap + offset, len); + bcopy(&VGLPlane[i][bwidth - last], dst->Bitmap + offset, len); pos += len; last -= len; if (last <= 0) Modified: projects/runtime-coverage-v2/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- projects/runtime-coverage-v2/libexec/rtld-elf/rtld_malloc.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/libexec/rtld-elf/rtld_malloc.c Sat May 4 02:10:47 2019 (r347076) @@ -45,17 +45,14 @@ static char *rcsid = "$FreeBSD$"; * This is designed for use in a virtual memory environment. */ -#include +#include #include +#include #include #include #include -#include -#include #include #include -#include -#include #include "rtld.h" #include "rtld_printf.h" #include "paths.h" @@ -81,10 +78,6 @@ union overhead { struct { u_char ovu_magic; /* magic number */ u_char ovu_index; /* bucket # */ -#ifdef RCHECK - u_short ovu_rmagic; /* range magic number */ - u_int ovu_size; /* actual block size */ -#endif } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index @@ -100,12 +93,6 @@ static int findbucket(union overhead *freep, int srchl #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ -#ifdef RCHECK -#define RSLOP sizeof (u_short) -#else -#define RSLOP 0 -#endif - /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The * smallest allocatable block is 8 bytes. The overhead information @@ -117,34 +104,7 @@ static union overhead *nextf[NBUCKETS]; static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ -#ifdef MSTATS /* - * nmalloc[i] is the difference between the number of mallocs and frees - * for a given block size. - */ -static u_int nmalloc[NBUCKETS]; -#include -#endif - -#if defined(MALLOC_DEBUG) || defined(RCHECK) -#define ASSERT(p) if (!(p)) botch("p") -#include -static void -botch(s) - char *s; -{ - fprintf(stderr, "\r\nassertion botched: %s\r\n", s); - (void) fflush(stderr); /* just in case user buffered it */ - abort(); -} -#else -#define ASSERT(p) -#endif - -/* Debugging stuff */ -#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) - -/* * The array of supported page sizes is provided by the user, i.e., the * program that calls this storage allocator. That program must initialize * the array before making its first call to allocate storage. The array @@ -188,15 +148,10 @@ __crt_malloc(size_t nbytes) * stored in hash buckets which satisfies request. * Account for space used per block for accounting. */ - if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { -#ifndef RCHECK + if (nbytes <= (unsigned long)(n = pagesz - sizeof(*op))) { amt = 8; /* size of first bucket */ bucket = 0; -#else - amt = 16; /* size of first bucket */ - bucket = 1; -#endif - n = -(sizeof (*op) + RSLOP); + n = -sizeof(*op); } else { amt = pagesz; bucket = pagebucket; @@ -220,18 +175,6 @@ __crt_malloc(size_t nbytes) nextf[bucket] = op->ov_next; op->ov_magic = MAGIC; op->ov_index = bucket; -#ifdef MSTATS - nmalloc[bucket]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = roundup2(nbytes, RSLOP); - op->ov_rmagic = RMAGIC; - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif return ((char *)(op + 1)); } @@ -266,13 +209,9 @@ morecore(int bucket) * sbrk_size <= 0 only for big, FLUFFY, requests (about * 2^30 bytes on a VAX, I think) or for a negative arg. */ - sz = 1 << (bucket + 3); -#ifdef MALLOC_DEBUG - ASSERT(sz > 0); -#else - if (sz <= 0) + if ((unsigned)bucket >= NBBY * sizeof(int) - 4) return; -#endif + sz = 1 << (bucket + 3); if (sz < pagesz) { amt = pagesz; nblks = amt / sz; @@ -306,23 +245,11 @@ __crt_free(void *cp) if (cp == NULL) return; op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); -#ifdef MALLOC_DEBUG - ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ -#else if (op->ov_magic != MAGIC) return; /* sanity */ -#endif -#ifdef RCHECK - ASSERT(op->ov_rmagic == RMAGIC); - ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); -#endif size = op->ov_index; - ASSERT(size < NBUCKETS); op->ov_next = nextf[size]; /* also clobbers ov_magic */ nextf[size] = op; -#ifdef MSTATS - nmalloc[size]--; -#endif } /* @@ -374,26 +301,21 @@ __crt_realloc(void *cp, size_t nbytes) } onb = 1 << (i + 3); if (onb < (u_int)pagesz) - onb -= sizeof (*op) + RSLOP; + onb -= sizeof(*op); else - onb += pagesz - sizeof (*op) - RSLOP; + onb += pagesz - sizeof(*op); /* avoid the copy if same size block */ if (was_alloced) { if (i) { i = 1 << (i + 2); if (i < pagesz) - i -= sizeof (*op) + RSLOP; + i -= sizeof(*op); else - i += pagesz - sizeof (*op) - RSLOP; + i += pagesz - sizeof(*op); } - if (nbytes <= onb && nbytes > (size_t)i) { -#ifdef RCHECK - op->ov_size = roundup2(nbytes, RSLOP); - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - return(cp); - } else - __crt_free(cp); + if (nbytes <= onb && nbytes > (size_t)i) + return (cp); + __crt_free(cp); } if ((res = __crt_malloc(nbytes)) == NULL) return (NULL); @@ -423,39 +345,6 @@ findbucket(union overhead *freep, int srchlen) } return (-1); } - -#ifdef MSTATS -/* - * mstats - print out statistics about malloc - * - * Prints two lines of numbers, one showing the length of the free list - * for each size category, the second showing the number of mallocs - - * frees for each size category. - */ -mstats(char * s) -{ - int i, j; - union overhead *p; - int totfree = 0, - totused = 0; - - fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); - for (i = 0; i < NBUCKETS; i++) { - for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) - ; - fprintf(stderr, " %d", j); - totfree += j * (1 << (i + 3)); - } - fprintf(stderr, "\nused:\t"); - for (i = 0; i < NBUCKETS; i++) { - fprintf(stderr, " %d", nmalloc[i]); - totused += nmalloc[i] * (1 << (i + 3)); - } - fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", - totused, totfree); -} -#endif - static int morepages(int n) Modified: projects/runtime-coverage-v2/release/Makefile.vm ============================================================================== --- projects/runtime-coverage-v2/release/Makefile.vm Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/release/Makefile.vm Sat May 4 02:10:47 2019 (r347076) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: projects/runtime-coverage-v2/release/tools/gce.conf ============================================================================== --- projects/runtime-coverage-v2/release/tools/gce.conf Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/release/tools/gce.conf Sat May 4 02:10:47 2019 (r347076) @@ -3,8 +3,8 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G +# The default of 3GB is too small for GCE, so override the size here. +export VMSIZE=20G # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ Modified: projects/runtime-coverage-v2/release/tools/vmimage.subr ============================================================================== --- projects/runtime-coverage-v2/release/tools/vmimage.subr Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/release/tools/vmimage.subr Sat May 4 02:10:47 2019 (r347076) @@ -182,6 +182,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 Modified: projects/runtime-coverage-v2/sbin/fsck_ffs/dir.c ============================================================================== --- projects/runtime-coverage-v2/sbin/fsck_ffs/dir.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/fsck_ffs/dir.c Sat May 4 02:10:47 2019 (r347076) @@ -147,14 +147,23 @@ fsck_readdir(struct inodesc *idesc) struct direct *dp, *ndp; struct bufarea *bp; long size, blksiz, fix, dploc; + int dc; blksiz = idesc->id_numfrags * sblock.fs_fsize; bp = getdirblk(idesc->id_blkno, blksiz); if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && idesc->id_loc < blksiz) { dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (dircheck(idesc, dp)) + if ((dc = dircheck(idesc, dp)) > 0) { + if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ + dirty(bp); + } goto dpok; + } if (idesc->id_fix == IGNORE) return (0); fix = dofix(idesc, "DIRECTORY CORRUPTED"); @@ -181,19 +190,26 @@ dpok: if ((idesc->id_loc % DIRBLKSIZ) == 0) return (dp); ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0 && - dircheck(idesc, ndp) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) + if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { + if ((dc = dircheck(idesc, ndp)) == 0) { + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (0); + fix = dofix(idesc, "DIRECTORY CORRUPTED"); + bp = getdirblk(idesc->id_blkno, blksiz); + dp = (struct direct *)(bp->b_un.b_buf + dploc); + dp->d_reclen += size; + if (fix) + dirty(bp); + } else if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ dirty(bp); + } } return (dp); } @@ -201,6 +217,11 @@ dpok: /* * Verify that a directory entry is valid. * This is a superset of the checks made in the kernel. + * Also optionally clears padding and unused directory space. + * + * Returns 0 if the entry is bad, 1 if the entry is good and no changes + * were made, and 2 if the entry is good but modified to clear out padding + * and unused space and needs to be written back to disk. */ static int dircheck(struct inodesc *idesc, struct direct *dp) @@ -209,15 +230,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) char *cp; u_char type; u_int8_t namlen; - int spaceleft; + int spaceleft, modified, unused; + modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || - (dp->d_reclen & 0x3) != 0) + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; - if (dp->d_ino == 0) - return (1); + if (dp->d_ino == 0) { + /* + * Special case of an unused directory entry. Normally + * the kernel would coalesce unused space with the previous + * entry by extending its d_reclen, but there are situations + * (e.g. fsck) where that doesn't occur. + * If we're clearing out directory cruft (-z flag), then make + * sure this entry gets fully cleared as well. + */ + if (zflag && fswritefd >= 0) { + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + if (dp->d_name[0] != '\0') { + dp->d_name[0] = '\0'; + modified = 1; + } + } + goto good; + } size = DIRSIZ(0, dp); namlen = dp->d_namlen; type = dp->d_type; @@ -231,7 +276,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) goto bad; if (*cp != '\0') goto bad; + +good: + if (zflag && fswritefd >= 0) { + /* + * Clear unused directory entry space, including the d_name + * padding. + */ + /* First figure the number of pad bytes. */ + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); + + /* Add in the free space to the end of the record. */ + unused += dp->d_reclen - DIRSIZ(0, dp); + + /* + * Now clear out the unused space, keeping track if we actually + * changed anything. + */ + for (cp = &dp->d_name[namlen + 1]; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; + modified = 1; + } + } + + if (modified) { + return 2; + } + } + return (1); + bad: if (debug) printf("Bad dir: ino %d reclen %d namlen %d type %d name %s\n", Modified: projects/runtime-coverage-v2/sbin/fsck_ffs/fsck.h ============================================================================== --- projects/runtime-coverage-v2/sbin/fsck_ffs/fsck.h Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/fsck_ffs/fsck.h Sat May 4 02:10:47 2019 (r347076) @@ -315,6 +315,7 @@ extern off_t bflag; /* location of alternate super b extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ +extern int zflag; /* zero unused directory space */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ Modified: projects/runtime-coverage-v2/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- projects/runtime-coverage-v2/sbin/fsck_ffs/fsck_ffs.8 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/fsck_ffs/fsck_ffs.8 Sat May 4 02:10:47 2019 (r347076) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 3, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCdEFfnpRrSyZ +.Op Fl BCdEFfnpRrSyZz .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -301,6 +301,9 @@ If both and .Fl Z are specified, blocks are first zeroed and then erased. +.It Fl z +Clear unused directory space. +The cleared space includes deleted file names and name padding. .El .Pp Inconsistencies checked are as follows: Modified: projects/runtime-coverage-v2/sbin/fsck_ffs/globs.c ============================================================================== --- projects/runtime-coverage-v2/sbin/fsck_ffs/globs.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/fsck_ffs/globs.c Sat May 4 02:10:47 2019 (r347076) @@ -85,6 +85,7 @@ off_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ +int zflag; /* zero unused directory space */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ Modified: projects/runtime-coverage-v2/sbin/fsck_ffs/main.c ============================================================================== --- projects/runtime-coverage-v2/sbin/fsck_ffs/main.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/fsck_ffs/main.c Sat May 4 02:10:47 2019 (r347076) @@ -89,7 +89,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -164,6 +164,10 @@ main(int argc, char *argv[]) case 'Z': Zflag++; + break; + + case 'z': + zflag++; break; default: Modified: projects/runtime-coverage-v2/sbin/ifconfig/ifconfig.8 ============================================================================== --- projects/runtime-coverage-v2/sbin/ifconfig/ifconfig.8 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/ifconfig/ifconfig.8 Sat May 4 02:10:47 2019 (r347076) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 27, 2018 +.Dd May 3, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2497,6 +2497,22 @@ Use the RSS hash from the network card if available. Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf which are shifted by the number of this parameter. +.It Cm use_numa +Enable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. +This is currently only implemented for lacp mode. +This works only on +.Xr NUMA 4 +hardware, running a kernel compiled with the +.Xr NUMA 4 +option, and when interfaces from multiple +.Xr NUMA 4 +domains are ports of the aggregation interface. +.It Cm -use_numa +Disable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. .It Cm lacp_fast_timeout Enable lacp fast-timeout on the interface. .It Cm -lacp_fast_timeout Modified: projects/runtime-coverage-v2/sbin/ifconfig/iflagg.c ============================================================================== --- projects/runtime-coverage-v2/sbin/ifconfig/iflagg.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/ifconfig/iflagg.c Sat May 4 02:10:47 2019 (r347076) @@ -130,6 +130,8 @@ setlaggsetopt(const char *val, int d, int s, const str switch (ro.ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_USE_NUMA: + case -LAGG_OPT_USE_NUMA: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: case LAGG_OPT_LACP_TXTEST: @@ -303,6 +305,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("lagghash", setlagghash), DEF_CMD("use_flowid", LAGG_OPT_USE_FLOWID, setlaggsetopt), DEF_CMD("-use_flowid", -LAGG_OPT_USE_FLOWID, setlaggsetopt), + DEF_CMD("use_numa", LAGG_OPT_USE_NUMA, setlaggsetopt), + DEF_CMD("-use_numa", -LAGG_OPT_USE_NUMA, setlaggsetopt), DEF_CMD("lacp_strict", LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("-lacp_strict", -LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("lacp_txtest", LAGG_OPT_LACP_TXTEST, setlaggsetopt), Modified: projects/runtime-coverage-v2/sbin/reboot/boot_i386.8 ============================================================================== --- projects/runtime-coverage-v2/sbin/reboot/boot_i386.8 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/sbin/reboot/boot_i386.8 Sat May 4 02:10:47 2019 (r347076) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2018 +.Dd April 30, 2019 .Dt BOOT 8 i386 .Os .Sh NAME @@ -95,7 +95,7 @@ program is documented separately. After the boot blocks have been loaded, you should see a prompt similar to the following: .Bd -literal ->> FreeBSD/i386 BOOT +>> FreeBSD/x86 BOOT Default: 0:ad(0,a)/boot/loader boot: .Ed Modified: projects/runtime-coverage-v2/share/man/man4/ccr.4 ============================================================================== --- projects/runtime-coverage-v2/share/man/man4/ccr.4 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/share/man/man4/ccr.4 Sat May 4 02:10:47 2019 (r347076) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2019 +.Dd April 29, 2019 .Dt CCR 4 .Os .Sh NAME @@ -34,7 +34,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indeunt +.Bd -ragged -offset indent .Cd "device ccr" .Ed .Pp @@ -49,9 +49,10 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, -SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, -SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, +SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC +operations for .Xr crypto 4 and .Xr ipsec 4 . Modified: projects/runtime-coverage-v2/share/man/man7/development.7 ============================================================================== --- projects/runtime-coverage-v2/share/man/man7/development.7 Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/share/man/man7/development.7 Sat May 4 02:10:47 2019 (r347076) @@ -93,7 +93,7 @@ For coding conventions, see To ask questions regarding development, use the mailing lists, such as freebsd-arch@ and freebsd-hackers@: .Pp -.Lk https://lists.FreeBSD.org/ +.Lk https://lists.FreeBSD.org .Pp To get your patches integrated into the main .Fx @@ -102,7 +102,7 @@ it is a code review tool that allows other developers suggest improvements, and, eventually, allows them to pick up the change and commit it: .Pp -.Lk https://reviews.FreeBSD.org/ +.Lk https://reviews.FreeBSD.org .Sh EXAMPLES Check out the CURRENT branch, build it, and install, overwriting the current system: Modified: projects/runtime-coverage-v2/share/misc/committers-src.dot ============================================================================== --- projects/runtime-coverage-v2/share/misc/committers-src.dot Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/share/misc/committers-src.dot Sat May 4 02:10:47 2019 (r347076) @@ -155,6 +155,7 @@ dexuan [label="Dexuan Cui\ndexuan@FreeBSD.org\n2016/10 dfr [label="Doug Rabson\ndfr@FreeBSD.org\n????/??/??"] dg [label="David Greenman\ndg@FreeBSD.org\n1993/06/14"] dim [label="Dimitry Andric\ndim@FreeBSD.org\n2010/08/30"] +dougm [label="Doug Moore\ndougm@FreeBSD.org\n2019/04/30"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2012/04/10"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2004/11/29"] dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] @@ -663,6 +664,7 @@ ken -> will kib -> ae kib -> badger kib -> dchagin +kib -> dougm kib -> gjb kib -> jah kib -> jlh @@ -694,6 +696,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> dougm markj -> lwhsu markj -> mhorne markj -> rlibby Modified: projects/runtime-coverage-v2/stand/common/disk.c ============================================================================== --- projects/runtime-coverage-v2/stand/common/disk.c Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/stand/common/disk.c Sat May 4 02:10:47 2019 (r347076) @@ -286,9 +286,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->entrysize = part.end - part.start + 1; slice = part.index; if (ptable_gettype(od->table) == PTABLE_GPT) { - partition = 255; + partition = D_PARTISGPT; goto out; /* Nothing more to do */ - } else if (partition == 255) { + } else if (partition == D_PARTISGPT) { /* * When we try to open GPT partition, but partition * table isn't GPT, reset d_partition value to -1 @@ -419,7 +419,7 @@ disk_parsedev(struct disk_devdesc *dev, const char *de /* we don't support nested partitions on GPT */ if (*cp != '\0' && *cp != ':') return (EINVAL); - partition = 255; + partition = D_PARTISGPT; } else #endif #ifdef LOADER_MBR_SUPPORT Modified: projects/runtime-coverage-v2/stand/efi/boot1/Makefile ============================================================================== --- projects/runtime-coverage-v2/stand/efi/boot1/Makefile Sat May 4 02:09:30 2019 (r347075) +++ projects/runtime-coverage-v2/stand/efi/boot1/Makefile Sat May 4 02:10:47 2019 (r347076) @@ -2,7 +2,8 @@ .include -PROG= boot1.sym +BOOT1?= boot1 +PROG= ${BOOT1}.sym INTERNALPROG= WARNS?= 6 @@ -24,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sat May 4 02:11:30 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20F0715A22D6 for ; Sat, 4 May 2019 02:11:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA36E6BD31; Sat, 4 May 2019 02:11:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94DF918DB; Sat, 4 May 2019 02:11:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x442BTxj041550; Sat, 4 May 2019 02:11:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442BSNA041546; Sat, 4 May 2019 02:11:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905040211.x442BSNA041546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 4 May 2019 02:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347077 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 347077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA36E6BD31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:11:30 -0000 Author: asomers Date: Sat May 4 02:11:28 2019 New Revision: 347077 URL: https://svnweb.freebsd.org/changeset/base/347077 Log: fusefs: use effective gid, not real gid, for FUSE operations This is the gid used for stuff like setting the group of a newly created file. Reported by: pjdfstest Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.c projects/fuse2/tests/sys/fs/fusefs/allow_other.cc projects/fuse2/tests/sys/fs/fusefs/utils.cc projects/fuse2/tests/sys/fs/fusefs/utils.hh Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_ipc.c Sat May 4 02:10:47 2019 (r347076) +++ projects/fuse2/sys/fs/fuse/fuse_ipc.c Sat May 4 02:11:28 2019 (r347077) @@ -191,6 +191,7 @@ fuse_interrupt_send(struct fuse_ticket *otick, int err struct fuse_data *data = otick->tk_data; struct fuse_ticket *tick, *xtick; struct ucred reused_creds; + gid_t reused_groups[1]; if (otick->irq_unique == 0) { /* @@ -233,7 +234,8 @@ fuse_interrupt_send(struct fuse_ticket *otick, int err */ ftick_hdr = fticket_in_header(otick); reused_creds.cr_uid = ftick_hdr->uid; - reused_creds.cr_rgid = ftick_hdr->gid; + reused_groups[0] = ftick_hdr->gid; + reused_creds.cr_groups = reused_groups; fdisp_init(&fdi, sizeof(*fii)); fdisp_make_pid(&fdi, FUSE_INTERRUPT, data, ftick_hdr->nodeid, ftick_hdr->pid, &reused_creds); @@ -878,7 +880,7 @@ fuse_setup_ihead(struct fuse_in_header *ihead, struct ihead->pid = pid; ihead->uid = cred->cr_uid; - ihead->gid = cred->cr_rgid; + ihead->gid = cred->cr_groups[0]; } /* Modified: projects/fuse2/tests/sys/fs/fusefs/allow_other.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/allow_other.cc Sat May 4 02:10:47 2019 (r347076) +++ projects/fuse2/tests/sys/fs/fusefs/allow_other.cc Sat May 4 02:11:28 2019 (r347077) @@ -98,6 +98,31 @@ TEST_F(AllowOther, allowed) ASSERT_EQ(0, WEXITSTATUS(status)); } +/* Check that fusefs uses the correct credentials for FUSE operations */ +TEST_F(AllowOther, creds) +{ + int status; + uid_t uid; + gid_t gid; + + get_unprivileged_id(&uid, &gid); + fork(true, &status, [=] { + EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in->header.opcode == FUSE_LOOKUP && + in->header.uid == uid && + in->header.gid == gid); + }, Eq(true)), + _) + ).Times(1) + .WillOnce(Invoke(ReturnErrno(ENOENT))); + }, []() { + eaccess(FULLPATH, F_OK); + return 0; + } + ); + ASSERT_EQ(0, WEXITSTATUS(status)); +} + /* * A variation of the Open.multiple_creds test showing how the bug can lead to a * privilege elevation. The first process is privileged and opens a file only Modified: projects/fuse2/tests/sys/fs/fusefs/utils.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.cc Sat May 4 02:10:47 2019 (r347076) +++ projects/fuse2/tests/sys/fs/fusefs/utils.cc Sat May 4 02:11:28 2019 (r347077) @@ -35,6 +35,7 @@ extern "C" { #include #include +#include #include #include #include @@ -317,10 +318,11 @@ void FuseTest::expect_write(uint64_t ino, uint64_t off }))); } -static void -get_unprivileged_uid(uid_t *uid) +void +get_unprivileged_id(uid_t *uid, gid_t *gid) { struct passwd *pw; + struct group *gr; /* * First try "tests", Kyua's default unprivileged user. XXX after @@ -333,7 +335,12 @@ get_unprivileged_uid(uid_t *uid) } if (pw == NULL) GTEST_SKIP() << "Test requires an unprivileged user"; + /* Use group "nobody", which is Kyua's default unprivileged group */ + gr = getgrnam("nobody"); + if (gr == NULL) + GTEST_SKIP() << "Test requires an unprivileged group"; *uid = pw->pw_uid; + *gid = gr->gr_gid; } void @@ -346,9 +353,10 @@ FuseTest::fork(bool drop_privs, int *child_status, int mflags = MAP_ANON | MAP_SHARED; pid_t child; uid_t uid; + gid_t gid; if (drop_privs) { - get_unprivileged_uid(&uid); + get_unprivileged_id(&uid, &gid); if (IsSkipped()) return; } @@ -367,6 +375,11 @@ FuseTest::fork(bool drop_privs, int *child_status, goto out; } + if (drop_privs && 0 != setegid(gid)) { + perror("setegid"); + err = 1; + goto out; + } if (drop_privs && 0 != setreuid(-1, uid)) { perror("setreuid"); err = 1; Modified: projects/fuse2/tests/sys/fs/fusefs/utils.hh ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.hh Sat May 4 02:10:47 2019 (r347076) +++ projects/fuse2/tests/sys/fs/fusefs/utils.hh Sat May 4 02:11:28 2019 (r347077) @@ -37,6 +37,8 @@ #define FUSE_WRITE_CACHE 1 #endif +void get_unprivileged_id(uid_t *uid, gid_t *gid); + class FuseTest : public ::testing::Test { protected: uint32_t m_maxreadahead; From owner-svn-src-projects@freebsd.org Sat May 4 16:28:00 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D45E1592F99 for ; Sat, 4 May 2019 16:28:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1548F62C; Sat, 4 May 2019 16:28:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9198ACBF; Sat, 4 May 2019 16:27:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44GRxcS099145; Sat, 4 May 2019 16:27:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44GRxA0099142; Sat, 4 May 2019 16:27:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905041627.x44GRxA0099142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 4 May 2019 16:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347128 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 347128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E1548F62C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 16:28:00 -0000 Author: asomers Date: Sat May 4 16:27:58 2019 New Revision: 347128 URL: https://svnweb.freebsd.org/changeset/base/347128 Log: fusefs: only root may set the sticky bit on a non-directory PR: 216391 Reported by: pjdfstest Sponsored by: The FreeBSD Foundation Added: projects/fuse2/tests/sys/fs/fusefs/default_permissions_privileged.cc (contents, props changed) Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/Makefile projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Sat May 4 16:24:43 2019 (r347127) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Sat May 4 16:27:58 2019 (r347128) @@ -1603,6 +1603,15 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) */ } if (vap->va_mode != (mode_t)VNOVAL) { + /* Only root may set the sticky bit on non-directories */ + if (dataflags & FSESS_DEFAULT_PERMISSIONS && + vp->v_type != VDIR && (vap->va_mode & S_ISTXT)) + { + if (priv_check_cred(cred, PRIV_VFS_STICKYFILE)) { + err = EFTYPE; + goto out; + } + } fsai->mode = vap->va_mode & ALLPERMS; fsai->valid |= FATTR_MODE; accmode |= VADMIN; Modified: projects/fuse2/tests/sys/fs/fusefs/Makefile ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/Makefile Sat May 4 16:24:43 2019 (r347127) +++ projects/fuse2/tests/sys/fs/fusefs/Makefile Sat May 4 16:27:58 2019 (r347128) @@ -11,6 +11,7 @@ GTESTS+= access GTESTS+= allow_other GTESTS+= create GTESTS+= default_permissions +GTESTS+= default_permissions_privileged GTESTS+= destroy GTESTS+= fifo GTESTS+= flush @@ -47,6 +48,7 @@ SRCS.$p+= utils.cc .endfor TEST_METADATA.default_permissions+= required_user="unprivileged" +TEST_METADATA.default_permissions_privileged+= required_user="root" TEST_METADATA.mknod+= required_user="root" # TODO: drastically increase timeout after test development is mostly complete Modified: projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Sat May 4 16:24:43 2019 (r347127) +++ projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Sat May 4 16:27:58 2019 (r347128) @@ -771,6 +771,28 @@ TEST_F(Setattr, eacces) EXPECT_EQ(EPERM, errno); } +/* Only the superuser may set the sticky bit on a non-directory */ +TEST_F(Setattr, sticky_regular_file) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t oldmode = 0644; + const mode_t newmode = 01644; + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1); + expect_lookup(RELPATH, ino, S_IFREG | oldmode, UINT64_MAX, geteuid()); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR); + }, Eq(true)), + _) + ).Times(0); + + EXPECT_NE(0, chmod(FULLPATH, newmode)); + EXPECT_EQ(EFTYPE, errno); +} + TEST_F(Setextattr, ok) { const char FULLPATH[] = "mountpoint/some_file.txt"; Added: projects/fuse2/tests/sys/fs/fusefs/default_permissions_privileged.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/fuse2/tests/sys/fs/fusefs/default_permissions_privileged.cc Sat May 4 16:27:58 2019 (r347128) @@ -0,0 +1,124 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by BFF Storage Systems, LLC under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for the "default_permissions" mount option that require a privileged + * user. + */ + +extern "C" { +#include +#include + +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +class DefaultPermissionsPrivileged: public FuseTest { +virtual void SetUp() { + m_default_permissions = true; + FuseTest::SetUp(); + if (HasFatalFailure() || IsSkipped()) + return; + + if (geteuid() != 0) { + GTEST_SKIP() << "This test requires a privileged user"; + } + + /* With -o default_permissions, FUSE_ACCESS should never be called */ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in->header.opcode == FUSE_ACCESS); + }, Eq(true)), + _) + ).Times(0); +} + +public: +void expect_getattr(uint64_t ino, mode_t mode, uint64_t attr_valid, int times, + uid_t uid = 0, gid_t gid = 0) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in->header.opcode == FUSE_GETATTR && + in->header.nodeid == ino); + }, Eq(true)), + _) + ).Times(times) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto out) { + SET_OUT_HEADER_LEN(out, attr); + out->body.attr.attr.ino = ino; // Must match nodeid + out->body.attr.attr.mode = mode; + out->body.attr.attr.size = 0; + out->body.attr.attr.uid = uid; + out->body.attr.attr.uid = gid; + out->body.attr.attr_valid = attr_valid; + }))); +} + +void expect_lookup(const char *relpath, uint64_t ino, mode_t mode, + uint64_t attr_valid, uid_t uid = 0, gid_t gid = 0) +{ + FuseTest::expect_lookup(relpath, ino, mode, 0, 1, attr_valid, uid, gid); +} + +}; + +class Setattr: public DefaultPermissionsPrivileged {}; + +TEST_F(Setattr, sticky_regular_file_eftype) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t oldmode = 0644; + const mode_t newmode = 01644; + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1); + expect_lookup(RELPATH, ino, S_IFREG | oldmode, UINT64_MAX, geteuid()); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_SETATTR); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, attr); + out->body.attr.attr.mode = S_IFREG | newmode; + }))); + + EXPECT_EQ(0, chmod(FULLPATH, newmode)) << strerror(errno); +} + +