From owner-svn-src-stable-10@freebsd.org Sun Jul 3 00:31:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D9EB817F9; Sun, 3 Jul 2016 00:31:34 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id 300502BE9; Sun, 3 Jul 2016 00:31:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u630VXFI080203; Sun, 3 Jul 2016 00:31:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u630VXlL080202; Sun, 3 Jul 2016 00:31:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201607030031.u630VXlL080202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 3 Jul 2016 00:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302318 - stable/10/release/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2016 00:31:34 -0000 Author: gjb Date: Sun Jul 3 00:31:33 2016 New Revision: 302318 URL: https://svnweb.freebsd.org/changeset/base/302318 Log: Limit VOLUME_LABEL (first argument to the mkisoimages scripts) to 32 characters. This is a direct commit to stable/10, as UEFI support natively exists for 11.0-CURRENT and unsupported in 9-STABLE. Submitted by: Rick Miller PR: 210463 Sponsored by: The FreeBSD Foundation Modified: stable/10/release/amd64/mkisoimages-uefi.sh Modified: stable/10/release/amd64/mkisoimages-uefi.sh ============================================================================== --- stable/10/release/amd64/mkisoimages-uefi.sh Sun Jul 3 00:08:17 2016 (r302317) +++ stable/10/release/amd64/mkisoimages-uefi.sh Sun Jul 3 00:31:33 2016 (r302318) @@ -50,7 +50,7 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]' | cut -c 1-31`; shift NAME=$1; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" From owner-svn-src-stable-10@freebsd.org Sun Jul 3 11:45:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF2CB90E58; Sun, 3 Jul 2016 11:45:55 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id 3DA772C58; Sun, 3 Jul 2016 11:45:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u63BjsKY029174; Sun, 3 Jul 2016 11:45:54 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u63BjsQb029173; Sun, 3 Jul 2016 11:45:54 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201607031145.u63BjsQb029173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 3 Jul 2016 11:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302323 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2016 11:45:55 -0000 Author: jilles Date: Sun Jul 3 11:45:54 2016 New Revision: 302323 URL: https://svnweb.freebsd.org/changeset/base/302323 Log: MFC r302151: posixshm: Fix lock leak when mac_posixshm_check_read rejects read. While reading the code, I noticed that shm_read() returns without unlocking foffset and rangelock if mac_posixshm_check_read() rejects the read. Modified: stable/10/sys/kern/uipc_shm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_shm.c ============================================================================== --- stable/10/sys/kern/uipc_shm.c Sun Jul 3 01:56:48 2016 (r302322) +++ stable/10/sys/kern/uipc_shm.c Sun Jul 3 11:45:54 2016 (r302323) @@ -293,14 +293,14 @@ shm_read(struct file *fp, struct uio *ui int error; shmfd = fp->f_data; - foffset_lock_uio(fp, uio, flags); - rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, - uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); #ifdef MAC error = mac_posixshm_check_read(active_cred, fp->f_cred, shmfd); if (error) return (error); #endif + foffset_lock_uio(fp, uio, flags); + rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, + uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); foffset_unlock_uio(fp, uio, flags); From owner-svn-src-stable-10@freebsd.org Mon Jul 4 14:23:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F21FB91125; Mon, 4 Jul 2016 14:23:37 +0000 (UTC) (envelope-from wblock@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 mx1.freebsd.org (Postfix) with ESMTPS id 188D52631; Mon, 4 Jul 2016 14:23:37 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u64ENaI0028350; Mon, 4 Jul 2016 14:23:36 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u64ENamN028349; Mon, 4 Jul 2016 14:23:36 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201607041423.u64ENamN028349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Mon, 4 Jul 2016 14:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302334 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2016 14:23:37 -0000 Author: wblock (doc committer) Date: Mon Jul 4 14:23:36 2016 New Revision: 302334 URL: https://svnweb.freebsd.org/changeset/base/302334 Log: MFC r301007: Clarify the explanations for the hostname and FQDN entries. Modified: stable/10/bin/sh/sh.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/sh.1 ============================================================================== --- stable/10/bin/sh/sh.1 Mon Jul 4 13:22:13 2016 (r302333) +++ stable/10/bin/sh/sh.1 Mon Jul 4 14:23:36 2016 (r302334) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 24, 2016 +.Dd May 30, 2016 .Dt SH 1 .Os .Sh NAME @@ -1371,9 +1371,9 @@ may include any of the following formatt which are replaced by the given information: .Bl -tag -width indent .It Li \eH -The fully-qualified hostname. +This system's fully-qualified hostname (FQDN). .It Li \eh -The local hostname. +This system's hostname. .It Li \eW The final component of the current working directory. .It Li \ew From owner-svn-src-stable-10@freebsd.org Wed Jul 6 17:42:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B91B75FAD; Wed, 6 Jul 2016 17:42:11 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 2805619E6; Wed, 6 Jul 2016 17:42:11 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u66HgAvD019535; Wed, 6 Jul 2016 17:42:10 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u66Hg9pF018824; Wed, 6 Jul 2016 17:42:09 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201607061742.u66Hg9pF018824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 6 Jul 2016 17:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302376 - in stable/10: sbin/camcontrol sys/cam sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2016 17:42:11 -0000 Author: truckman Date: Wed Jul 6 17:42:09 2016 New Revision: 302376 URL: https://svnweb.freebsd.org/changeset/base/302376 Log: MFC r299371 (by trasz) Add "camcontrol reprobe" subcommand, and implement it for da(4). This makes it possible to manually force updating capacity data after the disk got resized. Without it it might be neccessary to reboot before FreeBSD notices updated disk size under eg VMWare. Differential Revision: https://reviews.freebsd.org/D6108 Modified: stable/10/sbin/camcontrol/camcontrol.8 stable/10/sbin/camcontrol/camcontrol.c stable/10/sys/cam/cam_ccb.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.8 Wed Jul 6 16:20:10 2016 (r302375) +++ stable/10/sbin/camcontrol/camcontrol.8 Wed Jul 6 17:42:09 2016 (r302376) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2015 +.Dd April 26, 2016 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -98,6 +98,9 @@ .Op device id .Op generic args .Nm +.Ic reprobe +.Op device id +.Nm .Ic rescan .Aq all | bus Ns Op :target:lun .Nm @@ -518,6 +521,12 @@ are not specified). Print out the last logical block or the size of the device only, and omit the blocksize. .El +.Pp +Note that this command only displays the information, it does not update +the kernel data structures. +Use the +.Nm +reprobe subcommand to do that. .It Ic start Send the SCSI Start/Stop Unit (0x1B) command to the given device with the start bit set. @@ -539,6 +548,12 @@ The user may specify a scan of all busses, a single bus, or a lun. Scanning all luns on a target is not supported. +.It Ic reprobe +Tell the kernel to refresh the information about the device and +notify the upper layer, +.Xr GEOM 4 . +This includes sending the SCSI READ CAPACITY command and updating +the disk size visible to the rest of the system. .It Ic reset Tell the kernel to reset all busses in the system (with the .Ar all Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Wed Jul 6 16:20:10 2016 (r302375) +++ stable/10/sbin/camcontrol/camcontrol.c Wed Jul 6 17:42:09 2016 (r302376) @@ -100,7 +100,8 @@ typedef enum { CAM_CMD_APM = 0x00000021, CAM_CMD_AAM = 0x00000022, CAM_CMD_ATTRIB = 0x00000023, - CAM_CMD_OPCODES = 0x00000024 + CAM_CMD_OPCODES = 0x00000024, + CAM_CMD_REPROBE = 0x00000025 } cam_cmdmask; typedef enum { @@ -190,6 +191,7 @@ static struct camcontrol_opts option_tab {"eject", CAM_CMD_STARTSTOP, CAM_ARG_EJECT, NULL}, {"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"}, {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHNqs"}, + {"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL}, #endif /* MINIMALISTIC */ {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, {"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL}, @@ -328,6 +330,7 @@ static int scsiprintopcodes(struct cam_d static int scsiopcodes(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbose); +static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ #ifndef min @@ -8662,6 +8665,42 @@ bailout: #endif /* MINIMALISTIC */ +static int +scsireprobe(struct cam_device *device) +{ + union ccb *ccb; + int retval = 0; + + ccb = cam_getccb(device); + + if (ccb == NULL) { + warnx("%s: error allocating ccb", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + + ccb->ccb_h.func_code = XPT_REPROBE_LUN; + + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending XPT_REPROBE_LUN CCB"); + retval = 1; + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + retval = 1; + goto bailout; + } + +bailout: + cam_freeccb(ccb); + + return (retval); +} + void usage(int printlong) { @@ -8681,6 +8720,7 @@ usage(int printlong) " camcontrol stop [dev_id][generic args]\n" " camcontrol load [dev_id][generic args]\n" " camcontrol eject [dev_id][generic args]\n" +" camcontrol reprobe [dev_id][generic args]\n" #endif /* MINIMALISTIC */ " camcontrol rescan \n" " camcontrol reset \n" @@ -8753,6 +8793,7 @@ usage(int printlong) "stop send a Stop Unit command to the device\n" "load send a Start Unit command to the device with the load bit set\n" "eject send a Stop Unit command to the device with the eject bit set\n" +"reprobe update capacity information of the given device\n" "rescan rescan all busses, the given bus, or bus:target:lun\n" "reset reset all busses, the given bus, or bus:target:lun\n" "defects read the defect list of the specified device\n" @@ -9298,6 +9339,10 @@ main(int argc, char **argv) error = scsiopcodes(cam_dev, argc, argv, combinedopt, retry_count, timeout, arglist & CAM_ARG_VERBOSE); break; + case CAM_CMD_REPROBE: + error = scsireprobe(cam_dev); + break; + #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Wed Jul 6 16:20:10 2016 (r302375) +++ stable/10/sys/cam/cam_ccb.h Wed Jul 6 17:42:09 2016 (r302376) @@ -230,6 +230,8 @@ typedef enum { /* Notify Host Target driver of event */ XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /* Acknowledgement of event */ + XPT_REPROBE_LUN = 0x38 | XPT_FC_QUEUED | XPT_FC_USER_CCB, + /* Query device capacity and notify GEOM */ /* Vendor Unique codes: 0x80->0x8F */ XPT_VUNIQUE = 0x80 Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Wed Jul 6 16:20:10 2016 (r302375) +++ stable/10/sys/cam/cam_xpt.c Wed Jul 6 17:42:09 2016 (r302376) @@ -2991,6 +2991,11 @@ call_sim: xpt_freeze_devq(path, 1); start_ccb->ccb_h.status = CAM_REQ_CMP; break; + case XPT_REPROBE_LUN: + xpt_async(AC_INQ_CHANGED, path, NULL); + start_ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(start_ccb); + break; default: case XPT_SDEV_TYPE: case XPT_TERM_IO: Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Wed Jul 6 16:20:10 2016 (r302375) +++ stable/10/sys/cam/scsi/scsi_da.c Wed Jul 6 17:42:09 2016 (r302376) @@ -1758,6 +1758,11 @@ daasync(void *callback_arg, u_int32_t co ccbh->ccb_state |= DA_CCB_RETRY_UA; break; } + case AC_INQ_CHANGED: + softc = (struct da_softc *)periph->softc; + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + break; default: break; } @@ -2239,8 +2244,8 @@ daregister(struct cam_periph *periph, vo * would be to not attach the device on failure. */ xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | - AC_ADVINFO_CHANGED | AC_SCSI_AEN | AC_UNIT_ATTENTION, - daasync, periph, periph->path); + AC_ADVINFO_CHANGED | AC_SCSI_AEN | AC_UNIT_ATTENTION | + AC_INQ_CHANGED, daasync, periph, periph->path); /* * Emit an attribute changed notification just in case From owner-svn-src-stable-10@freebsd.org Wed Jul 6 17:45:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EE73B75034; Wed, 6 Jul 2016 17:45:40 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 29F531BE2; Wed, 6 Jul 2016 17:45:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u66HjdP0019749; Wed, 6 Jul 2016 17:45:39 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u66Hjc5v019740; Wed, 6 Jul 2016 17:45:38 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201607061745.u66Hjc5v019740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 6 Jul 2016 17:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302377 - in stable/10: lib/libcam sbin/camcontrol sbin/iscontrol sys/cam usr.sbin/camdd usr.sbin/mptutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2016 17:45:40 -0000 Author: truckman Date: Wed Jul 6 17:45:38 2016 New Revision: 302377 URL: https://svnweb.freebsd.org/changeset/base/302377 Log: MFC r300547 Fix multiple Coverity Out-of-bounds access false postive issues in CAM The currently used idiom for clearing the part of a ccb after its header generates one or two Coverity errors for each time it is used. All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON) error because of the treatment of the header as a two element array, with a pointer to the non-existent second element being passed as the starting address to bzero(). Some instances also alsp generate Out-of-bounds access (OVERRUN) errors, probably because the space being cleared is larger than the sizeofstruct ccb_hdr). In addition, this idiom is difficult for humans to understand and it is error prone. The user has to chose the proper struct ccb_* type (which does not appear in the surrounding code) for the sizeof() in the length calculation. I found several instances where the length was incorrect, which could cause either an actual out of bounds write, or incompletely clear the ccb. A better way is to write the code to clear the ccb itself starting at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate the length based on the specific type of struct ccb_* being cleared as specified by the union ccb member being used. The latter can normally be seen in the nearby code. This is friendlier for Coverity and other static analysis tools because they will see that the intent is to clear the trailing part of the ccb. Wrap all of the boilerplate code in a convenient macro that only requires a pointer to the desired union ccb member (or a pointer to the union ccb itself) as an argument. Reported by: Coverity CID: 1007578, 1008684, 1009724, 1009773, 1011304, 1011306 CID: 1011307, 1011308, 1011309, 1011310, 1011311, 1011312 CID: 1011313, 1011314, 1011315, 1011316, 1011317, 1011318 CID: 1011319, 1011320, 1011321, 1011322, 1011324, 1011325 CID: 1011326, 1011327, 1011328, 1011329, 1011330, 1011374 CID: 1011390, 1011391, 1011392, 1011393, 1011394, 1011395 CID: 1011396, 1011397, 1011398, 1011399, 1011400, 1011401 CID: 1011402, 1011403, 1011404, 1011405, 1011406, 1011408 CID: 1011409, 1011410, 1011411, 1011412, 1011413, 1011414 CID: 1017461, 1018387, 1086860, 1086874, 1194257, 1229897 CID: 1229968, 1306229, 1306234, 1331282, 1331283, 1331294 CID: 1331295, 1331535, 1331536, 1331539, 1331540, 1341623 CID: 1341624, 1341637, 1341638, 1355264, 1355324 Reviewed by: scottl, ken, delphij, imp MFH: 1 month Differential Revision: https://reviews.freebsd.org/D6496 Modified: stable/10/lib/libcam/camlib.c stable/10/sbin/camcontrol/attrib.c stable/10/sbin/camcontrol/camcontrol.c stable/10/sbin/camcontrol/fwdownload.c stable/10/sbin/camcontrol/persist.c stable/10/sbin/iscontrol/fsm.c stable/10/sys/cam/cam_ccb.h stable/10/usr.sbin/camdd/camdd.c stable/10/usr.sbin/mptutil/mpt_cam.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c ============================================================================== --- stable/10/lib/libcam/camlib.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/lib/libcam/camlib.c Wed Jul 6 17:45:38 2016 (r302377) @@ -619,7 +619,7 @@ cam_real_open_device(const char *path, i /* * Zero the payload, the kernel does look at the flags. */ - bzero(&(&ccb.ccb_h)[1], sizeof(struct ccb_trans_settings)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb.cts); /* * Get transfer settings for this device. Modified: stable/10/sbin/camcontrol/attrib.c ============================================================================== --- stable/10/sbin/camcontrol/attrib.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sbin/camcontrol/attrib.c Wed Jul 6 17:45:38 2016 (r302377) @@ -137,8 +137,7 @@ scsiattrib(struct cam_device *device, in goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); STAILQ_INIT(&write_attr_list); Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sbin/camcontrol/camcontrol.c Wed Jul 6 17:45:38 2016 (r302377) @@ -838,8 +838,7 @@ scsiinquiry(struct cam_device *device, i } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); inq_buf = (struct scsi_inquiry_data *)malloc( sizeof(struct scsi_inquiry_data)); @@ -954,8 +953,7 @@ scsiserial(struct cam_device *device, in } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf)); @@ -1047,8 +1045,7 @@ camxferrate(struct cam_device *device) return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; ccb->cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -1601,8 +1598,7 @@ ata_do_pass_16(struct cam_device *device ata_flags |= AP_FLAG_TLEN_NO_DATA; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_ata_pass_16(&ccb->csio, retries, @@ -1663,8 +1659,7 @@ ata_do_28bit_cmd(struct cam_device *devi timeout, quiet); } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); cam_fill_ataio(&ccb->ataio, retries, NULL, @@ -1733,8 +1728,7 @@ ata_do_cmd(struct cam_device *device, un return (error); } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); cam_fill_ataio(&ccb->ataio, retries, NULL, @@ -3184,8 +3178,7 @@ rescan_or_reset_bus(path_id_t bus, int r * no-op, sending a rescan to the xpt bus would result in a status of * CAM_REQ_INVALID. */ - bzero(&(&matchccb.ccb_h)[1], - sizeof(struct ccb_dev_match) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm); matchccb.ccb_h.func_code = XPT_DEV_MATCH; matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; bufsize = sizeof(struct dev_match_result) * 20; @@ -3533,8 +3526,7 @@ next_batch: * cam_getccb() zeros the CCB header only. So we need to zero the * payload portion of the ccb. */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_defects(&ccb->csio, /*retries*/ retry_count, @@ -3987,8 +3979,7 @@ mode_sense(struct cam_device *device, in if (ccb == NULL) errx(1, "mode_sense: couldn't allocate CCB"); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_mode_sense(&ccb->csio, /* retries */ retry_count, @@ -4037,8 +4028,7 @@ mode_select(struct cam_device *device, i if (ccb == NULL) errx(1, "mode_select: couldn't allocate CCB"); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_mode_select(&ccb->csio, /* retries */ retry_count, @@ -4155,8 +4145,7 @@ scsicmd(struct cam_device *device, int a return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4657,8 +4646,7 @@ tagcontrol(struct cam_device *device, in cam_path_string(device, pathstr, sizeof(pathstr)); if (numtags >= 0) { - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_relsim) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->crs); ccb->ccb_h.func_code = XPT_REL_SIMQ; ccb->ccb_h.flags = CAM_DEV_QFREEZE; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; @@ -4685,8 +4673,7 @@ tagcontrol(struct cam_device *device, in pathstr, ccb->crs.openings); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_getdevstats) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgds); ccb->ccb_h.func_code = XPT_GDEV_STATS; @@ -4886,8 +4873,7 @@ get_cpi(struct cam_device *device, struc warnx("get_cpi: couldn't allocate CCB"); return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; if (cam_send_ccb(device, ccb) < 0) { warn("get_cpi: error sending Path Inquiry CCB"); @@ -4925,8 +4911,7 @@ get_cgd(struct cam_device *device, struc warnx("get_cgd: couldn't allocate CCB"); return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; if (cam_send_ccb(device, ccb) < 0) { warn("get_cgd: error sending Path Inquiry CCB"); @@ -4971,8 +4956,7 @@ dev_has_vpd_page(struct cam_device *dev, } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); bzero(&sup_pages, sizeof(sup_pages)); @@ -5286,8 +5270,7 @@ get_print_cts(struct cam_device *device, return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -5427,8 +5410,7 @@ ratecontrol(struct cam_device *device, i break; } } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user @@ -5454,8 +5436,7 @@ ratecontrol(struct cam_device *device, i goto ratecontrol_bailout; } bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); if (quiet == 0) { fprintf(stdout, "%s parameters:\n", user_settings ? "User" : "Current"); @@ -5708,8 +5689,7 @@ scsiformat(struct cam_device *device, in return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -5857,8 +5837,7 @@ doreport: do { cam_status status; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * There's really no need to do error recovery or @@ -6005,8 +5984,7 @@ scsisanitize(struct cam_device *device, return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -6267,8 +6245,7 @@ doreport: do { cam_status status; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * There's really no need to do error recovery or @@ -6410,8 +6387,7 @@ scsireportluns(struct cam_device *device return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); countonly = 0; lunsonly = 0; @@ -6659,8 +6635,7 @@ scsireadcapacity(struct cam_device *devi return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -6864,8 +6839,7 @@ smpcmd(struct cam_device *device, int ar return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7058,8 +7032,7 @@ smpreportgeneral(struct cam_device *devi return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7121,8 +7094,7 @@ try_long: if ((response->long_response & SMP_RG_LONG_RESPONSE) && (long_response == 0)) { ccb->ccb_h.status = CAM_REQ_INPROG; - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); long_response = 1; goto try_long; } @@ -7204,8 +7176,7 @@ smpphycontrol(struct cam_device *device, return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7462,8 +7433,7 @@ smpmaninfo(struct cam_device *device, in return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7557,8 +7527,7 @@ getdevid(struct cam_devitem *item) goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cdai); /* * On the first try, we just probe for the size of the data, and @@ -7843,8 +7812,7 @@ smpphylist(struct cam_device *device, in return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); @@ -7948,8 +7916,7 @@ smpphylist(struct cam_device *device, in char tmpstr[256]; int j; - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; @@ -8238,8 +8205,7 @@ scsigetopcodes(struct cam_device *device } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); if (opcode_set != 0) { options |= RSO_OPTIONS_OC; @@ -8678,8 +8644,7 @@ scsireprobe(struct cam_device *device) return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); ccb->ccb_h.func_code = XPT_REPROBE_LUN; Modified: stable/10/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/10/sbin/camcontrol/fwdownload.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sbin/camcontrol/fwdownload.c Wed Jul 6 17:45:38 2016 (r302377) @@ -459,8 +459,7 @@ fw_validate_ibm(struct cam_device *dev, } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); bzero(&vpd_page, sizeof(vpd_page)); @@ -666,8 +665,7 @@ fw_check_device_ready(struct cam_device goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); if (devtype != CC_DT_SCSI) { dxfer_len = sizeof(struct ata_params); @@ -789,8 +787,7 @@ fw_download_img(struct cam_device *cam_d goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); max_pkt_size = vp->max_pkt_size; if (max_pkt_size == 0) @@ -821,8 +818,7 @@ fw_download_img(struct cam_device *cam_d vp->cdb_byte2; cdb.buffer_id = vp->inc_cdb_buffer_id ? pkt_count : 0; /* Zero out payload of ccb union after ccb header. */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * Copy previously constructed cdb into ccb_scsiio * struct. Modified: stable/10/sbin/camcontrol/persist.c ============================================================================== --- stable/10/sbin/camcontrol/persist.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sbin/camcontrol/persist.c Wed Jul 6 17:45:38 2016 (r302377) @@ -450,8 +450,7 @@ scsipersist(struct cam_device *device, i goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { Modified: stable/10/sbin/iscontrol/fsm.c ============================================================================== --- stable/10/sbin/iscontrol/fsm.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sbin/iscontrol/fsm.c Wed Jul 6 17:45:38 2016 (r302377) @@ -371,7 +371,7 @@ doCAM(isess_t *sess) debug(2, "pathstr=%s", pathstr); ccb = cam_getccb(sess->camdev); - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_relsim) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->crs); ccb->ccb_h.func_code = XPT_REL_SIMQ; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; ccb->crs.openings = sess->op->tags; Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/sys/cam/cam_ccb.h Wed Jul 6 17:45:38 2016 (r302377) @@ -1217,6 +1217,10 @@ union ccb { struct ccb_async casync; }; +#define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ + bzero((char *)(ccbp) + sizeof((ccbp)->ccb_h), \ + sizeof(*(ccbp)) - sizeof((ccbp)->ccb_h)) + __BEGIN_DECLS static __inline void cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, Modified: stable/10/usr.sbin/camdd/camdd.c ============================================================================== --- stable/10/usr.sbin/camdd/camdd.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/usr.sbin/camdd/camdd.c Wed Jul 6 17:45:38 2016 (r302377) @@ -1305,8 +1305,7 @@ camdd_probe_pass(struct cam_device *cam_ goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity(&ccb->csio, /*retries*/ probe_retry_count, @@ -1387,8 +1386,7 @@ rcap_done: goto bailout_error; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; ccb->ccb_h.flags = CAM_DIR_NONE; @@ -2439,8 +2437,7 @@ camdd_pass_run(struct camdd_dev *dev) data = &buf->buf_type_spec.data; ccb = &data->ccb; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * In almost every case the number of blocks should be the device Modified: stable/10/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- stable/10/usr.sbin/mptutil/mpt_cam.c Wed Jul 6 17:42:09 2016 (r302376) +++ stable/10/usr.sbin/mptutil/mpt_cam.c Wed Jul 6 17:45:38 2016 (r302377) @@ -241,8 +241,7 @@ fetch_scsi_capacity(struct cam_device *d return (ENOMEM); /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, &rcap, SSD_FULL_SIZE, 5000); @@ -273,8 +272,7 @@ fetch_scsi_capacity(struct cam_device *d } /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity_16(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, 0, 0, 0, (uint8_t *)&rcaplong, sizeof(rcaplong), SSD_FULL_SIZE, 5000); @@ -355,8 +353,7 @@ fetch_scsi_inquiry(struct cam_device *de return (ENOMEM); /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); inq_buf = calloc(1, sizeof(*inq_buf)); if (inq_buf == NULL) { From owner-svn-src-stable-10@freebsd.org Thu Jul 7 02:23:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4C6B75CE3; Thu, 7 Jul 2016 02:23:53 +0000 (UTC) (envelope-from cy@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 mx1.freebsd.org (Postfix) with ESMTPS id 78D4E1312; Thu, 7 Jul 2016 02:23:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u672NqOA013084; Thu, 7 Jul 2016 02:23:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u672Nq06013083; Thu, 7 Jul 2016 02:23:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201607070223.u672Nq06013083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 7 Jul 2016 02:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302383 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 02:23:53 -0000 Author: cy Date: Thu Jul 7 02:23:52 2016 New Revision: 302383 URL: https://svnweb.freebsd.org/changeset/base/302383 Log: MFC r302296: Remove dead code. Modified: stable/10/contrib/ipfilter/tools/ipf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipf.c ============================================================================== --- stable/10/contrib/ipfilter/tools/ipf.c Wed Jul 6 23:49:19 2016 (r302382) +++ stable/10/contrib/ipfilter/tools/ipf.c Thu Jul 7 02:23:52 2016 (r302383) @@ -410,23 +410,6 @@ static void flushfilter(arg, filter) return; } -#ifdef SIOCIPFFA - if (!strcmp(arg, "u")) { - closedevice(); - /* - * Flush auth rules and packets - */ - if (opendevice(IPL_AUTH, 1) == -1) - perror("open(IPL_AUTH)"); - else { - if (ioctl(fd, SIOCIPFFA, &fl) == -1) - ipferror(fd, "ioctl(SIOCIPFFA)"); - } - closedevice(); - return; - } -#endif - if (strchr(arg, 'i') || strchr(arg, 'I')) fl = FR_INQUE; if (strchr(arg, 'o') || strchr(arg, 'O')) From owner-svn-src-stable-10@freebsd.org Thu Jul 7 05:00:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD1A6B75637; Thu, 7 Jul 2016 05:00:00 +0000 (UTC) (envelope-from delphij@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 mx1.freebsd.org (Postfix) with ESMTPS id 6D5A01C44; Thu, 7 Jul 2016 05:00:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u674xxEK068732; Thu, 7 Jul 2016 04:59:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u674xwHD068722; Thu, 7 Jul 2016 04:59:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607070459.u674xwHD068722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 7 Jul 2016 04:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302385 - in stable/10/contrib/expat: . doc examples lib tests tests/benchmark xmlwf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 05:00:00 -0000 Author: delphij Date: Thu Jul 7 04:59:58 2016 New Revision: 302385 URL: https://svnweb.freebsd.org/changeset/base/302385 Log: MFC r302305: MFV r302260: expat 2.2.0. Added: stable/10/contrib/expat/configure.ac - copied unchanged from r302305, head/contrib/expat/configure.ac stable/10/contrib/expat/doc/xmlwf.xml - copied unchanged from r302305, head/contrib/expat/doc/xmlwf.xml Deleted: stable/10/contrib/expat/configure.in stable/10/contrib/expat/doc/xmlwf.sgml Modified: stable/10/contrib/expat/COPYING stable/10/contrib/expat/Changes stable/10/contrib/expat/MANIFEST stable/10/contrib/expat/Makefile.in stable/10/contrib/expat/README stable/10/contrib/expat/doc/expat.png (contents, props changed) stable/10/contrib/expat/doc/reference.html stable/10/contrib/expat/doc/xmlwf.1 stable/10/contrib/expat/examples/elements.c stable/10/contrib/expat/examples/outline.c stable/10/contrib/expat/expat_config.h.in stable/10/contrib/expat/lib/expat.h stable/10/contrib/expat/lib/expat_external.h stable/10/contrib/expat/lib/internal.h stable/10/contrib/expat/lib/xmlparse.c stable/10/contrib/expat/lib/xmlrole.c stable/10/contrib/expat/lib/xmltok.c stable/10/contrib/expat/lib/xmltok.h stable/10/contrib/expat/lib/xmltok_impl.c stable/10/contrib/expat/tests/benchmark/README.txt stable/10/contrib/expat/tests/chardata.c stable/10/contrib/expat/tests/minicheck.c stable/10/contrib/expat/tests/minicheck.h stable/10/contrib/expat/tests/runtests.c stable/10/contrib/expat/tests/xmltest.sh stable/10/contrib/expat/xmlwf/codepage.c stable/10/contrib/expat/xmlwf/readfilemap.c stable/10/contrib/expat/xmlwf/unixfilemap.c stable/10/contrib/expat/xmlwf/xmlfile.c stable/10/contrib/expat/xmlwf/xmlwf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/expat/COPYING ============================================================================== --- stable/10/contrib/expat/COPYING Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/COPYING Thu Jul 7 04:59:58 2016 (r302385) @@ -1,6 +1,5 @@ -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - and Clark Cooper -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. +Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper +Copyright (c) 2001-2016 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Modified: stable/10/contrib/expat/Changes ============================================================================== --- stable/10/contrib/expat/Changes Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/Changes Thu Jul 7 04:59:58 2016 (r302385) @@ -1,3 +1,67 @@ +Release 2.2.0 Tue June 21 2016 + Security fixes: + #537 CVE-2016-0718 -- Fix crash on malformed input + CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 / + CVE-2015-2716 introduced with Expat 2.1.1 + #499 CVE-2016-5300 -- Use more entropy for hash initialization + than the original fix to CVE-2012-0876 + #519 CVE-2012-6702 -- Resolve troublesome internal call to srand + that was introduced with Expat 2.1.0 + when addressing CVE-2012-0876 (issue #496) + + Bug fixes: + Fix uninitialized reads of size 1 + (e.g. in little2_updatePosition) + Fix detection of UTF-8 character boundaries + + Other changes: + #532 Fix compilation for Visual Studio 2010 (keyword "C99") + Autotools: Resolve use of "$<" to better support bmake + Autotools: Add QA script "qa.sh" (and make target "qa") + Autotools: Respect CXXFLAGS if given + Autotools: Fix "make run-xmltest" + Autotools: Have "make run-xmltest" check for expected output + p90 CMake: Fix static build (BUILD_shared=OFF) on Windows + #536 CMake: Add soversion, support -DNO_SONAME=yes to bypass + #323 CMake: Add suffix "d" to differentiate debug from release + CMake: Define WIN32 with CMake on Windows + Annotate memory allocators for GCC + Address all currently known compile warnings + Make sure that API symbols remain visible despite + -fvisibility=hidden + Remove executable flag from source files + Resolve COMPILED_FROM_DSP in favor of WIN32 + + Special thanks to: + Björn Lindahl + Christian Heimes + Cristian Rodríguez + Daniel Krügler + Gustavo Grieco + Karl Waclawek + László Böszörményi + Marco Grassi + Pascal Cuoq + Sergei Nikulov + Thomas Beutlich + Warren Young + Yann Droneaud + +Release 2.1.1 Sat March 12 2016 + Security fixes: + #582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer + + Bug fixes: + #502: Fix potential null pointer dereference + #520: Symbol XML_SetHashSalt was not exported + Output of "xmlwf -h" was incomplete + + Other changes: + #503: Document behavior of calling XML_SetHashSalt with salt 0 + Minor improvements to man page xmlwf(1) + Improvements to the experimental CMake build system + libtool now invoked with --verbose + Release 2.1.0 Sat March 24 2012 - Bug Fixes: #1742315: Harmful XML_ParserCreateNS suggestion. @@ -23,7 +87,7 @@ Release 2.1.0 Sat March 24 2012 #3312568: CMake support. #3446384: Report byte offsets for attr names and values. - New Features / API changes: - Added new API member XML_SetHashSalt() that allows setting an intial + Added new API member XML_SetHashSalt() that allows setting an initial value (salt) for hash calculations. This is part of the fix for bug #3496608 to randomize hash parameters. When compiled with XML_ATTR_INFO defined, adds new API member Modified: stable/10/contrib/expat/MANIFEST ============================================================================== --- stable/10/contrib/expat/MANIFEST Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/MANIFEST Thu Jul 7 04:59:58 2016 (r302385) @@ -44,7 +44,7 @@ doc/reference.html doc/style.css doc/valid-xhtml10.png doc/xmlwf.1 -doc/xmlwf.sgml +doc/xmlwf.xml CMakeLists.txt CMake.README COPYING @@ -54,7 +54,7 @@ MANIFEST Makefile.in README configure -configure.in +configure.ac expat_config.h.in expat_config.h.cmake expat.pc.in Modified: stable/10/contrib/expat/Makefile.in ============================================================================== --- stable/10/contrib/expat/Makefile.in Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/Makefile.in Thu Jul 7 04:59:58 2016 (r302385) @@ -42,7 +42,7 @@ INSTALL_DATA = @INSTALL_DATA@ mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h +APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h expat_config.h LIBRARY = libexpat.la DESTDIR = $(INSTALL_ROOT) @@ -51,7 +51,7 @@ default: buildlib xmlwf/xmlwf@EXEEXT@ buildlib: $(LIBRARY) expat.pc -all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline $(MANFILE) clean: cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs @@ -77,7 +77,10 @@ check: tests/runtests tests/runtestspp tests/runtests tests/runtestspp -install: xmlwf/xmlwf@EXEEXT@ installlib +$(MANFILE): + $(MAKE) -C doc xmlwf.1 + +install: xmlwf/xmlwf@EXEEXT@ installlib $(MANFILE) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) @@ -116,7 +119,7 @@ CXXFLAGS = @CXXFLAGS@ VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ ### autoconf this? -LTFLAGS = --silent +LTFLAGS = --verbose COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS) CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS) @@ -154,11 +157,11 @@ xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIB examples/elements.@OBJEXT@: examples/elements.c examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) $< $(LIBRARY) + $(LINK_EXE) examples/elements.@OBJEXT@ $(LIBRARY) examples/outline.@OBJEXT@: examples/outline.c examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) $< $(LIBRARY) + $(LINK_EXE) examples/outline.@OBJEXT@ $(LIBRARY) tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h @@ -180,11 +183,19 @@ tests/xmlts.zip: wget --output-document=tests/xmlts.zip \ http://www.w3.org/XML/Test/xmlts20080827.zip -tests/XML-Test-Suite: tests/xmlts.zip +tests/xmlconf: tests/xmlts.zip cd tests && unzip -q xmlts.zip -run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite - tests/xmltest.sh +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/xmlconf + tests/xmltest.sh 2>&1 | tee tests/xmltest.log + diff -u tests/xmltest.log.expected tests/xmltest.log + +.PHONY: qa +qa: + ./qa.sh address + ./qa.sh memory + ./qa.sh undefined + ./qa.sh coverage .SUFFIXES: .c .cpp .lo .@OBJEXT@ Modified: stable/10/contrib/expat/README ============================================================================== --- stable/10/contrib/expat/README Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/README Thu Jul 7 04:59:58 2016 (r302385) @@ -1,5 +1,5 @@ - Expat, Release 2.1.0 + Expat, Release 2.2.0 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register @@ -114,7 +114,7 @@ Note for Solaris users: The "ar" comman "/usr/ccs/bin", which is not in the default PATH. You will need to add this to your path for the "make" command, and probably also switch to GNU make (the "make" found in /usr/ccs/bin does not seem to work -properly -- appearantly it does not understand .PHONY directives). If +properly -- apparently it does not understand .PHONY directives). If you're using ksh or bash, use this command to build: PATH=/usr/ccs/bin:$PATH make Copied: stable/10/contrib/expat/configure.ac (from r302305, head/contrib/expat/configure.ac) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/expat/configure.ac Thu Jul 7 04:59:58 2016 (r302385, copy of r302305, head/contrib/expat/configure.ac) @@ -0,0 +1,157 @@ +dnl configuration script for expat +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright 2000 Clark Cooper +dnl +dnl This file is part of EXPAT. +dnl +dnl EXPAT is free software; you can redistribute it and/or modify it +dnl under the terms of the License (based on the MIT/X license) contained +dnl in the file COPYING that comes with this distribution. +dnl + +dnl Ensure that Expat is configured with autoconf 2.58 or newer +AC_PREREQ(2.58) + +dnl Get the version number of Expat, using m4's esyscmd() command to run +dnl the command at m4-generation time. This allows us to create an m4 +dnl symbol holding the correct version number. AC_INIT() requires the +dnl version number at m4-time, rather than when ./configure is run, so +dnl all this must happen as part of m4, not as part of the shell code +dnl contained in ./configure. +dnl +dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate +dnl test. I believe this test will work, but I don't have a place with non- +dnl GNU M4 to test it right now. +define([expat_version], ifdef([__gnu__], + [esyscmd(conftools/get-version.sh lib/expat.h)], + [2.2.x])) +AC_INIT(expat, expat_version, expat-bugs@libexpat.org) +undefine([expat_version]) + +AC_CONFIG_SRCDIR(Makefile.in) +AC_CONFIG_AUX_DIR(conftools) +AC_CONFIG_MACRO_DIR([m4]) + + +dnl +dnl Increment LIBREVISION if source code has changed at all +dnl +dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 +dnl +dnl If the API changes compatibly (i.e. simply adding a new function +dnl without changing or removing earlier interfaces), then increment LIBAGE. +dnl +dnl If the API changes incompatibly set LIBAGE back to 0 +dnl + +LIBCURRENT=7 # sync +LIBREVISION=2 # with +LIBAGE=6 # CMakeLists.txt! + +AC_CONFIG_HEADER(expat_config.h) + +sinclude(conftools/ac_c_bigendian_cross.m4) + +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +AC_SUBST(LIBCURRENT) +AC_SUBST(LIBREVISION) +AC_SUBST(LIBAGE) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL + +if test "$GCC" = yes ; then + dnl + dnl Be careful about adding the -fexceptions option; some versions of + dnl GCC don't support it and it causes extra warnings that are only + dnl distracting; avoid. + dnl + OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" + CFLAGS="$OLDCFLAGS -fexceptions" + AC_MSG_CHECKING(whether $CC accepts -fexceptions) + AC_TRY_LINK( , , + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") + if test "x$CXXFLAGS" = x ; then + CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'` + fi +fi + +dnl Checks for header files. +AC_HEADER_STDC + +dnl Checks for typedefs, structures, and compiler characteristics. + +dnl Note: Avoid using AC_C_BIGENDIAN because it does not +dnl work in a cross compile. +AC_C_BIGENDIAN_CROSS + +AC_C_CONST +AC_TYPE_SIZE_T +AC_CHECK_FUNCS(memmove bcopy) + +dnl Only needed for xmlwf: +AC_CHECK_HEADERS(fcntl.h unistd.h) +AC_TYPE_OFF_T +AC_FUNC_MMAP + +if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then + FILEMAP=unixfilemap +else + FILEMAP=readfilemap +fi +AC_SUBST(FILEMAP) + +dnl Needed for the test support code; this was found at +dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html + +# AC_CPP_FUNC +# ------------------ # +# Checks to see if ANSI C99 CPP variable __func__ works. +# If not, perhaps __FUNCTION__ works instead. +# If not, we'll just define __func__ to "". +AC_DEFUN([AC_CPP_FUNC], +[AC_REQUIRE([AC_PROG_CC_STDC])dnl +AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], +[[char *foo = __func__;]])], + [ac_cv_cpp_func=yes], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], +[[char *foo = __FUNCTION__;]])], + [ac_cv_cpp_func=__FUNCTION__], + [ac_cv_cpp_func=no])])]) +if test $ac_cv_cpp_func = __FUNCTION__; then + AC_DEFINE(__func__,__FUNCTION__, + [Define to __FUNCTION__ or "" if `__func__' does not conform to +ANSI C.]) +elif test $ac_cv_cpp_func = no; then + AC_DEFINE(__func__,"", + [Define to __FUNCTION__ or "" if `__func__' does not conform to +ANSI C.]) +fi +])# AC_CPP_FUNC + +AC_CPP_FUNC + + +dnl Some basic configuration: +AC_DEFINE([XML_NS], 1, + [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_DTD], 1, + [Define to make parameter entity parsing functionality available.]) +AC_DEFINE([XML_CONTEXT_BYTES], 1024, + [Define to specify how much context to retain around the current parse point.]) + +AC_CONFIG_FILES([Makefile expat.pc]) +AC_OUTPUT + +abs_srcdir="`cd $srcdir && pwd`" +abs_builddir="`pwd`" +if test "$abs_srcdir" != "$abs_builddir"; then + make mkdir-init +fi Modified: stable/10/contrib/expat/doc/expat.png ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/10/contrib/expat/doc/reference.html ============================================================================== --- stable/10/contrib/expat/doc/reference.html Thu Jul 7 03:39:18 2016 (r302384) +++ stable/10/contrib/expat/doc/reference.html Thu Jul 7 04:59:58 2016 (r302385) @@ -2151,8 +2151,12 @@ Helps in preventing DoS attacks based on function behavior. In order to have an effect this must be called before parsing has started. Returns 1 if successful, 0 when called after XML_Parse or XML_ParseBuffer. -

Note: This call is optional, as the parser will auto-generate a new -random salt value if no value has been set at the start of parsing.

+

Note:This call is optional, as the parser will auto-generate +a new random salt value if no value has been set at the start of parsing. +

Note:One should not call XML_SetHashSalt with a +hash salt value of 0, as this value is used as sentinel value to indicate +that XML_SetHashSalt has not been called. Consequently +such a call will have no effect, even if it returns 1.


Modified: stable/10/contrib/expat/doc/xmlwf.1
==============================================================================
--- stable/10/contrib/expat/doc/xmlwf.1	Thu Jul  7 03:39:18 2016	(r302384)
+++ stable/10/contrib/expat/doc/xmlwf.1	Thu Jul  7 04:59:58 2016	(r302385)
@@ -1,33 +1,40 @@
-.\" This manpage has been automatically generated by docbook2man 
-.\" from a DocBook document.  This tool can be found at:
-.\"  
-.\" Please send any bug reports, improvements, comments, patches, 
-.\" etc. to Steve Cheng .
-.TH "XMLWF" "1" "24 January 2003" "" ""
+'\" -*- coding: us-ascii -*-
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH XMLWF 1 "March 11, 2016" "" ""
 .SH NAME
 xmlwf \- Determines if an XML document is well-formed
 .SH SYNOPSIS
-
-\fBxmlwf\fR [ \fB-s\fR]  [ \fB-n\fR]  [ \fB-p\fR]  [ \fB-x\fR]  [ \fB-e \fIencoding\fB\fR]  [ \fB-w\fR]  [ \fB-d \fIoutput-dir\fB\fR]  [ \fB-c\fR]  [ \fB-m\fR]  [ \fB-r\fR]  [ \fB-t\fR]  [ \fB-v\fR]  [ \fBfile ...\fR] 
-
-.SH "DESCRIPTION"
-.PP
+'nh
+.fi
+.ad l
+\fBxmlwf\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-v\fR] [file ...]
+'in \n(.iu-\nxu
+.ad b
+'hy
+.SH DESCRIPTION
 \fBxmlwf\fR uses the Expat library to
-determine if an XML document is well-formed.  It is
+determine if an XML document is well-formed. It is
 non-validating.
 .PP
 If you do not specify any files on the command-line, and you
 have a recent version of \fBxmlwf\fR, the
 input file will be read from standard input.
 .SH "WELL-FORMED DOCUMENTS"
-.PP
 A well-formed document must adhere to the
 following rules:
 .TP 0.2i
 \(bu
-The file begins with an XML declaration.  For instance,
-.
-\fBNOTE:\fR
+The file begins with an XML declaration. For instance,
+\*(T<\*(T>.
+\fINOTE:\fR
 \fBxmlwf\fR does not currently
 check for a valid XML declaration.
 .TP 0.2i
@@ -36,8 +43,8 @@ Every start tag is either empty ()
 or has a corresponding end tag.
 .TP 0.2i
 \(bu
-There is exactly one root element.  This element must contain
-all other elements in the document.  Only comments, white
+There is exactly one root element. This element must contain
+all other elements in the document. Only comments, white
 space, and processing instructions may come after the close
 of the root element.
 .TP 0.2i
@@ -49,39 +56,38 @@ All attribute values are enclosed in quo
 or double).
 .PP
 If the document has a DTD, and it strictly complies with that
-DTD, then the document is also considered \fBvalid\fR.
+DTD, then the document is also considered \fIvalid\fR.
 \fBxmlwf\fR is a non-validating parser --
-it does not check the DTD.  However, it does support
-external entities (see the \fB-x\fR option).
-.SH "OPTIONS"
-.PP
+it does not check the DTD. However, it does support
+external entities (see the \*(T<\fB\-x\fR\*(T> option).
+.SH OPTIONS
 When an option includes an argument, you may specify the argument either
-separately ("\fB-d\fR output") or concatenated with the
-option ("\fB-d\fRoutput").  \fBxmlwf\fR
+separately ("\*(T<\fB\-d\fR\*(T> output") or concatenated with the
+option ("\*(T<\fB\-d\fR\*(T>output"). \fBxmlwf\fR
 supports both.
-.TP
-\fB-c\fR
+.TP 
+\*(T<\fB\-c\fR\*(T>
 If the input file is well-formed and \fBxmlwf\fR
 doesn't encounter any errors, the input file is simply copied to
 the output directory unchanged.
-This implies no namespaces (turns off \fB-n\fR) and
-requires \fB-d\fR to specify an output file.
-.TP
-\fB-d output-dir\fR
+This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
+requires \*(T<\fB\-d\fR\*(T> to specify an output file.
+.TP 
+\*(T<\fB\-d output\-dir\fR\*(T>
 Specifies a directory to contain transformed
 representations of the input files.
-By default, \fB-d\fR outputs a canonical representation
+By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
 (described below).
-You can select different output formats using \fB-c\fR
-and \fB-m\fR.
+You can select different output formats using \*(T<\fB\-c\fR\*(T>
+and \*(T<\fB\-m\fR\*(T>.
 
 The output filenames will
 be exactly the same as the input filenames or "STDIN" if the input is
-coming from standard input.  Therefore, you must be careful that the
+coming from standard input. Therefore, you must be careful that the
 output file does not go into the same directory as the input
-file.  Otherwise, \fBxmlwf\fR will delete the
+file. Otherwise, \fBxmlwf\fR will delete the
 input file before it generates the output file (just like running
-cat < file > file in most shells).
+\*(T file\*(T> in most shells).
 
 Two structurally equivalent XML documents have a byte-for-byte
 identical canonical XML representation.
@@ -89,39 +95,39 @@ Note that ignorable white space is consi
 is treated equivalently to data.
 More on canonical XML can be found at
 http://www.jclark.com/xml/canonxml.html .
-.TP
-\fB-e encoding\fR
+.TP 
+\*(T<\fB\-e encoding\fR\*(T>
 Specifies the character encoding for the document, overriding
-any document encoding declaration.  \fBxmlwf\fR
+any document encoding declaration. \fBxmlwf\fR
 supports four built-in encodings:
-US-ASCII,
-UTF-8,
-UTF-16, and
-ISO-8859-1.
-Also see the \fB-w\fR option.
-.TP
-\fB-m\fR
+\*(T,
+\*(T,
+\*(T, and
+\*(T.
+Also see the \*(T<\fB\-w\fR\*(T> option.
+.TP 
+\*(T<\fB\-m\fR\*(T>
 Outputs some strange sort of XML file that completely
 describes the input file, including character positions.
-Requires \fB-d\fR to specify an output file.
-.TP
-\fB-n\fR
-Turns on namespace processing.  (describe namespaces)
-\fB-c\fR disables namespaces.
-.TP
-\fB-p\fR
+Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
+.TP 
+\*(T<\fB\-n\fR\*(T>
+Turns on namespace processing. (describe namespaces)
+\*(T<\fB\-c\fR\*(T> disables namespaces.
+.TP 
+\*(T<\fB\-p\fR\*(T>
 Tells xmlwf to process external DTDs and parameter
 entities.
 
 Normally \fBxmlwf\fR never parses parameter
-entities.  \fB-p\fR tells it to always parse them.
-\fB-p\fR implies \fB-x\fR.
-.TP
-\fB-r\fR
+entities. \*(T<\fB\-p\fR\*(T> tells it to always parse them.
+\*(T<\fB\-p\fR\*(T> implies \*(T<\fB\-x\fR\*(T>.
+.TP 
+\*(T<\fB\-r\fR\*(T>
 Normally \fBxmlwf\fR memory-maps the XML file
 before parsing; this can result in faster parsing on many
 platforms.
-\fB-r\fR turns off memory-mapping and uses normal file
+\*(T<\fB\-r\fR\*(T> turns off memory-mapping and uses normal file
 IO calls instead.
 Of course, memory-mapping is automatically turned off
 when reading from standard input.
@@ -131,34 +137,33 @@ substantially higher memory usage for
 \fBxmlwf\fR, but this appears to be a matter of
 the operating system reporting memory in a strange way; there is
 not a leak in \fBxmlwf\fR.
-.TP
-\fB-s\fR
+.TP 
+\*(T<\fB\-s\fR\*(T>
 Prints an error if the document is not standalone. 
 A document is standalone if it has no external subset and no
 references to parameter entities.
-.TP
-\fB-t\fR
-Turns on timings.  This tells Expat to parse the entire file,
+.TP 
+\*(T<\fB\-t\fR\*(T>
+Turns on timings. This tells Expat to parse the entire file,
 but not perform any processing.
 This gives a fairly accurate idea of the raw speed of Expat itself
 without client overhead.
-\fB-t\fR turns off most of the output options
-(\fB-d\fR, \fB-m\fR, \fB-c\fR,
-\&...).
-.TP
-\fB-v\fR
+\*(T<\fB\-t\fR\*(T> turns off most of the output options
+(\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-m\fR\*(T>, \*(T<\fB\-c\fR\*(T>, ...).
+.TP 
+\*(T<\fB\-v\fR\*(T>
 Prints the version of the Expat library being used, including some
 information on the compile-time configuration of the library, and
 then exits.
-.TP
-\fB-w\fR
+.TP 
+\*(T<\fB\-w\fR\*(T>
 Enables support for Windows code pages.
 Normally, \fBxmlwf\fR will throw an error if it
-runs across an encoding that it is not equipped to handle itself.  With
-\fB-w\fR, xmlwf will try to use a Windows code
-page.  See also \fB-e\fR.
-.TP
-\fB-x\fR
+runs across an encoding that it is not equipped to handle itself. With
+\*(T<\fB\-w\fR\*(T>, xmlwf will try to use a Windows code
+page. See also \*(T<\fB\-e\fR\*(T>.
+.TP 
+\*(T<\fB\-x\fR\*(T>
 Turns on parsing external entities.
 
 Non-validating parsers are not required to resolve external
@@ -172,80 +177,75 @@ data from outside the XML file currently
 This is an example of an internal entity:
 
 .nf
+
 
 .fi
 
 And here are some examples of external entities:
 
 .nf
-  (parsed)
+
+  (parsed)
          (unparsed)
 .fi
-.TP
-\fB--\fR
+.TP 
+\*(T<\fB\-\-\fR\*(T>
 (Two hyphens.)
-Terminates the list of options.  This is only needed if a filename
-starts with a hyphen.  For example:
+Terminates the list of options. This is only needed if a filename
+starts with a hyphen. For example:
 
 .nf
-xmlwf -- -myfile.xml
+
+xmlwf \-\- \-myfile.xml
 .fi
 
 will run \fBxmlwf\fR on the file
-\fI-myfile.xml\fR.
+\*(T<\fI\-myfile.xml\fR\*(T>.
 .PP
 Older versions of \fBxmlwf\fR do not support
 reading from standard input.
-.SH "OUTPUT"
-.PP
+.SH OUTPUT
 If an input file is not well-formed,
 \fBxmlwf\fR prints a single line describing
-the problem to standard output.  If a file is well formed,
+the problem to standard output. If a file is well formed,
 \fBxmlwf\fR outputs nothing.
-Note that the result code is \fBnot\fR set.
-.SH "BUGS"
-.PP
-According to the W3C standard, an XML file without a
-declaration at the beginning is not considered well-formed.
-However, \fBxmlwf\fR allows this to pass.
-.PP
+Note that the result code is \fInot\fR set.
+.SH BUGS
 \fBxmlwf\fR returns a 0 - noerr result,
-even if the file is not well-formed.  There is no good way for
+even if the file is not well-formed. There is no good way for
 a program to use \fBxmlwf\fR to quickly
 check a file -- it must parse \fBxmlwf\fR's
 standard output.
 .PP
 The errors should go to standard error, not standard output.
 .PP
-There should be a way to get \fB-d\fR to send its
+There should be a way to get \*(T<\fB\-d\fR\*(T> to send its
 output to standard output rather than forcing the user to send
 it to a file.
 .PP
 I have no idea why anyone would want to use the
-\fB-d\fR, \fB-c\fR, and
-\fB-m\fR options.  If someone could explain it to
+\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
+\*(T<\fB\-m\fR\*(T> options. If someone could explain it to
 me, I'd like to add this information to this manpage.
-.SH "ALTERNATIVES"
-.PP
+.SH ALTERNATIVES
 Here are some XML validators on the web:
 
 .nf
-http://www.hcrc.ed.ac.uk/~richard/xml-check.html
+
+http://www.hcrc.ed.ac.uk/~richard/xml\-check.html
 http://www.stg.brown.edu/service/xmlvalid/
 http://www.scripting.com/frontier5/xml/code/xmlValidator.html
 http://www.xml.com/pub/a/tools/ruwf/check.html
 .fi
 .SH "SEE ALSO"
-.PP
-
 .nf
+
 The Expat home page:        http://www.libexpat.org/
-The W3 XML specification:   http://www.w3.org/TR/REC-xml
+The W3 XML specification:   http://www.w3.org/TR/REC\-xml
 .fi
-.SH "AUTHOR"
-.PP
-This manual page was written by Scott Bronson  for
-the Debian GNU/Linux system (but may be used by others).  Permission is
+.SH AUTHOR
+This manual page was written by Scott Bronson <\*(T> for
+the Debian GNU/Linux system (but may be used by others). Permission is
 granted to copy, distribute and/or modify this document under
 the terms of the GNU Free Documentation
 License, Version 1.1.

Copied: stable/10/contrib/expat/doc/xmlwf.xml (from r302305, head/contrib/expat/doc/xmlwf.xml)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/contrib/expat/doc/xmlwf.xml	Thu Jul  7 04:59:58 2016	(r302385, copy of r302305, head/contrib/expat/doc/xmlwf.xml)
@@ -0,0 +1,440 @@
+
+  Scott">
+  Bronson">
+  
+  March 11, 2016">
+  
+  1">
+  bronson@rinspin.com">
+  
+  XMLWF">
+  
+
+  Debian GNU/Linux">
+  GNU">
+]>
+
+
+  
+    
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2001 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + Determines if an XML document is well-formed + + + + &dhpackage; + + + + + + + + + + + + + + + + + + file ... + + + + + DESCRIPTION + + + &dhpackage; uses the Expat library to + determine if an XML document is well-formed. It is + non-validating. + + + + If you do not specify any files on the command-line, and you + have a recent version of &dhpackage;, the + input file will be read from standard input. + + + + + + WELL-FORMED DOCUMENTS + + + A well-formed document must adhere to the + following rules: + + + + + The file begins with an XML declaration. For instance, + <?xml version="1.0" standalone="yes"?>. + NOTE: + &dhpackage; does not currently + check for a valid XML declaration. + + + Every start tag is either empty (<tag/>) + or has a corresponding end tag. + + + There is exactly one root element. This element must contain + all other elements in the document. Only comments, white + space, and processing instructions may come after the close + of the root element. + + + All elements nest properly. + + + All attribute values are enclosed in quotes (either single + or double). + + + + + If the document has a DTD, and it strictly complies with that + DTD, then the document is also considered valid. + &dhpackage; is a non-validating parser -- + it does not check the DTD. However, it does support + external entities (see the option). + + + + + OPTIONS + + +When an option includes an argument, you may specify the argument either +separately (" output") or concatenated with the +option ("output"). &dhpackage; +supports both. + + + + + + + + + If the input file is well-formed and &dhpackage; + doesn't encounter any errors, the input file is simply copied to + the output directory unchanged. + This implies no namespaces (turns off ) and + requires to specify an output file. + + + + + + + + + Specifies a directory to contain transformed + representations of the input files. + By default, outputs a canonical representation + (described below). + You can select different output formats using + and . + + + The output filenames will + be exactly the same as the input filenames or "STDIN" if the input is + coming from standard input. Therefore, you must be careful that the + output file does not go into the same directory as the input + file. Otherwise, &dhpackage; will delete the + input file before it generates the output file (just like running + cat < file > file in most shells). + + + Two structurally equivalent XML documents have a byte-for-byte + identical canonical XML representation. + Note that ignorable white space is considered significant and + is treated equivalently to data. + More on canonical XML can be found at + http://www.jclark.com/xml/canonxml.html . + + + + + + + + + Specifies the character encoding for the document, overriding + any document encoding declaration. &dhpackage; + supports four built-in encodings: + US-ASCII, + UTF-8, + UTF-16, and + ISO-8859-1. + Also see the option. + + + + + + + + + Outputs some strange sort of XML file that completely + describes the input file, including character positions. + Requires to specify an output file. + + + + + + + + + Turns on namespace processing. (describe namespaces) + disables namespaces. + + + + + + + + + Tells xmlwf to process external DTDs and parameter + entities. + + + Normally &dhpackage; never parses parameter + entities. tells it to always parse them. + implies . + + + + + + + + + Normally &dhpackage; memory-maps the XML file + before parsing; this can result in faster parsing on many + platforms. + turns off memory-mapping and uses normal file + IO calls instead. + Of course, memory-mapping is automatically turned off + when reading from standard input. + + + Use of memory-mapping can cause some platforms to report + substantially higher memory usage for + &dhpackage;, but this appears to be a matter of + the operating system reporting memory in a strange way; there is + not a leak in &dhpackage;. + + + + + + + + + Prints an error if the document is not standalone. + A document is standalone if it has no external subset and no + references to parameter entities. + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Fri Jul 8 02:34:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C899B83073; Fri, 8 Jul 2016 02:34:06 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id DC55F1369; Fri, 8 Jul 2016 02:34:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u682Y5Uh051893; Fri, 8 Jul 2016 02:34:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u682Y5cg051892; Fri, 8 Jul 2016 02:34:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607080234.u682Y5cg051892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Jul 2016 02:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302421 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 02:34:06 -0000 Author: kib Date: Fri Jul 8 02:34:04 2016 New Revision: 302421 URL: https://svnweb.freebsd.org/changeset/base/302421 Log: MFC r302196 Since VOP_INACTIVE() is not guaranteed to be called, all cleanups executed by inactive methods, must be repeated on reclaim. MFC r302210: Clean other flags in ncl_inactive, only. Modified: stable/10/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clnode.c Fri Jul 8 02:19:09 2016 (r302420) +++ stable/10/sys/fs/nfsclient/nfs_clnode.c Fri Jul 8 02:34:04 2016 (r302421) @@ -200,15 +200,40 @@ nfs_freesillyrename(void *arg, __unused free(sp, M_NEWNFSREQ); } -int -ncl_inactive(struct vop_inactive_args *ap) +static void +ncl_releasesillyrename(struct vnode *vp, struct thread *td) { struct nfsnode *np; struct sillyrename *sp; - struct vnode *vp = ap->a_vp; - boolean_t retv; + ASSERT_VOP_ELOCKED(vp, "releasesillyrename"); np = VTONFS(vp); + mtx_assert(&np->n_mtx, MA_OWNED); + if (vp->v_type != VDIR) { + sp = np->n_sillyrename; + np->n_sillyrename = NULL; + } else + sp = NULL; + if (sp != NULL) { + mtx_unlock(&np->n_mtx); + (void) ncl_vinvalbuf(vp, 0, td, 1); + /* + * Remove the silly file that was rename'd earlier + */ + ncl_removeit(sp, vp); + crfree(sp->s_cred); + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); + taskqueue_enqueue(taskqueue_thread, &sp->s_task); + mtx_lock(&np->n_mtx); + } +} + +int +ncl_inactive(struct vop_inactive_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct nfsnode *np; + boolean_t retv; if (NFS_ISV4(vp) && vp->v_type == VREG) { /* @@ -230,24 +255,15 @@ ncl_inactive(struct vop_inactive_args *a } } + np = VTONFS(vp); mtx_lock(&np->n_mtx); - if (vp->v_type != VDIR) { - sp = np->n_sillyrename; - np->n_sillyrename = NULL; - } else - sp = NULL; - if (sp) { - mtx_unlock(&np->n_mtx); - (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); - /* - * Remove the silly file that was rename'd earlier - */ - ncl_removeit(sp, vp); - crfree(sp->s_cred); - TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); - taskqueue_enqueue(taskqueue_thread, &sp->s_task); - mtx_lock(&np->n_mtx); - } + ncl_releasesillyrename(vp, ap->a_td); + + /* + * NMODIFIED means that there might be dirty/stale buffers + * associated with the NFS vnode. None of the other flags are + * meaningful after the vnode is unused. + */ np->n_flag &= NMODIFIED; mtx_unlock(&np->n_mtx); return (0); @@ -270,6 +286,10 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (nfs_reclaim_p != NULL) nfs_reclaim_p(ap); + mtx_lock(&np->n_mtx); + ncl_releasesillyrename(vp, ap->a_td); + mtx_unlock(&np->n_mtx); + /* * Destroy the vm object and flush associated pages. */ From owner-svn-src-stable-10@freebsd.org Fri Jul 8 02:52:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32002B833D3; Fri, 8 Jul 2016 02:52:40 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 089621BE0; Fri, 8 Jul 2016 02:52:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u682qdZI059412; Fri, 8 Jul 2016 02:52:39 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u682qdx7059411; Fri, 8 Jul 2016 02:52:39 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201607080252.u682qdx7059411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 8 Jul 2016 02:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302422 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 02:52:40 -0000 Author: truckman Date: Fri Jul 8 02:52:39 2016 New Revision: 302422 URL: https://svnweb.freebsd.org/changeset/base/302422 Log: MFC r302338 Fix a race condition between the main thread in aqm_pie_cleanup() and the callout thread that can cause a kernel panic. Always do the final cleanup in the callout thread by passing a separate callout function for that task to callout_reset_sbt(). Protect the ref_count decrement in the callout with DN_BH_WLOCK(). All other ref_count manipulation is protected with this lock. There is still a tiny window between ref_count reaching zero and the end of the callout function where it is unsafe to unload the module. Fixing this would require the use of callout_drain(), but this can't be done because dummynet holds a mutex and callout_drain() might sleep. Remove the callout_pending(), callout_active(), and callout_deactivate() calls from calculate_drop_prob(). They are not needed because this callout uses callout_init_mtx(). Submitted by: Rasool Al-Saadi Differential Revision: https://reviews.freebsd.org/D6928 Modified: stable/10/sys/netpfil/ipfw/dn_aqm_pie.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/dn_aqm_pie.c ============================================================================== --- stable/10/sys/netpfil/ipfw/dn_aqm_pie.c Fri Jul 8 02:34:04 2016 (r302421) +++ stable/10/sys/netpfil/ipfw/dn_aqm_pie.c Fri Jul 8 02:52:39 2016 (r302422) @@ -207,24 +207,6 @@ calculate_drop_prob(void *x) struct dn_aqm_pie_parms *pprms; struct pie_status *pst = (struct pie_status *) x; - /* dealing with race condition */ - if (callout_pending(&pst->aqm_pie_callout)) { - /* callout was reset */ - mtx_unlock(&pst->lock_mtx); - return; - } - - if (!callout_active(&pst->aqm_pie_callout)) { - /* callout was stopped */ - mtx_unlock(&pst->lock_mtx); - mtx_destroy(&pst->lock_mtx); - free(x, M_DUMMYNET); - //pst->pq->aqm_status = NULL; - pie_desc.ref_count--; - return; - } - callout_deactivate(&pst->aqm_pie_callout); - pprms = pst->parms; prob = pst->drop_prob; @@ -576,7 +558,7 @@ aqm_pie_init(struct dn_queue *q) do { /* exit with break when error occurs*/ if (!pprms){ - D("AQM_PIE is not configured"); + DX(2, "AQM_PIE is not configured"); err = EINVAL; break; } @@ -615,6 +597,22 @@ aqm_pie_init(struct dn_queue *q) } /* + * Callout function to destroy pie mtx and free PIE status memory + */ +static void +pie_callout_cleanup(void *x) +{ + struct pie_status *pst = (struct pie_status *) x; + + mtx_unlock(&pst->lock_mtx); + mtx_destroy(&pst->lock_mtx); + free(x, M_DUMMYNET); + DN_BH_WLOCK(); + pie_desc.ref_count--; + DN_BH_WUNLOCK(); +} + +/* * Clean up PIE status for queue 'q' * Destroy memory allocated for PIE status. */ @@ -640,22 +638,19 @@ aqm_pie_cleanup(struct dn_queue *q) return 1; } + /* + * Free PIE status allocated memory using pie_callout_cleanup() callout + * function to avoid any potential race. + * We reset aqm_pie_callout to call pie_callout_cleanup() in next 1um. This + * stops the scheduled calculate_drop_prob() callout and call pie_callout_cleanup() + * which does memory freeing. + */ mtx_lock(&pst->lock_mtx); + callout_reset_sbt(&pst->aqm_pie_callout, + SBT_1US, 0, pie_callout_cleanup, pst, 0); + q->aqm_status = NULL; + mtx_unlock(&pst->lock_mtx); - /* stop callout timer */ - if (callout_stop(&pst->aqm_pie_callout) || !(pst->sflags & PIE_ACTIVE)) { - mtx_unlock(&pst->lock_mtx); - mtx_destroy(&pst->lock_mtx); - free(q->aqm_status, M_DUMMYNET); - q->aqm_status = NULL; - pie_desc.ref_count--; - return 0; - } else { - q->aqm_status = NULL; - mtx_unlock(&pst->lock_mtx); - DX(2, "PIE callout has not been stoped from cleanup!"); - return EBUSY; - } return 0; } From owner-svn-src-stable-10@freebsd.org Fri Jul 8 10:06:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEFF5B76AE6; Fri, 8 Jul 2016 10:06:04 +0000 (UTC) (envelope-from mm@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 mx1.freebsd.org (Postfix) with ESMTPS id 722B01F0E; Fri, 8 Jul 2016 10:06:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u68A63Oe018213; Fri, 8 Jul 2016 10:06:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68A63KC018207; Fri, 8 Jul 2016 10:06:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201607081006.u68A63KC018207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 8 Jul 2016 10:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302425 - in stable/10/contrib/libarchive: libarchive libarchive/test libarchive_fe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 10:06:04 -0000 Author: mm Date: Fri Jul 8 10:06:02 2016 New Revision: 302425 URL: https://svnweb.freebsd.org/changeset/base/302425 Log: MFC r302294: Sync libarchive with vendor, bugfixes for tests: - fix tests on filesystems without birthtime support, e.g. UFS1 (1) - vendor issue #729: avoid use of C99 for-scope declarations in test_write_format_gnutar_filenames.c PR: 204157 (1) Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_string.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/test/main.c stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c stable/10/contrib/libarchive/libarchive_fe/passphrase.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Fri Jul 8 10:06:02 2016 (r302425) @@ -1504,7 +1504,11 @@ setup_current_filesystem(struct archive_ struct tree *t = a->tree; struct statfs sfs; #if defined(HAVE_GETVFSBYNAME) && defined(VFCF_SYNTHETIC) +# if defined(HAVE_STRUCT_VFSCONF) + struct vfsconf vfc; +# else struct xvfsconf vfc; +# endif #endif int r, xr = 0; #if !defined(HAVE_STRUCT_STATFS_F_NAMEMAX) Modified: stable/10/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_string.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive/archive_string.c Fri Jul 8 10:06:02 2016 (r302425) @@ -559,7 +559,8 @@ archive_wstring_append_from_mbs_in_codep } if (count == 0 && length != 0) ret = -1; - } while (0); + break; + } while (1); } dest->length += count; dest->s[dest->length] = L'\0'; @@ -3552,18 +3553,19 @@ win_strncat_from_utf16(struct archive_st ll = WideCharToMultiByte(sc->to_cp, 0, (LPCWSTR)u16, (int)bytes>>1, mbs, (int)mbs_size, NULL, &defchar); - if (ll == 0 && - GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - /* Need more buffer for MBS. */ - ll = WideCharToMultiByte(sc->to_cp, 0, - (LPCWSTR)u16, (int)bytes, NULL, 0, NULL, NULL); - if (archive_string_ensure(as, ll +1) == NULL) - return (-1); - mbs = as->s + as->length; - mbs_size = as->buffer_length - as->length -1; - continue; + /* Exit loop if we succeeded */ + if (ll != 0 || + GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + break; } - } while (0); + /* Else expand buffer and loop to try again. */ + ll = WideCharToMultiByte(sc->to_cp, 0, + (LPCWSTR)u16, (int)bytes, NULL, 0, NULL, NULL); + if (archive_string_ensure(as, ll +1) == NULL) + return (-1); + mbs = as->s + as->length; + mbs_size = as->buffer_length - as->length -1; + } while (1); archive_string_free(&tmp); as->length += ll; as->s[as->length] = '\0'; @@ -3634,19 +3636,20 @@ win_strncat_to_utf16(struct archive_stri do { count = MultiByteToWideChar(sc->from_cp, MB_PRECOMPOSED, s, (int)length, (LPWSTR)u16, (int)avail>>1); - if (count == 0 && - GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - /* Need more buffer for UTF-16 string */ - count = MultiByteToWideChar(sc->from_cp, - MB_PRECOMPOSED, s, (int)length, NULL, 0); - if (archive_string_ensure(as16, (count +1) * 2) - == NULL) - return (-1); - u16 = as16->s + as16->length; - avail = as16->buffer_length - 2; - continue; + /* Exit loop if we succeeded */ + if (count != 0 || + GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + break; } - } while (0); + /* Expand buffer and try again */ + count = MultiByteToWideChar(sc->from_cp, + MB_PRECOMPOSED, s, (int)length, NULL, 0); + if (archive_string_ensure(as16, (count +1) * 2) + == NULL) + return (-1); + u16 = as16->s + as16->length; + avail = as16->buffer_length - 2; + } while (1); as16->length += count * 2; as16->s[as16->length] = 0; as16->s[as16->length+1] = 0; Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jul 8 10:06:02 2016 (r302425) @@ -3487,6 +3487,9 @@ exit_xattr: static int copy_acls(struct archive_write_disk *a, int tmpfd, int dffd) { +#ifndef HAVE_SYS_ACL_H + return 0; +#else acl_t acl, dfacl = NULL; int acl_r, ret = ARCHIVE_OK; @@ -3514,6 +3517,7 @@ exit_acl: if (dfacl) acl_free(dfacl); return (ret); +#endif } static int Modified: stable/10/contrib/libarchive/libarchive/test/main.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/main.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive/test/main.c Fri Jul 8 10:06:02 2016 (r302425) @@ -1292,6 +1292,11 @@ assertion_file_time(const char *file, in switch (type) { case 'a': filet_nsec = st.st_atimespec.tv_nsec; break; case 'b': filet = st.st_birthtime; + /* FreeBSD filesystems that don't support birthtime + * (e.g., UFS1) always return -1 here. */ + if (filet == -1) { + return (1); + } filet_nsec = st.st_birthtimespec.tv_nsec; break; case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break; default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type); Modified: stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c Fri Jul 8 10:06:02 2016 (r302425) @@ -42,6 +42,7 @@ DEFINE_TEST(test_write_format_gnutar_fil struct archive_entry *ae, *template; struct archive *a; size_t used; + int i; buff = malloc(buffsize); /* million bytes of work area */ assert(buff != NULL); @@ -55,7 +56,7 @@ DEFINE_TEST(test_write_format_gnutar_fil archive_entry_set_mode(template, S_IFREG | 0755); archive_entry_set_size(template, 8); - for (int i = 0; i < 2000; ++i) { + for (i = 0; i < 2000; ++i) { filename[i] = 'a'; filename[i + 1] = '\0'; archive_entry_copy_pathname(template, filename); @@ -97,6 +98,7 @@ DEFINE_TEST(test_write_format_gnutar_lin struct archive_entry *ae, *template; struct archive *a; size_t used; + int i; buff = malloc(buffsize); /* million bytes of work area */ assert(buff != NULL); @@ -110,7 +112,7 @@ DEFINE_TEST(test_write_format_gnutar_lin archive_entry_set_mode(template, S_IFLNK | 0755); archive_entry_copy_pathname(template, "link"); - for (int i = 0; i < 2000; ++i) { + for (i = 0; i < 2000; ++i) { filename[i] = 'a'; filename[i + 1] = '\0'; archive_entry_copy_symlink(template, filename); Modified: stable/10/contrib/libarchive/libarchive_fe/passphrase.c ============================================================================== --- stable/10/contrib/libarchive/libarchive_fe/passphrase.c Fri Jul 8 04:34:13 2016 (r302424) +++ stable/10/contrib/libarchive/libarchive_fe/passphrase.c Fri Jul 8 10:06:02 2016 (r302425) @@ -132,6 +132,10 @@ readpassphrase(const char *prompt, char #include #include +#ifndef _PATH_TTY +#define _PATH_TTY "/dev/tty" +#endif + #ifdef TCSASOFT # define _T_FLUSH (TCSAFLUSH|TCSASOFT) #else From owner-svn-src-stable-10@freebsd.org Fri Jul 8 19:04:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3008CB833F7; Fri, 8 Jul 2016 19:04: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 mx1.freebsd.org (Postfix) with ESMTPS id 004E11B49; Fri, 8 Jul 2016 19:04: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 u68J4q6S019902; Fri, 8 Jul 2016 19:04:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68J4qSA019901; Fri, 8 Jul 2016 19:04:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607081904.u68J4qSA019901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 19:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302442 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 19:04:53 -0000 Author: ngie Date: Fri Jul 8 19:04:51 2016 New Revision: 302442 URL: https://svnweb.freebsd.org/changeset/base/302442 Log: MFC r301707: Use NULL instead of `0` in _ht_getnetbyname(..) - getnetent returns NULL on completion/error. - .h_aliases is NULL terminated. Modified: stable/10/lib/libc/net/getnetbyht.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getnetbyht.c ============================================================================== --- stable/10/lib/libc/net/getnetbyht.c Fri Jul 8 18:54:28 2016 (r302441) +++ stable/10/lib/libc/net/getnetbyht.c Fri Jul 8 19:04:51 2016 (r302442) @@ -215,10 +215,10 @@ _ht_getnetbyname(void *rval, void *cb_da } _setnethtent(ned->stayopen, ned); - while ((error = getnetent_p(&ne, ned)) == 0) { + while ((error = getnetent_p(&ne, ned)) == NULL) { if (strcasecmp(ne.n_name, name) == 0) break; - for (cp = ne.n_aliases; *cp != 0; cp++) + for (cp = ne.n_aliases; *cp != NULL; cp++) if (strcasecmp(*cp, name) == 0) goto found; } From owner-svn-src-stable-10@freebsd.org Fri Jul 8 19:13:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB39CB8366B; Fri, 8 Jul 2016 19:13:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id B79601378; Fri, 8 Jul 2016 19:13:19 +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 u68JDISX023765; Fri, 8 Jul 2016 19:13:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68JDIex023764; Fri, 8 Jul 2016 19:13:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607081913.u68JDIex023764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 19:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302444 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 19:13:20 -0000 Author: ngie Date: Fri Jul 8 19:13:18 2016 New Revision: 302444 URL: https://svnweb.freebsd.org/changeset/base/302444 Log: MFC r301708: Revert r301707 getnetent_p doesn't return NULL like getnetent does. coccinelle got confused and I didn't verify that it worked before committing the change Pointyhat to: ngie Modified: stable/10/lib/libc/net/getnetbyht.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getnetbyht.c ============================================================================== --- stable/10/lib/libc/net/getnetbyht.c Fri Jul 8 19:09:47 2016 (r302443) +++ stable/10/lib/libc/net/getnetbyht.c Fri Jul 8 19:13:18 2016 (r302444) @@ -215,10 +215,10 @@ _ht_getnetbyname(void *rval, void *cb_da } _setnethtent(ned->stayopen, ned); - while ((error = getnetent_p(&ne, ned)) == NULL) { + while ((error = getnetent_p(&ne, ned)) == 0) { if (strcasecmp(ne.n_name, name) == 0) break; - for (cp = ne.n_aliases; *cp != NULL; cp++) + for (cp = ne.n_aliases; *cp != 0; cp++) if (strcasecmp(*cp, name) == 0) goto found; } From owner-svn-src-stable-10@freebsd.org Fri Jul 8 19:19:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA1A2B83840; Fri, 8 Jul 2016 19:19:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7A5BF18E5; Fri, 8 Jul 2016 19:19:31 +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 u68JJUop024146; Fri, 8 Jul 2016 19:19:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68JJUC1024145; Fri, 8 Jul 2016 19:19:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607081919.u68JJUC1024145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 19:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302447 - stable/10/contrib/netbsd-tests/lib/libc/string X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 19:19:31 -0000 Author: ngie Date: Fri Jul 8 19:19:30 2016 New Revision: 302447 URL: https://svnweb.freebsd.org/changeset/base/302447 Log: MFC r301749: Add debug output to aid in determining why `goodResult` != `result` PR: 210619 (for diagnosis) Modified: stable/10/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/string/t_memcpy.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Fri Jul 8 19:16:50 2016 (r302446) +++ stable/10/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Fri Jul 8 19:19:30 2016 (r302447) @@ -108,7 +108,12 @@ ATF_TC_BODY(memcpy_basic, tc) if (i != j) runTest(start[i], start[j]); MD5End(mc, result); +#ifdef __NetBSD__ ATF_REQUIRE_EQ(strcmp(result, goodResult), 0); +#else + ATF_REQUIRE_EQ_MSG(strcmp(result, goodResult), 0, "%s != %s", + result, goodResult); +#endif } ATF_TC(memccpy_simple); From owner-svn-src-stable-10@freebsd.org Fri Jul 8 20:30:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4D1B84D6C; Fri, 8 Jul 2016 20:30:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8B2AB1377; Fri, 8 Jul 2016 20:30: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 u68KUKRw050286; Fri, 8 Jul 2016 20:30:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68KUKV7050285; Fri, 8 Jul 2016 20:30:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607082030.u68KUKV7050285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 20:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302451 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 20:30:21 -0000 Author: ngie Date: Fri Jul 8 20:30:20 2016 New Revision: 302451 URL: https://svnweb.freebsd.org/changeset/base/302451 Log: MFC r301800: Deobfuscate cleanup path in clnt_bck_create(..) Similar to r300836, cl and ct will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and ct was not, ct would not be free'd, and also removes a duplicate test for cl not being NULL. CID: 1229999 Modified: stable/10/sys/rpc/clnt_bck.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/clnt_bck.c ============================================================================== --- stable/10/sys/rpc/clnt_bck.c Fri Jul 8 20:20:46 2016 (r302450) +++ stable/10/sys/rpc/clnt_bck.c Fri Jul 8 20:30:20 2016 (r302451) @@ -175,14 +175,9 @@ clnt_bck_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(&ct->ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); - } + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); + mem_free(cl, sizeof (CLIENT)); return (NULL); } From owner-svn-src-stable-10@freebsd.org Fri Jul 8 20:39:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A85B851C6; Fri, 8 Jul 2016 20:39:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 69BA21A57; Fri, 8 Jul 2016 20:39:38 +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 u68KdbbW053949; Fri, 8 Jul 2016 20:39:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68Kdb7R053948; Fri, 8 Jul 2016 20:39:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607082039.u68Kdb7R053948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 20:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302453 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 20:39:38 -0000 Author: ngie Date: Fri Jul 8 20:39:37 2016 New Revision: 302453 URL: https://svnweb.freebsd.org/changeset/base/302453 Log: MFC r301605: Bounds check rpcbs_rmtcall(..) to ensure rtype is less than RPCBVERS_STAT Not returning if rtype == RPCBVERS_STAT will cause us to overrun the inf array, as it's defined to be exactly RPCBVERS_STAT elements in rpcb_prot.x: > include/rpc/rpcb_prot.x:typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; The proposed change also matches the rest of the rtype upper bound checks in the file, so the original change was likely a typo. CID: 1007567 Modified: stable/10/usr.sbin/rpcbind/rpcb_stat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcb_stat.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcb_stat.c Fri Jul 8 20:33:20 2016 (r302452) +++ stable/10/usr.sbin/rpcbind/rpcb_stat.c Fri Jul 8 20:39:37 2016 (r302453) @@ -152,7 +152,7 @@ rpcbs_rmtcall(rpcvers_t rtype, rpcproc_t rpcbs_rmtcalllist *rl; struct netconfig *nconf; - if (rtype > RPCBVERS_STAT) + if (rtype >= RPCBVERS_STAT) return; for (rl = inf[rtype].rmtinfo; rl; rl = rl->next) { From owner-svn-src-stable-10@freebsd.org Fri Jul 8 20:50:45 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4C38B8550D; Fri, 8 Jul 2016 20:50:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8470311C9; Fri, 8 Jul 2016 20:50:45 +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 u68KoirE057897; Fri, 8 Jul 2016 20:50:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68KoiR8057896; Fri, 8 Jul 2016 20:50:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607082050.u68KoiR8057896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jul 2016 20:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302455 - stable/10/usr.sbin/rpc.lockd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 20:50:45 -0000 Author: ngie Date: Fri Jul 8 20:50:44 2016 New Revision: 302455 URL: https://svnweb.freebsd.org/changeset/base/302455 Log: MFC r301871: Add missing break in lock_partialfilelock(..) with NFS_RESERR This will help ensure that the right error is trickled up when the function is called if the lock status is NFS_RESERR Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php CID: 1008161, 1304956 Modified: stable/10/usr.sbin/rpc.lockd/lockd_lock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.lockd/lockd_lock.c ============================================================================== --- stable/10/usr.sbin/rpc.lockd/lockd_lock.c Fri Jul 8 20:40:50 2016 (r302454) +++ stable/10/usr.sbin/rpc.lockd/lockd_lock.c Fri Jul 8 20:50:44 2016 (r302455) @@ -1426,6 +1426,7 @@ lock_partialfilelock(struct file_lock *f break; case NFS_RESERR: retval = PFL_NFSRESERR; + break; default: debuglog("Unmatched lnlstatus %d\n"); retval = PFL_NFSDENIED_NOLOCK;