From owner-svn-src-stable-12@freebsd.org Sun Apr 28 03:49:43 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C94D157032B; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2068207E; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD48516B; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3ngax010706; Sun, 28 Apr 2019 03:49:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3nfgq010698; Sun, 28 Apr 2019 03:49:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280349.x3S3nfgq010698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346802 - in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Commit-Revision: 346802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F2068207E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:49:44 -0000 Author: kevans Date: Sun Apr 28 03:49:40 2019 New Revision: 346802 URL: https://svnweb.freebsd.org/changeset/base/346802 Log: MFC r346545-r346546, r346680, r346700, r346705 r346545: libbe(3): allow creation of arbitrary depth boot environments libbe currently only provides an API to create a recursive boot environment, without any formal support for intentionally limiting the depth. This changeset adds an API, be_create_depth, that may be used to arbitrarily restrict the depth of the new BE. r346546: libbe(3): Add a test for be creation r346680: libbe(3): Copy received properties as well This was inherently broken on send|recv datasets. r346700: libbe(3): Fix mis-application of patch (SHLIBDIR) Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of the patch, leaving it to get installed to the wrong place and subsequently removed via ObsoleteFiles. r346705: libbe(3): Fix libcompat build SHLIBDIR should still be optionally set, just before src.opts.mk is included so that libcompat can properly override it. This fixes lib32 failures reported by both Jenkins and Michael Butler. Added: stable/12/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/lib/libbe/Makefile stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/libbe.3 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/lib/libbe/Makefile stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_impl.h stable/11/lib/libbe/libbe.3 Directory Properties: stable/11/ (props changed) Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/etc/mtree/BSD.tests.dist Sun Apr 28 03:49:40 2019 (r346802) @@ -272,6 +272,8 @@ .. libarchive .. + libbe + .. libc c063 .. Modified: stable/12/lib/libbe/Makefile ============================================================================== --- stable/12/lib/libbe/Makefile Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/Makefile Sun Apr 28 03:49:40 2019 (r346802) @@ -1,8 +1,11 @@ # $FreeBSD$ +SHLIBDIR?= /lib + +.include + PACKAGE= lib${LIB} LIB= be -SHLIBDIR?= /lib SHLIB_MAJOR= 1 SHLIB_MINOR= 0 @@ -27,5 +30,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/ CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= YES +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be.c Sun Apr 28 03:49:40 2019 (r346802) @@ -372,7 +372,6 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c sizeof(buf)) >= sizeof(buf)) return (set_error(lbh, BE_ERR_INVALIDNAME)); } - if ((err = zfs_snapshot(lbh->lzh, buf, recursive, NULL)) != 0) { switch (err) { case EZFS_INVALIDNAME: @@ -432,8 +431,12 @@ be_deep_clone_prop(int prop, void *cb) /* Just continue if we fail to read a property */ return (ZPROP_CONT); - /* Only copy locally defined properties */ - if (src != ZPROP_SRC_LOCAL) + /* + * Only copy locally defined or received properties. This continues + * to avoid temporary/default/local properties intentionally without + * breaking received datasets. + */ + if (src != ZPROP_SRC_LOCAL && src != ZPROP_SRC_RECEIVED) return (ZPROP_CONT); /* Augment mountpoint with altroot, if needed */ @@ -446,43 +449,78 @@ be_deep_clone_prop(int prop, void *cb) return (ZPROP_CONT); } +/* + * Return the corresponding boot environment path for a given + * dataset path, the constructed path is placed in 'result'. + * + * example: say our new boot environment name is 'bootenv' and + * the dataset path is 'zroot/ROOT/default/data/set'. + * + * result should produce: 'zroot/ROOT/bootenv/data/set' + */ static int -be_deep_clone(zfs_handle_t *ds, void *data) +be_get_path(struct libbe_deep_clone *ldc, const char *dspath, char *result, int result_size) { + char *pos; + char *child_dataset; + + /* match the root path for the boot environments */ + pos = strstr(dspath, ldc->lbh->root); + + /* no match, different pools? */ + if (pos == NULL) + return (BE_ERR_BADPATH); + + /* root path of the new boot environment */ + snprintf(result, result_size, "%s/%s", ldc->lbh->root, ldc->bename); + + /* gets us to the parent dataset, the +1 consumes a trailing slash */ + pos += strlen(ldc->lbh->root) + 1; + + /* skip the parent dataset */ + if ((child_dataset = strchr(pos, '/')) != NULL) + strlcat(result, child_dataset, result_size); + + return (BE_ERR_SUCCESS); +} + +static int +be_clone_cb(zfs_handle_t *ds, void *data) +{ int err; char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; const char *dspath; - char *dsname; zfs_handle_t *snap_hdl; nvlist_t *props; - struct libbe_deep_clone *isdc, sdc; + struct libbe_deep_clone *ldc; struct libbe_dccb dccb; - isdc = (struct libbe_deep_clone *)data; + ldc = (struct libbe_deep_clone *)data; dspath = zfs_get_name(ds); - if ((dsname = strrchr(dspath, '/')) == NULL) - return (BE_ERR_UNKNOWN); - dsname++; - if (isdc->bename == NULL) - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, dsname); - else - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, isdc->bename); + snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, ldc->snapname); - snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, isdc->snapname); + /* construct the boot environment path from the dataset we're cloning */ + if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) + return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); - if (zfs_dataset_exists(isdc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(isdc->lbh, BE_ERR_EXISTS)); + /* the dataset to be created (i.e. the boot environment) already exists */ + if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) + return (set_error(ldc->lbh, BE_ERR_EXISTS)); + /* no snapshot found for this dataset, silently skip it */ + if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) + return (0); + if ((snap_hdl = - zfs_open(isdc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(isdc->lbh, BE_ERR_ZFSOPEN)); + zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) + return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - dccb.lbh = isdc->lbh; + dccb.lbh = ldc->lbh; dccb.zhp = ds; dccb.props = props; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, @@ -490,58 +528,55 @@ be_deep_clone(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - err = BE_ERR_ZFSCLONE; + return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); nvlist_free(props); zfs_close(snap_hdl); - /* Failed to clone */ - if (err != BE_ERR_SUCCESS) - return (set_error(isdc->lbh, err)); + if (ldc->depth_limit == -1 || ldc->depth < ldc->depth_limit) { + ldc->depth++; + err = zfs_iter_filesystems(ds, be_clone_cb, ldc); + ldc->depth--; + } - sdc.lbh = isdc->lbh; - sdc.bename = NULL; - sdc.snapname = isdc->snapname; - sdc.be_root = (char *)&be_path; - - err = zfs_iter_filesystems(ds, be_deep_clone, &sdc); - - return (err); + return (set_error(ldc->lbh, err)); } /* - * Create the boot environment from pre-existing snapshot - */ -int -be_create_from_existing_snap(libbe_handle_t *lbh, const char *name, - const char *snap) + * Create a boot environment with a given name from a given snapshot. + * Snapshots can be in the format 'zroot/ROOT/default@snapshot' or + * 'default@snapshot'. In the latter case, 'default@snapshot' will be prepended + * with the root path that libbe was initailized with. +*/ +static int +be_clone(libbe_handle_t *lbh, const char *bename, const char *snapshot, int depth) { int err; - char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; - const char *bename; char *parentname, *snapname; zfs_handle_t *parent_hdl; - struct libbe_deep_clone sdc; + struct libbe_deep_clone ldc; - if ((err = be_validate_name(lbh, name)) != 0) + /* ensure the boot environment name is valid */ + if ((err = be_validate_name(lbh, bename)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, snap, snap_path)) != 0) + + /* + * prepend the boot environment root path if we're + * given a partial snapshot name. + */ + if ((err = be_root_concat(lbh, snapshot, snap_path)) != 0) return (set_error(lbh, err)); + + /* ensure the snapshot exists */ if ((err = be_validate_snap(lbh, snap_path)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, name, be_path)) != 0) - return (set_error(lbh, err)); - - if ((bename = strrchr(name, '/')) == NULL) - bename = name; - else - bename++; - + /* get a copy of the snapshot path so we can disect it */ if ((parentname = strdup(snap_path)) == NULL) return (set_error(lbh, BE_ERR_UNKNOWN)); + /* split dataset name from snapshot name */ snapname = strchr(parentname, '@'); if (snapname == NULL) { free(parentname); @@ -550,32 +585,56 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons *snapname = '\0'; snapname++; - sdc.lbh = lbh; - sdc.bename = bename; - sdc.snapname = snapname; - sdc.be_root = lbh->root; + /* set-up the boot environment */ + ldc.lbh = lbh; + ldc.bename = bename; + ldc.snapname = snapname; + ldc.depth = 0; + ldc.depth_limit = depth; + /* the boot environment will be cloned from this dataset */ parent_hdl = zfs_open(lbh->lzh, parentname, ZFS_TYPE_DATASET); - err = be_deep_clone(parent_hdl, &sdc); + /* create the boot environment */ + err = be_clone_cb(parent_hdl, &ldc); + free(parentname); return (set_error(lbh, err)); } +/* + * Create a boot environment from pre-existing snapshot, specifying a depth. + */ +int be_create_depth(libbe_handle_t *lbh, const char *bename, + const char *snap, int depth) +{ + return (be_clone(lbh, bename, snap, depth)); +} /* + * Create the boot environment from pre-existing snapshot + */ +int +be_create_from_existing_snap(libbe_handle_t *lbh, const char *bename, + const char *snap) +{ + return (be_clone(lbh, bename, snap, -1)); +} + + +/* * Create a boot environment from an existing boot environment */ int -be_create_from_existing(libbe_handle_t *lbh, const char *name, const char *old) +be_create_from_existing(libbe_handle_t *lbh, const char *bename, const char *old) { int err; - char buf[BE_MAXPATHLEN]; + char snap[BE_MAXPATHLEN]; - if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf)) != 0) + if ((err = be_snapshot(lbh, old, NULL, true, snap)) != 0) return (set_error(lbh, err)); - err = be_create_from_existing_snap(lbh, name, (char *)buf); + err = be_clone(lbh, bename, snap, -1); return (set_error(lbh, err)); } Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be.h Sun Apr 28 03:49:40 2019 (r346802) @@ -84,6 +84,7 @@ int be_activate(libbe_handle_t *, const char *, bool); /* Bootenv creation functions */ int be_create(libbe_handle_t *, const char *); +int be_create_depth(libbe_handle_t *, const char *, const char *, int); int be_create_from_existing(libbe_handle_t *, const char *, const char *); int be_create_from_existing_snap(libbe_handle_t *, const char *, const char *); int be_snapshot(libbe_handle_t *, const char *, const char *, bool, char *); Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be_impl.h Sun Apr 28 03:49:40 2019 (r346802) @@ -50,7 +50,8 @@ struct libbe_deep_clone { libbe_handle_t *lbh; const char *bename; const char *snapname; - const char *be_root; + int depth; + int depth_limit; }; struct libbe_dccb { Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/libbe.3 Sun Apr 28 03:49:40 2019 (r346802) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2019 +.Dd April 22, 2019 .Dt LIBBE 3 .Os .Sh NAME @@ -63,6 +63,9 @@ .Fn be_create "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int +.Fn be_create_depth "libbe_handle_t *hdl" "const char *be_name" "const char *snap" "int depth" +.Pp +.Ft int .Fn be_create_from_existing "libbe_handle_t *hdl" "const char *be_name" "const char *be_origin" .Pp .Ft int @@ -213,19 +216,29 @@ function returns the boot environment root path. The .Fn be_create function creates a boot environment with the given name. -It will be created from a snapshot of the currently booted boot environment. +The new boot environment will be created from a recursive snapshot of the +currently booted boot environment. .Pp The +.Fn be_create_depth +function creates a boot environment with the given name from an existing +snapshot. +The depth parameter specifies the depth of recursion that will be cloned from +the existing snapshot. +A depth of '0' is no recursion and '-1' is unlimited (i.e., a recursive boot +environment). +.Pp +The .Fn be_create_from_existing function creates a boot environment with the given name from the name of an existing boot environment. -A snapshot will be made of the base boot environment, and the new boot -environment will be created from that. +A recursive snapshot will be made of the origin boot environment, and the new +boot environment will be created from that. .Pp The .Fn be_create_from_existing_snap -function creates a boot environment with the given name from an existing -snapshot. +function creates a recursive boot environment with the given name from an +existing snapshot. .Pp The .Fn be_rename From owner-svn-src-stable-12@freebsd.org Sun Apr 28 03:51:09 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C6051570488; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42BA282364; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19ABE529E; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3p8Mk014556; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3p8Gk014555; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280351.x3S3p8Gk014555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346803 - in stable: 11/sys/net 12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/net 12/sys/net X-SVN-Commit-Revision: 346803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42BA282364 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.90)[-0.898,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:51:09 -0000 Author: kevans Date: Sun Apr 28 03:51:08 2019 New Revision: 346803 URL: https://svnweb.freebsd.org/changeset/base/346803 Log: MFC r346688-r346689: tap(4) MODULE_VERSION r346688: tap(4): Add a MODULE_VERSION Otherwise tap(4) can be loaded by loader despite being compiled into the kernel, causing a panic as things try to double-initialize. r346689: tap(4): Correct driver name... PR: 220867 Modified: stable/12/sys/net/if_tap.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/net/if_tap.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/net/if_tap.c ============================================================================== --- stable/12/sys/net/if_tap.c Sun Apr 28 03:49:40 2019 (r346802) +++ stable/12/sys/net/if_tap.c Sun Apr 28 03:51:08 2019 (r346803) @@ -175,6 +175,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); +MODULE_VERSION(if_tap, 1); static int tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-stable-12@freebsd.org Sun Apr 28 14:30:27 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D618F157FDAE; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 759ED95C20; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AE88BF01; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEUQhk050513; Sun, 28 Apr 2019 14:30:26 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEUQcW050512; Sun, 28 Apr 2019 14:30:26 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281430.x3SEUQcW050512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346841 - stable/12/sys/amd64/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/amd64/linux X-SVN-Commit-Revision: 346841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 759ED95C20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:30:27 -0000 Author: dchagin Date: Sun Apr 28 14:30:25 2019 New Revision: 346841 URL: https://svnweb.freebsd.org/changeset/base/346841 Log: MFC r345468: Revert r313993. AMD64_SET_**BASE expects a pointer to a pointer, we just passing in the pointer value itself. Set PCB_FULL_IRET for doreti to restore %fs, %gs and its correspondig base. PR: 225105 Modified: stable/12/sys/amd64/linux/linux_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/12/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:20:29 2019 (r346840) +++ stable/12/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:30:25 2019 (r346841) @@ -228,35 +228,38 @@ linux_sigaltstack(struct thread *td, struct linux_siga int linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) { + struct pcb *pcb; int error; - struct sysarch_args bsd_args; + pcb = td->td_pcb; LINUX_CTR2(arch_prctl, "0x%x, %p", args->code, args->addr); switch (args->code) { case LINUX_ARCH_SET_GS: - bsd_args.op = AMD64_SET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_gsbase = args->addr; + td->td_frame->tf_gs = _ugssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_SET_FS: - bsd_args.op = AMD64_SET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_fsbase = args->addr; + td->td_frame->tf_fs = _ufssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_GET_FS: - bsd_args.op = AMD64_GET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_fsbase, PTRIN(args->addr), + sizeof(args->addr)); break; case LINUX_ARCH_GET_GS: - bsd_args.op = AMD64_GET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_gsbase, PTRIN(args->addr), + sizeof(args->addr)); break; default: error = EINVAL; From owner-svn-src-stable-12@freebsd.org Sun Apr 28 14:34:35 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCE4157FFAA; Sun, 28 Apr 2019 14:34:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A48E395FE8; Sun, 28 Apr 2019 14:34:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6911DC0B6; Sun, 28 Apr 2019 14:34:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEYYOF055532; Sun, 28 Apr 2019 14:34:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEYWa0055517; Sun, 28 Apr 2019 14:34:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281434.x3SEYWa0055517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346842 - in stable/12/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys: amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A48E395FE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:34:35 -0000 Author: dchagin Date: Sun Apr 28 14:34:31 2019 New Revision: 346842 URL: https://svnweb.freebsd.org/changeset/base/346842 Log: MFC r345469, r345470: Linux between 4.18 and 5.0 split IPC system calls. In preparation for doing this in the Linuxulator modify our linux_shmat() to match actual Linux shmat() system call. Modified: stable/12/sys/amd64/linux32/linux32_machdep.c stable/12/sys/amd64/linux32/linux32_proto.h stable/12/sys/amd64/linux32/linux32_systrace_args.c stable/12/sys/amd64/linux32/syscalls.master stable/12/sys/compat/linux/linux_ipc.c stable/12/sys/compat/linux/linux_ipc.h stable/12/sys/i386/linux/linux_machdep.c stable/12/sys/i386/linux/linux_proto.h stable/12/sys/i386/linux/linux_systrace_args.c stable/12/sys/i386/linux/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:34:31 2019 (r346842) @@ -259,7 +259,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -278,7 +278,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -287,7 +287,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -304,13 +304,13 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -327,22 +327,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = PTRIN((l_uint)args->arg3); - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -358,7 +365,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/12/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:34:31 2019 (r346842) @@ -369,9 +369,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/12/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) @@ -785,9 +785,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -3894,13 +3894,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "userland void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/12/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux32/syscalls.master Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) @@ -212,8 +212,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } Modified: stable/12/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/12/sys/compat/linux/linux_ipc.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/compat/linux/linux_ipc.c Sun Apr 28 14:34:31 2019 (r346842) @@ -785,23 +785,11 @@ linux_shmat(struct thread *td, struct linux_shmat_args void *shmaddr; int shmflg; } */ bsd_args; - int error; -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - l_uintptr_t addr; -#endif bsd_args.shmid = args->shmid; bsd_args.shmaddr = PTRIN(args->shmaddr); bsd_args.shmflg = args->shmflg; - if ((error = sys_shmat(td, &bsd_args))) - return (error); -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - addr = td->td_retval[0]; - if ((error = copyout(&addr, PTRIN(args->raddr), sizeof(addr)))) - return (error); - td->td_retval[0] = 0; -#endif - return (0); + return (sys_shmat(td, &bsd_args)); } int Modified: stable/12/sys/compat/linux/linux_ipc.h ============================================================================== --- stable/12/sys/compat/linux/linux_ipc.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/compat/linux/linux_ipc.h Sun Apr 28 14:34:31 2019 (r346842) @@ -141,7 +141,6 @@ struct linux_shmat_args l_int shmid; char *shmaddr; l_int shmflg; - l_ulong *raddr; }; struct linux_shmctl_args Modified: stable/12/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/12/sys/i386/linux/linux_machdep.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_machdep.c Sun Apr 28 14:34:31 2019 (r346842) @@ -133,7 +133,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -152,7 +152,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -161,7 +161,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -176,15 +176,15 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct l_ipc_kludge tmp; int error; - if (args->ptr == NULL) + if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); - a.msgp = tmp.msgp; + a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -201,22 +201,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = (l_ulong *)args->arg3; - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -232,7 +239,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/12/sys/i386/linux/linux_proto.h ============================================================================== --- stable/12/sys/i386/linux/linux_proto.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_proto.h Sun Apr 28 14:34:31 2019 (r346842) @@ -372,9 +372,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/12/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/12/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) @@ -814,9 +814,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -4012,13 +4012,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "userland void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/12/sys/i386/linux/syscalls.master ============================================================================== --- stable/12/sys/i386/linux/syscalls.master Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) @@ -214,8 +214,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } From owner-svn-src-stable-12@freebsd.org Sun Apr 28 14:37:24 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25294158003C; Sun, 28 Apr 2019 14:37:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4CD396163; Sun, 28 Apr 2019 14:37:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A99A6C0BB; Sun, 28 Apr 2019 14:37:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEbNXJ055984; Sun, 28 Apr 2019 14:37:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEbKhD055963; Sun, 28 Apr 2019 14:37:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281437.x3SEbKhD055963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346843 - in stable/12/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4CD396163 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:37:24 -0000 Author: dchagin Date: Sun Apr 28 14:37:20 2019 New Revision: 346843 URL: https://svnweb.freebsd.org/changeset/base/346843 Log: MFC r345471, r345472, r346603: Update syscall.master to 5.0. For 32-bit Linuxulator, ipc() syscall was historically the entry point for the IPC API. Starting in Linux 4.18, direct syscalls are provided for the IPC. Enable it. Modified: stable/12/sys/amd64/linux/linux_dummy.c stable/12/sys/amd64/linux/linux_proto.h stable/12/sys/amd64/linux/linux_syscall.h stable/12/sys/amd64/linux/linux_syscalls.c stable/12/sys/amd64/linux/linux_sysent.c stable/12/sys/amd64/linux/linux_systrace_args.c stable/12/sys/amd64/linux/syscalls.master stable/12/sys/amd64/linux32/linux32_dummy.c stable/12/sys/amd64/linux32/linux32_proto.h stable/12/sys/amd64/linux32/linux32_syscall.h stable/12/sys/amd64/linux32/linux32_syscalls.c stable/12/sys/amd64/linux32/linux32_sysent.c stable/12/sys/amd64/linux32/linux32_systrace_args.c stable/12/sys/amd64/linux32/syscalls.master stable/12/sys/compat/linux/linux_ipc.h stable/12/sys/i386/linux/linux.h stable/12/sys/i386/linux/linux_dummy.c stable/12/sys/i386/linux/linux_proto.h stable/12/sys/i386/linux/linux_syscall.h stable/12/sys/i386/linux/linux_syscalls.c stable/12/sys/i386/linux/linux_sysent.c stable/12/sys/i386/linux/linux_systrace_args.c stable/12/sys/i386/linux/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:37:20 2019 (r346843) @@ -155,6 +155,16 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/12/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/12/sys/amd64/linux/linux_proto.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_proto.h Sun Apr 28 14:37:20 2019 (r346843) @@ -1213,6 +1213,34 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_open(struct thread *, struct linux_open_args *); int linux_newstat(struct thread *, struct linux_newstat_args *); @@ -1479,6 +1507,13 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -1786,6 +1821,13 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX_SYS_AUE_linux_statx AUE_NULL +#define LINUX_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX_SYS_AUE_linux_rseq AUE_NULL +#define LINUX_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/12/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/12/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:37:20 2019 (r346843) @@ -313,4 +313,11 @@ #define LINUX_SYS_linux_pkey_mprotect 329 #define LINUX_SYS_linux_pkey_alloc 330 #define LINUX_SYS_linux_pkey_free 331 -#define LINUX_SYS_MAXSYSCALL 333 +#define LINUX_SYS_linux_statx 332 +#define LINUX_SYS_linux_io_pgetevents 333 +#define LINUX_SYS_linux_rseq 334 +#define LINUX_SYS_linux_pidfd_send_signal 424 +#define LINUX_SYS_linux_io_uring_setup 425 +#define LINUX_SYS_linux_io_uring_enter 426 +#define LINUX_SYS_linux_io_uring_register 427 +#define LINUX_SYS_MAXSYSCALL 429 Modified: stable/12/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/12/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:37:20 2019 (r346843) @@ -339,5 +339,101 @@ const char *linux_syscallnames[] = { "linux_pkey_mprotect", /* 329 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 330 = linux_pkey_alloc */ "linux_pkey_free", /* 331 = linux_pkey_free */ - "#332", /* 332 = nosys */ + "linux_statx", /* 332 = linux_statx */ + "linux_io_pgetevents", /* 333 = linux_io_pgetevents */ + "linux_rseq", /* 334 = linux_rseq */ + "#335", /* 335 = nosys */ + "#336", /* 336 = nosys */ + "#337", /* 337 = nosys */ + "#338", /* 338 = nosys */ + "#339", /* 339 = nosys */ + "#340", /* 340 = nosys */ + "#341", /* 341 = nosys */ + "#342", /* 342 = nosys */ + "#343", /* 343 = nosys */ + "#344", /* 344 = nosys */ + "#345", /* 345 = nosys */ + "#346", /* 346 = nosys */ + "#347", /* 347 = nosys */ + "#348", /* 348 = nosys */ + "#349", /* 349 = nosys */ + "#350", /* 350 = nosys */ + "#351", /* 351 = nosys */ + "#352", /* 352 = nosys */ + "#353", /* 353 = nosys */ + "#354", /* 354 = nosys */ + "#355", /* 355 = nosys */ + "#356", /* 356 = nosys */ + "#357", /* 357 = nosys */ + "#358", /* 358 = nosys */ + "#359", /* 359 = nosys */ + "#360", /* 360 = nosys */ + "#361", /* 361 = nosys */ + "#362", /* 362 = nosys */ + "#363", /* 363 = nosys */ + "#364", /* 364 = nosys */ + "#365", /* 365 = nosys */ + "#366", /* 366 = nosys */ + "#367", /* 367 = nosys */ + "#368", /* 368 = nosys */ + "#369", /* 369 = nosys */ + "#370", /* 370 = nosys */ + "#371", /* 371 = nosys */ + "#372", /* 372 = nosys */ + "#373", /* 373 = nosys */ + "#374", /* 374 = nosys */ + "#375", /* 375 = nosys */ + "#376", /* 376 = nosys */ + "#377", /* 377 = nosys */ + "#378", /* 378 = nosys */ + "#379", /* 379 = nosys */ + "#380", /* 380 = nosys */ + "#381", /* 381 = nosys */ + "#382", /* 382 = nosys */ + "#383", /* 383 = nosys */ + "#384", /* 384 = nosys */ + "#385", /* 385 = nosys */ + "#386", /* 386 = nosys */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "#393", /* 393 = nosys */ + "#394", /* 394 = nosys */ + "#395", /* 395 = nosys */ + "#396", /* 396 = nosys */ + "#397", /* 397 = nosys */ + "#398", /* 398 = nosys */ + "#399", /* 399 = nosys */ + "#400", /* 400 = nosys */ + "#401", /* 401 = nosys */ + "#402", /* 402 = nosys */ + "#403", /* 403 = nosys */ + "#404", /* 404 = nosys */ + "#405", /* 405 = nosys */ + "#406", /* 406 = nosys */ + "#407", /* 407 = nosys */ + "#408", /* 408 = nosys */ + "#409", /* 409 = nosys */ + "#410", /* 410 = nosys */ + "#411", /* 411 = nosys */ + "#412", /* 412 = nosys */ + "#413", /* 413 = nosys */ + "#414", /* 414 = nosys */ + "#415", /* 415 = nosys */ + "#416", /* 416 = nosys */ + "#417", /* 417 = nosys */ + "#418", /* 418 = nosys */ + "#419", /* 419 = nosys */ + "#420", /* 420 = nosys */ + "#421", /* 421 = nosys */ + "#422", /* 422 = nosys */ + "#423", /* 423 = nosys */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/12/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:37:20 2019 (r346843) @@ -349,5 +349,101 @@ struct sysent linux_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 332 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_statx */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 335 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 336 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 337 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 338 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 340 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 341 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 342 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 343 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 344 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 345 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 346 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 347 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 348 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 350 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 351 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 352 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 353 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 354 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 355 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 356 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 357 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 358 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 360 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 361 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 362 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 363 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 367 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 368 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 369 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 370 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 371 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 372 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 373 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 374 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 376 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 377 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 378 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 379 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 380 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 381 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 382 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 384 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 385 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 386 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 393 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 394 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 395 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 396 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 397 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 398 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 399 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 400 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 401 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 402 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 403 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 404 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 405 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 406 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 407 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 408 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 409 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 410 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 411 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 412 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 413 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 414 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 416 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 417 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 418 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 419 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 420 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 421 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 422 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 423 = nosys */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:37:20 2019 (r346843) @@ -2447,6 +2447,52 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 332: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_io_pgetevents */ + case 333: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 334: { + *n_args = 0; + break; + } + /* linux_pidfd_send_signal */ + case 424: { + struct linux_pidfd_send_signal_args *p = params; + iarg[0] = p->pidfd; /* l_int */ + iarg[1] = p->sig; /* l_int */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; + break; + } + /* linux_io_uring_setup */ + case 425: { + *n_args = 0; + break; + } + /* linux_io_uring_enter */ + case 426: { + *n_args = 0; + break; + } + /* linux_io_uring_register */ + case 427: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -6305,6 +6351,62 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_statx */ + case 332: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "userland const char *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "userland void *"; + break; + default: + break; + }; + break; + /* linux_io_pgetevents */ + case 333: + break; + /* linux_rseq */ + case 334: + break; + /* linux_pidfd_send_signal */ + case 424: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_siginfo_t *"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; + break; + /* linux_io_uring_setup */ + case 425: + break; + /* linux_io_uring_enter */ + case 426: + break; + /* linux_io_uring_register */ + case 427: + break; default: break; }; @@ -7647,6 +7749,26 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_statx */ + case 332: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_pgetevents */ + case 333: + /* linux_rseq */ + case 334: + /* linux_pidfd_send_signal */ + case 424: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_uring_setup */ + case 425: + /* linux_io_uring_enter */ + case 426: + /* linux_io_uring_register */ + case 427: default: break; }; Modified: stable/12/sys/amd64/linux/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/syscalls.master Sun Apr 28 14:37:20 2019 (r346843) @@ -595,7 +595,21 @@ 330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ l_ulong init_val); } 331 AUE_NULL STD { int linux_pkey_free(l_int pkey); } +; Linux 4.11: +332 AUE_NULL STD { int linux_statx(l_int dirfd, \ + const char *pathname, l_uint flags, \ + l_uint mask, void *statxbuf); } +; Linux 4.18: +333 AUE_NULL STD { int linux_io_pgetevents(void); } +334 AUE_NULL STD { int linux_rseq(void); } +; Linux 5.0: +335-423 AUE_NULL UNIMPL nosys +424 AUE_NULL STD { int linux_pidfd_send_signal(l_int pidfd, \ + l_int sig, l_siginfo_t *info, l_uint flags); } +425 AUE_NULL STD { int linux_io_uring_setup(void); } +426 AUE_NULL STD { int linux_io_uring_enter(void); } +427 AUE_NULL STD { int linux_io_uring_register(void); } ; please, keep this line at the end. -332 AUE_NULL UNIMPL nosys +428 AUE_NULL UNIMPL nosys ; vim: syntax=off Modified: stable/12/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:37:20 2019 (r346843) @@ -161,6 +161,37 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +DUMMY(arch_prctl); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(clock_gettime64); +DUMMY(clock_settime64); +DUMMY(clock_adjtime64); +DUMMY(clock_getres_time64); +DUMMY(clock_nanosleep_time64); +DUMMY(timer_gettime64); +DUMMY(timer_settime64); +DUMMY(timerfd_gettime64); +DUMMY(timerfd_settime64); +DUMMY(utimensat_time64); +DUMMY(pselect6_time64); +DUMMY(ppoll_time64); +DUMMY(io_pgetevents_time64); +DUMMY(recvmmsg_time64); +DUMMY(mq_timedsend_time64); +DUMMY(mq_timedreceive_time64); +DUMMY(semtimedop_time64); +DUMMY(rt_sigtimedwait_time64); +DUMMY(futex_time64); +DUMMY(sched_rr_get_interval_time64); +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/12/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:37:20 2019 (r346843) @@ -1365,6 +1365,149 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_arch_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_clock_gettime64_args { + register_t dummy; +}; +struct linux_clock_settime64_args { + register_t dummy; +}; +struct linux_clock_adjtime64_args { + register_t dummy; +}; +struct linux_clock_getres_time64_args { + register_t dummy; +}; +struct linux_clock_nanosleep_time64_args { + register_t dummy; +}; +struct linux_timer_gettime64_args { + register_t dummy; +}; +struct linux_timer_settime64_args { + register_t dummy; +}; +struct linux_timerfd_gettime64_args { + register_t dummy; +}; +struct linux_timerfd_settime64_args { + register_t dummy; +}; +struct linux_utimensat_time64_args { + register_t dummy; +}; +struct linux_pselect6_time64_args { + register_t dummy; +}; +struct linux_ppoll_time64_args { + register_t dummy; +}; +struct linux_io_pgetevents_time64_args { + register_t dummy; +}; +struct linux_recvmmsg_time64_args { + register_t dummy; +}; +struct linux_mq_timedsend_time64_args { + register_t dummy; +}; +struct linux_mq_timedreceive_time64_args { + register_t dummy; +}; +struct linux_semtimedop_time64_args { + register_t dummy; +}; +struct linux_rt_sigtimedwait_time64_args { + register_t dummy; +}; +struct linux_futex_time64_args { + register_t dummy; +}; +struct linux_sched_rr_get_interval_time64_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_exit(struct thread *, struct linux_exit_args *); int linux_fork(struct thread *, struct linux_fork_args *); @@ -1673,6 +1816,44 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_arch_prctl(struct thread *, struct linux_arch_prctl_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_semget(struct thread *, struct linux_semget_args *); +int linux_semctl(struct thread *, struct linux_semctl_args *); +int linux_shmget(struct thread *, struct linux_shmget_args *); +int linux_shmctl(struct thread *, struct linux_shmctl_args *); +int linux_shmat(struct thread *, struct linux_shmat_args *); +int linux_shmdt(struct thread *, struct linux_shmdt_args *); +int linux_msgget(struct thread *, struct linux_msgget_args *); +int linux_msgsnd(struct thread *, struct linux_msgsnd_args *); +int linux_msgrcv(struct thread *, struct linux_msgrcv_args *); +int linux_msgctl(struct thread *, struct linux_msgctl_args *); +int linux_clock_gettime64(struct thread *, struct linux_clock_gettime64_args *); +int linux_clock_settime64(struct thread *, struct linux_clock_settime64_args *); +int linux_clock_adjtime64(struct thread *, struct linux_clock_adjtime64_args *); +int linux_clock_getres_time64(struct thread *, struct linux_clock_getres_time64_args *); +int linux_clock_nanosleep_time64(struct thread *, struct linux_clock_nanosleep_time64_args *); +int linux_timer_gettime64(struct thread *, struct linux_timer_gettime64_args *); +int linux_timer_settime64(struct thread *, struct linux_timer_settime64_args *); +int linux_timerfd_gettime64(struct thread *, struct linux_timerfd_gettime64_args *); +int linux_timerfd_settime64(struct thread *, struct linux_timerfd_settime64_args *); +int linux_utimensat_time64(struct thread *, struct linux_utimensat_time64_args *); +int linux_pselect6_time64(struct thread *, struct linux_pselect6_time64_args *); +int linux_ppoll_time64(struct thread *, struct linux_ppoll_time64_args *); +int linux_io_pgetevents_time64(struct thread *, struct linux_io_pgetevents_time64_args *); +int linux_recvmmsg_time64(struct thread *, struct linux_recvmmsg_time64_args *); +int linux_mq_timedsend_time64(struct thread *, struct linux_mq_timedsend_time64_args *); +int linux_mq_timedreceive_time64(struct thread *, struct linux_mq_timedreceive_time64_args *); +int linux_semtimedop_time64(struct thread *, struct linux_semtimedop_time64_args *); +int linux_rt_sigtimedwait_time64(struct thread *, struct linux_rt_sigtimedwait_time64_args *); +int linux_futex_time64(struct thread *, struct linux_futex_time64_args *); +int linux_sched_rr_get_interval_time64(struct thread *, struct linux_sched_rr_get_interval_time64_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -2022,6 +2203,44 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX32_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX32_SYS_AUE_linux_statx AUE_NULL +#define LINUX32_SYS_AUE_linux_arch_prctl AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX32_SYS_AUE_linux_rseq AUE_NULL +#define LINUX32_SYS_AUE_linux_semget AUE_NULL +#define LINUX32_SYS_AUE_linux_semctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmget AUE_NULL +#define LINUX32_SYS_AUE_linux_shmctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmat AUE_NULL +#define LINUX32_SYS_AUE_linux_shmdt AUE_NULL +#define LINUX32_SYS_AUE_linux_msgget AUE_NULL +#define LINUX32_SYS_AUE_linux_msgsnd AUE_NULL +#define LINUX32_SYS_AUE_linux_msgrcv AUE_NULL +#define LINUX32_SYS_AUE_linux_msgctl AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_adjtime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_getres_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_nanosleep_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_utimensat_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pselect6_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_ppoll_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_recvmmsg_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedsend_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedreceive_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_semtimedop_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigtimedwait_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_futex_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_sched_rr_get_interval_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/12/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:37:20 2019 (r346843) @@ -350,4 +350,42 @@ #define LINUX32_SYS_linux_pkey_mprotect 380 #define LINUX32_SYS_linux_pkey_alloc 381 #define LINUX32_SYS_linux_pkey_free 382 -#define LINUX32_SYS_MAXSYSCALL 384 +#define LINUX32_SYS_linux_statx 383 +#define LINUX32_SYS_linux_arch_prctl 384 +#define LINUX32_SYS_linux_io_pgetevents 385 +#define LINUX32_SYS_linux_rseq 386 +#define LINUX32_SYS_linux_semget 393 +#define LINUX32_SYS_linux_semctl 394 +#define LINUX32_SYS_linux_shmget 395 +#define LINUX32_SYS_linux_shmctl 396 +#define LINUX32_SYS_linux_shmat 397 +#define LINUX32_SYS_linux_shmdt 398 +#define LINUX32_SYS_linux_msgget 399 +#define LINUX32_SYS_linux_msgsnd 400 +#define LINUX32_SYS_linux_msgrcv 401 +#define LINUX32_SYS_linux_msgctl 402 +#define LINUX32_SYS_linux_clock_gettime64 403 +#define LINUX32_SYS_linux_clock_settime64 404 +#define LINUX32_SYS_linux_clock_adjtime64 405 +#define LINUX32_SYS_linux_clock_getres_time64 406 +#define LINUX32_SYS_linux_clock_nanosleep_time64 407 +#define LINUX32_SYS_linux_timer_gettime64 408 +#define LINUX32_SYS_linux_timer_settime64 409 +#define LINUX32_SYS_linux_timerfd_gettime64 410 +#define LINUX32_SYS_linux_timerfd_settime64 411 +#define LINUX32_SYS_linux_utimensat_time64 412 +#define LINUX32_SYS_linux_pselect6_time64 413 +#define LINUX32_SYS_linux_ppoll_time64 414 +#define LINUX32_SYS_linux_io_pgetevents_time64 416 +#define LINUX32_SYS_linux_recvmmsg_time64 417 +#define LINUX32_SYS_linux_mq_timedsend_time64 418 +#define LINUX32_SYS_linux_mq_timedreceive_time64 419 +#define LINUX32_SYS_linux_semtimedop_time64 420 +#define LINUX32_SYS_linux_rt_sigtimedwait_time64 421 +#define LINUX32_SYS_linux_futex_time64 422 +#define LINUX32_SYS_linux_sched_rr_get_interval_time64 423 +#define LINUX32_SYS_linux_pidfd_send_signal 424 +#define LINUX32_SYS_linux_io_uring_setup 425 +#define LINUX32_SYS_linux_io_uring_enter 426 +#define LINUX32_SYS_linux_io_uring_register 427 +#define LINUX32_SYS_MAXSYSCALL 429 Modified: stable/12/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:37:20 2019 (r346843) @@ -390,5 +390,50 @@ const char *linux32_syscallnames[] = { "linux_pkey_mprotect", /* 380 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 381 = linux_pkey_alloc */ "linux_pkey_free", /* 382 = linux_pkey_free */ - "#383", /* 383 = nosys */ + "linux_statx", /* 383 = linux_statx */ + "linux_arch_prctl", /* 384 = linux_arch_prctl */ + "linux_io_pgetevents", /* 385 = linux_io_pgetevents */ + "linux_rseq", /* 386 = linux_rseq */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "linux_semget", /* 393 = linux_semget */ + "linux_semctl", /* 394 = linux_semctl */ + "linux_shmget", /* 395 = linux_shmget */ + "linux_shmctl", /* 396 = linux_shmctl */ + "linux_shmat", /* 397 = linux_shmat */ + "linux_shmdt", /* 398 = linux_shmdt */ + "linux_msgget", /* 399 = linux_msgget */ + "linux_msgsnd", /* 400 = linux_msgsnd */ + "linux_msgrcv", /* 401 = linux_msgrcv */ + "linux_msgctl", /* 402 = linux_msgctl */ + "linux_clock_gettime64", /* 403 = linux_clock_gettime64 */ + "linux_clock_settime64", /* 404 = linux_clock_settime64 */ + "linux_clock_adjtime64", /* 405 = linux_clock_adjtime64 */ + "linux_clock_getres_time64", /* 406 = linux_clock_getres_time64 */ + "linux_clock_nanosleep_time64", /* 407 = linux_clock_nanosleep_time64 */ + "linux_timer_gettime64", /* 408 = linux_timer_gettime64 */ + "linux_timer_settime64", /* 409 = linux_timer_settime64 */ + "linux_timerfd_gettime64", /* 410 = linux_timerfd_gettime64 */ + "linux_timerfd_settime64", /* 411 = linux_timerfd_settime64 */ + "linux_utimensat_time64", /* 412 = linux_utimensat_time64 */ + "linux_pselect6_time64", /* 413 = linux_pselect6_time64 */ + "linux_ppoll_time64", /* 414 = linux_ppoll_time64 */ + "#415", /* 415 = nosys */ + "linux_io_pgetevents_time64", /* 416 = linux_io_pgetevents_time64 */ + "linux_recvmmsg_time64", /* 417 = linux_recvmmsg_time64 */ + "linux_mq_timedsend_time64", /* 418 = linux_mq_timedsend_time64 */ + "linux_mq_timedreceive_time64", /* 419 = linux_mq_timedreceive_time64 */ + "linux_semtimedop_time64", /* 420 = linux_semtimedop_time64 */ + "linux_rt_sigtimedwait_time64", /* 421 = linux_rt_sigtimedwait_time64 */ + "linux_futex_time64", /* 422 = linux_futex_time64 */ + "linux_sched_rr_get_interval_time64", /* 423 = linux_sched_rr_get_interval_time64 */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:37:20 2019 (r346843) @@ -400,5 +400,50 @@ struct sysent linux32_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 380 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 381 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 382 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 383 = linux_statx */ + { AS(linux_arch_prctl_args), (sy_call_t *)linux_arch_prctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 384 = linux_arch_prctl */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 385 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 386 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { AS(linux_semget_args), (sy_call_t *)linux_semget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 393 = linux_semget */ + { AS(linux_semctl_args), (sy_call_t *)linux_semctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 394 = linux_semctl */ + { AS(linux_shmget_args), (sy_call_t *)linux_shmget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 395 = linux_shmget */ + { AS(linux_shmctl_args), (sy_call_t *)linux_shmctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 396 = linux_shmctl */ + { AS(linux_shmat_args), (sy_call_t *)linux_shmat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 397 = linux_shmat */ + { AS(linux_shmdt_args), (sy_call_t *)linux_shmdt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 398 = linux_shmdt */ + { AS(linux_msgget_args), (sy_call_t *)linux_msgget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 399 = linux_msgget */ + { AS(linux_msgsnd_args), (sy_call_t *)linux_msgsnd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 400 = linux_msgsnd */ + { AS(linux_msgrcv_args), (sy_call_t *)linux_msgrcv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 401 = linux_msgrcv */ + { AS(linux_msgctl_args), (sy_call_t *)linux_msgctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 402 = linux_msgctl */ + { 0, (sy_call_t *)linux_clock_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 403 = linux_clock_gettime64 */ + { 0, (sy_call_t *)linux_clock_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 404 = linux_clock_settime64 */ + { 0, (sy_call_t *)linux_clock_adjtime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 405 = linux_clock_adjtime64 */ + { 0, (sy_call_t *)linux_clock_getres_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 406 = linux_clock_getres_time64 */ + { 0, (sy_call_t *)linux_clock_nanosleep_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 407 = linux_clock_nanosleep_time64 */ + { 0, (sy_call_t *)linux_timer_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 408 = linux_timer_gettime64 */ + { 0, (sy_call_t *)linux_timer_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 409 = linux_timer_settime64 */ + { 0, (sy_call_t *)linux_timerfd_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 410 = linux_timerfd_gettime64 */ + { 0, (sy_call_t *)linux_timerfd_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ + { 0, (sy_call_t *)linux_utimensat_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ + { 0, (sy_call_t *)linux_pselect6_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ + { 0, (sy_call_t *)linux_ppoll_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)linux_io_pgetevents_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ + { 0, (sy_call_t *)linux_recvmmsg_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 417 = linux_recvmmsg_time64 */ + { 0, (sy_call_t *)linux_mq_timedsend_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 418 = linux_mq_timedsend_time64 */ + { 0, (sy_call_t *)linux_mq_timedreceive_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ + { 0, (sy_call_t *)linux_semtimedop_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ + { 0, (sy_call_t *)linux_rt_sigtimedwait_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ + { 0, (sy_call_t *)linux_futex_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 422 = linux_futex_time64 */ + { 0, (sy_call_t *)linux_sched_rr_get_interval_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:37:20 2019 (r346843) @@ -2708,6 +2708,251 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 383: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_arch_prctl */ + case 384: { + struct linux_arch_prctl_args *p = params; + iarg[0] = p->option; /* l_int */ + iarg[1] = p->arg2; /* l_ulong */ + *n_args = 2; + break; + } + /* linux_io_pgetevents */ + case 385: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 386: { + *n_args = 0; + break; + } + /* linux_semget */ + case 393: { + struct linux_semget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->nsems; /* l_int */ + iarg[2] = p->semflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_semctl */ + case 394: { + struct linux_semctl_args *p = params; + iarg[0] = p->semid; /* l_int */ + iarg[1] = p->semnum; /* l_int */ + iarg[2] = p->cmd; /* l_int */ + uarg[3] = p->arg.buf; /* union l_semun */ + *n_args = 4; + break; + } + /* linux_shmget */ + case 395: { + struct linux_shmget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->size; /* l_size_t */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmctl */ + case 396: { + struct linux_shmctl_args *p = params; + iarg[0] = p->shmid; /* l_int */ + iarg[1] = p->cmd; /* l_int */ + uarg[2] = (intptr_t) p->buf; /* struct l_shmid_ds * */ + *n_args = 3; + break; + } + /* linux_shmat */ + case 397: { + struct linux_shmat_args *p = params; + iarg[0] = p->shmid; /* l_int */ + uarg[1] = (intptr_t) p->shmaddr; /* char * */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmdt */ + case 398: { + struct linux_shmdt_args *p = params; + uarg[0] = (intptr_t) p->shmaddr; /* char * */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Sun Apr 28 14:38:22 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3427F15800C5; Sun, 28 Apr 2019 14:38:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC79D9629F; Sun, 28 Apr 2019 14:38:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72A4C0BC; Sun, 28 Apr 2019 14:38:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEcLHD056147; Sun, 28 Apr 2019 14:38:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEcLTg056146; Sun, 28 Apr 2019 14:38:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281438.x3SEcLTg056146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346844 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 346844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC79D9629F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:38:22 -0000 Author: dchagin Date: Sun Apr 28 14:38:21 2019 New Revision: 346844 URL: https://svnweb.freebsd.org/changeset/base/346844 Log: MFC r345473: Whitespace cleanup (annoying). Modified: stable/12/sys/compat/linux/linux_fork.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_fork.c ============================================================================== --- stable/12/sys/compat/linux/linux_fork.c Sun Apr 28 14:37:20 2019 (r346843) +++ stable/12/sys/compat/linux/linux_fork.c Sun Apr 28 14:38:21 2019 (r346844) @@ -353,7 +353,7 @@ linux_clone_thread(struct thread *td, struct linux_clo thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - + if (p->p_ptevents & PTRACE_LWP) newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); From owner-svn-src-stable-12@freebsd.org Mon Apr 29 13:20:25 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C0A158C82E; Mon, 29 Apr 2019 13:20:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF80876E49; Mon, 29 Apr 2019 13:20:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C62972275A; Mon, 29 Apr 2019 13:20:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TDKOb4077316; Mon, 29 Apr 2019 13:20:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TDKO75077315; Mon, 29 Apr 2019 13:20:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904291320.x3TDKO75077315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 13:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346886 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 346886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF80876E49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:20:25 -0000 Author: markj Date: Mon Apr 29 13:20:24 2019 New Revision: 346886 URL: https://svnweb.freebsd.org/changeset/base/346886 Log: MFC r346544: Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit. Modified: stable/12/sys/conf/NOTES Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Mon Apr 29 09:52:53 2019 (r346885) +++ stable/12/sys/conf/NOTES Mon Apr 29 13:20:24 2019 (r346886) @@ -563,8 +563,10 @@ options KASSERT_PANIC_OPTIONAL # # The DIAGNOSTIC option is used to enable extra debugging information -# from some parts of the kernel. As this makes everything more noisy, -# it is disabled by default. +# and invariants checking. The added checks are too expensive or noisy +# for an INVARIANTS kernel and thus are disabled by default. It is +# expected that a kernel configured with DIAGNOSTIC will also have the +# INVARIANTS option enabled. # options DIAGNOSTIC From owner-svn-src-stable-12@freebsd.org Mon Apr 29 16:16:03 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F200E1595551; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 989A58A90B; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72E5424658; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGG2O1070824; Mon, 29 Apr 2019 16:16:02 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGG0qt070814; Mon, 29 Apr 2019 16:16:00 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201904291616.x3TGG0qt070814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 29 Apr 2019 16:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346892 - in stable/12: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 346892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 989A58A90B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:16:03 -0000 Author: mhorne Date: Mon Apr 29 16:16:00 2019 New Revision: 346892 URL: https://svnweb.freebsd.org/changeset/base/346892 Log: MFC r346016: Add option to build LLVM RISC-V target Approved by: markj (mentor) Added: stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV Modified: stable/12/lib/clang/include/llvm/Config/AsmParsers.def stable/12/lib/clang/include/llvm/Config/AsmPrinters.def stable/12/lib/clang/include/llvm/Config/Disassemblers.def stable/12/lib/clang/include/llvm/Config/Targets.def stable/12/lib/clang/libllvm/Makefile stable/12/lib/clang/llvm.build.mk stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_ASM_PARSER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PARSER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PARSER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PARSER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_ASM_PRINTER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PRINTER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PRINTER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PRINTER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_DISASSEMBLER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_DISASSEMBLER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_DISASSEMBLER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_DISASSEMBLER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_TARGET(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_TARGET(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_TARGET(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_TARGET(Sparc) #endif Modified: stable/12/lib/clang/libllvm/Makefile ============================================================================== --- stable/12/lib/clang/libllvm/Makefile Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/libllvm/Makefile Mon Apr 29 16:16:00 2019 (r346892) @@ -10,14 +10,15 @@ CFLAGS+= -I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ - ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ - ${MK_LLVM_TARGET_X86} == "no" + ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_RISCV} == "no" && \ + ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ - MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC, \ + or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC RISCV Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -1128,6 +1129,34 @@ SRCS_MIN+= Target/PowerPC/PPCVSXFMAMutate.cpp SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +SRCS_MIN+= Target/RISCV/AsmParser/RISCVAsmParser.cpp +SRCS_MIN+= Target/RISCV/Disassembler/RISCVDisassembler.cpp +SRCS_MIN+= Target/RISCV/InstPrinter/RISCVInstPrinter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp +SRCS_MIN+= Target/RISCV/RISCVAsmPrinter.cpp +SRCS_MIN+= Target/RISCV/RISCVExpandPseudoInsts.cpp +SRCS_MIN+= Target/RISCV/RISCVFrameLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVInstrInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVISelDAGToDAG.cpp +SRCS_MIN+= Target/RISCV/RISCVISelLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVMCInstLower.cpp +SRCS_MIN+= Target/RISCV/RISCVMergeBaseOffset.cpp +SRCS_MIN+= Target/RISCV/RISCVRegisterInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVSubtarget.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetMachine.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetObjectFile.cpp +SRCS_MIN+= Target/RISCV/TargetInfo/RISCVTargetInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVBaseInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVMatInt.cpp +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" SRCS_MIN+= Target/Sparc/AsmParser/SparcAsmParser.cpp SRCS_MIN+= Target/Sparc/DelaySlotFiller.cpp @@ -1545,13 +1574,15 @@ beforebuild: # Note: some rules are superfluous, not every combination is valid. .for arch in \ - AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 + AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc \ + RISCV/RISCV X86/X86 . for hdr in \ AsmMatcher/-gen-asm-matcher \ AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ AsmWriter/-gen-asm-writer \ CallingConv/-gen-callingconv \ CodeEmitter/-gen-emitter \ + CompressInstEmitter/-gen-compress-inst-emitter \ DAGISel/-gen-dag-isel \ DisassemblerTables/-gen-disassembler \ EVEX2VEXTables/-gen-x86-EVEX2VEX-tables \ @@ -1643,6 +1674,21 @@ TGHDRS+= PPCGenMCCodeEmitter.inc TGHDRS+= PPCGenRegisterInfo.inc TGHDRS+= PPCGenSubtargetInfo.inc .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +TGHDRS+= RISCVGenAsmMatcher.inc +TGHDRS+= RISCVGenAsmWriter.inc +TGHDRS+= RISCVGenCallingConv.inc +TGHDRS+= RISCVGenCompressInstEmitter.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenDisassemblerTables.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenInstrInfo.inc +TGHDRS+= RISCVGenMCCodeEmitter.inc +TGHDRS+= RISCVGenMCPseudoLowering.inc +TGHDRS+= RISCVGenRegisterInfo.inc +TGHDRS+= RISCVGenSubtargetInfo.inc +TGHDRS+= RISCVGenSystemOperands.inc +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" TGHDRS+= SparcGenAsmMatcher.inc TGHDRS+= SparcGenAsmWriter.inc Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/llvm.build.mk Mon Apr 29 16:16:00 2019 (r346892) @@ -69,6 +69,12 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_POWERPC LLVM_NATIVE_ARCH= PowerPC . endif .endif +.if ${MK_LLVM_TARGET_RISCV} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_RISCV +. if ${MACHINE_CPUARCH} == "riscv" +LLVM_NATIVE_ARCH= RISCV +. endif +.endif .if ${MK_LLVM_TARGET_SPARC} != "no" CFLAGS+= -DLLVM_TARGET_ENABLE_SPARC . if ${MACHINE_CPUARCH} == "sparc64" Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/share/man/man5/src.conf.5 Mon Apr 29 16:16:00 2019 (r346892) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 17, 2019 +.Dd March 29, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -151,6 +151,10 @@ for Verified Exec and When set, these options are also in effect: .Pp .Bl -inset -compact +.It Va WITH_LOADER_EFI_SECUREBOOT +(unless +.Va WITHOUT_LOADER_EFI_SECUREBOOT +is set explicitly) .It Va WITH_LOADER_VERIEXEC (unless .Va WITHOUT_LOADER_VERIEXEC @@ -380,6 +384,10 @@ is set explicitly) (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) +.It Va WITHOUT_LLVM_TARGET_RISCV +(unless +.Va WITH_LLVM_TARGET_RISCV +is set explicitly) .It Va WITHOUT_LLVM_TARGET_SPARC (unless .Va WITH_LLVM_TARGET_SPARC @@ -1190,6 +1198,20 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_RISCV +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64. +.It Va WITH_LLVM_TARGET_RISCV +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1222,6 +1244,11 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITH_LOADER_EFI_SECUREBOOT +Enable building +.Xr loader 8 +with support for verification based on certificates obtained from UEFI. +.Pp .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader on x86. This option is a nop on all other platforms. @@ -1262,6 +1289,14 @@ with support for verifcation similar to Verified Exec. .Pp It depends on .Va WITH_BEARSSL +When set, these options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITH_LOADER_EFI_SECUREBOOT +(unless +.Va WITHOUT_LOADER_EFI_SECUREBOOT +is set explicitly) +.El .It Va WITHOUT_LOADER_ZFS Set to not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/share/mk/src.opts.mk Mon Apr 29 16:16:00 2019 (r346892) @@ -285,6 +285,7 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__ .endfor __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV .include # If the compiler is not C++11 capable, disable Clang and use GCC instead. Copied: stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV Mon Apr 29 16:16:00 2019 (r346892, copy of r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. Copied: stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV Mon Apr 29 16:16:00 2019 (r346892, copy of r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. From owner-svn-src-stable-12@freebsd.org Mon Apr 29 18:25:41 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7EB1598751; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD9D8FDB9; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B3925D8B; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIPdHr040243; Mon, 29 Apr 2019 18:25:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIPd74040239; Mon, 29 Apr 2019 18:25:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291825.x3TIPd74040239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346900 - stable/12/usr.bin/ar X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/ar X-SVN-Commit-Revision: 346900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DD9D8FDB9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:25:41 -0000 Author: emaste Date: Mon Apr 29 18:25:39 2019 New Revision: 346900 URL: https://svnweb.freebsd.org/changeset/base/346900 Log: MFC r339648: ar: report errno on warning/error Previously ar would report an error like "ar: fatal: Write error" without including additional errno information. Change warnings and errors to include archive_errno() so that the user may have some idea of the reason for the failure. Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/ar/acpyacc.y stable/12/usr.bin/ar/ar.h stable/12/usr.bin/ar/read.c stable/12/usr.bin/ar/write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ar/acpyacc.y ============================================================================== --- stable/12/usr.bin/ar/acpyacc.y Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/acpyacc.y Mon Apr 29 18:25:39 2019 (r346900) @@ -254,7 +254,8 @@ arscp_open(char *fname) archive_read_support_format_ar(a); AC(archive_read_open_filename(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); AC(archive_read_close(a)); AC(archive_read_free(a)); if (r != ARCHIVE_OK) Modified: stable/12/usr.bin/ar/ar.h ============================================================================== --- stable/12/usr.bin/ar/ar.h Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/ar.h Mon Apr 29 18:25:39 2019 (r346900) @@ -52,10 +52,10 @@ /* * Convenient wrapper for general libarchive error handling. */ -#define AC(CALL) do { \ - if ((CALL)) \ - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", \ - archive_error_string(a)); \ +#define AC(CALL) do { \ + if ((CALL)) \ + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", \ + archive_error_string(a)); \ } while (0) /* Modified: stable/12/usr.bin/ar/read.c ============================================================================== --- stable/12/usr.bin/ar/read.c Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/read.c Mon Apr 29 18:25:39 2019 (r346900) @@ -96,7 +96,8 @@ read_archive(struct bsdar *bsdar, char mode) r = archive_read_next_header(a, &entry); if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_EOF || r == ARCHIVE_FATAL) break; if (r == ARCHIVE_RETRY) { @@ -151,7 +152,7 @@ read_archive(struct bsdar *bsdar, char mode) if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) { (void)fprintf(stdout, "\n"); - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } @@ -205,7 +206,7 @@ read_archive(struct bsdar *bsdar, char mode) } if (r) - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } } Modified: stable/12/usr.bin/ar/write.c ============================================================================== --- stable/12/usr.bin/ar/write.c Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/write.c Mon Apr 29 18:25:39 2019 (r346900) @@ -291,12 +291,13 @@ read_objs(struct bsdar *bsdar, const char *archive, in for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_FATAL) - bsdar_errc(bsdar, EX_DATAERR, 0, "%s", + bsdar_errc(bsdar, EX_DATAERR, archive_errno(a), "%s", archive_error_string(a)); if (r == ARCHIVE_EOF) break; if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_RETRY) { bsdar_warnc(bsdar, 0, "Retrying..."); continue; @@ -341,7 +342,7 @@ read_objs(struct bsdar *bsdar, const char *archive, in bsdar_errc(bsdar, EX_SOFTWARE, errno, "malloc failed"); if (archive_read_data(a, buff, size) != (ssize_t)size) { - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); free(buff); continue; @@ -594,7 +595,7 @@ write_data(struct bsdar *bsdar, struct archive *a, con while (s > 0) { written = archive_write_data(a, buf, s); if (written < 0) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", archive_error_string(a)); buf = (const char *)buf + written; s -= written; From owner-svn-src-stable-12@freebsd.org Mon Apr 29 18:34:12 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69621598BBB; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B62368684; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2684A25F2E; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIYB5r045410; Mon, 29 Apr 2019 18:34:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIYBav045405; Mon, 29 Apr 2019 18:34:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291834.x3TIYBav045405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346902 - stable/12/usr.bin/ar X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/ar X-SVN-Commit-Revision: 346902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B62368684 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:34:13 -0000 Author: emaste Date: Mon Apr 29 18:34:11 2019 New Revision: 346902 URL: https://svnweb.freebsd.org/changeset/base/346902 Log: MFC ar: implement support for /SYM64/ 64-bit archives r346079: ar: implement support for /SYM64/ 64-bit archives Submitted by: Gerald Aryeetey Reviewed by: imp (earlier) r346568: ar: test for writing 64-bit format only if symbol count is nonzero This is a minor simplification; if we do not have any symbols the empty symbol table can be in 32-bit format. r346569: ar: use array notation to access s_so This is somewhat more readable than pointer arithmetic. Also remove an unnecessary cast while here. r346582: ar: shuffle symbol offsets during conversion for 32-bit ar archives During processing we maintain symbol offsets in the 64-bit s_so array, and when writing the archive convert to 32-bit if no offsets are greater than 4GB. However, this was somewhat inefficient as we looped over the array twice: first, converting to big endian and second, writing each 32-bit value one at a time (and incorrectly so on big-endian platforms). Instead, when writing a 32-bit archive shuffle convert symbol data to big endian (as required by the ar format) and shuffle to the beginning of the allocation at the same time. Also correct emission of the symbol count on big endian platforms. Further changes are planned, but this should fix powerpc64. Reported by: jhibbits, mlinimon Reviewed by: jhibbits, Gerald Aryeetey (earlier) Tested by: jhibbits PR: 234454 Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/ar/ar.h stable/12/usr.bin/ar/read.c stable/12/usr.bin/ar/write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ar/ar.h ============================================================================== --- stable/12/usr.bin/ar/ar.h Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/ar.h Mon Apr 29 18:34:11 2019 (r346902) @@ -100,9 +100,11 @@ struct bsdar { /* * Fields for the archive symbol table. */ - uint32_t s_cnt; /* current number of symbols. */ - uint32_t *s_so; /* symbol offset table. */ + uint64_t s_cnt; /* current number of symbols. */ + uint64_t *s_so; /* symbol offset table. */ + uint64_t s_so_max; /* maximum symbol offset. */ size_t s_so_cap; /* capacity of so table buffer. */ + char *s_sn; /* symbol name table */ size_t s_sn_cap; /* capacity of sn table buffer. */ size_t s_sn_sz; /* current size of sn table. */ Modified: stable/12/usr.bin/ar/read.c ============================================================================== --- stable/12/usr.bin/ar/read.c Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/read.c Mon Apr 29 18:34:11 2019 (r346902) @@ -109,7 +109,8 @@ read_archive(struct bsdar *bsdar, char mode) break; /* Skip pseudo members. */ - if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0) + if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0 || + strcmp(name, "/SYM64/") == 0) continue; if (bsdar->argc > 0) { Modified: stable/12/usr.bin/ar/write.c ============================================================================== --- stable/12/usr.bin/ar/write.c Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/write.c Mon Apr 29 18:34:11 2019 (r346902) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ #define _INIT_AS_CAP 128 /* initial archive string table size */ -#define _INIT_SYMOFF_CAP (256*(sizeof(uint32_t))) /* initial so table size */ +#define _INIT_SYMOFF_CAP (256*(sizeof(uint64_t))) /* initial so table size */ #define _INIT_SYMNAME_CAP 1024 /* initial sn table size */ #define _MAXNAMELEN_SVR4 15 /* max member name length in svr4 variant */ #define _TRUNCATE_LEN 15 /* number of bytes to keep for member name */ @@ -557,6 +557,7 @@ write_cleanup(struct bsdar *bsdar) free(bsdar->s_sn); bsdar->as = NULL; bsdar->s_so = NULL; + bsdar->s_so_max = 0; bsdar->s_sn = NULL; } @@ -613,7 +614,10 @@ write_objs(struct bsdar *bsdar) struct archive_entry *entry; size_t s_sz; /* size of archive symbol table. */ size_t pm_sz; /* size of pseudo members */ - int i, nr; + size_t w_sz; /* size of words in symbol table */ + uint64_t nr; + uint32_t nr32; + int i; if (elf_version(EV_CURRENT) == EV_NONE) bsdar_errc(bsdar, EX_SOFTWARE, 0, @@ -628,9 +632,6 @@ write_objs(struct bsdar *bsdar) if (strlen(obj->name) > _MAXNAMELEN_SVR4) add_to_ar_str_table(bsdar, obj->name); bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2; - if (bsdar->rela_off > UINT32_MAX) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); } /* @@ -656,18 +657,31 @@ write_objs(struct bsdar *bsdar) * * absolute_offset = htobe32(relative_offset + size_of_pseudo_members) */ - + w_sz = sizeof(uint32_t); if (bsdar->s_cnt != 0) { s_sz = (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz; pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz); if (bsdar->as != NULL) pm_sz += _ARHDR_LEN + bsdar->as_sz; - for (i = 0; (size_t)i < bsdar->s_cnt; i++) { - if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); - *(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) + - pm_sz); + /* Use the 64-bit word size format if necessary. */ + if (bsdar->s_so_max > UINT32_MAX - pm_sz) { + w_sz = sizeof(uint64_t); + pm_sz -= s_sz; + s_sz = (bsdar->s_cnt + 1) * sizeof(uint64_t) + + bsdar->s_sn_sz; + pm_sz += s_sz; + /* Convert to big-endian. */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + bsdar->s_so[i] = + htobe64(bsdar->s_so[i] + pm_sz); + } else { + /* + * Convert to big-endian and shuffle in-place to + * the front of the allocation. XXX UB + */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + ((uint32_t *)(bsdar->s_so))[i] = + htobe32(bsdar->s_so[i] + pm_sz); } } @@ -689,16 +703,23 @@ write_objs(struct bsdar *bsdar) if (entry == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_entry_new failed"); - archive_entry_copy_pathname(entry, "/"); + if (w_sz == sizeof(uint64_t)) + archive_entry_copy_pathname(entry, "/SYM64/"); + else + archive_entry_copy_pathname(entry, "/"); if ((bsdar->options & AR_D) == 0) archive_entry_set_mtime(entry, time(NULL), 0); - archive_entry_set_size(entry, (bsdar->s_cnt + 1) * - sizeof(uint32_t) + bsdar->s_sn_sz); + archive_entry_set_size(entry, (bsdar->s_cnt + 1) * w_sz + + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); - nr = htobe32(bsdar->s_cnt); - write_data(bsdar, a, &nr, sizeof(uint32_t)); - write_data(bsdar, a, bsdar->s_so, sizeof(uint32_t) * - bsdar->s_cnt); + if (w_sz == sizeof(uint64_t)) { + nr = htobe64(bsdar->s_cnt); + write_data(bsdar, a, &nr, sizeof(nr)); + } else { + nr32 = htobe32((uint32_t)bsdar->s_cnt); + write_data(bsdar, a, &nr32, sizeof(nr32)); + } + write_data(bsdar, a, bsdar->s_so, w_sz * bsdar->s_cnt); write_data(bsdar, a, bsdar->s_sn, bsdar->s_sn_sz); archive_entry_free(entry); } @@ -904,13 +925,15 @@ add_to_ar_sym_table(struct bsdar *bsdar, const char *n bsdar->s_sn_sz = 0; } - if (bsdar->s_cnt * sizeof(uint32_t) >= bsdar->s_so_cap) { + if (bsdar->s_cnt * sizeof(uint64_t) >= bsdar->s_so_cap) { bsdar->s_so_cap *= 2; bsdar->s_so = realloc(bsdar->s_so, bsdar->s_so_cap); if (bsdar->s_so == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "realloc failed"); } bsdar->s_so[bsdar->s_cnt] = bsdar->rela_off; + if ((uint64_t)bsdar->rela_off > bsdar->s_so_max) + bsdar->s_so_max = (uint64_t)bsdar->rela_off; bsdar->s_cnt++; /* From owner-svn-src-stable-12@freebsd.org Mon Apr 29 18:54:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F017159962F; Mon, 29 Apr 2019 18:54:40 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAE966ACF7; Mon, 29 Apr 2019 18:54:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFA0C2629C; Mon, 29 Apr 2019 18:54:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIsdx5056021; Mon, 29 Apr 2019 18:54:39 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIsdcP056020; Mon, 29 Apr 2019 18:54:39 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291854.x3TIsdcP056020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346906 - stable/12/sys/contrib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/contrib/libnv X-SVN-Commit-Revision: 346906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAE966ACF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:54:40 -0000 Author: oshogbo Date: Mon Apr 29 18:54:39 2019 New Revision: 346906 URL: https://svnweb.freebsd.org/changeset/base/346906 Log: MFC r346112: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius MFC r346115: The nvlist_report_missing is also used by the cnvlist. It can't be a static one. Reported by: jenkins Modified: stable/12/sys/contrib/libnv/nvlist.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/libnv/nvlist.c ============================================================================== --- stable/12/sys/contrib/libnv/nvlist.c Mon Apr 29 18:52:04 2019 (r346905) +++ stable/12/sys/contrib/libnv/nvlist.c Mon Apr 29 18:54:39 2019 (r346906) @@ -1365,7 +1365,7 @@ nvlist_first_nvpair(const nvlist_t *nvl) } nvpair_t * -nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_next_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; @@ -1381,7 +1381,7 @@ nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t } nvpair_t * -nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_prev_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; From owner-svn-src-stable-12@freebsd.org Mon Apr 29 18:56:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0807B1599785; Mon, 29 Apr 2019 18:56:40 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A449D6AFB1; Mon, 29 Apr 2019 18:56:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E7952629F; Mon, 29 Apr 2019 18:56:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIudDA056232; Mon, 29 Apr 2019 18:56:39 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIudSp056231; Mon, 29 Apr 2019 18:56:39 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291856.x3TIudSp056231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346908 - stable/12/sys/contrib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/contrib/libnv X-SVN-Commit-Revision: 346908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A449D6AFB1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:56:40 -0000 Author: oshogbo Date: Mon Apr 29 18:56:39 2019 New Revision: 346908 URL: https://svnweb.freebsd.org/changeset/base/346908 Log: MFC r346113: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius Modified: stable/12/sys/contrib/libnv/nvpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/libnv/nvpair.c ============================================================================== --- stable/12/sys/contrib/libnv/nvpair.c Mon Apr 29 18:55:49 2019 (r346907) +++ stable/12/sys/contrib/libnv/nvpair.c Mon Apr 29 18:56:39 2019 (r346908) @@ -108,7 +108,7 @@ struct nvpair_header { void -nvpair_assert(const nvpair_t *nvp) +nvpair_assert(const nvpair_t *nvp __unused) { NVPAIR_ASSERT(nvp); @@ -235,7 +235,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) } void -nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl) +nvpair_remove(struct nvl_head *head, nvpair_t *nvp, + const nvlist_t *nvl __unused) { NVPAIR_ASSERT(nvp); @@ -359,7 +360,7 @@ nvpair_pack_header(const nvpair_t *nvp, unsigned char } unsigned char * -nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, +nvpair_pack_null(const nvpair_t *nvp __unused, unsigned char *ptr, size_t *leftp __unused) { From owner-svn-src-stable-12@freebsd.org Mon Apr 29 19:09:45 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13FD1599E94; Mon, 29 Apr 2019 19:09:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6795C6BBA2; Mon, 29 Apr 2019 19:09: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA5B2646C; Mon, 29 Apr 2019 19:09: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 x3TJ9jjA061961; Mon, 29 Apr 2019 19:09:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJ9jk6061960; Mon, 29 Apr 2019 19:09:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291909.x3TJ9jk6061960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346909 - stable/12/tests/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/tests/sys/kern X-SVN-Commit-Revision: 346909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6795C6BBA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:09:45 -0000 Author: ngie Date: Mon Apr 29 19:09:44 2019 New Revision: 346909 URL: https://svnweb.freebsd.org/changeset/base/346909 Log: MFC r346542: Fix sys.kern.coredump_phnum_test.coredump_phnum on i386 The zero-padding when printing out the Size field is on 32-bit architectures is 5, not 15. Adjust the regular expression to work with both the 32-bit and 64-bit case. Modified: stable/12/tests/sys/kern/coredump_phnum_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- stable/12/tests/sys/kern/coredump_phnum_test.sh Mon Apr 29 18:56:39 2019 (r346908) +++ stable/12/tests/sys/kern/coredump_phnum_test.sh Mon Apr 29 19:09:44 2019 (r346909) @@ -65,7 +65,7 @@ EOF -x 'readelf -h coredump_phnum_helper.core | grep "Number of program headers:"' atf_check -o "match:There are 66[0-9]{3} program headers" \ -x 'readelf -l coredump_phnum_helper.core | grep -1 "program headers"' - atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ + atf_check -o "match: 00000(0000000000)?1 .* 66[0-9]{3} " \ -x 'readelf -S coredump_phnum_helper.core | grep -A1 "^ \[ 0\] "' atf_check -o "match:66[0-9]{3}" \ From owner-svn-src-stable-12@freebsd.org Mon Apr 29 19:10:26 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C059B1599EE6; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6225B6BCC7; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35BA226470; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJAPfX062094; Mon, 29 Apr 2019 19:10:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJAOCX062092; Mon, 29 Apr 2019 19:10:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904291910.x3TJAOCX062092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 29 Apr 2019 19:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346910 - in stable/12: libexec/rc/rc.d usr.sbin/nfsd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: libexec/rc/rc.d usr.sbin/nfsd X-SVN-Commit-Revision: 346910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6225B6BCC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:10:26 -0000 Author: mav Date: Mon Apr 29 19:10:24 2019 New Revision: 346910 URL: https://svnweb.freebsd.org/changeset/base/346910 Log: MFC r344192 (by sef): Add support for a virtual hostname to nfsd Specifically, this allows (via "-V vhostname") telling nfsd what principal to use, instead of the hostname. This is used at iXsystems for fail-over in HA systems. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D19191 Modified: stable/12/libexec/rc/rc.d/nfsd stable/12/usr.sbin/nfsd/nfsd.8 stable/12/usr.sbin/nfsd/nfsd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/nfsd ============================================================================== --- stable/12/libexec/rc/rc.d/nfsd Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/libexec/rc/rc.d/nfsd Mon Apr 29 19:10:24 2019 (r346910) @@ -13,6 +13,7 @@ name="nfsd" desc="Remote NFS server" rcvar="nfs_server_enable" command="/usr/sbin/${name}" +nfs_server_vhost="" load_rc_config $name start_precmd="nfsd_precmd" @@ -20,6 +21,7 @@ sig_stop="USR1" nfsd_precmd() { + local _vhost rc_flags="${nfs_server_flags}" # Load the modules now, so that the vfs.nfsd sysctl @@ -46,6 +48,9 @@ nfsd_precmd() force_depend rpcbind || return 1 force_depend mountd || return 1 + if [ -n "${nfs_server_vhost}" ]; then + command_args="-V \"${nfs_server_vhost}\"" + fi } run_rc_command "$1" Modified: stable/12/usr.sbin/nfsd/nfsd.8 ============================================================================== --- stable/12/usr.sbin/nfsd/nfsd.8 Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/usr.sbin/nfsd/nfsd.8 Mon Apr 29 19:10:24 2019 (r346910) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd February 14, 2019 .Dt NFSD 8 .Os .Sh NAME @@ -43,6 +43,7 @@ server .Op Fl h Ar bindip .Op Fl p Ar pnfs_setup .Op Fl m Ar mirror_level +.Op Fl V Ar virtual_hostname .Op Fl Fl maxthreads Ar max_threads .Op Fl Fl minthreads Ar min_threads .Sh DESCRIPTION @@ -78,6 +79,9 @@ Unregister the service with .Xr rpcbind 8 without creating any servers. +.It Fl V Ar virtual_hostname +Specifies a hostname to be used as a principal name, instead of +the default hostname. .It Fl n Ar threads Specifies how many servers to create. This option is equivalent to specifying .Fl Fl maxthreads Modified: stable/12/usr.sbin/nfsd/nfsd.c ============================================================================== --- stable/12/usr.sbin/nfsd/nfsd.c Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/usr.sbin/nfsd/nfsd.c Mon Apr 29 19:10:24 2019 (r346910) @@ -122,7 +122,7 @@ static void nonfs(int); static void reapchild(int); static int setbindhost(struct addrinfo **ia, const char *bindhost, struct addrinfo hints); -static void start_server(int, struct nfsd_nfsd_args *); +static void start_server(int, struct nfsd_nfsd_args *, const char *vhost); static void unregistration(void); static void usage(void); static void open_stable(int *, int *); @@ -176,6 +176,7 @@ main(int argc, char **argv) char **bindhost = NULL; pid_t pid; struct nfsd_nfsd_args nfsdargs; + const char *vhostname = NULL; nfsdargs.mirrorcnt = 1; nfsdargs.addr = NULL; @@ -183,16 +184,24 @@ main(int argc, char **argv) nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; - getopt_shortopts = "ah:n:rdtuep:m:"; + getopt_shortopts = "ah:n:rdtuep:m:V:"; getopt_usage = "usage:\n" " nfsd [-ardtue] [-h bindip]\n" " [-n numservers] [--minthreads #] [--maxthreads #]\n" - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," - "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" + " [-V virtual_hostname]\n" + " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { + case 'V': + if (strlen(optarg) <= MAXHOSTNAMELEN) + vhostname = optarg; + else + warnx("Virtual host name (%s) is too long", + optarg); + break; case 'a': bindanyflag = 1; break; @@ -473,7 +482,7 @@ main(int argc, char **argv) } else { (void)signal(SIGUSR1, child_cleanup); setproctitle("server"); - start_server(0, &nfsdargs); + start_server(0, &nfsdargs, vhostname); } } @@ -790,7 +799,7 @@ main(int argc, char **argv) * a "server" too. start_server will not return. */ if (!tcpflag) - start_server(1, &nfsdargs); + start_server(1, &nfsdargs, vhostname); /* * Loop forever accepting connections and passing the sockets @@ -987,7 +996,7 @@ get_tuned_nfsdcount(void) } static void -start_server(int master, struct nfsd_nfsd_args *nfsdargp) +start_server(int master, struct nfsd_nfsd_args *nfsdargp, const char *vhost) { char principal[MAXHOSTNAMELEN + 5]; int status, error; @@ -995,7 +1004,10 @@ start_server(int master, struct nfsd_nfsd_args *nfsdar struct addrinfo *aip, hints; status = 0; - gethostname(hostname, sizeof (hostname)); + if (vhost == NULL) + gethostname(hostname, sizeof (hostname)); + else + strlcpy(hostname, vhost, sizeof (hostname)); snprintf(principal, sizeof (principal), "nfs@%s", hostname); if ((cp = strchr(hostname, '.')) == NULL || *(cp + 1) == '\0') { From owner-svn-src-stable-12@freebsd.org Mon Apr 29 19:12:48 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA061159A132; Mon, 29 Apr 2019 19:12:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 810EB6C20F; Mon, 29 Apr 2019 19:12:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDC026626; Mon, 29 Apr 2019 19:12:48 +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 x3TJCmOa067124; Mon, 29 Apr 2019 19:12:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJCmUw067123; Mon, 29 Apr 2019 19:12:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291912.x3TJCmUw067123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346912 - stable/12/lib/libc/tests/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/lib/libc/tests/sys X-SVN-Commit-Revision: 346912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 810EB6C20F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:12:49 -0000 Author: ngie Date: Mon Apr 29 19:12:47 2019 New Revision: 346912 URL: https://svnweb.freebsd.org/changeset/base/346912 Log: MFC r346539: Fix `get_int_via_sysctlbyname(..)` on Jenkins Initialize `oldlen` to the size of the value, instead of leaving the value unitialized. Leaving it unitialized seems to work by accident on amd64 when running 64-bit programs, but not on i386. This matches patterns in use in other programs. PR: 237458 Tested on: ^/head (amd64), ^/stable/11 (i386) Modified: stable/12/lib/libc/tests/sys/sendfile_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- stable/12/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:11:56 2019 (r346911) +++ stable/12/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:12:47 2019 (r346912) @@ -62,6 +62,8 @@ get_int_via_sysctlbyname(const char *oidname) size_t oldlen; int int_value; + oldlen = sizeof(int_value); + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); From owner-svn-src-stable-12@freebsd.org Mon Apr 29 19:32:13 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AEB159AC3E; Mon, 29 Apr 2019 19:32:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 790986E552; Mon, 29 Apr 2019 19:32:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6806726875; Mon, 29 Apr 2019 19:32:12 +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 x3TJWCPE077622; Mon, 29 Apr 2019 19:32:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJWCn3077621; Mon, 29 Apr 2019 19:32:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291932.x3TJWCn3077621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346917 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 346917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 790986E552 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:32:13 -0000 Author: ngie Date: Mon Apr 29 19:32:11 2019 New Revision: 346917 URL: https://svnweb.freebsd.org/changeset/base/346917 Log: MFC r345723: PROG_OVERRIDE_VARS should override default values if specified The behavior prior to this change would not override default values if set in `bsd.own.mk`, or (in the more general case) globally before `bsd.progs.mk` was included. This affected `bsd.test.mk` as well, since it consumes `bsd.progs.mk`. Some examples of this failing behavior are as follows: * `BINMODE` defaults to 0555 per `bsd.own.mk`. If someone wanted to set the `BINMODE` to `NOBINMODE` (0444) for `prog`, for example, like `BINMODE.prog= ${NOBINMODE}`, `bsd.progs.mk` would not honor the per-PROG setting. * An application, `prog`, does not build at `WARNS?= 6`. Before this change, setting to a lower `WARNS` value, e.g., `WARNS.prog= 3`, would have been impossible, requiring that `prog` be built from another directory, the global `WARNS` be lowered, or a per-PROG value needing to be set across the board. None of the above workarounds is desirable. This change unbreaks variables defined in `PROG_OVERRIDE_VARS` which have defaults set before `bsd.progs.mk` is included, by setting them to their defined values if set on a per-PROG basis. Modified: stable/12/share/mk/bsd.progs.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/bsd.progs.mk ============================================================================== --- stable/12/share/mk/bsd.progs.mk Mon Apr 29 19:25:06 2019 (r346916) +++ stable/12/share/mk/bsd.progs.mk Mon Apr 29 19:32:11 2019 (r346917) @@ -34,6 +34,11 @@ $v += ${${v}.${PROG}} $v += ${${v}_${PROG}} .endif .else +.if defined(${v}.${PROG}) +$v = ${${v}.${PROG}} +.elif defined(${v}_${PROG}) +$v = ${${v}_${PROG}} +.endif $v ?= .endif .endfor From owner-svn-src-stable-12@freebsd.org Mon Apr 29 19:34:14 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16BB159AE1A; Mon, 29 Apr 2019 19:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0176E937; Mon, 29 Apr 2019 19:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10E42269A9; Mon, 29 Apr 2019 19:34:14 +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 x3TJYDa0077884; Mon, 29 Apr 2019 19:34:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJY9wD077859; Mon, 29 Apr 2019 19:34:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291934.x3TJY9wD077859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346918 - in stable/12: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars ... X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/... X-SVN-Commit-Revision: 346918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E0176E937 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:34:15 -0000 Author: ngie Date: Mon Apr 29 19:34:09 2019 New Revision: 346918 URL: https://svnweb.freebsd.org/changeset/base/346918 Log: MFC r346571,r346572: Update the spelling of my name Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". Modified: stable/12/lib/libcam/tests/libcam_test.c stable/12/lib/libkvm/tests/kvm_close_test.c stable/12/lib/libkvm/tests/kvm_geterr_test.c stable/12/lib/libkvm/tests/kvm_open2_test.c stable/12/lib/libkvm/tests/kvm_open_test.c stable/12/lib/libkvm/tests/kvm_test_common.c stable/12/lib/libkvm/tests/kvm_test_common.h stable/12/lib/libsbuf/tests/sbuf_core_test.c stable/12/lib/libsbuf/tests/sbuf_stdio_test.c stable/12/lib/libsbuf/tests/sbuf_string_test.c stable/12/lib/libsbuf/tests/sbuf_test_common.h stable/12/share/examples/tests/tests/tap/cp_test.sh stable/12/share/man/man4/cfiscsi.4 stable/12/share/man/man5/cd9660.5 stable/12/share/zoneinfo/tests/backward_test.sh stable/12/share/zoneinfo/tests/zoneinfo_common.sh stable/12/usr.bin/calendar/calendars/calendar.freebsd stable/12/usr.bin/du/tests/du_test.sh stable/12/usr.bin/getconf/tests/arch_type.c stable/12/usr.bin/procstat/tests/procstat_test.sh stable/12/usr.bin/procstat/tests/while1.c stable/12/usr.sbin/sysrc/sysrc.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/12/lib/libcam/tests/libcam_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libcam/tests/libcam_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_close_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_geterr_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_open2_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_open_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_test_common.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_test_common.h ============================================================================== --- stable/12/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_test_common.h ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/share/examples/tests/tests/tap/cp_test.sh ============================================================================== --- stable/12/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/share/man/man4/cfiscsi.4 ============================================================================== --- stable/12/share/man/man4/cfiscsi.4 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/man/man4/cfiscsi.4 Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -109,4 +108,4 @@ subsystem was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/12/share/man/man5/cd9660.5 ============================================================================== --- stable/12/share/man/man5/cd9660.5 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/man/man5/cd9660.5 Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ .\" -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -79,4 +78,4 @@ and .An Atsushi Murai Aq Mt amurai@spec.co.jp . .Pp This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/12/share/zoneinfo/tests/backward_test.sh ============================================================================== --- stable/12/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/share/zoneinfo/tests/zoneinfo_common.sh ============================================================================== --- stable/12/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/12/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:34:09 2019 (r346918) @@ -44,7 +44,7 @@ 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: stable/12/usr.bin/du/tests/du_test.sh ============================================================================== --- stable/12/usr.bin/du/tests/du_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/du/tests/du_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/getconf/tests/arch_type.c ============================================================================== --- stable/12/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- stable/12/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/procstat/tests/while1.c ============================================================================== --- stable/12/usr.bin/procstat/tests/while1.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/procstat/tests/while1.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/usr.sbin/sysrc/sysrc.8 ============================================================================== --- stable/12/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:34:09 2019 (r346918) @@ -480,6 +480,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-stable-12@freebsd.org Mon Apr 29 21:39:10 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00B1A159EAA5; Mon, 29 Apr 2019 21:39:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 978477695A; Mon, 29 Apr 2019 21:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FBA227E92; Mon, 29 Apr 2019 21:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TLd97A043333; Mon, 29 Apr 2019 21:39:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TLd9eP043332; Mon, 29 Apr 2019 21:39:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292139.x3TLd9eP043332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346929 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 346929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 978477695A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:39:10 -0000 Author: jhb Date: Mon Apr 29 21:39:09 2019 New Revision: 346929 URL: https://svnweb.freebsd.org/changeset/base/346929 Log: MFC 345041: Update ccr(4) to note recent support for SHA2-224 and plain SHA hashes. Modified: stable/12/share/man/man4/ccr.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ccr.4 ============================================================================== --- stable/12/share/man/man4/ccr.4 Mon Apr 29 21:34:24 2019 (r346928) +++ stable/12/share/man/man4/ccr.4 Mon Apr 29 21:39:09 2019 (r346929) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd March 11, 2019 .Dt CCR 4 .Os .Sh NAME @@ -49,13 +49,14 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1-HMAC, +The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, +SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for .Xr crypto 4 and .Xr ipsec 4 . The driver also supports chaining one of AES-CBC, AES-CTR, or AES-XTS with -SHA1-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for encrypt-then-authenticate operations. For further hardware information and questions related to hardware requirements, see From owner-svn-src-stable-12@freebsd.org Mon Apr 29 23:07:20 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFD315A090D; Mon, 29 Apr 2019 23:07:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCFA81E4B; Mon, 29 Apr 2019 23:07:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391D5E16; Mon, 29 Apr 2019 23:07:20 +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 x3TN7K4c090315; Mon, 29 Apr 2019 23:07:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TN7Ju2090314; Mon, 29 Apr 2019 23:07:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904292307.x3TN7Ju2090314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 23:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346936 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 346936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DCFA81E4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 23:07:21 -0000 Author: ngie Date: Mon Apr 29 23:07:19 2019 New Revision: 346936 URL: https://svnweb.freebsd.org/changeset/base/346936 Log: MFC r345351: r345351 (by bdrewery): Build common kernel dependencies before modules. This ensures files like genassym.o and awk/mfiles are generated before descending into the modules build. It may also allow some module builds to not recreate files that are already present in the KERNBUILDDIR. This fixes a rare build race where genassym.o is missing and assym.inc is empty. More work is planned around this to reduce some redundant dependency generation in modules. PR: 233339 Modified: stable/12/sys/conf/kern.post.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/kern.post.mk ============================================================================== --- stable/12/sys/conf/kern.post.mk Mon Apr 29 22:37:35 2019 (r346935) +++ stable/12/sys/conf/kern.post.mk Mon Apr 29 23:07:19 2019 (r346936) @@ -122,6 +122,8 @@ kernel-obj: .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) modules: modules-all +modules-depend: beforebuild +modules-all: beforebuild .if !defined(NO_MODULES_OBJ) modules-all modules-depend: modules-obj From owner-svn-src-stable-12@freebsd.org Tue Apr 30 00:54:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5682015A2761; Tue, 30 Apr 2019 00:54:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9E9850FE; Tue, 30 Apr 2019 00:54:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3BE2082; Tue, 30 Apr 2019 00:54:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U0sV4Z048013; Tue, 30 Apr 2019 00:54:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0sVev048012; Tue, 30 Apr 2019 00:54:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300054.x3U0sVev048012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346937 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 346937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF9E9850FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 00:54:32 -0000 Author: ian Date: Tue Apr 30 00:54:31 2019 New Revision: 346937 URL: https://svnweb.freebsd.org/changeset/base/346937 Log: MFC r346489: Move the reporting of spurious interrupts under bootverbose control, because occasional spurious interrupts are a normal thing on this hardware. Also, change the name of the cpu-local interrupt controller driver from local_intc to lintc, because the name gets built into interrupt names, which have to fit into a 19-byte field for stats reporting (so this allows 5 more bytes of the actual interrupt name to be displayed). Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c Mon Apr 29 23:07:19 2019 (r346936) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Apr 30 00:54:31 2019 (r346937) @@ -230,7 +230,7 @@ bcm2835_intc_intr(void *arg) } arm_irq_memory_barrier(0); /* XXX */ } - if (num == 0) + if (num == 0 && bootverbose) device_printf(sc->sc_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Mon Apr 29 23:07:19 2019 (r346936) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Tue Apr 30 00:54:31 2019 (r346937) @@ -421,7 +421,7 @@ bcm_lintc_intr(void *arg) reg &= ~BCM_LINTC_PENDING_MASK; if (reg != 0) device_printf(sc->bls_dev, "Unknown interrupt(s) %x\n", reg); - else if (num == 0) + else if (num == 0 && bootverbose) device_printf(sc->bls_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); @@ -730,12 +730,12 @@ static device_method_t bcm_lintc_methods[] = { }; static driver_t bcm_lintc_driver = { - "local_intc", + "lintc", bcm_lintc_methods, sizeof(struct bcm_lintc_softc), }; static devclass_t bcm_lintc_devclass; -EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, +EARLY_DRIVER_MODULE(lintc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, 0, 0, BUS_PASS_INTERRUPT); From owner-svn-src-stable-12@freebsd.org Tue Apr 30 00:58:44 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 631C215A2878; Tue, 30 Apr 2019 00:58:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BB985289; Tue, 30 Apr 2019 00:58:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA17A2084; Tue, 30 Apr 2019 00:58:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U0whOP048245; Tue, 30 Apr 2019 00:58:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0whD2048244; Tue, 30 Apr 2019 00:58:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300058.x3U0whD2048244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346938 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 346938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05BB985289 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 00:58:44 -0000 Author: ian Date: Tue Apr 30 00:58:43 2019 New Revision: 346938 URL: https://svnweb.freebsd.org/changeset/base/346938 Log: MFC r346713: Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to change, not the variable used to return the original pin state. PR: 237378 Reported by: Mori Hiroki Modified: stable/12/sys/dev/gpio/gpioc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/gpioc.c ============================================================================== --- stable/12/sys/dev/gpio/gpioc.c Tue Apr 30 00:54:31 2019 (r346937) +++ stable/12/sys/dev/gpio/gpioc.c Tue Apr 30 00:58:43 2019 (r346938) @@ -192,7 +192,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg case GPIOACCESS32: a32 = (struct gpio_access_32 *)arg; res = GPIO_PIN_ACCESS_32(sc->sc_pdev, a32->first_pin, - a32->clear_pins, a32->orig_pins, &a32->orig_pins); + a32->clear_pins, a32->change_pins, &a32->orig_pins); break; case GPIOCONFIG32: c32 = (struct gpio_config_32 *)arg; From owner-svn-src-stable-12@freebsd.org Tue Apr 30 01:00:00 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69F215A28FF; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582EB853C3; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32324208A; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U100DV048413; Tue, 30 Apr 2019 01:00:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0xxkn048349; Tue, 30 Apr 2019 00:59:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300059.x3U0xxkn048349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346939 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 346939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 582EB853C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 01:00:01 -0000 Author: ian Date: Tue Apr 30 00:59:59 2019 New Revision: 346939 URL: https://svnweb.freebsd.org/changeset/base/346939 Log: MFC r346751: Add a manpage for elf_aux_info(3) Added: stable/12/lib/libc/gen/auxv.3 - copied unchanged from r346751, head/lib/libc/gen/auxv.3 Modified: stable/12/lib/libc/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/gen/Makefile.inc Tue Apr 30 00:58:43 2019 (r346938) +++ stable/12/lib/libc/gen/Makefile.inc Tue Apr 30 00:59:59 2019 (r346939) @@ -193,6 +193,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map MAN+= alarm.3 \ arc4random.3 \ + auxv.3 \ basename.3 \ cap_rights_get.3 \ cap_sandboxed.3 \ @@ -321,6 +322,7 @@ MAN+= alarm.3 \ MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 +MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 Copied: stable/12/lib/libc/gen/auxv.3 (from r346751, head/lib/libc/gen/auxv.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/gen/auxv.3 Tue Apr 30 00:59:59 2019 (r346939, copy of r346751, head/lib/libc/gen/auxv.3) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 25, 2019 +.Dt ELF_AUX_INFO 3 +.Os +.Sh NAME +.Nm elf_aux_info +.Nd extract data from the elf auxiliary vector of the current process +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/auxv.h +.Ft int +.Fn elf_aux_info "int aux" "void *buf" "int buflen" +.Sh DESCRIPTION +The +.Fn elf_aux_info +function retrieves the auxiliary info vector requested in +.Va aux . +The information is stored into the provided buffer if it will fit. +The following values, defined in +.In sys/elf_common.h +can be requested: +.Bl -tag -width AT_OSRELDATE +.It AT_CANARY +The canary value for SSP. +.It AT_HWCAP +CPU / hardware feature flags. +.It AT_HWCAP2 +CPU / hardware feature flags. +.It AT_NCPUS +Number of CPUs. +.It AT_OSRELDATE +Kernel OSRELDATE. +.It AT_PAGESIZES +Vector of page sizes. +.It AT_PAGESZ +Page size in bytes. +.It AT_TIMEKEEP +Pointer to VDSO timehands (for library internal use). +.El +.Sh RETURN VALUES +Returns zero on success, or an error number on failure. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +An unknown item was requested. +.It Bq Er EINVAL +The provided buffer was not the right size for the requested item. +.It Bq Er ENOENT +The requested item is not available. +.El +.Sh HISTORY +The +.Fn elf_aux_info +function appeared in +.Fx 12.0 . +.Sh BUGS +Only a small subset of available auxiliary info vector items are +accessible with this function. +Some items require a "right-sized" buffer while others just require a +"big enough" buffer. From owner-svn-src-stable-12@freebsd.org Tue Apr 30 07:10:13 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148C415859C4; Tue, 30 Apr 2019 07:10:13 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A96F28FBB0; Tue, 30 Apr 2019 07:10:12 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EBB5620D; Tue, 30 Apr 2019 07:10:12 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7ACr4042020; Tue, 30 Apr 2019 07:10:12 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7AB1K042017; Tue, 30 Apr 2019 07:10:11 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201904300710.x3U7AB1K042017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 30 Apr 2019 07:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346943 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 346943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A96F28FBB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:10:13 -0000 Author: kadesai Date: Tue Apr 30 07:10:11 2019 New Revision: 346943 URL: https://svnweb.freebsd.org/changeset/base/346943 Log: MFC r345056, r345058, r345059 r345056 fw_outstanding"(outstanding IOs at firmware level) counter gets screwed up when R1 fastpath writes are running. Some of the cases which are not handled properly in driver are: 1. With R1 fastpath supported, single write from CAM layer can consume 2 MPT frames at driver/firmware level for fastpath qualification(if fw_outstanding < controller Queue Depth). Due to this driver has to throttle IOs coming from CAM layer as well as second fastpath write(of R1 write) against Adapter Queue Depth. If "fw_outstanding" reaches to adapter queue depth, driver should return IOs from CAM layer with device busy status.While allocating second MPT frame(corresponding to R1 FP write) also, driver should ensure fw_outstanding should not exceed adapter QD. 2. For R1 fastpath writes completion, driver decrements "fw_oustanding" counter without really returning MPT frame to free pool. It may cause IOs(with heavy IOs running, consuming whole adapter Queue Depth) consuming MPT frames reserved for DCMDs(management commands) and DCMDs(internal and sent by application) not getting MPT frame will start failing. Below is one test case to hit the issue described above- 1. Run heavy IOs (outstanding IOs should hit adapter Queue Depth). 2. Run management tool (Broadcom's storcli tool) querying adapter in loop (run command- "storcli64 /c0 show" in loop). 3. Management tool's requests would start failing due to non-availability of free MPT frames as all frames would be consumed by IOs. Fix: Increment/decrement of "fw_outstanding" counter should be in sync with MPT frame get/return. r345058 Allocated MFI frames should be same as MPT frames reserved for DCMDs r345059 Update driver version to 07.709.04.00-fbsd Modified: stable/12/sys/dev/mrsas/mrsas.c stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 07:10:11 2019 (r346943) @@ -1712,6 +1712,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } else { /* * If the peer Raid 1/10 fast path failed, @@ -1735,12 +1736,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M r1_cmd->callout_owner = false; } mrsas_release_mpt_cmd(r1_cmd); + mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } } - mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; @@ -2526,6 +2528,9 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } + + device_printf(sc->mrsas_dev, "max_fw_cmds: %u max_scsi_cmds: %u\n", + sc->max_fw_cmds, sc->max_scsi_cmds); return (0); } @@ -2553,8 +2558,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - sc->max_scsi_cmds = sc->max_fw_cmds - - (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); + sc->max_scsi_cmds = sc->max_fw_cmds - MRSAS_MAX_MFI_CMDS; /* Determine allocation size of command frames */ sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; Modified: stable/12/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 07:10:11 2019 (r346943) @@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.709.01.00-fbsd" +#define MRSAS_VERSION "07.709.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 Modified: stable/12/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 07:10:11 2019 (r346943) @@ -467,11 +467,20 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * return (0); } ccb_h->status |= CAM_SIM_QUEUED; + + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { + ccb_h->status |= CAM_REQUEUE_REQ; + xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); + return (0); + } + cmd = mrsas_get_mpt_cmd(sc); if (!cmd) { ccb_h->status |= CAM_REQUEUE_REQ; xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -638,7 +647,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * mrsas_scsiio_timeout, cmd); #endif - if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->io_cmds_highwater) + if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) sc->io_cmds_highwater++; /* @@ -653,7 +662,6 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * * new command */ if (cmd->r1_alt_dev_handle != MR_DEVHANDLE_INVALID) { - mrsas_atomic_inc(&sc->fw_outstanding); mrsas_prepare_secondRaid1_IO(sc, cmd); mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high); @@ -669,6 +677,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * done: xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -1092,14 +1101,20 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (io_info.r1_alt_dev_handle != MR_DEVHANDLE_INVALID) && (raid->level == 1) && !io_info.isRead) { r1_cmd = mrsas_get_mpt_cmd(sc); - if (!r1_cmd) { + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { fp_possible = FALSE; - printf("Avago debug fp disable from %s %d \n", - __func__, __LINE__); + mrsas_atomic_dec(&sc->fw_outstanding); } else { - cmd->peer_cmd = r1_cmd; - r1_cmd->peer_cmd = cmd; - } + r1_cmd = mrsas_get_mpt_cmd(sc); + if (!r1_cmd) { + fp_possible = FALSE; + mrsas_atomic_dec(&sc->fw_outstanding); + } + else { + cmd->peer_cmd = r1_cmd; + r1_cmd->peer_cmd = cmd; + } + } } } From owner-svn-src-stable-12@freebsd.org Tue Apr 30 09:10:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AEE1589C96; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928AC94F8A; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69EBA76A3; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U9AmGT006682; Tue, 30 Apr 2019 09:10:48 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9AjUP006664; Tue, 30 Apr 2019 09:10:45 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201904300910.x3U9AjUP006664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Tue, 30 Apr 2019 09:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346955 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 346955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 928AC94F8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:10:49 -0000 Author: fsu Date: Tue Apr 30 09:10:45 2019 New Revision: 346955 URL: https://svnweb.freebsd.org/changeset/base/346955 Log: MFC r346267, 346269: ext2fs: Initial version of DTrace support. Reviewed by: pfg, gnn Differential Revision: https://reviews.freebsd.org/D19848 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c stable/12/sys/fs/ext2fs/ext2_csum.c stable/12/sys/fs/ext2fs/ext2_extattr.c stable/12/sys/fs/ext2fs/ext2_extents.c stable/12/sys/fs/ext2fs/ext2_extents.h stable/12/sys/fs/ext2fs/ext2_extern.h stable/12/sys/fs/ext2fs/ext2_hash.c stable/12/sys/fs/ext2fs/ext2_htree.c stable/12/sys/fs/ext2fs/ext2_inode.c stable/12/sys/fs/ext2fs/ext2_inode_cnv.c stable/12/sys/fs/ext2fs/ext2_lookup.c stable/12/sys/fs/ext2fs/ext2_subr.c stable/12/sys/fs/ext2fs/ext2_vfsops.c stable/12/sys/fs/ext2fs/ext2_vnops.c stable/12/sys/fs/ext2fs/fs.h Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Tue Apr 30 09:10:45 2019 (r346955) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,23 @@ #include #include +SDT_PROVIDER_DEFINE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , alloc, trace, "int", "char*"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_reallocblks_realloc, + "ino_t", "e2fs_lbn_t", "e2fs_lbn_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_bap, "uint32_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_blkno, "e2fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, "char*", "int"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + "int", "daddr_t", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_blkfree_bad_block, "ino_t", "e4fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_vfree_doublefree, "char*", "ino_t"); + static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int); static u_long ext2_dirpref(struct inode *); @@ -128,8 +146,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t } nospace: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "filesystem full"); - uprintf("\n%s: write failed, filesystem is full\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate data block"); return (ENOSPC); } @@ -147,8 +164,10 @@ ext2_alloc_meta(struct inode *ip) EXT2_LOCK(ip->i_ump); blk = ext2_hashalloc(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize, ext2_alloccg); - if (0 == blk) + if (0 == blk) { EXT2_UNLOCK(ip->i_ump); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate meta block"); + } return (blk); } @@ -289,10 +308,8 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) * block pointers in the inode and indirect blocks associated * with the file. */ -#ifdef DEBUG - printf("realloc: ino %ju, lbns %jd-%jd\n\told:", - (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); -#endif /* DEBUG */ + SDT_PROBE3(ext2fs, , alloc, ext2_reallocblks_realloc, + ip->i_number, start_lbn, end_lbn); blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { if (i == ssize) { @@ -303,9 +320,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap)) panic("ext2_reallocblks: alloc mismatch"); #endif -#ifdef DEBUG - printf(" %d,", *bap); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_bap, *bap); *bap++ = blkno; } /* @@ -341,20 +356,13 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) /* * Last, free the old blocks and assign the new blocks to the buffers. */ -#ifdef DEBUG - printf("\n\tnew:"); -#endif /* DEBUG */ for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) { ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->e2fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); -#ifdef DEBUG - printf(" %d,", blkno); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_blkno, blkno); } -#ifdef DEBUG - printf("\n"); -#endif /* DEBUG */ + return (0); fail: @@ -481,8 +489,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred noinodes: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "out of inodes"); - uprintf("\n%s: create/symlink failed, no inodes free\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "out of inodes"); return (ENOSPC); } @@ -959,21 +966,24 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf /* Check block bitmap block number */ offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad block bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad block bitmap, group", cg); return (EINVAL); } /* Check inode bitmap block number */ offset = e2fs_gd_get_i_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad inode bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode bitmap", cg); return (EINVAL); } /* Check inode table */ offset = e2fs_gd_get_i_tables(gd) - group_first_block; if (offset >= max_bit || offset + fs->e2fs_itpg >= max_bit) { - printf("ext2fs: bad inode table, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode table, group", cg); return (EINVAL); } @@ -1350,9 +1360,8 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - printf("ext2fs: inode bitmap corrupted: " - "cg = %d, ipref = %lld, fs = %s - run fsck\n", - cg, (long long)ipref, fs->e2fs_fsmnt); + SDT_PROBE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + cg, ipref, fs->e2fs_fsmnt); brelse(bp); EXT2_LOCK(ump); return (0); @@ -1401,9 +1410,7 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long ump = ip->i_ump; cg = dtog(fs, bno); if (bno >= fs->e2fs_bcount) { - printf("bad block %lld, ino %ju\n", (long long)bno, - (uintmax_t)ip->i_number); - ext2_fserr(fs, ip->i_uid, "bad block"); + SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, ip->i_number, bno); return; } error = bread(ip->i_devvp, @@ -1416,9 +1423,8 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long bbp = (char *)bp->b_data; bno = dtogd(fs, bno); if (isclr(bbp, bno)) { - printf("block = %lld, fs = %s\n", + panic("ext2_blkfree: freeing free block %lld, fs=%s", (long long)bno, fs->e2fs_fsmnt); - panic("ext2_blkfree: freeing free block"); } clrbit(bbp, bno); EXT2_LOCK(ump); @@ -1464,8 +1470,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) ibp = (char *)bp->b_data; ino = (ino - 1) % fs->e2fs->e2fs_ipg; if (isclr(ibp, ino)) { - printf("ino = %ju, fs = %s\n", - ino, fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, ext2_vfree_doublefree, + fs->e2fs_fsmnt, ino); if (fs->e2fs_ronly == 0) panic("ext2_vfree: freeing free inode"); } @@ -1513,26 +1519,12 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t start = 0; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { - printf("start = %d, len = %d, fs = %s\n", + panic("ext2_mapsearch: map corrupted: start=%d, len=%d, fs=%s", start, len, fs->e2fs_fsmnt); - panic("ext2_mapsearch: map corrupted"); /* NOTREACHED */ } } return ((loc - bbp) * NBBY + ffs(~*loc) - 1); -} - -/* - * Fserr prints the name of a filesystem with an error diagnostic. - * - * The form of the error message is: - * fs: error message - */ -void -ext2_fserr(struct m_ext2fs *fs, uid_t uid, char *cp) -{ - - log(LOG_ERR, "uid %u on %s: %s\n", uid, fs->e2fs_fsmnt, cp); } int Modified: stable/12/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_csum.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_csum.c Tue Apr 30 09:10:45 2019 (r346955) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, csum, "int", "char*"); + #define EXT2_BG_INODE_BITMAP_CSUM_HI_END \ (offsetof(struct ext2_gd, ext4bgd_i_bmap_csum_hi) + \ sizeof(uint16_t)) @@ -134,8 +143,7 @@ ext2_extattr_blk_csum_verify(struct inode *ip, struct if (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && (header->h_checksum != ext2_extattr_blk_csum(ip, ip->i_facl, header))) { - printf("WARNING: bad extattr csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extattr csum detected"); return (EIO); } @@ -351,8 +359,7 @@ ext2_dir_blk_csum_verify(struct inode *ip, struct buf error = ext2_dx_csum_verify(ip, ep); if (error) - printf("WARNING: bad directory csum detected, ip=%lu" - " - run fsck\n", (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad directory csum detected"); return (error); } @@ -445,8 +452,7 @@ ext2_extent_blk_csum_verify(struct inode *ip, void *da calculated = ext2_extent_blk_csum(ip, ehp); if (provided != calculated) { - printf("WARNING: bad extent csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extent csum detected"); return (EIO); } @@ -491,8 +497,7 @@ ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad inode bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode bitmap csum detected"); return (EIO); } @@ -532,8 +537,7 @@ ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad block bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad block bitmap csum detected"); return (EIO); } @@ -629,7 +633,7 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) return (0); - printf("WARNING: Bad inode %ju csum - run fsck\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode csum"); return (EIO); } Modified: stable/12/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extattr.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extattr.c Tue Apr 30 09:10:45 2019 (r346955) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extattr, "int", "char*"); + static int ext2_extattr_attrnamespace_to_bsd(int attrnamespace) { @@ -89,9 +98,8 @@ ext2_extattr_name_to_bsd(int attrnamespace, const char * XXX: Not all linux namespaces are mapped to bsd for now, * return NULL, which will be converted to ENOTSUP on upper layer. */ -#ifdef EXT2FS_DEBUG - printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); -#endif + SDT_PROBE2(ext2fs, , trace, extattr, 1, + "can not convert ext2fs name to bsd namespace"); return (NULL); } Modified: stable/12/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extents.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extents.c Tue Apr 30 09:10:45 2019 (r346955) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extents, "int", "char*"); + static MALLOC_DEFINE(M_EXT2EXTENTS, "ext2_extents", "EXT2 extents"); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS static void ext4_ext_print_extent(struct ext4_extent *ep) { @@ -230,22 +239,22 @@ ext4_ext_check_header(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (eh->eh_magic != EXT4_EXT_MAGIC) { - error_msg = "invalid magic"; + error_msg = "header: invalid magic"; goto corrupted; } if (eh->eh_max == 0) { - error_msg = "invalid eh_max"; + error_msg = "header: invalid eh_max"; goto corrupted; } if (eh->eh_ecount > eh->eh_max) { - error_msg = "invalid eh_entries"; + error_msg = "header: invalid eh_entries"; goto corrupted; } return (0); corrupted: - ext2_fserr(fs, ip->i_uid, error_msg); + SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); return (EIO); } @@ -412,7 +421,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, ppos++; if (ppos > depth) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ppos > depth => extent corrupted"); error = EIO; brelse(bp); @@ -643,13 +652,13 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (lblk == path->ep_index->ei_blk) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "lblk == index blk => extent corrupted"); return (EIO); } if (path->ep_header->eh_ecount >= path->ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ecout > maxcount => extent corrupted"); return (EIO); } @@ -667,7 +676,7 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex memmove(idx + 1, idx, len * sizeof(struct ext4_extent_index)); if (idx > EXT_MAX_INDEX(path->ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "index is out of range => extent corrupted"); return (EIO); } @@ -736,7 +745,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa * We will split at current extent for now. */ if (path[depth].ep_ext > EXT_MAX_EXTENT(path[depth].ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extent is out of range => extent corrupted"); return (EIO); } @@ -773,7 +782,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa ex = EXT_FIRST_EXTENT(neh); if (path[depth].ep_header->eh_ecount != path[depth].ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extents count out of range => extent corrupted"); error = EIO; goto cleanup; @@ -1362,7 +1371,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(ip->i_e2fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "bad header => extent corrupted"); return (EIO); } @@ -1449,7 +1458,8 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad eh = ext4_ext_block_header(bp->b_data); if (eh->eh_depth != depth) { - ext2_fserr(fs, ip->i_uid, "unexpected eh_depth"); + SDT_PROBE2(ext2fs, , trace, extents, 1, + "unexpected eh_depth"); goto err; } Modified: stable/12/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extents.h Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extents.h Tue Apr 30 09:10:45 2019 (r346955) @@ -129,7 +129,7 @@ int ext4_ext_remove_space(struct inode *ip, off_t leng int ext4_ext_get_blocks(struct inode *ip, int64_t iblock, unsigned long max_blocks, struct ucred *cred, struct buf **bpp, int *allocate, daddr_t *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext4_ext_print_extent_tree_status(struct inode *ip); #endif Modified: stable/12/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extern.h Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extern.h Tue Apr 30 09:10:45 2019 (r346955) @@ -66,7 +66,6 @@ int ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *); void ext2_clusteracct(struct m_ext2fs *, char *, int, e4fs_daddr_t, int); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); -void ext2_fserr(struct m_ext2fs *, uid_t, char *); int ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *); int ext2_i2ei(struct inode *, struct ext2fs_dinode *); @@ -80,7 +79,7 @@ int ext2_vfree(struct vnode *, ino_t, int); int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp); int ext2_lookup(struct vop_cachedlookup_args *); int ext2_readdir(struct vop_readdir_args *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *); #endif int ext2_direnter(struct inode *, Modified: stable/12/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_hash.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_hash.c Tue Apr 30 09:10:45 2019 (r346955) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, hash, "int", "char*"); + /* F, G, and H are MD4 functions */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -300,6 +309,7 @@ ext2_htree_hash(const char *name, int len, minor = hash[2]; break; default: + SDT_PROBE2(ext2fs, , trace, hash, 1, "unexpected hash version"); goto error; } Modified: stable/12/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_htree.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_htree.c Tue Apr 30 09:10:45 2019 (r346955) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, htree, "int", "char*"); + static void ext2_append_entry(char *block, uint32_t blksize, struct ext2fs_direct_2 *last_entry, struct ext2fs_direct_2 *new_entry, int csum_size); @@ -816,7 +825,8 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ if (ext2_htree_get_count(root_entires) == ext2_htree_get_limit(root_entires)) { - /* Directory index is full */ + SDT_PROBE2(ext2fs, , trace, htree, 1, + "directory index is full"); error = EIO; goto finish; } Modified: stable/12/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_inode.c Tue Apr 30 09:10:45 2019 (r346955) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include Modified: stable/12/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 30 09:10:45 2019 (r346955) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -40,10 +41,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, inode_cnv, "int", "char*"); + #define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2) #define NSEC_TO_XTIME(t) (le32toh(t << 2) & EXT3_NSEC_MASK) -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *in) { @@ -83,7 +92,7 @@ ext2_print_inode(struct inode *in) printf("\n"); } } -#endif /* EXT2FS_DEBUG */ +#endif /* EXT2FS_PRINT_EXTENTS */ /* * raw ext2 inode to inode @@ -96,12 +105,12 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if ((ip->i_number < EXT2_FIRST_INO(fs) && ip->i_number != EXT2_ROOTINO) || (ip->i_number < EXT2_ROOTINO) || (ip->i_number > fs->e2fs->e2fs_icount)) { - printf("ext2fs: bad inode number %ju\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "bad inode number"); return (EINVAL); } if (ip->i_number == EXT2_ROOTINO && ei->e2di_nlink == 0) { - printf("ext2fs: root inode unallocated\n"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "root inode unallocated"); return (EINVAL); } ip->i_nlink = ei->e2di_nlink; @@ -110,8 +119,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if (EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE) { if (E2FS_REV0_INODE_SIZE + ei->e2di_extra_isize > EXT2_INODE_SIZE(fs) || (ei->e2di_extra_isize & 3)) { - printf("ext2fs: bad extra inode size %u, inode size=%u\n", - ei->e2di_extra_isize, EXT2_INODE_SIZE(fs)); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, + "bad extra inode size"); return (EINVAL); } } @@ -199,7 +208,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS : 0; if (ip->i_blocks > ~0U && !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) { - ext2_fserr(fs, ip->i_uid, "i_blocks value is out of range"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "i_blocks value is out of range"); return (EIO); } if (ip->i_blocks <= 0xffffffffffffULL) { Modified: stable/12/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_lookup.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_lookup.c Tue Apr 30 09:10:45 2019 (r346955) @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , lookup, trace, "int", "char*"); +SDT_PROBE_DEFINE4(ext2fs, , trace, ext2_dirbad_error, + "char*", "ino_t", "doff_t", "char*"); +SDT_PROBE_DEFINE5(ext2fs, , trace, ext2_dirbadentry_error, + "char*", "int", "uint32_t", "uint16_t", "uint8_t"); + #ifdef INVARIANTS static int dirchk = 1; #else @@ -810,10 +823,8 @@ ext2_dirbad(struct inode *ip, doff_t offset, char *how mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, (long)offset, how); else - (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); - + SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error, + mp->mnt_stat.f_mntonname, ip->i_number, offset, how); } /* @@ -849,10 +860,9 @@ ext2_dirbadentry(struct vnode *dp, struct ext2fs_direc */ if (error_msg != NULL) { - printf("bad directory entry: %s\n", error_msg); - printf("offset=%d, inode=%lu, rec_len=%u, name_len=%u\n", - entryoffsetinblock, (unsigned long)de->e2d_ino, - de->e2d_reclen, de->e2d_namlen); + SDT_PROBE5(ext2fs, , trace, ext2_dirbadentry_error, + error_msg, entryoffsetinblock, + de->e2d_ino, de->e2d_reclen, de->e2d_namlen); } return error_msg == NULL ? 0 : 1; } @@ -1276,7 +1286,8 @@ ext2_checkpath(struct inode *source, struct inode *tar out: if (error == ENOTDIR) - printf("checkpath: .. not a directory\n"); + SDT_PROBE2(ext2fs, , lookup, trace, 1, + "checkpath: .. not a directory"); if (vp != NULL) vput(vp); return (error); Modified: stable/12/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_subr.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_subr.c Tue Apr 30 09:10:45 2019 (r346955) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 30 09:10:45 2019 (r346955) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , vfsops, trace, "int", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , vfsops, ext2_cg_validate_error, "char*", "int"); +SDT_PROBE_DEFINE1(ext2fs, , vfsops, ext2_compute_sb_data_error, "char*"); + static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); static int ext2_reload(struct mount *mp, struct thread *td); @@ -381,48 +392,54 @@ ext2_cg_validate(struct m_ext2fs *fs) b_bitmap = e2fs_gd_get_b_bitmap(gd); if (b_bitmap == 0) { - printf("ext2fs: cg %u: block bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap is zero", i); return (EINVAL); } if (b_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: block bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap overlaps gds", i); return (EINVAL); } if (b_bitmap < first_block || b_bitmap > last_block) { - printf("ext2fs: cg %u: block bitmap not in group, blk=%ju\n", - i, b_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap not in group", i); return (EINVAL); } i_bitmap = e2fs_gd_get_i_bitmap(gd); if (i_bitmap == 0) { - printf("ext2fs: cg %u: inode bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap is zero", i); return (EINVAL); } if (i_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: inode bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap overlaps gds", i); return (EINVAL); } if (i_bitmap < first_block || i_bitmap > last_block) { - printf("ext2fs: cg %u: inode bitmap not in group blk=%ju\n", - i, i_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap not in group blk", i); return (EINVAL); } i_tables = e2fs_gd_get_i_tables(gd); if (i_tables == 0) { - printf("ext2fs: cg %u: inode table is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode table is zero", i); return (EINVAL); } if (i_tables <= last_cg_block) { - printf("ext2fs: cg %u: inode talbes overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode talbes overlaps gds", i); return (EINVAL); } if (i_tables < first_block || i_tables + fs->e2fs_itpg - 1 > last_block) { - printf("ext2fs: cg %u: inode tables not in group blk=%ju\n", - i, i_tables); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode tables not in group blk", i); return (EINVAL); } @@ -450,7 +467,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check checksum features */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) && EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - printf("ext2fs: incorrect checksum features combination\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "incorrect checksum features combination"); return (EINVAL); } @@ -467,7 +485,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for block size = 1K|2K|4K */ if (es->e2fs_log_bsize > 2) { - printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad block size"); return (EINVAL); } @@ -479,15 +498,15 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for fragment size */ if (es->e2fs_log_fsize > (EXT2_MAX_FRAG_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE)) { - printf("ext2fs: invalid log cluster size: %u\n", - es->e2fs_log_fsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid log cluster size"); return (EINVAL); } fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; if (fs->e2fs_fsize != fs->e2fs_bsize) { - printf("ext2fs: fragment size (%u) != block size %u\n", - fs->e2fs_fsize, fs->e2fs_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "fragment size != block size"); return (EINVAL); } @@ -495,8 +514,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check reserved gdt blocks for future filesystem expansion */ if (es->e2fs_reserved_ngdb > (fs->e2fs_bsize / 4)) { - printf("ext2fs: number of reserved GDT blocks too large: %u\n", - es->e2fs_reserved_ngdb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "number of reserved GDT blocks too large"); return (EINVAL); } @@ -509,8 +528,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f * Check first ino. */ if (es->e2fs_first_ino < EXT2_FIRSTINO) { - printf("ext2fs: invalid first ino: %u\n", - es->e2fs_first_ino); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid first ino"); return (EINVAL); } @@ -520,8 +539,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("ext2fs: invalid inode size %u\n", - fs->e2fs_isize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inode size"); return (EINVAL); } } @@ -529,33 +548,36 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check group descriptors */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && es->e3fs_desc_size != E2FS_64BIT_GD_SIZE) { - printf("ext2fs: unsupported 64bit descriptor size %u\n", - es->e3fs_desc_size); - return (EINVAL); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "unsupported 64bit descriptor size"); + return (EINVAL); } fs->e2fs_bpg = es->e2fs_bpg; fs->e2fs_fpg = es->e2fs_fpg; if (fs->e2fs_bpg == 0 || fs->e2fs_fpg == 0) { - printf("ext2fs: zero blocks/fragments per group\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "zero blocks/fragments per group"); return (EINVAL); } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { - printf("ext2fs: non-standard group size unsupported %d\n", - fs->e2fs_bpg); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "non-standard group size unsupported"); return (EINVAL); } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); if (fs->e2fs_ipb == 0 || fs->e2fs_ipb > fs->e2fs_bsize / E2FS_REV0_INODE_SIZE) { - printf("ext2fs: bad inodes per block size\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad inodes per block size"); return (EINVAL); } fs->e2fs_ipg = es->e2fs_ipg; if (fs->e2fs_ipg < fs->e2fs_ipb || fs->e2fs_ipg > fs->e2fs_bsize * 8) { - printf("ext2fs: invalid inodes per group: %u\n", fs->e2fs_ipb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inodes per group"); return (EINVAL); } @@ -571,25 +593,29 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f } if (fs->e2fs_rbcount > fs->e2fs_bcount || fs->e2fs_fbcount > fs->e2fs_bcount) { - printf("ext2fs: invalid block count\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid block count"); return (EINVAL); } if (es->e2fs_first_dblock >= fs->e2fs_bcount) { - printf("ext2fs: first data block out of range\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "first data block out of range"); return (EINVAL); } fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); if (fs->e2fs_gcount > ((uint64_t)1 << 32) - EXT2_DESCS_PER_BLOCK(fs)) { - printf("ext2fs: groups count too large: %u\n", fs->e2fs_gcount); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "groups count too large"); return (EINVAL); } /* Check for extra isize in big inodes. */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { - printf("ext2fs: no space for extra inode timestamps\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "no space for extra inode timestamps"); return (EINVAL); } @@ -1095,8 +1121,7 @@ ext2_sync(struct mount *mp, int waitfor) td = curthread; fs = ump->um_e2fs; if (fs->e2fs_fmod != 0 && fs->e2fs_ronly != 0) { /* XXX */ - printf("fs = %s\n", fs->e2fs_fsmnt); - panic("ext2_sync: rofs mod"); + panic("ext2_sync: rofs mod fs=%s", fs->e2fs_fsmnt); } /* @@ -1242,7 +1267,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, stru for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS ext2_print_inode(ip); ext4_ext_print_extent_tree_status(ip); #endif Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vnops.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_vnops.c Tue Apr 30 09:10:45 2019 (r346955) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,14 @@ #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Tue Apr 30 18:36:57 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CE1A159A6F8; Tue, 30 Apr 2019 18:36:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5D6E87797; Tue, 30 Apr 2019 18:36:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6DCEDCCD; Tue, 30 Apr 2019 18:36:56 +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 x3UIauUG011420; Tue, 30 Apr 2019 18:36:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UIauaO011419; Tue, 30 Apr 2019 18:36:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904301836.x3UIauaO011419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Apr 2019 18:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346971 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 346971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5D6E87797 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:36:57 -0000 Author: kib Date: Tue Apr 30 18:36:56 2019 New Revision: 346971 URL: https://svnweb.freebsd.org/changeset/base/346971 Log: MFC r346596: ipoib: assign link-local address according to RFC. Modified: stable/12/sys/netinet6/in6_ifattach.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/12/sys/netinet6/in6_ifattach.c Tue Apr 30 18:03:17 2019 (r346970) +++ stable/12/sys/netinet6/in6_ifattach.c Tue Apr 30 18:36:56 2019 (r346971) @@ -327,6 +327,14 @@ found: IF_ADDR_RUNLOCK(ifp); return -1; + case IFT_INFINIBAND: + if (addrlen != 20) { + IF_ADDR_RUNLOCK(ifp); + return -1; + } + bcopy(addr + 12, &in6->s6_addr[8], 8); + break; + default: IF_ADDR_RUNLOCK(ifp); return -1; From owner-svn-src-stable-12@freebsd.org Tue Apr 30 21:24:45 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA82159EED0; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4283A8F6D3; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3C3FA75; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULOiB3006396; Tue, 30 Apr 2019 21:24:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULOi5w006395; Tue, 30 Apr 2019 21:24:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904302124.x3ULOi5w006395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 21:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346974 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 346974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4283A8F6D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:24:45 -0000 Author: np Date: Tue Apr 30 21:24:44 2019 New Revision: 346974 URL: https://svnweb.freebsd.org/changeset/base/346974 Log: MFC r340375 (by jch@): cxgbe/netmap: Fix cxgbe netmap when interface is DOWN A kernel panic can occur if the cxgbe interface is DOWN when activating netmap. This patch prevents the driver from freeing up cxgbe netmap resources when they have not been allocated. Submitted by: Nicolas Witkowski Reviewed by: np Sponsored by: Verisign, Inc. Differential Revision: https://reviews.freebsd.org/D17802 Modified: stable/12/sys/dev/cxgbe/t4_netmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 18:48:20 2019 (r346973) +++ stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 21:24:44 2019 (r346974) @@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v ASSERT_SYNCHRONIZED_OP(sc); + if (!nm_netmap_on(na)) + return (0); + if ((vi->flags & VI_INIT_DONE) == 0) return (0); From owner-svn-src-stable-12@freebsd.org Tue Apr 30 21:27:33 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A46159EFB6; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3208F858; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61E6FFA78; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULRX0W006552; Tue, 30 Apr 2019 21:27:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULRXUd006551; Tue, 30 Apr 2019 21:27:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904302127.x3ULRXUd006551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 21:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346975 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 346975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B3208F858 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:27:34 -0000 Author: np Date: Tue Apr 30 21:27:32 2019 New Revision: 346975 URL: https://svnweb.freebsd.org/changeset/base/346975 Log: MFC r346567: cxgbe(4): Make sure bundled_fw is always initialized before use. This fixes a bug that prevented the driver from auto-flashing the firmware when it didn't see one on the card. This feature was introduced in r321390 and this bug was introduced in r343269. Reported by: gallatin@ Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Apr 30 21:24:44 2019 (r346974) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Apr 30 21:27:32 2019 (r346975) @@ -3529,19 +3529,6 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = false; fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; - if (reason != NULL) - goto install; - - if ((sc->flags & FW_OK) == 0) { - - if (c == 0xffffffff) { - reason = "missing"; - goto install; - } - - return (0); - } - memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); if (t4_fw_install < 0) { rc = load_fw_module(sc, &cfg, &fw); @@ -3557,6 +3544,20 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = true; } d = be32toh(bundled_fw.fw_ver); + + if (reason != NULL) + goto install; + + if ((sc->flags & FW_OK) == 0) { + + if (c == 0xffffffff) { + reason = "missing"; + goto install; + } + + rc = 0; + goto done; + } if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; From owner-svn-src-stable-12@freebsd.org Tue Apr 30 23:01:15 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2260F15A0EF8; Tue, 30 Apr 2019 23:01:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB1386BE72; Tue, 30 Apr 2019 23:01:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F2CF18A0A; Tue, 30 Apr 2019 23:01:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UN1Es9053919; Tue, 30 Apr 2019 23:01:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UN1DXS053915; Tue, 30 Apr 2019 23:01:13 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201904302301.x3UN1DXS053915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 30 Apr 2019 23:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346977 - in stable/12/lib/libsecureboot: . h X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/lib/libsecureboot: . h X-SVN-Commit-Revision: 346977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB1386BE72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 23:01:15 -0000 Author: sjg Date: Tue Apr 30 23:01:13 2019 New Revision: 346977 URL: https://svnweb.freebsd.org/changeset/base/346977 Log: Allow no_hash to appear in manifest. sbin/veriexec will ignore entries that have no hash anyway, but loader needs to be explicitly told that such files are ok to ignore (not verify). We will report as Unverified depending on verbose level, but with no reason - because we are not rejecting the file. MFC r346604 Modified: stable/12/lib/libsecureboot/h/libsecureboot.h stable/12/lib/libsecureboot/vectx.c stable/12/lib/libsecureboot/veopen.c stable/12/lib/libsecureboot/verify_file.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- stable/12/lib/libsecureboot/h/libsecureboot.h Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/h/libsecureboot.h Tue Apr 30 23:01:13 2019 (r346977) @@ -86,6 +86,7 @@ ssize_t ve_pcr_get(unsigned char *, size_t); #define VEF_VERBOSE 1 #define VE_FINGERPRINT_OK 1 +#define VE_FINGERPRINT_IGNORE 2 /* errors from verify_fd */ #define VE_FINGERPRINT_NONE -2 #define VE_FINGERPRINT_WRONG -3 Modified: stable/12/lib/libsecureboot/vectx.c ============================================================================== --- stable/12/lib/libsecureboot/vectx.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/vectx.c Tue Apr 30 23:01:13 2019 (r346977) @@ -120,7 +120,10 @@ vectx_open(int fd, const char *path, off_t off, struct ctx->vec_status = VE_FINGERPRINT_NONE; ve_error_set("%s: no entry", path); } else { - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + ctx->vec_status = VE_FINGERPRINT_IGNORE; + hashsz = 0; + } else if (strncmp(cp, "sha256=", 7) == 0) { ctx->vec_md = &br_sha256_vtable; hashsz = br_sha256_SIZE; cp += 7; @@ -150,11 +153,13 @@ vectx_open(int fd, const char *path, off_t off, struct *error = ctx->vec_status; ctx->vec_hashsz = hashsz; ctx->vec_want = cp; - ctx->vec_md->init(&ctx->vec_ctx.vtable); + if (hashsz > 0) { + ctx->vec_md->init(&ctx->vec_ctx.vtable); - if (hashsz > 0 && off > 0) { - lseek(fd, 0, SEEK_SET); - vectx_lseek(ctx, off, SEEK_SET); + if (off > 0) { + lseek(fd, 0, SEEK_SET); + vectx_lseek(ctx, off, SEEK_SET); + } } return (ctx); Modified: stable/12/lib/libsecureboot/veopen.c ============================================================================== --- stable/12/lib/libsecureboot/veopen.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/veopen.c Tue Apr 30 23:01:13 2019 (r346977) @@ -345,7 +345,9 @@ verify_fingerprint(int fd, const char *path, const cha size_t hlen; int n; - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + return (VE_FINGERPRINT_IGNORE); + } else if (strncmp(cp, "sha256=", 7) == 0) { md = &br_sha256_vtable; hlen = br_sha256_SIZE; cp += 7; @@ -423,6 +425,7 @@ verify_fd(int fd, const char *path, off_t off, struct rc = verify_fingerprint(fd, path, cp, off); switch (rc) { case VE_FINGERPRINT_OK: + case VE_FINGERPRINT_IGNORE: case VE_FINGERPRINT_UNKNOWN: return (rc); default: Modified: stable/12/lib/libsecureboot/verify_file.c ============================================================================== --- stable/12/lib/libsecureboot/verify_file.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/verify_file.c Tue Apr 30 23:01:13 2019 (r346977) @@ -343,10 +343,14 @@ verify_file(int fd, const char *filename, off_t off, i if ((rc = verify_fd(fd, filename, off, &st)) >= 0) { if (verbose || severity > VE_WANT) { #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0 - printf("Verified %s %llu,%llu\n", filename, + printf("%serified %s %llu,%llu\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename, (long long)st.st_dev, (long long)st.st_ino); #else - printf("Verified %s\n", filename); + printf("%serified %s\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename); #endif } if (severity < VE_MUST) { /* not a kernel or module */ From owner-svn-src-stable-12@freebsd.org Tue Apr 30 23:53:55 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EB5215A1DEA; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26E226D66B; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6636193DF; Tue, 30 Apr 2019 23:53:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UNrs5Q084672; Tue, 30 Apr 2019 23:53:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UNrswv084671; Tue, 30 Apr 2019 23:53:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904302353.x3UNrswv084671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Apr 2019 23:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346978 - in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 346978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26E226D66B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 23:53:55 -0000 Author: jhb Date: Tue Apr 30 23:53:54 2019 New Revision: 346978 URL: https://svnweb.freebsd.org/changeset/base/346978 Log: MFC 344711: Fix missed posted interrupts in VT-x in bhyve. When a vCPU is HLTed, interrupts with a priority below the processor priority (PPR) should not resume the vCPU while interrupts at or above the PPR should. With posted interrupts, bhyve maintains a bitmap of pending interrupts in PIR descriptor along with a single 'pending' bit. This bit is checked by a CPU running in guest mode at various places to determine if it should be checked. In addition, another CPU can force a CPU in guest mode to check for pending interrupts by sending an IPI to a special IDT vector reserved for this purpose. bhyve had a bug in that it would only notify a guest vCPU of an interrupt (e.g. by sending the special IPI or by resuming it if it was idle due to HLT) if an interrupt arrived that was higher priority than PPR and no interrupts were currently pending. This assumed that if the 'pending' bit was set, any needed notification was already in progress. However, if the first interrupt sent to a HLTed vCPU was lower priority than PPR and the second was higher than PPR, the first interrupt would set 'pending' but not notify the vCPU, and the second interrupt would not notify the vCPU because 'pending' was already set. To fix this, track the priority of pending interrupts in a separate per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that is above PPR and higher than any previously-received interrupt. This was found and debugged in the bhyve port to SmartOS maintained by Joyent. Relevant SmartOS bugs with more background: https://smartos.org/bugview/OS-6829 https://smartos.org/bugview/OS-6930 https://smartos.org/bugview/OS-7354 Modified: stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:01:13 2019 (r346977) +++ stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:53:54 2019 (r346978) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2018 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -3402,8 +3403,11 @@ struct vlapic_vtx { struct vlapic vlapic; struct pir_desc *pir_desc; struct vmx *vmx; + u_int pending_prio; }; +#define VPR_PRIO_BIT(vpr) (1 << ((vpr) >> 4)) + #define VMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg) \ do { \ VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \ @@ -3425,7 +3429,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, struct vlapic_vtx *vlapic_vtx; struct pir_desc *pir_desc; uint64_t mask; - int idx, notify; + int idx, notify = 0; vlapic_vtx = (struct vlapic_vtx *)vlapic; pir_desc = vlapic_vtx->pir_desc; @@ -3438,8 +3442,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, idx = vector / 64; mask = 1UL << (vector % 64); atomic_set_long(&pir_desc->pir[idx], mask); - notify = atomic_cmpset_long(&pir_desc->pending, 0, 1); + /* + * A notification is required whenever the 'pending' bit makes a + * transition from 0->1. + * + * Even if the 'pending' bit is already asserted, notification about + * the incoming interrupt may still be necessary. For example, if a + * vCPU is HLTed with a high PPR, a low priority interrupt would cause + * the 0->1 'pending' transition with a notification, but the vCPU + * would ignore the interrupt for the time being. The same vCPU would + * need to then be notified if a high-priority interrupt arrived which + * satisfied the PPR. + * + * The priorities of interrupts injected while 'pending' is asserted + * are tracked in a custom bitfield 'pending_prio'. Should the + * to-be-injected interrupt exceed the priorities already present, the + * notification is sent. The priorities recorded in 'pending_prio' are + * cleared whenever the 'pending' bit makes another 0->1 transition. + */ + if (atomic_cmpset_long(&pir_desc->pending, 0, 1) != 0) { + notify = 1; + vlapic_vtx->pending_prio = 0; + } else { + const u_int old_prio = vlapic_vtx->pending_prio; + const u_int prio_bit = VPR_PRIO_BIT(vector & APIC_TPR_INT); + + if ((old_prio & prio_bit) == 0 && prio_bit > old_prio) { + atomic_set_int(&vlapic_vtx->pending_prio, prio_bit); + notify = 1; + } + } + VMX_CTR_PIR(vlapic->vm, vlapic->vcpuid, pir_desc, notify, vector, level, "vmx_set_intr_ready"); return (notify); @@ -3504,14 +3538,31 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "HLT with non-zero PPR %d", lapic->ppr); + vpr = 0; for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { vpr = (i * 64 + flsl(pirval) - 1) & APIC_TPR_INT; - return (vpr > ppr); + break; } } - return (0); + + /* + * If the highest-priority pending interrupt falls short of the + * processor priority of this vCPU, ensure that 'pending_prio' does not + * have any stale bits which would preclude a higher-priority interrupt + * from incurring a notification later. + */ + if (vpr <= ppr) { + const u_int prio_bit = VPR_PRIO_BIT(vpr); + const u_int old = vlapic_vtx->pending_prio; + + if (old > prio_bit && (old & prio_bit) == 0) { + vlapic_vtx->pending_prio = prio_bit; + } + return (0); + } + return (1); } static void From owner-svn-src-stable-12@freebsd.org Wed May 1 01:42:42 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE53515A3E20; Wed, 1 May 2019 01:42:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8E708FE; Wed, 1 May 2019 01:42:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05AF81A6EE; Wed, 1 May 2019 01:42:41 +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 x411gekh041819; Wed, 1 May 2019 01:42:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411gde2041811; Wed, 1 May 2019 01:42:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010142.x411gde2041811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346980 - in stable/12: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/sr... X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_common contrib/wpa/... X-SVN-Commit-Revision: 346980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48B8E708FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:42:42 -0000 Author: cy Date: Wed May 1 01:42:38 2019 New Revision: 346980 URL: https://svnweb.freebsd.org/changeset/base/346980 Log: MFC r341759, r341796, r341839, r341989, r346591: The following five MFCs update wpa 2.6 --> 2.8. r341759: MFV r341618: Update wpa 2.6 --> 2.7. r341796: Clean stale wpa dependencies and objects after r341759 The wpa update added some source files with the same name as a file in another directory (found via .PATH in the previous version). Having a stale entry in a .depend file means the new file won't be built, so test for this case and if found remove all of wpa's dependency files. Sponsored by: The FreeBSD Foundation r341839: Set default ciphers. Submitted by: jkim@ r341989: Makefile.inc1: update stale wpa dependency removal statement Only stale .depend files are removed; do not mention object files. r346591: Update wpa_supplicant/hostapd 2.7 --> 2.8 Upstream documents the following advisories: - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\ with-unexpected-fragment.txt Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496, CVE-2019-9497, CVE-2019-9498, CVE-2019-9499 Relnotes: yes Added: stable/12/contrib/wpa/hostapd/README-MULTI-AP - copied unchanged from r346591, head/contrib/wpa/hostapd/README-MULTI-AP stable/12/contrib/wpa/src/ap/dpp_hostapd.c - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.c stable/12/contrib/wpa/src/ap/dpp_hostapd.h - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.h stable/12/contrib/wpa/src/ap/eth_p_oui.c - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.c stable/12/contrib/wpa/src/ap/eth_p_oui.h - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.h stable/12/contrib/wpa/src/ap/fils_hlp.c - copied, changed from r341759, head/contrib/wpa/src/ap/fils_hlp.c stable/12/contrib/wpa/src/ap/fils_hlp.h - copied unchanged from r341759, head/contrib/wpa/src/ap/fils_hlp.h stable/12/contrib/wpa/src/ap/gas_query_ap.c - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.c stable/12/contrib/wpa/src/ap/gas_query_ap.h - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.h stable/12/contrib/wpa/src/ap/ieee802_11_he.c - copied, changed from r341759, head/contrib/wpa/src/ap/ieee802_11_he.c stable/12/contrib/wpa/src/common/dhcp.h - copied unchanged from r341759, head/contrib/wpa/src/common/dhcp.h stable/12/contrib/wpa/src/common/dpp.c - copied, changed from r341759, head/contrib/wpa/src/common/dpp.c stable/12/contrib/wpa/src/common/dpp.h - copied, changed from r341759, head/contrib/wpa/src/common/dpp.h stable/12/contrib/wpa/src/common/gas_server.c - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.c stable/12/contrib/wpa/src/common/gas_server.h - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.h stable/12/contrib/wpa/src/common/ocv.c - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.c stable/12/contrib/wpa/src/common/ocv.h - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.h stable/12/contrib/wpa/src/crypto/crypto_linux.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_linux.c stable/12/contrib/wpa/src/crypto/crypto_nettle.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_nettle.c stable/12/contrib/wpa/src/crypto/crypto_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_wolfssl.c stable/12/contrib/wpa/src/crypto/fips_prf_wolfssl.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/fips_prf_wolfssl.c stable/12/contrib/wpa/src/crypto/sha384-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384-kdf.c stable/12/contrib/wpa/src/crypto/sha384.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384.c stable/12/contrib/wpa/src/crypto/sha512-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-kdf.c stable/12/contrib/wpa/src/crypto/sha512-prf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-prf.c stable/12/contrib/wpa/src/crypto/sha512.c - copied unchanged from r346591, head/contrib/wpa/src/crypto/sha512.c stable/12/contrib/wpa/src/crypto/sha512.h - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512.h stable/12/contrib/wpa/src/crypto/tls_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/tls_wolfssl.c stable/12/contrib/wpa/src/drivers/driver_macsec_linux.c - copied, changed from r341759, head/contrib/wpa/src/drivers/driver_macsec_linux.c stable/12/contrib/wpa/src/drivers/driver_wired_common.c - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.c stable/12/contrib/wpa/src/drivers/driver_wired_common.h - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.h stable/12/contrib/wpa/src/utils/const_time.h - copied unchanged from r346591, head/contrib/wpa/src/utils/const_time.h stable/12/contrib/wpa/src/utils/crc32.c - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.c stable/12/contrib/wpa/src/utils/crc32.h - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.h stable/12/contrib/wpa/src/utils/json.c - copied, changed from r341759, head/contrib/wpa/src/utils/json.c stable/12/contrib/wpa/src/utils/json.h - copied unchanged from r341759, head/contrib/wpa/src/utils/json.h stable/12/contrib/wpa/wpa_supplicant/README-DPP - copied unchanged from r346591, head/contrib/wpa/wpa_supplicant/README-DPP stable/12/contrib/wpa/wpa_supplicant/dpp_supplicant.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.c stable/12/contrib/wpa/wpa_supplicant/dpp_supplicant.h - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.h stable/12/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py stable/12/contrib/wpa/wpa_supplicant/op_classes.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/op_classes.c stable/12/contrib/wpa/wpa_supplicant/rrm.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/rrm.c Deleted: stable/12/contrib/wpa/src/ap/peerkey_auth.c stable/12/contrib/wpa/src/rsn_supp/peerkey.c stable/12/contrib/wpa/src/rsn_supp/peerkey.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c stable/12/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in stable/12/contrib/wpa/wpa_supplicant/examples/wpas-test.py Modified: stable/12/Makefile.inc1 stable/12/contrib/wpa/CONTRIBUTIONS stable/12/contrib/wpa/COPYING stable/12/contrib/wpa/README stable/12/contrib/wpa/hostapd/ChangeLog stable/12/contrib/wpa/hostapd/README stable/12/contrib/wpa/hostapd/config_file.c stable/12/contrib/wpa/hostapd/config_file.h stable/12/contrib/wpa/hostapd/ctrl_iface.c stable/12/contrib/wpa/hostapd/defconfig stable/12/contrib/wpa/hostapd/hlr_auc_gw.c stable/12/contrib/wpa/hostapd/hostapd.conf stable/12/contrib/wpa/hostapd/hostapd.eap_user_sqlite stable/12/contrib/wpa/hostapd/hostapd.wpa_psk stable/12/contrib/wpa/hostapd/hostapd_cli.c stable/12/contrib/wpa/hostapd/main.c stable/12/contrib/wpa/hostapd/wps-ap-nfc.py stable/12/contrib/wpa/hs20/client/Makefile stable/12/contrib/wpa/hs20/client/est.c stable/12/contrib/wpa/hs20/client/oma_dm_client.c stable/12/contrib/wpa/hs20/client/osu_client.c stable/12/contrib/wpa/hs20/client/osu_client.h stable/12/contrib/wpa/src/ap/acs.c stable/12/contrib/wpa/src/ap/acs.h stable/12/contrib/wpa/src/ap/ap_config.c stable/12/contrib/wpa/src/ap/ap_config.h stable/12/contrib/wpa/src/ap/ap_drv_ops.c stable/12/contrib/wpa/src/ap/ap_drv_ops.h stable/12/contrib/wpa/src/ap/ap_mlme.c stable/12/contrib/wpa/src/ap/authsrv.c stable/12/contrib/wpa/src/ap/beacon.c stable/12/contrib/wpa/src/ap/beacon.h stable/12/contrib/wpa/src/ap/bss_load.c stable/12/contrib/wpa/src/ap/ctrl_iface_ap.c stable/12/contrib/wpa/src/ap/ctrl_iface_ap.h stable/12/contrib/wpa/src/ap/dfs.c stable/12/contrib/wpa/src/ap/dfs.h stable/12/contrib/wpa/src/ap/dhcp_snoop.c stable/12/contrib/wpa/src/ap/drv_callbacks.c stable/12/contrib/wpa/src/ap/eap_user_db.c stable/12/contrib/wpa/src/ap/gas_serv.c stable/12/contrib/wpa/src/ap/gas_serv.h stable/12/contrib/wpa/src/ap/hostapd.c stable/12/contrib/wpa/src/ap/hostapd.h stable/12/contrib/wpa/src/ap/hs20.c stable/12/contrib/wpa/src/ap/hs20.h stable/12/contrib/wpa/src/ap/hw_features.c stable/12/contrib/wpa/src/ap/ieee802_11.c stable/12/contrib/wpa/src/ap/ieee802_11.h stable/12/contrib/wpa/src/ap/ieee802_11_auth.c stable/12/contrib/wpa/src/ap/ieee802_11_auth.h stable/12/contrib/wpa/src/ap/ieee802_11_ht.c stable/12/contrib/wpa/src/ap/ieee802_11_shared.c stable/12/contrib/wpa/src/ap/ieee802_11_vht.c stable/12/contrib/wpa/src/ap/ieee802_1x.c stable/12/contrib/wpa/src/ap/ieee802_1x.h stable/12/contrib/wpa/src/ap/ndisc_snoop.c stable/12/contrib/wpa/src/ap/neighbor_db.c stable/12/contrib/wpa/src/ap/neighbor_db.h stable/12/contrib/wpa/src/ap/pmksa_cache_auth.c stable/12/contrib/wpa/src/ap/pmksa_cache_auth.h stable/12/contrib/wpa/src/ap/rrm.c stable/12/contrib/wpa/src/ap/rrm.h stable/12/contrib/wpa/src/ap/sta_info.c stable/12/contrib/wpa/src/ap/sta_info.h stable/12/contrib/wpa/src/ap/taxonomy.c stable/12/contrib/wpa/src/ap/tkip_countermeasures.c stable/12/contrib/wpa/src/ap/vlan_full.c stable/12/contrib/wpa/src/ap/vlan_init.c stable/12/contrib/wpa/src/ap/wmm.c stable/12/contrib/wpa/src/ap/wnm_ap.c stable/12/contrib/wpa/src/ap/wnm_ap.h stable/12/contrib/wpa/src/ap/wpa_auth.c stable/12/contrib/wpa/src/ap/wpa_auth.h stable/12/contrib/wpa/src/ap/wpa_auth_ft.c stable/12/contrib/wpa/src/ap/wpa_auth_glue.c stable/12/contrib/wpa/src/ap/wpa_auth_i.h stable/12/contrib/wpa/src/ap/wpa_auth_ie.c stable/12/contrib/wpa/src/ap/wpa_auth_ie.h stable/12/contrib/wpa/src/ap/wps_hostapd.c stable/12/contrib/wpa/src/common/common_module_tests.c stable/12/contrib/wpa/src/common/ctrl_iface_common.c stable/12/contrib/wpa/src/common/ctrl_iface_common.h stable/12/contrib/wpa/src/common/defs.h stable/12/contrib/wpa/src/common/gas.c stable/12/contrib/wpa/src/common/gas.h stable/12/contrib/wpa/src/common/hw_features_common.c stable/12/contrib/wpa/src/common/hw_features_common.h stable/12/contrib/wpa/src/common/ieee802_11_common.c stable/12/contrib/wpa/src/common/ieee802_11_common.h stable/12/contrib/wpa/src/common/ieee802_11_defs.h stable/12/contrib/wpa/src/common/ieee802_1x_defs.h stable/12/contrib/wpa/src/common/privsep_commands.h stable/12/contrib/wpa/src/common/qca-vendor.h stable/12/contrib/wpa/src/common/sae.c stable/12/contrib/wpa/src/common/sae.h stable/12/contrib/wpa/src/common/version.h stable/12/contrib/wpa/src/common/wpa_common.c stable/12/contrib/wpa/src/common/wpa_common.h stable/12/contrib/wpa/src/common/wpa_ctrl.c stable/12/contrib/wpa/src/common/wpa_ctrl.h stable/12/contrib/wpa/src/common/wpa_helpers.c stable/12/contrib/wpa/src/crypto/aes-ctr.c stable/12/contrib/wpa/src/crypto/aes-internal-dec.c stable/12/contrib/wpa/src/crypto/aes-internal-enc.c stable/12/contrib/wpa/src/crypto/aes-siv.c stable/12/contrib/wpa/src/crypto/aes.h stable/12/contrib/wpa/src/crypto/aes_siv.h stable/12/contrib/wpa/src/crypto/aes_wrap.h stable/12/contrib/wpa/src/crypto/crypto.h stable/12/contrib/wpa/src/crypto/crypto_gnutls.c stable/12/contrib/wpa/src/crypto/crypto_internal-modexp.c stable/12/contrib/wpa/src/crypto/crypto_internal.c stable/12/contrib/wpa/src/crypto/crypto_libtomcrypt.c stable/12/contrib/wpa/src/crypto/crypto_module_tests.c stable/12/contrib/wpa/src/crypto/crypto_none.c stable/12/contrib/wpa/src/crypto/crypto_openssl.c stable/12/contrib/wpa/src/crypto/des-internal.c stable/12/contrib/wpa/src/crypto/dh_groups.c stable/12/contrib/wpa/src/crypto/md4-internal.c stable/12/contrib/wpa/src/crypto/ms_funcs.c stable/12/contrib/wpa/src/crypto/ms_funcs.h stable/12/contrib/wpa/src/crypto/random.c stable/12/contrib/wpa/src/crypto/sha1-internal.c stable/12/contrib/wpa/src/crypto/sha1-tlsprf.c stable/12/contrib/wpa/src/crypto/sha256-internal.c stable/12/contrib/wpa/src/crypto/sha256-kdf.c stable/12/contrib/wpa/src/crypto/sha384-prf.c stable/12/contrib/wpa/src/crypto/sha384.h stable/12/contrib/wpa/src/crypto/sha512-internal.c stable/12/contrib/wpa/src/crypto/tls.h stable/12/contrib/wpa/src/crypto/tls_gnutls.c stable/12/contrib/wpa/src/crypto/tls_internal.c stable/12/contrib/wpa/src/crypto/tls_none.c stable/12/contrib/wpa/src/crypto/tls_openssl.c stable/12/contrib/wpa/src/drivers/driver.h stable/12/contrib/wpa/src/drivers/driver_bsd.c stable/12/contrib/wpa/src/drivers/driver_common.c stable/12/contrib/wpa/src/drivers/driver_macsec_qca.c stable/12/contrib/wpa/src/drivers/driver_ndis.c stable/12/contrib/wpa/src/drivers/driver_nl80211.h stable/12/contrib/wpa/src/drivers/driver_nl80211_capa.c stable/12/contrib/wpa/src/drivers/driver_nl80211_event.c stable/12/contrib/wpa/src/drivers/driver_nl80211_monitor.c stable/12/contrib/wpa/src/drivers/driver_nl80211_scan.c stable/12/contrib/wpa/src/drivers/driver_openbsd.c stable/12/contrib/wpa/src/drivers/driver_privsep.c stable/12/contrib/wpa/src/drivers/driver_wired.c stable/12/contrib/wpa/src/drivers/drivers.c stable/12/contrib/wpa/src/eap_common/eap_eke_common.c stable/12/contrib/wpa/src/eap_common/eap_fast_common.c stable/12/contrib/wpa/src/eap_common/eap_pwd_common.c stable/12/contrib/wpa/src/eap_common/eap_pwd_common.h stable/12/contrib/wpa/src/eap_common/eap_sake_common.c stable/12/contrib/wpa/src/eap_common/eap_sake_common.h stable/12/contrib/wpa/src/eap_common/eap_sim_common.c stable/12/contrib/wpa/src/eap_peer/eap.c stable/12/contrib/wpa/src/eap_peer/eap.h stable/12/contrib/wpa/src/eap_peer/eap_aka.c stable/12/contrib/wpa/src/eap_peer/eap_config.h stable/12/contrib/wpa/src/eap_peer/eap_eke.c stable/12/contrib/wpa/src/eap_peer/eap_fast.c stable/12/contrib/wpa/src/eap_peer/eap_fast_pac.c stable/12/contrib/wpa/src/eap_peer/eap_gpsk.c stable/12/contrib/wpa/src/eap_peer/eap_i.h stable/12/contrib/wpa/src/eap_peer/eap_ikev2.c stable/12/contrib/wpa/src/eap_peer/eap_leap.c stable/12/contrib/wpa/src/eap_peer/eap_mschapv2.c stable/12/contrib/wpa/src/eap_peer/eap_pax.c stable/12/contrib/wpa/src/eap_peer/eap_peap.c stable/12/contrib/wpa/src/eap_peer/eap_proxy.h stable/12/contrib/wpa/src/eap_peer/eap_proxy_dummy.c stable/12/contrib/wpa/src/eap_peer/eap_psk.c stable/12/contrib/wpa/src/eap_peer/eap_pwd.c stable/12/contrib/wpa/src/eap_peer/eap_sake.c stable/12/contrib/wpa/src/eap_peer/eap_sim.c stable/12/contrib/wpa/src/eap_peer/eap_tls.c stable/12/contrib/wpa/src/eap_peer/eap_tls_common.c stable/12/contrib/wpa/src/eap_peer/eap_tls_common.h stable/12/contrib/wpa/src/eap_peer/eap_ttls.c stable/12/contrib/wpa/src/eap_peer/eap_wsc.c stable/12/contrib/wpa/src/eap_peer/ikev2.c stable/12/contrib/wpa/src/eap_peer/tncc.c stable/12/contrib/wpa/src/eap_server/eap.h stable/12/contrib/wpa/src/eap_server/eap_i.h stable/12/contrib/wpa/src/eap_server/eap_server.c stable/12/contrib/wpa/src/eap_server/eap_server_aka.c stable/12/contrib/wpa/src/eap_server/eap_server_eke.c stable/12/contrib/wpa/src/eap_server/eap_server_fast.c stable/12/contrib/wpa/src/eap_server/eap_server_gpsk.c stable/12/contrib/wpa/src/eap_server/eap_server_gtc.c stable/12/contrib/wpa/src/eap_server/eap_server_ikev2.c stable/12/contrib/wpa/src/eap_server/eap_server_mschapv2.c stable/12/contrib/wpa/src/eap_server/eap_server_pax.c stable/12/contrib/wpa/src/eap_server/eap_server_peap.c stable/12/contrib/wpa/src/eap_server/eap_server_psk.c stable/12/contrib/wpa/src/eap_server/eap_server_pwd.c stable/12/contrib/wpa/src/eap_server/eap_server_sake.c stable/12/contrib/wpa/src/eap_server/eap_server_sim.c stable/12/contrib/wpa/src/eap_server/eap_server_tls.c stable/12/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/12/contrib/wpa/src/eap_server/eap_server_ttls.c stable/12/contrib/wpa/src/eap_server/eap_server_wsc.c stable/12/contrib/wpa/src/eap_server/eap_tls_common.h stable/12/contrib/wpa/src/eap_server/ikev2.c stable/12/contrib/wpa/src/eap_server/tncs.c stable/12/contrib/wpa/src/eapol_auth/eapol_auth_sm.c stable/12/contrib/wpa/src/eapol_auth/eapol_auth_sm.h stable/12/contrib/wpa/src/eapol_supp/eapol_supp_sm.c stable/12/contrib/wpa/src/eapol_supp/eapol_supp_sm.h stable/12/contrib/wpa/src/fst/fst.h stable/12/contrib/wpa/src/fst/fst_ctrl_aux.h stable/12/contrib/wpa/src/fst/fst_ctrl_iface.c stable/12/contrib/wpa/src/fst/fst_group.c stable/12/contrib/wpa/src/fst/fst_iface.h stable/12/contrib/wpa/src/fst/fst_session.c stable/12/contrib/wpa/src/l2_packet/l2_packet.h stable/12/contrib/wpa/src/l2_packet/l2_packet_privsep.c stable/12/contrib/wpa/src/p2p/p2p.c stable/12/contrib/wpa/src/p2p/p2p.h stable/12/contrib/wpa/src/p2p/p2p_build.c stable/12/contrib/wpa/src/p2p/p2p_go_neg.c stable/12/contrib/wpa/src/p2p/p2p_group.c stable/12/contrib/wpa/src/p2p/p2p_i.h stable/12/contrib/wpa/src/p2p/p2p_invitation.c stable/12/contrib/wpa/src/p2p/p2p_pd.c stable/12/contrib/wpa/src/p2p/p2p_sd.c stable/12/contrib/wpa/src/p2p/p2p_utils.c stable/12/contrib/wpa/src/pae/ieee802_1x_cp.c stable/12/contrib/wpa/src/pae/ieee802_1x_cp.h stable/12/contrib/wpa/src/pae/ieee802_1x_kay.c stable/12/contrib/wpa/src/pae/ieee802_1x_kay.h stable/12/contrib/wpa/src/pae/ieee802_1x_kay_i.h stable/12/contrib/wpa/src/pae/ieee802_1x_key.c stable/12/contrib/wpa/src/pae/ieee802_1x_key.h stable/12/contrib/wpa/src/pae/ieee802_1x_secy_ops.c stable/12/contrib/wpa/src/pae/ieee802_1x_secy_ops.h stable/12/contrib/wpa/src/radius/radius.c stable/12/contrib/wpa/src/radius/radius.h stable/12/contrib/wpa/src/radius/radius_client.c stable/12/contrib/wpa/src/radius/radius_das.c stable/12/contrib/wpa/src/radius/radius_das.h stable/12/contrib/wpa/src/radius/radius_server.c stable/12/contrib/wpa/src/radius/radius_server.h stable/12/contrib/wpa/src/rsn_supp/pmksa_cache.c stable/12/contrib/wpa/src/rsn_supp/pmksa_cache.h stable/12/contrib/wpa/src/rsn_supp/preauth.c stable/12/contrib/wpa/src/rsn_supp/tdls.c stable/12/contrib/wpa/src/rsn_supp/wpa.c stable/12/contrib/wpa/src/rsn_supp/wpa.h stable/12/contrib/wpa/src/rsn_supp/wpa_ft.c stable/12/contrib/wpa/src/rsn_supp/wpa_i.h stable/12/contrib/wpa/src/rsn_supp/wpa_ie.c stable/12/contrib/wpa/src/rsn_supp/wpa_ie.h stable/12/contrib/wpa/src/tls/asn1.c stable/12/contrib/wpa/src/tls/bignum.c stable/12/contrib/wpa/src/tls/libtommath.c stable/12/contrib/wpa/src/tls/rsa.c stable/12/contrib/wpa/src/tls/tlsv1_client.c stable/12/contrib/wpa/src/tls/tlsv1_client.h stable/12/contrib/wpa/src/tls/tlsv1_client_read.c stable/12/contrib/wpa/src/tls/tlsv1_client_write.c stable/12/contrib/wpa/src/tls/tlsv1_common.c stable/12/contrib/wpa/src/tls/tlsv1_cred.c stable/12/contrib/wpa/src/tls/tlsv1_server.c stable/12/contrib/wpa/src/tls/tlsv1_server.h stable/12/contrib/wpa/src/tls/tlsv1_server_i.h stable/12/contrib/wpa/src/tls/tlsv1_server_read.c stable/12/contrib/wpa/src/tls/tlsv1_server_write.c stable/12/contrib/wpa/src/tls/x509v3.c stable/12/contrib/wpa/src/utils/base64.c stable/12/contrib/wpa/src/utils/base64.h stable/12/contrib/wpa/src/utils/browser-wpadebug.c stable/12/contrib/wpa/src/utils/browser.c stable/12/contrib/wpa/src/utils/common.c stable/12/contrib/wpa/src/utils/common.h stable/12/contrib/wpa/src/utils/eloop.c stable/12/contrib/wpa/src/utils/eloop.h stable/12/contrib/wpa/src/utils/http_curl.c stable/12/contrib/wpa/src/utils/list.h stable/12/contrib/wpa/src/utils/os.h stable/12/contrib/wpa/src/utils/os_internal.c stable/12/contrib/wpa/src/utils/os_none.c stable/12/contrib/wpa/src/utils/os_unix.c stable/12/contrib/wpa/src/utils/os_win32.c stable/12/contrib/wpa/src/utils/trace.c stable/12/contrib/wpa/src/utils/utils_module_tests.c stable/12/contrib/wpa/src/utils/uuid.c stable/12/contrib/wpa/src/utils/uuid.h stable/12/contrib/wpa/src/utils/wpa_debug.c stable/12/contrib/wpa/src/utils/wpa_debug.h stable/12/contrib/wpa/src/utils/wpabuf.c stable/12/contrib/wpa/src/utils/xml-utils.c stable/12/contrib/wpa/src/wps/wps.c stable/12/contrib/wpa/src/wps/wps.h stable/12/contrib/wpa/src/wps/wps_attr_build.c stable/12/contrib/wpa/src/wps/wps_attr_parse.c stable/12/contrib/wpa/src/wps/wps_attr_parse.h stable/12/contrib/wpa/src/wps/wps_common.c stable/12/contrib/wpa/src/wps/wps_defs.h stable/12/contrib/wpa/src/wps/wps_dev_attr.c stable/12/contrib/wpa/src/wps/wps_dev_attr.h stable/12/contrib/wpa/src/wps/wps_enrollee.c stable/12/contrib/wpa/src/wps/wps_er.c stable/12/contrib/wpa/src/wps/wps_i.h stable/12/contrib/wpa/src/wps/wps_registrar.c stable/12/contrib/wpa/src/wps/wps_upnp.c stable/12/contrib/wpa/src/wps/wps_validate.c stable/12/contrib/wpa/wpa_supplicant/Android.mk stable/12/contrib/wpa/wpa_supplicant/ChangeLog stable/12/contrib/wpa/wpa_supplicant/README stable/12/contrib/wpa/wpa_supplicant/README-HS20 stable/12/contrib/wpa/wpa_supplicant/README-P2P stable/12/contrib/wpa/wpa_supplicant/android.config stable/12/contrib/wpa/wpa_supplicant/ap.c stable/12/contrib/wpa/wpa_supplicant/ap.h stable/12/contrib/wpa/wpa_supplicant/autoscan.c stable/12/contrib/wpa/wpa_supplicant/bgscan.c stable/12/contrib/wpa/wpa_supplicant/bgscan_learn.c stable/12/contrib/wpa/wpa_supplicant/bgscan_simple.c stable/12/contrib/wpa/wpa_supplicant/bss.c stable/12/contrib/wpa/wpa_supplicant/bss.h stable/12/contrib/wpa/wpa_supplicant/config.c stable/12/contrib/wpa/wpa_supplicant/config.h stable/12/contrib/wpa/wpa_supplicant/config_file.c stable/12/contrib/wpa/wpa_supplicant/config_ssid.h stable/12/contrib/wpa/wpa_supplicant/ctrl_iface.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c stable/12/contrib/wpa/wpa_supplicant/dbus/Makefile stable/12/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_common.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c stable/12/contrib/wpa/wpa_supplicant/defconfig stable/12/contrib/wpa/wpa_supplicant/driver_i.h stable/12/contrib/wpa/wpa_supplicant/eapol_test.c stable/12/contrib/wpa/wpa_supplicant/eapol_test.py stable/12/contrib/wpa/wpa_supplicant/events.c stable/12/contrib/wpa/wpa_supplicant/examples/dbus-listen-preq.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p-nfc.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_connect.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_disconnect.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_find.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_flush.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_group_add.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_invite.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_listen.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_stop_find.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py stable/12/contrib/wpa/wpa_supplicant/examples/wps-ap-cli stable/12/contrib/wpa/wpa_supplicant/examples/wps-nfc.py stable/12/contrib/wpa/wpa_supplicant/gas_query.c stable/12/contrib/wpa/wpa_supplicant/gas_query.h stable/12/contrib/wpa/wpa_supplicant/hs20_supplicant.c stable/12/contrib/wpa/wpa_supplicant/hs20_supplicant.h stable/12/contrib/wpa/wpa_supplicant/ibss_rsn.c stable/12/contrib/wpa/wpa_supplicant/interworking.c stable/12/contrib/wpa/wpa_supplicant/interworking.h stable/12/contrib/wpa/wpa_supplicant/main.c stable/12/contrib/wpa/wpa_supplicant/mbo.c stable/12/contrib/wpa/wpa_supplicant/mesh.c stable/12/contrib/wpa/wpa_supplicant/mesh_mpm.c stable/12/contrib/wpa/wpa_supplicant/mesh_rsn.c stable/12/contrib/wpa/wpa_supplicant/notify.c stable/12/contrib/wpa/wpa_supplicant/notify.h stable/12/contrib/wpa/wpa_supplicant/offchannel.c stable/12/contrib/wpa/wpa_supplicant/p2p_supplicant.c stable/12/contrib/wpa/wpa_supplicant/p2p_supplicant.h stable/12/contrib/wpa/wpa_supplicant/preauth_test.c stable/12/contrib/wpa/wpa_supplicant/scan.c stable/12/contrib/wpa/wpa_supplicant/sme.c stable/12/contrib/wpa/wpa_supplicant/sme.h stable/12/contrib/wpa/wpa_supplicant/systemd/wpa_supplicant.service.in stable/12/contrib/wpa/wpa_supplicant/utils/log2pcap.py stable/12/contrib/wpa/wpa_supplicant/wifi_display.c stable/12/contrib/wpa/wpa_supplicant/wmm_ac.c stable/12/contrib/wpa/wpa_supplicant/wnm_sta.c stable/12/contrib/wpa/wpa_supplicant/wnm_sta.h stable/12/contrib/wpa/wpa_supplicant/wpa_cli.c stable/12/contrib/wpa/wpa_supplicant/wpa_passphrase.c stable/12/contrib/wpa/wpa_supplicant/wpa_priv.c stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant.c stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant.conf stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant_template.conf stable/12/contrib/wpa/wpa_supplicant/wpas_glue.c stable/12/contrib/wpa/wpa_supplicant/wpas_kay.c stable/12/contrib/wpa/wpa_supplicant/wpas_kay.h stable/12/contrib/wpa/wpa_supplicant/wps_supplicant.c stable/12/contrib/wpa/wpa_supplicant/wps_supplicant.h stable/12/usr.sbin/wpa/Makefile.crypto stable/12/usr.sbin/wpa/Makefile.inc stable/12/usr.sbin/wpa/hostapd/Makefile stable/12/usr.sbin/wpa/wpa_cli/Makefile stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Wed May 1 00:00:49 2019 (r346979) +++ stable/12/Makefile.inc1 Wed May 1 01:42:38 2019 (r346980) @@ -963,6 +963,14 @@ _cleanobj_fast_depend_hack: .PHONY rm -f ${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.*; \ fi +# 20181209 r341759 track migration across wpa update + @if [ -e "${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o" ] && \ + egrep -q 'src/ap/rrm.c' \ + ${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o; then \ + echo "Removing stale wpa dependencies"; \ + rm -f ${OBJTOP}/usr.sbin/wpa/*/.depend*; \ + fi + _worldtmp: .PHONY @echo @echo "--------------------------------------------------------------" Modified: stable/12/contrib/wpa/CONTRIBUTIONS ============================================================================== --- stable/12/contrib/wpa/CONTRIBUTIONS Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/CONTRIBUTIONS Wed May 1 01:42:38 2019 (r346980) @@ -140,7 +140,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without Modified: stable/12/contrib/wpa/COPYING ============================================================================== --- stable/12/contrib/wpa/COPYING Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/COPYING Wed May 1 01:42:38 2019 (r346980) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Modified: stable/12/contrib/wpa/README ============================================================================== --- stable/12/contrib/wpa/README Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/README Wed May 1 01:42:38 2019 (r346980) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: stable/12/contrib/wpa/hostapd/ChangeLog ============================================================================== --- stable/12/contrib/wpa/hostapd/ChangeLog Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/ChangeLog Wed May 1 01:42:38 2019 (r346980) @@ -1,5 +1,115 @@ ChangeLog for hostapd +2019-04-21 - v2.8 + * SAE changes + - added support for SAE Password Identifier + - changed default configuration to enable only group 19 + (i.e., disable groups 20, 21, 25, 26 from default configuration) and + disable all unsuitable groups completely based on REVmd changes + - improved anti-clogging token mechanism and SAE authentication + frame processing during heavy CPU load; this mitigates some issues + with potential DoS attacks trying to flood an AP with large number + of SAE messages + - added Finite Cyclic Group field in status code 77 responses + - reject use of unsuitable groups based on new implementation guidance + in REVmd (allow only FFC groups with prime >= 3072 bits and ECC + groups with prime >= 256) + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-1/] (CVE-2019-9494) + - fixed confirm message validation in error cases + [https://w1.fi/security/2019-3/] (CVE-2019-9496) + * EAP-pwd changes + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-2/] (CVE-2019-9495) + - verify peer scalar/element + [https://w1.fi/security/2019-4/] (CVE-2019-9497 and CVE-2019-9498) + - fix message reassembly issue with unexpected fragment + [https://w1.fi/security/2019-5/] + - enforce rand,mask generation rules more strictly + - fix a memory leak in PWE derivation + - disallow ECC groups with a prime under 256 bits (groups 25, 26, and + 27) + * Hotspot 2.0 changes + - added support for release number 3 + - reject release 2 or newer association without PMF + * added support for RSN operating channel validation + (CONFIG_OCV=y and configuration parameter ocv=1) + * added Multi-AP protocol support + * added FTM responder configuration + * fixed build with LibreSSL + * added FT/RRB workaround for short Ethernet frame padding + * fixed KEK2 derivation for FILS+FT + * added RSSI-based association rejection from OCE + * extended beacon reporting functionality + * VLAN changes + - allow local VLAN management with remote RADIUS authentication + - add WPA/WPA2 passphrase/PSK -based VLAN assignment + * OpenSSL: allow systemwide policies to be overridden + * extended PEAP to derive EMSK to enable use with ERP/FILS + * extended WPS to allow SAE configuration to be added automatically + for PSK (wps_cred_add_sae=1) + * fixed FT and SA Query Action frame with AP-MLME-in-driver cases + * OWE: allow Diffie-Hellman Parameter element to be included with DPP + in preparation for DPP protocol extension + * RADIUS server: started to accept ERP keyName-NAI as user identity + automatically without matching EAP database entry + * fixed PTK rekeying with FILS and FT + +2018-12-02 - v2.7 + * fixed WPA packet number reuse with replayed messages and key + reinstallation + [http://w1.fi/security/2017-1/] (CVE-2017-13082) + * added support for FILS (IEEE 802.11ai) shared key authentication + * added support for OWE (Opportunistic Wireless Encryption, RFC 8110; + and transition mode defined by WFA) + * added support for DPP (Wi-Fi Device Provisioning Protocol) + * FT: + - added local generation of PMK-R0/PMK-R1 for FT-PSK + (ft_psk_generate_local=1) + - replaced inter-AP protocol with a cleaner design that is more + easily extensible; this breaks backward compatibility and requires + all APs in the ESS to be updated at the same time to maintain FT + functionality + - added support for wildcard R0KH/R1KH + - replaced r0_key_lifetime (minutes) parameter with + ft_r0_key_lifetime (seconds) + - fixed wpa_psk_file use for FT-PSK + - fixed FT-SAE PMKID matching + - added expiration to PMK-R0 and PMK-R1 cache + - added IEEE VLAN support (including tagged VLANs) + - added support for SHA384 based AKM + * SAE + - fixed some PMKSA caching cases with SAE + - added support for configuring SAE password separately of the + WPA2 PSK/passphrase + - added option to require MFP for SAE associations + (sae_require_pmf=1) + - fixed PTK and EAPOL-Key integrity and key-wrap algorithm selection + for SAE; + note: this is not backwards compatible, i.e., both the AP and + station side implementations will need to be update at the same + time to maintain interoperability + - added support for Password Identifier + * hostapd_cli: added support for command history and completion + * added support for requesting beacon report + * large number of other fixes, cleanup, and extensions + * added option to configure EAPOL-Key retry limits + (wpa_group_update_count and wpa_pairwise_update_count) + * removed all PeerKey functionality + * fixed nl80211 AP mode configuration regression with Linux 4.15 and + newer + * added support for using wolfSSL cryptographic library + * fixed some 20/40 MHz coexistence cases where the BSS could drop to + 20 MHz even when 40 MHz would be allowed + * Hotspot 2.0 + - added support for setting Venue URL ANQP-element (venue_url) + - added support for advertising Hotspot 2.0 operator icons + - added support for Roaming Consortium Selection element + - added support for Terms and Conditions + - added support for OSEN connection in a shared RSN BSS + * added support for using OpenSSL 1.1.1 + * added EAP-pwd server support for salted passwords + 2016-10-02 - v2.6 * fixed EAP-pwd last fragment validation [http://w1.fi/security/2015-7/] (CVE-2015-5314) Modified: stable/12/contrib/wpa/hostapd/README ============================================================================== --- stable/12/contrib/wpa/hostapd/README Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/README Wed May 1 01:42:38 2019 (r346980) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WP Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with @@ -70,7 +70,7 @@ Requirements Current hardware/software requirements: - drivers: Host AP driver for Prism2/2.5/3. - (http://hostap.epitest.fi/) + (http://w1.fi/hostap-driver.html) Please note that station firmware version needs to be 1.7.0 or newer to work in WPA mode. @@ -81,8 +81,7 @@ Current hardware/software requirements: Any wired Ethernet driver for wired IEEE 802.1X authentication (experimental code) - FreeBSD -current (with some kernel mods that have not yet been - committed when hostapd v0.3.0 was released) + FreeBSD -current BSD net80211 layer (e.g., Atheros driver) @@ -186,24 +185,14 @@ Authenticator and RADIUS encapsulation between the Aut the Authentication Server. Other than this, the functionality is similar to the case with the co-located Authentication Server. -Authentication Server and Supplicant ------------------------------------- +Authentication Server +--------------------- Any RADIUS server supporting EAP should be usable as an IEEE 802.1X Authentication Server with hostapd Authenticator. FreeRADIUS (http://www.freeradius.org/) has been successfully tested with hostapd -Authenticator and both Xsupplicant (http://www.open1x.org) and Windows -XP Supplicants. EAP/TLS was used with Xsupplicant and -EAP/MD5-Challenge with Windows XP. +Authenticator. -http://www.missl.cs.umd.edu/wireless/eaptls/ has useful information -about using EAP/TLS with FreeRADIUS and Xsupplicant (just replace -Cisco access point with Host AP driver, hostapd daemon, and a Prism2 -card ;-). http://www.freeradius.org/doc/EAP-MD5.html has information -about using EAP/MD5 with FreeRADIUS, including instructions for WinXP -configuration. http://www.denobula.com/EAPTLS.pdf has a HOWTO on -EAP/TLS use with WinXP Supplicant. - Automatic WEP key configuration ------------------------------- @@ -243,16 +232,15 @@ networks that require some kind of security. Task grou of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked to address the flaws of the base standard and has in practice completed its work in May 2004. The IEEE 802.11i amendment to the IEEE -802.11 standard was approved in June 2004 and this amendment is likely -to be published in July 2004. +802.11 standard was approved in June 2004 and this amendment was +published in July 2004. Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the IEEE 802.11i work (draft 3.0) to define a subset of the security enhancements that can be implemented with existing wlan hardware. This is called Wi-Fi Protected Access (WPA). This has now become a mandatory component of interoperability testing and certification done -by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web -site (http://www.wi-fi.org/OpenSection/protected_access.asp). +by Wi-Fi Alliance. IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm for protecting wireless networks. WEP uses RC4 with 40-bit keys, Copied: stable/12/contrib/wpa/hostapd/README-MULTI-AP (from r346591, head/contrib/wpa/hostapd/README-MULTI-AP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/wpa/hostapd/README-MULTI-AP Wed May 1 01:42:38 2019 (r346980, copy of r346591, head/contrib/wpa/hostapd/README-MULTI-AP) @@ -0,0 +1,160 @@ +hostapd, wpa_supplicant and the Multi-AP Specification +====================================================== + +This document describes how hostapd and wpa_supplicant can be configured to +support the Multi-AP Specification. + +Introduction to Multi-AP +------------------------ + +The Wi-Fi Alliance Multi-AP Specification is the technical specification for +Wi-Fi CERTIFIED EasyMesh(TM) [1], the Wi-Fi Alliance® certification program for +Multi-AP. It defines control protocols between Wi-Fi® access points (APs) to +join them into a network with centralized control and operation. It is targeted +only at routers (repeaters, gateways, ...), not at clients. Clients are not +involved at all in the protocols. + +Most of the Multi-AP specification falls outside of the scope of +hostapd/wpa_supplicant. hostapd/wpa_supplicant is only involved for the items +summarized below. The rest of the protocol must be implemented by a separate +daemon, e.g., prplMesh [2]. That daemon also needs to communicate with hostapd, +e.g., to get a list of associated clients, but this can be done using the normal +hostapd interfaces. + +hostapd/wpa_supplicant needs to be configured specifically to support: +- the WPS onboarding process; +- configuring backhaul links. + +The text below refers to "Multi-AP Specification v1.0" [3]. + + +Fronthaul and backhaul links +---------------------------- + +In a Multi-AP network, the central controller can configure the BSSs on the +devices that are joined into the network. These are called fronthaul BSSs. +From the point of view of hostapd, there is nothing special about these +fronthaul BSSs. + +In addition to fronthaul BSSs, the controller can also configure backhaul +links. A backhaul link is a link between two access point devices, giving +internet access to access point devices that don't have a wired link. The +Multi-AP specification doesn't dictate this, but typically the backhaul link +will be bridged into a LAN together with (one of) the fronthaul BSS(s) and the +wired Ethernet ports. + +A backhaul link must be treated specially by hostapd and wpa_supplicant. One +side of the backhaul link is configured through the Multi-AP protocol as the +"backhaul STA", i.e., the client side of the link. A backhaul STA is like any +station and is handled appropriately by wpa_supplicant, but two additional +features are required. It must send an additional information element in each +(Re)Association Request frame ([3], section 5.2, paragraph 4). In addition, it +must use 4-address mode for all frames sent over this link ([3], section 14). +Therefore, wpa_supplicant must be configured explicitly as the backhaul STA +role, by setting 'multi_ap_backhaul_sta=1' in the network configuration block +or when configuring the network profile through the control interface. When +'multi_ap_backhaul_sta=1', wpa_supplicant includes the Multi-AP IE in +(Re)Association Request frame and verifies that it is included in the +(Re)Association Response frame. If it is not, association fails. If it is, +wpa_supplicant sets 4-address mode for this interface through a driver +callback. + +The AP side of the backhaul link is called a "backhaul BSS". Such a BSS must +be handled specially by hostapd, because it must add an additional information +element in each (Re)Association Response frame, but only to stations that have +identified themselves as backhaul stations ([3], section 5.2, paragraph 5-6). +This is important because it is possible to use the same BSS and SSID for +fronthaul and backhaul at the same time. The additional information element must +only be used for frames sent to a backhaul STA, not to a normal STA. Also, +frames sent to a backhaul STA must use 4-address mode, while frames sent to a +normal STA (fronthaul, when it's a fronthaul and backhaul BSS) must use +3-address mode. + +A BSS is configured in Multi-AP mode in hostapd by setting the 'multi_ap' +configuration option to 1 (backhaul BSS), 2 (fronthaul BSS), or 3 +(simultaneous backhaul and fronthaul BSS). If this option is set, hostapd +parses the Multi-AP information element in the Association Request frame. If the +station is a backhaul STA and the BSS is configured as a backhaul BSS, +hostapd sets up 4-address mode. Since there may be multiple stations connected +simultaneously, and each of them has a different RA (receiver address), a VLAN +is created for each backhaul STA and it is automatically added to a bridge. +This is the same behavior as for WDS, and the relevant option ('bridge' or +'wds_bridge') applies here as well. + +If 'multi_ap' is 1 (backhaul BSS only), any station that tries to associate +without the Multi-AP information element will be denied. + +If 'multi_ap' is 2 (fronthaul BSS only), any station that tries to associate +with the Multi-AP information element will be denied. That is also the only +difference with 'multi_ap' set to 0: in the latter case, the Multi-AP +information element is simply ignored. + +In summary, this is the end-to-end behavior for a backhaul BSS (i.e., +multi_ap_backhaul_sta=1 in wpa_supplicant on STA, and multi_ap=1 or 3 in +hostapd on AP). Note that point 1 means that hostapd must not be configured +with WPS support on the backhaul BSS (multi_ap=1). hostapd does not check for +that. + +1. Backhaul BSS beacons do not advertise WPS support (other than that, nothing + Multi-AP specific). +2. STA sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. STA sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. STA and AP both use 4-address mode for Data frames. + + +WPS support +----------- + +WPS requires more special handling. WPS must only be advertised on fronthaul +BSSs, not on backhaul BSSs, so WPS should not be enabled on a backhaul-only +BSS in hostapd.conf. The WPS configuration purely works on the fronthaul BSS. +When a WPS M1 message has an additional subelement that indicates a request for +a Multi-AP backhaul link, hostapd must not respond with the normal fronthaul +BSS credentials; instead, it should respond with the (potentially different) +backhaul BSS credentials. + +To support this, hostapd has the 'multi_ap_backhaul_ssid', +'multi_ap_backhaul_wpa_psk' and 'multi_ap_backhaul_wpa_passphrase' options. +When these are set on an BSS with WPS, they are used instead of the normal +credentials when hostapd receives a WPS M1 message with the Multi-AP IE. Only +WPA2-Personal is supported in the Multi-AP specification, so there is no need +to specify authentication or encryption options. For the backhaul credentials, +per-device PSK is not supported. + +If the BSS is a simultaneous backhaul and fronthaul BSS, there is no need to +specify the backhaul credentials, since the backhaul and fronthaul credentials +are identical. + +To enable the Multi-AP backhaul STA feature when it performs WPS, a new +parameter has been introduced to the WPS_PBC control interface call. When this +"multi_ap=1" option is set, it adds the Multi-AP backhaul subelement to the +Association Request frame and the M1 message. It then configures the new network +profile with 'multi_ap_backhaul_sta=1'. Note that this means that if the AP does +not follow the Multi-AP specification, wpa_supplicant will fail to associate. + +In summary, this is the end-to-end behavior for WPS of a backhaul link (i.e., +multi_ap=1 option is given in the wps_pbc call on the STA side, and multi_ap=2 +and multi_ap_backhaul_ssid and either multi_ap_backhaul_wpa_psk or +multi_ap_backhaul_wpa_passphrase are set to the credentials of a backhaul BSS +in hostapd on Registrar AP). + +1. Fronthaul BSS Beacon frames advertise WPS support (nothing Multi-AP + specific). +2. Enrollee sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. Enrollee sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. Enrollee sends M1 with additional Multi-AP subelement. +7. AP sends M8 with backhaul instead of fronthaul credentials. +8. Enrollee sends Deauthentication frame. + + +References +---------- + +[1] https://www.wi-fi.org/discover-wi-fi/wi-fi-easymesh +[2] https://github.com/prplfoundation/prplMesh +[3] https://www.wi-fi.org/file/multi-ap-specification-v10 + (requires registration) Modified: stable/12/contrib/wpa/hostapd/config_file.c ============================================================================== --- stable/12/contrib/wpa/hostapd/config_file.c Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/config_file.c Wed May 1 01:42:38 2019 (r346980) @@ -1,6 +1,6 @@ /* * hostapd / Configuration file parser - * Copyright (c) 2003-2015, Jouni Malinen + * Copyright (c) 2003-2018, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -14,6 +14,8 @@ #include "utils/common.h" #include "utils/uuid.h" #include "common/ieee802_11_defs.h" +#include "crypto/sha256.h" +#include "crypto/tls.h" #include "drivers/driver.h" #include "eap_server/eap.h" #include "radius/radius_client.h" @@ -35,7 +37,7 @@ static int hostapd_config_read_vlan_file(struct hostap const char *fname) { FILE *f; - char buf[128], *pos, *pos2; + char buf[128], *pos, *pos2, *pos3; int line = 0, vlan_id; struct hostapd_vlan *vlan; @@ -80,7 +82,10 @@ static int hostapd_config_read_vlan_file(struct hostap pos2 = pos; while (*pos2 != ' ' && *pos2 != '\t' && *pos2 != '\0') pos2++; - *pos2 = '\0'; + + if (*pos2 != '\0') + *(pos2++) = '\0'; + if (*pos == '\0' || os_strlen(pos) > IFNAMSIZ) { wpa_printf(MSG_ERROR, "Invalid VLAN ifname at line %d " "in '%s'", line, fname); @@ -88,6 +93,13 @@ static int hostapd_config_read_vlan_file(struct hostap return -1; } + while (*pos2 == ' ' || *pos2 == '\t') + pos2++; + pos3 = pos2; + while (*pos3 != ' ' && *pos3 != '\t' && *pos3 != '\0') + pos3++; + *pos3 = '\0'; + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " @@ -100,6 +112,7 @@ static int hostapd_config_read_vlan_file(struct hostap vlan->vlan_desc.untagged = vlan_id; vlan->vlan_desc.notempty = !!vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); + os_strlcpy(vlan->bridge, pos2, sizeof(vlan->bridge)); vlan->next = bss->vlan; bss->vlan = vlan; } @@ -111,7 +124,7 @@ static int hostapd_config_read_vlan_file(struct hostap #endif /* CONFIG_NO_VLAN */ -static int hostapd_acl_comp(const void *a, const void *b) +int hostapd_acl_comp(const void *a, const void *b) { const struct mac_acl_entry *aa = a; const struct mac_acl_entry *bb = b; @@ -119,6 +132,44 @@ static int hostapd_acl_comp(const void *a, const void } +int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, + int vlan_id, const u8 *addr) +{ + struct mac_acl_entry *newacl; + + newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); + if (!newacl) { + wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + return -1; + } + + *acl = newacl; + os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); + os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); + (*acl)[*num].vlan_id.untagged = vlan_id; + (*acl)[*num].vlan_id.notempty = !!vlan_id; + (*num)++; + + return 0; +} + + +void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, + const u8 *addr) +{ + int i = 0; + + while (i < *num) { + if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { + os_remove_in_array(*acl, *num, sizeof(**acl), i); + (*num)--; + } else { + i++; + } + } +} + + static int hostapd_config_read_maclist(const char *fname, struct mac_acl_entry **acl, int *num) { @@ -126,12 +177,8 @@ static int hostapd_config_read_maclist(const char *fna char buf[128], *pos; int line = 0; u8 addr[ETH_ALEN]; - struct mac_acl_entry *newacl; int vlan_id; - if (!fname) - return 0; - f = fopen(fname, "r"); if (!f) { wpa_printf(MSG_ERROR, "MAC list file '%s' not found.", fname); @@ -139,7 +186,7 @@ static int hostapd_config_read_maclist(const char *fna } while (fgets(buf, sizeof(buf), f)) { - int i, rem = 0; + int rem = 0; line++; @@ -169,16 +216,7 @@ static int hostapd_config_read_maclist(const char *fna } if (rem) { - i = 0; - while (i < *num) { - if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == - 0) { - os_remove_in_array(*acl, *num, - sizeof(**acl), i); - (*num)--; - } else - i++; - } + hostapd_remove_acl_mac(acl, num, addr); continue; } vlan_id = 0; @@ -190,31 +228,78 @@ static int hostapd_config_read_maclist(const char *fna if (*pos != '\0') vlan_id = atoi(pos); - newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); - if (newacl == NULL) { - wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + if (hostapd_add_acl_maclist(acl, num, vlan_id, addr) < 0) { fclose(f); return -1; } - - *acl = newacl; - os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); - os_memset(&(*acl)[*num].vlan_id, 0, - sizeof((*acl)[*num].vlan_id)); - (*acl)[*num].vlan_id.untagged = vlan_id; - (*acl)[*num].vlan_id.notempty = !!vlan_id; - (*num)++; } fclose(f); - qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); + if (*acl) + qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); return 0; } #ifdef EAP_SERVER + +static int hostapd_config_eap_user_salted(struct hostapd_eap_user *user, + const char *hash, size_t len, + char **pos, int line, + const char *fname) +{ + char *pos2 = *pos; + + while (*pos2 != '\0' && *pos2 != ' ' && *pos2 != '\t' && *pos2 != '#') + pos2++; + + if (pos2 - *pos < (int) (2 * (len + 1))) { /* at least 1 byte of salt */ + wpa_printf(MSG_ERROR, + "Invalid salted %s hash on line %d in '%s'", + hash, line, fname); + return -1; + } + + user->password = os_malloc(len); + if (!user->password) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->password, len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salted password on line %d in '%s'", + line, fname); + return -1; + } + user->password_len = len; + *pos += 2 * len; + + user->salt_len = (pos2 - *pos) / 2; + user->salt = os_malloc(user->salt_len); + if (!user->salt) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->salt, user->salt_len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salt for password on line %d in '%s'", + line, fname); + return -1; + } + + *pos = pos2; + return 0; +} + + static int hostapd_config_read_eap_user(const char *fname, struct hostapd_bss_config *conf) { @@ -223,9 +308,6 @@ static int hostapd_config_read_eap_user(const char *fn int line = 0, ret = 0, num_methods; struct hostapd_eap_user *user = NULL, *tail = NULL, *new_user = NULL; - if (!fname) - return 0; - if (os_strncmp(fname, "sqlite:", 7) == 0) { #ifdef CONFIG_SQLITE os_free(conf->eap_user_sqlite); @@ -312,13 +394,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->identity = os_malloc(pos - start); + user->identity = os_memdup(start, pos - start); if (user->identity == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP identity"); goto failed; } - os_memcpy(user->identity, start, pos - start); user->identity_len = pos - start; if (pos[0] == '"' && pos[1] == '*') { @@ -436,13 +517,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->password = os_malloc(pos - start); + user->password = os_memdup(start, pos - start); if (user->password == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP password"); goto failed; } - os_memcpy(user->password, start, pos - start); user->password_len = pos - start; pos++; @@ -471,6 +551,24 @@ static int hostapd_config_read_eap_user(const char *fn user->password_len = 16; user->password_hash = 1; pos = pos2; + } else if (os_strncmp(pos, "ssha1:", 6) == 0) { + pos += 6; + if (hostapd_config_eap_user_salted(user, "sha1", 20, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha256:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha256", 32, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha512:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha512", 64, + &pos, + line, fname) < 0) + goto failed; } else { pos2 = pos; while (*pos2 != '\0' && *pos2 != ' ' && @@ -522,19 +620,15 @@ static int hostapd_config_read_eap_user(const char *fn fclose(f); if (ret == 0) { - user = conf->eap_user; - while (user) { - struct hostapd_eap_user *prev; - - prev = user; - user = user->next; - hostapd_config_free_eap_user(prev); - } + hostapd_config_free_eap_users(conf->eap_user); conf->eap_user = new_user; + } else { + hostapd_config_free_eap_users(new_user); } return ret; } + #endif /* EAP_SERVER */ @@ -684,12 +778,16 @@ static int hostapd_config_parse_key_mgmt(int line, con val |= WPA_KEY_MGMT_PSK; else if (os_strcmp(start, "WPA-EAP") == 0) val |= WPA_KEY_MGMT_IEEE8021X; -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP else if (os_strcmp(start, "FT-PSK") == 0) val |= WPA_KEY_MGMT_FT_PSK; else if (os_strcmp(start, "FT-EAP") == 0) val |= WPA_KEY_MGMT_FT_IEEE8021X; -#endif /* CONFIG_IEEE80211R */ +#ifdef CONFIG_SHA384 + else if (os_strcmp(start, "FT-EAP-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_IEEE8021X_SHA384; +#endif /* CONFIG_SHA384 */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211W else if (os_strcmp(start, "WPA-PSK-SHA256") == 0) val |= WPA_KEY_MGMT_PSK_SHA256; @@ -710,6 +808,30 @@ static int hostapd_config_parse_key_mgmt(int line, con else if (os_strcmp(start, "WPA-EAP-SUITE-B-192") == 0) val |= WPA_KEY_MGMT_IEEE8021X_SUITE_B_192; #endif /* CONFIG_SUITEB192 */ +#ifdef CONFIG_FILS + else if (os_strcmp(start, "FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FILS_SHA256; + else if (os_strcmp(start, "FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FILS_SHA384; +#ifdef CONFIG_IEEE80211R_AP + else if (os_strcmp(start, "FT-FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA256; + else if (os_strcmp(start, "FT-FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA384; +#endif /* CONFIG_IEEE80211R_AP */ +#endif /* CONFIG_FILS */ +#ifdef CONFIG_OWE + else if (os_strcmp(start, "OWE") == 0) + val |= WPA_KEY_MGMT_OWE; +#endif /* CONFIG_OWE */ +#ifdef CONFIG_DPP + else if (os_strcmp(start, "DPP") == 0) + val |= WPA_KEY_MGMT_DPP; +#endif /* CONFIG_DPP */ +#ifdef CONFIG_HS20 + else if (os_strcmp(start, "OSEN") == 0) + val |= WPA_KEY_MGMT_OSEN; +#endif /* CONFIG_HS20 */ else { wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'", line, start); @@ -755,17 +877,34 @@ static int hostapd_config_read_wep(struct hostapd_wep_ { size_t len = os_strlen(val); - if (keyidx < 0 || keyidx > 3 || wep->key[keyidx] != NULL) + if (keyidx < 0 || keyidx > 3) return -1; + if (len == 0) { + int i, set = 0; + + bin_clear_free(wep->key[keyidx], wep->len[keyidx]); + wep->key[keyidx] = NULL; + wep->len[keyidx] = 0; + for (i = 0; i < NUM_WEP_KEYS; i++) { + if (wep->key[i]) + set++; + } + if (!set) + wep->keys_set = 0; + return 0; + } + + if (wep->key[keyidx] != NULL) + return -1; + if (val[0] == '"') { if (len < 2 || val[len - 1] != '"') return -1; len -= 2; - wep->key[keyidx] = os_malloc(len); + wep->key[keyidx] = os_memdup(val + 1, len); if (wep->key[keyidx] == NULL) return -1; - os_memcpy(wep->key[keyidx], val + 1, len); wep->len[keyidx] = len; } else { if (len & 1) @@ -978,7 +1117,27 @@ static int hostapd_config_tx_queue(struct hostapd_conf } -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP + +static int rkh_derive_key(const char *pos, u8 *key, size_t key_len) +{ + u8 oldkey[16]; + int ret; + + if (!hexstr2bin(pos, key, key_len)) + return 0; + + /* Try to use old short key for backwards compatibility */ + if (hexstr2bin(pos, oldkey, sizeof(oldkey))) + return -1; + + ret = hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, + key, key_len); + os_memset(oldkey, 0, sizeof(oldkey)); + return ret; +} + + static int add_r0kh(struct hostapd_bss_config *bss, char *value) { struct ft_remote_r0kh *r0kh; @@ -1012,7 +1171,7 @@ static int add_r0kh(struct hostapd_bss_config *bss, ch os_memcpy(r0kh->id, pos, r0kh->id_len); pos = next; - if (hexstr2bin(pos, r0kh->key, sizeof(r0kh->key))) { + if (rkh_derive_key(pos, r0kh->key, sizeof(r0kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R0KH key: '%s'", pos); os_free(r0kh); return -1; @@ -1057,7 +1216,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch } pos = next; - if (hexstr2bin(pos, r1kh->key, sizeof(r1kh->key))) { + if (rkh_derive_key(pos, r1kh->key, sizeof(r1kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R1KH key: '%s'", pos); os_free(r1kh); return -1; @@ -1068,7 +1227,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch return 0; } -#endif /* CONFIG_IEEE80211R */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211N @@ -1085,6 +1244,12 @@ static int hostapd_config_ht_capab(struct hostapd_conf conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; conf->secondary_channel = 1; } + if (os_strstr(capab, "[HT40+]") && os_strstr(capab, "[HT40-]")) { + conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; + conf->ht40_plus_minus_allowed = 1; + } + if (!os_strstr(capab, "[HT40+]") && !os_strstr(capab, "[HT40-]")) + conf->secondary_channel = 0; if (os_strstr(capab, "[SMPS-STATIC]")) { conf->ht_capab &= ~HT_CAP_INFO_SMPS_MASK; conf->ht_capab |= HT_CAP_INFO_SMPS_STATIC; @@ -1214,6 +1379,30 @@ static int hostapd_config_vht_capab(struct hostapd_con #endif /* CONFIG_IEEE80211AC */ +#ifdef CONFIG_IEEE80211AX + +static u8 find_bit_offset(u8 val) +{ + u8 res = 0; + + for (; val; val >>= 1) { + if (val & 1) + break; + res++; + } + + return res; +} + + +static u8 set_he_cap(int val, u8 mask) +{ + return (u8) (mask & (val << find_bit_offset(mask))); +} + +#endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_INTERWORKING static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, int line) @@ -1307,6 +1496,44 @@ static int parse_venue_name(struct hostapd_bss_config } +static int parse_venue_url(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char *sep; + size_t nlen; + struct hostapd_venue_url *url; + int ret = -1; + + sep = os_strchr(pos, ':'); + if (!sep) + goto fail; + *sep++ = '\0'; + + nlen = os_strlen(sep); + if (nlen > 254) + goto fail; + + url = os_realloc_array(bss->venue_url, bss->venue_url_count + 1, + sizeof(struct hostapd_venue_url)); + if (!url) + goto fail; + + bss->venue_url = url; + url = &bss->venue_url[bss->venue_url_count++]; + + url->venue_number = atoi(pos); + url->url_len = nlen; + os_memcpy(url->url, sep, nlen); + + ret = 0; +fail: + if (ret) + wpa_printf(MSG_ERROR, "Line %d: Invalid venue_url '%s'", + line, pos); + return ret; +} + + static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, int line) { @@ -1857,6 +2084,24 @@ static int hs20_parse_osu_nai(struct hostapd_bss_confi } +static int hs20_parse_osu_nai2(struct hostapd_bss_config *bss, + char *pos, int line) +{ + if (bss->last_osu == NULL) { + wpa_printf(MSG_ERROR, "Line %d: Unexpected OSU field", line); + return -1; + } + + os_free(bss->last_osu->osu_nai2); + bss->last_osu->osu_nai2 = os_strdup(pos); + if (bss->last_osu->osu_nai2 == NULL) + return -1; + bss->hs20_osu_providers_nai_count++; + + return 0; +} + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Wed May 1 01:49:34 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F8C15A3FCE; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC5E70BC2; Wed, 1 May 2019 01:49:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB8AD1A6F2; Wed, 1 May 2019 01:49:33 +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 x411nXQi042238; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411nXfu042237; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010149.x411nXfu042237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EC5E70BC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:49:34 -0000 Author: cy Date: Wed May 1 01:49:33 2019 New Revision: 346982 URL: https://svnweb.freebsd.org/changeset/base/346982 Log: MFC r346804: Left justify a function header brace as it should be. No functional change. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:43:17 2019 (r346981) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:49:33 2019 (r346982) @@ -1181,7 +1181,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-stable-12@freebsd.org Wed May 1 01:53:53 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113C515803D2; Wed, 1 May 2019 01:53:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B896E712D5; Wed, 1 May 2019 01:53:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFC621A896; Wed, 1 May 2019 01:53:51 +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 x411rp7G047577; Wed, 1 May 2019 01:53:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411rafT047563; Wed, 1 May 2019 01:53:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010153.x411rafT047563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346983 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Commit-Revision: 346983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B896E712D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:53:53 -0000 Author: cy Date: Wed May 1 01:53:19 2019 New Revision: 346983 URL: https://svnweb.freebsd.org/changeset/base/346983 Log: MFC r346459: MFV r346450: Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200) Modified: stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/sqlite3/configure ============================================================================== --- stable/12/contrib/sqlite3/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.27.1' + VERSION='3.27.2' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/12/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/12/contrib/sqlite3/sqlite3.c Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/sqlite3.c Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.1. By combining all the individual C code files into this +** version 3.27.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -3408,7 +3408,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database @@ -14937,57 +14937,56 @@ typedef struct VdbeOpList VdbeOpList; #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */ #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */ #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */ -#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */ -#define OP_Delete 124 -#define OP_ResetCount 125 -#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ -#define OP_SorterData 127 /* synopsis: r[P2]=data */ -#define OP_RowData 128 /* synopsis: r[P2]=data */ -#define OP_Rowid 129 /* synopsis: r[P2]=rowid */ -#define OP_NullRow 130 -#define OP_SeekEnd 131 -#define OP_SorterInsert 132 /* synopsis: key=r[P2] */ -#define OP_IdxInsert 133 /* synopsis: key=r[P2] */ -#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */ -#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */ -#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */ -#define OP_Destroy 137 -#define OP_Clear 138 -#define OP_ResetSorter 139 -#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_Delete 123 +#define OP_ResetCount 124 +#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ +#define OP_SorterData 126 /* synopsis: r[P2]=data */ +#define OP_RowData 127 /* synopsis: r[P2]=data */ +#define OP_Rowid 128 /* synopsis: r[P2]=rowid */ +#define OP_NullRow 129 +#define OP_SeekEnd 130 +#define OP_SorterInsert 131 /* synopsis: key=r[P2] */ +#define OP_IdxInsert 132 /* synopsis: key=r[P2] */ +#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */ +#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */ +#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */ +#define OP_Destroy 136 +#define OP_Clear 137 +#define OP_ResetSorter 138 +#define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_SqlExec 140 #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ -#define OP_SqlExec 142 -#define OP_ParseSchema 143 -#define OP_LoadAnalysis 144 -#define OP_DropTable 145 -#define OP_DropIndex 146 -#define OP_DropTrigger 147 -#define OP_IntegrityCk 148 -#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */ -#define OP_Param 150 -#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */ -#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */ -#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ -#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ -#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */ -#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */ -#define OP_Expire 159 -#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */ -#define OP_VBegin 161 -#define OP_VCreate 162 -#define OP_VDestroy 163 -#define OP_VOpen 164 -#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */ -#define OP_VRename 166 -#define OP_Pagecount 167 -#define OP_MaxPgcnt 168 -#define OP_Trace 169 -#define OP_CursorHint 170 -#define OP_Noop 171 -#define OP_Explain 172 -#define OP_Abortable 173 +#define OP_ParseSchema 142 +#define OP_LoadAnalysis 143 +#define OP_DropTable 144 +#define OP_DropIndex 145 +#define OP_DropTrigger 146 +#define OP_IntegrityCk 147 +#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */ +#define OP_Param 149 +#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */ +#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */ +#define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ +#define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ +#define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */ +#define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */ +#define OP_Expire 158 +#define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */ +#define OP_VBegin 160 +#define OP_VCreate 161 +#define OP_VDestroy 162 +#define OP_VOpen 163 +#define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */ +#define OP_VRename 165 +#define OP_Pagecount 166 +#define OP_MaxPgcnt 167 +#define OP_Trace 168 +#define OP_CursorHint 169 +#define OP_Noop 170 +#define OP_Explain 171 +#define OP_Abortable 172 /* Properties such as "out2" or "jump" that are specified in ** comments following the "case" for each opcode in the vdbe.c @@ -15016,12 +15015,12 @@ typedef struct VdbeOpList VdbeOpList; /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\ -/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ -/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\ -/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\ -/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,} +/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\ +/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\ +/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\ +/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ +/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\ +/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,} /* The sqlite3P2Values() routine is able to run faster if it knows ** the value of the largest JUMP opcode. The smaller the maximum @@ -19174,7 +19173,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, S SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *); SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...); SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int); -SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int); +SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*); SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*); SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p); @@ -32139,57 +32138,56 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"), /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), - /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), - /* 124 */ "Delete" OpHelp(""), - /* 125 */ "ResetCount" OpHelp(""), - /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), - /* 127 */ "SorterData" OpHelp("r[P2]=data"), - /* 128 */ "RowData" OpHelp("r[P2]=data"), - /* 129 */ "Rowid" OpHelp("r[P2]=rowid"), - /* 130 */ "NullRow" OpHelp(""), - /* 131 */ "SeekEnd" OpHelp(""), - /* 132 */ "SorterInsert" OpHelp("key=r[P2]"), - /* 133 */ "IdxInsert" OpHelp("key=r[P2]"), - /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"), - /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), - /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"), - /* 137 */ "Destroy" OpHelp(""), - /* 138 */ "Clear" OpHelp(""), - /* 139 */ "ResetSorter" OpHelp(""), - /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 123 */ "Delete" OpHelp(""), + /* 124 */ "ResetCount" OpHelp(""), + /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), + /* 126 */ "SorterData" OpHelp("r[P2]=data"), + /* 127 */ "RowData" OpHelp("r[P2]=data"), + /* 128 */ "Rowid" OpHelp("r[P2]=rowid"), + /* 129 */ "NullRow" OpHelp(""), + /* 130 */ "SeekEnd" OpHelp(""), + /* 131 */ "SorterInsert" OpHelp("key=r[P2]"), + /* 132 */ "IdxInsert" OpHelp("key=r[P2]"), + /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"), + /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), + /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"), + /* 136 */ "Destroy" OpHelp(""), + /* 137 */ "Clear" OpHelp(""), + /* 138 */ "ResetSorter" OpHelp(""), + /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 140 */ "SqlExec" OpHelp(""), /* 141 */ "Real" OpHelp("r[P2]=P4"), - /* 142 */ "SqlExec" OpHelp(""), - /* 143 */ "ParseSchema" OpHelp(""), - /* 144 */ "LoadAnalysis" OpHelp(""), - /* 145 */ "DropTable" OpHelp(""), - /* 146 */ "DropIndex" OpHelp(""), - /* 147 */ "DropTrigger" OpHelp(""), - /* 148 */ "IntegrityCk" OpHelp(""), - /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), - /* 150 */ "Param" OpHelp(""), - /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), - /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), - /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), - /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), - /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"), - /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), - /* 159 */ "Expire" OpHelp(""), - /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), - /* 161 */ "VBegin" OpHelp(""), - /* 162 */ "VCreate" OpHelp(""), - /* 163 */ "VDestroy" OpHelp(""), - /* 164 */ "VOpen" OpHelp(""), - /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), - /* 166 */ "VRename" OpHelp(""), - /* 167 */ "Pagecount" OpHelp(""), - /* 168 */ "MaxPgcnt" OpHelp(""), - /* 169 */ "Trace" OpHelp(""), - /* 170 */ "CursorHint" OpHelp(""), - /* 171 */ "Noop" OpHelp(""), - /* 172 */ "Explain" OpHelp(""), - /* 173 */ "Abortable" OpHelp(""), + /* 142 */ "ParseSchema" OpHelp(""), + /* 143 */ "LoadAnalysis" OpHelp(""), + /* 144 */ "DropTable" OpHelp(""), + /* 145 */ "DropIndex" OpHelp(""), + /* 146 */ "DropTrigger" OpHelp(""), + /* 147 */ "IntegrityCk" OpHelp(""), + /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), + /* 149 */ "Param" OpHelp(""), + /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), + /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), + /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), + /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), + /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"), + /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), + /* 158 */ "Expire" OpHelp(""), + /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), + /* 160 */ "VBegin" OpHelp(""), + /* 161 */ "VCreate" OpHelp(""), + /* 162 */ "VDestroy" OpHelp(""), + /* 163 */ "VOpen" OpHelp(""), + /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), + /* 165 */ "VRename" OpHelp(""), + /* 166 */ "Pagecount" OpHelp(""), + /* 167 */ "MaxPgcnt" OpHelp(""), + /* 168 */ "Trace" OpHelp(""), + /* 169 */ "CursorHint" OpHelp(""), + /* 170 */ "Noop" OpHelp(""), + /* 171 */ "Explain" OpHelp(""), + /* 172 */ "Abortable" OpHelp(""), }; return azName[i]; } @@ -87935,14 +87933,7 @@ case OP_NewRowid: { /* out2 */ ** This instruction only works on tables. The equivalent instruction ** for indices is OP_IdxInsert. */ -/* Opcode: InsertInt P1 P2 P3 P4 P5 -** Synopsis: intkey=P3 data=r[P2] -** -** This works exactly like OP_Insert except that the key is the -** integer value P3, not the value of the integer stored in register P3. -*/ -case OP_Insert: -case OP_InsertInt: { +case OP_Insert: { Mem *pData; /* MEM cell holding data for the record to be inserted */ Mem *pKey; /* MEM cell holding key for the record */ VdbeCursor *pC; /* Cursor to table into which insert is written */ @@ -87963,16 +87954,11 @@ case OP_InsertInt: { REGISTER_TRACE(pOp->p2, pData); sqlite3VdbeIncrWriteCounter(p, pC); - if( pOp->opcode==OP_Insert ){ - pKey = &aMem[pOp->p3]; - assert( pKey->flags & MEM_Int ); - assert( memIsValid(pKey) ); - REGISTER_TRACE(pOp->p3, pKey); - x.nKey = pKey->u.i; - }else{ - assert( pOp->opcode==OP_InsertInt ); - x.nKey = pOp->p3; - } + pKey = &aMem[pOp->p3]; + assert( pKey->flags & MEM_Int ); + assert( memIsValid(pKey) ); + REGISTER_TRACE(pOp->p3, pKey); + x.nKey = pKey->u.i; if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ assert( pC->iDb>=0 ); @@ -96131,7 +96117,39 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy( return 0; } +#ifndef SQLITE_OMIT_WINDOWFUNC /* +** Walker callback for resolveRemoveWindows(). +*/ +static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){ + if( ExprHasProperty(pExpr, EP_WinFunc) ){ + Window **pp; + for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ + if( *pp==pExpr->y.pWin ){ + *pp = (*pp)->pNextWin; + break; + } + } + } + return WRC_Continue; +} + +/* +** Remove any Window objects owned by the expression pExpr from the +** Select.pWin list of Select object pSelect. +*/ +static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){ + Walker sWalker; + memset(&sWalker, 0, sizeof(Walker)); + sWalker.xExprCallback = resolveRemoveWindowsCb; + sWalker.u.pSelect = pSelect; + sqlite3WalkExpr(&sWalker, pExpr); +} +#else +# define resolveRemoveWindows(x,y) +#endif + +/* ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect. ** The Name context of the SELECT statement is pNC. zType is either ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is. @@ -96197,19 +96215,10 @@ static int resolveOrderGroupBy( } for(j=0; jpEList->nExpr; j++){ if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ -#ifndef SQLITE_OMIT_WINDOWFUNC - if( ExprHasProperty(pE, EP_WinFunc) ){ - /* Since this window function is being changed into a reference - ** to the same window function the result set, remove the instance - ** of this window function from the Select.pWin list. */ - Window **pp; - for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ - if( *pp==pE->y.pWin ){ - *pp = (*pp)->pNextWin; - } - } - } -#endif + /* Since this expresion is being changed into a reference + ** to an identical expression in the result set, remove all Window + ** objects belonging to the expression from the Select.pWin list. */ + resolveRemoveWindows(pSelect, pE); pItem->u.x.iOrderByCol = j+1; } } @@ -99181,14 +99190,11 @@ SQLITE_PRIVATE int sqlite3FindInIndex( eType = IN_INDEX_EPH; if( inFlags & IN_INDEX_LOOP ){ pParse->nQueryLoop = 0; - if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){ - eType = IN_INDEX_ROWID; - } }else if( prRhsHasNull ){ *prRhsHasNull = rMayHaveNull = ++pParse->nMem; } assert( pX->op==TK_IN ); - sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID); + sqlite3CodeRhsOfIN(pParse, pX, iTab); if( rMayHaveNull ){ sqlite3SetHasNullFlag(v, iTab, rMayHaveNull); } @@ -99289,12 +99295,6 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars ** however the cursor number returned might not be the same, as it might ** have been duplicated using OP_OpenDup. ** -** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed -** to be a non-null integer. In this case, the ephemeral table can be an -** table B-Tree that keyed by only integers. The more general cases uses -** an index B-Tree which can have arbitrary keys, but is slower to both -** read and write. -** ** If the LHS expression ("x" in the examples) is a column value, or ** the SELECT statement returns a column value, then the affinity of that ** column is used to build the index keys. If both 'x' and the @@ -99306,8 +99306,7 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars SQLITE_PRIVATE void sqlite3CodeRhsOfIN( Parse *pParse, /* Parsing context */ Expr *pExpr, /* The IN operator */ - int iTab, /* Use this cursor number */ - int isRowid /* If true, LHS is a rowid */ + int iTab /* Use this cursor number */ ){ int addrOnce = 0; /* Address of the OP_Once instruction at top */ int addr; /* Address of OP_OpenEphemeral instruction */ @@ -99360,14 +99359,12 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Check to see if this is a vector IN operator */ pLeft = pExpr->pLeft; nVal = sqlite3ExprVectorSize(pLeft); - assert( !isRowid || nVal==1 ); /* Construct the ephemeral table that will contain the content of ** RHS of the IN operator. */ pExpr->iTable = iTab; - addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, - pExpr->iTable, (isRowid?0:nVal)); + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal); #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS if( ExprHasProperty(pExpr, EP_xIsSelect) ){ VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId)); @@ -99375,7 +99372,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( VdbeComment((v, "RHS of IN operator")); } #endif - pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); + pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1); if( ExprHasProperty(pExpr, EP_xIsSelect) ){ /* Case 1: expr IN (SELECT ...) @@ -99389,7 +99386,6 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d", addrOnce?"":"CORRELATED ", pSelect->selId )); - assert( !isRowid ); /* If the LHS and RHS of the IN operator do not match, that ** error will have been caught long before we reach this point. */ if( ALWAYS(pEList->nExpr==nVal) ){ @@ -99442,10 +99438,8 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Loop through each expression in . */ r1 = sqlite3GetTempReg(pParse); r2 = sqlite3GetTempReg(pParse); - if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC); for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ Expr *pE2 = pItem->pExpr; - int iValToIns; /* If the expression is not constant then we will need to ** disable the test that was generated above that makes sure @@ -99458,20 +99452,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( } /* Evaluate the expression and insert it into the temp table */ - if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ - sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns); - }else{ - r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); - if( isRowid ){ - sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, - sqlite3VdbeCurrentAddr(v)+2); - VdbeCoverage(v); - sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3); - }else{ - sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); - sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); - } - } + r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); + sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); + sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); } sqlite3ReleaseTempReg(pParse, r1); sqlite3ReleaseTempReg(pParse, r2); @@ -118107,10 +118090,13 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion( pik_flags |= (update_flags & OPFLAG_SAVEPOSITION); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( update_flags==0 ){ - sqlite3VdbeAddOp4(v, OP_InsertInt, - iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE + int r = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Integer, 0, r); + sqlite3VdbeAddOp4(v, OP_Insert, + iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE ); sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP); + sqlite3ReleaseTempReg(pParse, r); } #endif } @@ -136427,7 +136413,6 @@ static int codeEqualityTerm( if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iReg + i - iEq; if( eType==IN_INDEX_ROWID ){ - testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; @@ -137189,6 +137174,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg); VdbeCoverage(v); pLevel->op = OP_Noop; + if( (pTerm->prereqAll & pLevel->notReady)==0 ){ + pTerm->wtFlags |= TERM_CODED; + } }else if( (pLoop->wsFlags & WHERE_IPK)!=0 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 ){ @@ -217076,7 +217064,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT); } /* @@ -221840,9 +221828,9 @@ SQLITE_API int sqlite3_stmt_init( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ /************** End of stmt.c ************************************************/ -#if __LINE__!=221843 +#if __LINE__!=221831 #undef SQLITE_SOURCE_ID -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2" +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2" #endif /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } Modified: stable/12/contrib/sqlite3/sqlite3.h ============================================================================== --- stable/12/contrib/sqlite3/sqlite3.h Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/sqlite3.h Wed May 1 01:53:19 2019 (r346983) @@ -123,9 +123,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -2369,7 +2369,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database Modified: stable/12/contrib/sqlite3/tea/configure ============================================================================== --- stable/12/contrib/sqlite3/tea/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/tea/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1365,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1467,7 +1467,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9426,7 +9426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/tea/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/tea/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/tea/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([sqlite], [3.27.1]) +AC_INIT([sqlite], [3.27.2]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From owner-svn-src-stable-12@freebsd.org Wed May 1 07:00:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5B8158D634; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3278E84B; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 755FB1DC62; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4170vYb006512; Wed, 1 May 2019 07:00:57 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4170vgJ006511; Wed, 1 May 2019 07:00:57 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201905010700.x4170vgJ006511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 1 May 2019 07:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346986 - stable/12/contrib/tcpdump X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/contrib/tcpdump X-SVN-Commit-Revision: 346986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A3278E84B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.74)[-0.742,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:00:58 -0000 Author: oshogbo Date: Wed May 1 07:00:56 2019 New Revision: 346986 URL: https://svnweb.freebsd.org/changeset/base/346986 Log: MFC r346263: tcpdump: disable Capsicum if -E option is provided. The -E is used to provide a secret for decrypting IPsec. The secret may be provided through command line or as the file. The problem is that tcpdump doesn't support yet opening files in capability mode and the file may contain a list of the files to open. As a workaround, for now, let's just disable capsicum if the -E the option is provided. PR: 236819 Modified: stable/12/contrib/tcpdump/tcpdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/12/contrib/tcpdump/tcpdump.c Wed May 1 06:59:04 2019 (r346985) +++ stable/12/contrib/tcpdump/tcpdump.c Wed May 1 07:00:56 2019 (r346986) @@ -2063,7 +2063,8 @@ main(int argc, char **argv) } #ifdef HAVE_CAPSICUM - cansandbox = (VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL && + ndo->ndo_espsecret == NULL); #ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else From owner-svn-src-stable-12@freebsd.org Wed May 1 09:04:15 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FBD7158525E; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A0906CD0C; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 078561F252; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4194FWr072045; Wed, 1 May 2019 09:04:15 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4194EJH072042; Wed, 1 May 2019 09:04:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905010904.x4194EJH072042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 1 May 2019 09:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346987 - in stable/12: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Commit-Revision: 346987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A0906CD0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 09:04:15 -0000 Author: ae Date: Wed May 1 09:04:14 2019 New Revision: 346987 URL: https://svnweb.freebsd.org/changeset/base/346987 Log: MFC r345797: Add IPv6 transport for bsnmp. This patch adds a new table begemotSnmpdTransInetTable that uses the InetAddressType textual convention and can be used to create listening ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports future extension beyond UDP by adding a protocol identifier to the table index. In order to support this gensnmptree had to be modified. Submitted by: harti Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16654 Added: stable/12/contrib/bsnmp/snmpd/trans_inet.c - copied unchanged from r345797, head/contrib/bsnmp/snmpd/trans_inet.c stable/12/contrib/bsnmp/snmpd/trans_inet.h - copied unchanged from r345797, head/contrib/bsnmp/snmpd/trans_inet.h Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c stable/12/contrib/bsnmp/lib/snmpclient.c stable/12/contrib/bsnmp/lib/snmpclient.h stable/12/contrib/bsnmp/lib/tc.def stable/12/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt stable/12/contrib/bsnmp/snmpd/main.c stable/12/contrib/bsnmp/snmpd/snmpd.config stable/12/contrib/bsnmp/snmpd/snmpd.h stable/12/contrib/bsnmp/snmpd/snmpmod.h stable/12/contrib/bsnmp/snmpd/trans_lsock.c stable/12/contrib/bsnmp/snmpd/trans_udp.c stable/12/contrib/bsnmp/snmpd/tree.def stable/12/lib/libbsnmp/libbsnmp/Makefile stable/12/usr.sbin/bsnmpd/bsnmpd/Makefile stable/12/usr.sbin/bsnmpd/bsnmpd/snmpd.config Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 Wed May 1 09:04:14 2019 (r346987) @@ -31,7 +31,7 @@ .\" .\" $Begemot: gensnmptree.1 383 2006-05-30 07:40:49Z brandt_h $ .\" -.Dd June 29, 2018 +.Dd April 2, 2019 .Dt GENSNMPTREE 1 .Os .Sh NAME @@ -100,25 +100,11 @@ is the length of the OID. is the last component of the OID. .El .It Fl F -Together with -.Fl E -causes -.Nm -instead of the generation of enum definitions the generation of -functions for checking a value to be one of the enumeration variants and -for conversion between strings and the enum. The file is sent to standard -output and is meant to be included into a C-file for compilation. +emit definitions for C-functions includeable in a C-file that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl f -This flag can be used together with -.Fl E -or when generating the tree files. It causes -.Nm -to emit static inline functions for checking a value to be one of the -enumeration values and for conversion between strings and the enum. -If used when generating the tree files, the preprocessor symbol -.Ar SNMPTREE_TYPES -must be defined when including the tree header file for these definitions -to become visible. +emit definitions for inline C-functions that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl h Print a short help page. .It Fl I Ar directory @@ -136,36 +122,6 @@ Instead of normal output print the resulting tree. Prefix the file names and the table name with .Ar prefix . .El -.Pp -The following functions are generated by -.Fl f -or -.Fl F : -.Pp -.Ft static inline int -.Fn isok_EnumName "enum EnumName" ; -.Pp -.Ft static inline const char * -.Fn tostr_EnumName "enum EnumName" ; -.Pp -.Ft static inline int -.Fn fromstr_EnumName "const char *" "enum EnumName *" ; -.Pp -The -.Fa EnumName -is replaced with the enumeration name. -.Fn isok_EnumName -returns 1 if the argument is one of the valid enum values and 0 otherwise. -.Fn tostr_EnumName -returns a string representation of the enumeration value. -If the values is not one of the legal values -.Ar EnumName??? -is returned. -.Fn fromstr_EnumName -returns 1 if the string represents one of the legal enumeration values and -0 otherwise. -If 1 is return the variable pointed to by the second argument is set to -the enumeration value. .Sh MIBS The syntax of the MIB description file can formally be specified as follows: .Bd -unfilled -offset indent Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 1 09:04:14 2019 (r346987) @@ -110,7 +110,6 @@ static int debug; static const char usgtxt[] = "\ Generate SNMP tables.\n\ -$Id$\n\ usage: gensnmptree [-dEeFfhlt] [-I directory] [-i infile] [-p prefix]\n\ [name]...\n\ options:\n\ @@ -127,6 +126,37 @@ options:\n\ -t generate a .def file\n\ "; +/** + * Program operation. + */ +enum op { + /** generate the tree */ + OP_GEN, + + /** extract OIDs */ + OP_EXTRACT, + + /** print the parsed tree */ + OP_TREE, + + /** extract enums */ + OP_ENUMS, +}; + +/** + * Which functions to create. + */ +enum gen_funcs { + /** none */ + GEN_FUNCS_NONE, + + /** functions for header files */ + GEN_FUNCS_H, + + /** functions for C files */ + GEN_FUNCS_C, +}; + /* * A node in the OID tree */ @@ -162,15 +192,18 @@ struct node { uint32_t index; /* index for table entry */ char *func; /* function for tables */ struct node_list subs; + char *subtypes[SNMP_INDEXES_MAX]; } entry; struct leaf { enum snmp_syntax syntax; /* syntax for this leaf */ char *func; /* function name */ + char *subtype; /* subtype */ } leaf; struct column { enum snmp_syntax syntax; /* syntax for this column */ + char *subtype; /* subtype */ } column; } u; }; @@ -214,7 +247,7 @@ xalloc(size_t size) { void *ptr; - if ((ptr = malloc(size)) == NULL) + if ((ptr = calloc(1, size)) == NULL) err(1, "allocing %zu bytes", size); return (ptr); @@ -710,12 +743,14 @@ make_type(const char *s) * token. */ static u_int -parse_type(enum tok *tok, struct type *t, const char *vname) +parse_type(enum tok *tok, struct type *t, const char *vname, char **subtype) { u_int syntax; struct enums *e; syntax = val; + if (subtype != NULL) + *subtype = NULL; if (*tok == TOK_ENUM || *tok == TOK_BITS) { if (t == NULL && vname != NULL) { @@ -759,6 +794,8 @@ parse_type(enum tok *tok, struct type *t, const char * if ((*tok = gettoken()) == '|') { if (gettoken() != TOK_STR) report("subtype expected after '|'"); + if (subtype != NULL) + *subtype = savetok(); *tok = gettoken(); } } @@ -794,18 +831,21 @@ parse(enum tok tok) if ((tok = gettoken()) == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { /* LEAF or COLUM */ - u_int syntax = parse_type(&tok, NULL, node->name); + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, &subtype); if (tok == TOK_STR) { /* LEAF */ node->type = NODE_LEAF; node->u.leaf.func = savetok(); node->u.leaf.syntax = syntax; + node->u.leaf.subtype = subtype; tok = gettoken(); } else { /* COLUMN */ node->type = NODE_COLUMN; node->u.column.syntax = syntax; + node->u.column.subtype = subtype; } while (tok != ')') { @@ -825,9 +865,12 @@ parse(enum tok tok) tok = gettoken(); while (tok == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { - u_int syntax = parse_type(&tok, NULL, node->name); - if (index_count++ == SNMP_INDEXES_MAX) + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, + &subtype); + if (index_count == SNMP_INDEXES_MAX) report("too many table indexes"); + node->u.entry.subtypes[index_count++] = subtype; node->u.entry.index |= syntax << (SNMP_INDEX_SHIFT * index_count); } @@ -882,7 +925,8 @@ parse_top(enum tok tok) tok = gettoken(); t->is_enum = (tok == TOK_ENUM); t->is_bits = (tok == TOK_BITS); - t->syntax = parse_type(&tok, t, NULL); + + t->syntax = parse_type(&tok, t, NULL, NULL); pushback(tok); return (NULL); @@ -903,7 +947,7 @@ parse_top(enum tok tok) * Generate the C-code table part for one node. */ static void -gen_node(FILE *fp, struct node *np, struct asn_oid *oid, u_int idx, +gen_node(FILE *fp, const struct node *np, struct asn_oid *oid, u_int idx, const char *func) { u_int n; @@ -1008,7 +1052,7 @@ gen_node(FILE *fp, struct node *np, struct asn_oid *oi * Generate the header file with the function declarations. */ static void -gen_header(FILE *fp, struct node *np, u_int oidlen, const char *func) +gen_header(FILE *fp, const struct node *np, u_int oidlen, const char *func) { char f[MAXSTR + 4]; struct node *sub; @@ -1058,7 +1102,7 @@ gen_header(FILE *fp, struct node *np, u_int oidlen, co * Generate the OID table. */ static void -gen_table(FILE *fp, struct node *node) +gen_table(FILE *fp, const struct node *node) { struct asn_oid oid; @@ -1067,7 +1111,6 @@ gen_table(FILE *fp, struct node *node) #ifdef HAVE_STDINT_H fprintf(fp, "#include \n"); #endif - fprintf(fp, "#include \n"); if (localincs) { fprintf(fp, "#include \"asn1.h\"\n"); fprintf(fp, "#include \"snmp.h\"\n"); @@ -1118,6 +1161,8 @@ gen_tree(const struct node *np, int level) case NODE_LEAF: print_syntax(np->u.leaf.syntax); + if (np->u.leaf.subtype != NULL) + printf(" | %s", np->u.leaf.subtype); printf(" %s%s%s)\n", np->u.leaf.func, (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); @@ -1137,8 +1182,11 @@ gen_tree(const struct node *np, int level) case NODE_ENTRY: printf(" :"); - for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) + for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) { print_syntax(SNMP_INDEX(np->u.entry.index, i)); + if (np->u.entry.subtypes[i] != NULL) + printf(" | %s", np->u.entry.subtypes[i]); + } printf(" %s\n", np->u.entry.func); TAILQ_FOREACH(sp, &np->u.entry.subs, link) gen_tree(sp, level + 1); @@ -1147,6 +1195,8 @@ gen_tree(const struct node *np, int level) case NODE_COLUMN: print_syntax(np->u.column.syntax); + if (np->u.column.subtype != NULL) + printf(" | %s", np->u.column.subtype); printf("%s%s)\n", (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); break; @@ -1194,15 +1244,6 @@ extract(FILE *fp, const struct node *np, struct asn_oi return (1); } -/** - * Extract the named OID. - * - * \param fp file to extract to - * \param root root of the tree - * \param object name of the object to extract - * - * \return 0 on success, -1 if the object was not found - */ static int gen_extract(FILE *fp, const struct node *root, char *object) { @@ -1391,45 +1432,6 @@ unminus(FILE *fp, const char *s) } /** - * Generate a definition for the enum packed into a guard against multiple - * definitions. - * - * \param fp file to write definition to - * \param t type - */ -static void -gen_enum(FILE *fp, const struct type *t) -{ - const struct enums *e; - long min = LONG_MAX; - - fprintf(fp, "\n"); - fprintf(fp, "#ifndef %s_defined__\n", t->name); - fprintf(fp, "#define %s_defined__\n", t->name); - fprintf(fp, "/*\n"); - fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); - fprintf(fp, " */\n"); - fprintf(fp, "enum %s {\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t%s_", t->name); - unminus(fp, e->name); - fprintf(fp, " = %ld,\n", e->value); - if (e->value < min) - min = e->value; - } - fprintf(fp, "};\n"); - fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); - fprintf(fp, "#define STRING_%s \\\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); - unminus(fp, e->name); - fprintf(fp, "\",\\\n"); - } - fprintf(fp, "\n"); - fprintf(fp, "#endif /* %s_defined__ */\n", t->name); -} - -/** * Generate helper functions for an enum. * * We always generate a switch statement for the isok function. The compiler @@ -1494,6 +1496,54 @@ gen_enum_funcs(FILE *fp, const struct type *t, int cco } /** + * Generate a definition for the enum packed into a guard against multiple + * definitions. + * + * \param fp file to write definition to + * \param t type + * \param dof generate functions too + */ +static void +gen_enum(FILE *fp, const struct type *t, int dof) +{ + const struct enums *e; + long min = LONG_MAX; + + fprintf(fp, "\n"); + fprintf(fp, "#ifndef %s_defined__\n", t->name); + fprintf(fp, "#define %s_defined__\n", t->name); + fprintf(fp, "/*\n"); + fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); + fprintf(fp, " */\n"); + fprintf(fp, "enum %s {\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t%s_", t->name); + unminus(fp, e->name); + fprintf(fp, " = %ld,\n", e->value); + if (e->value < min) + min = e->value; + } + fprintf(fp, "};\n"); + fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); + fprintf(fp, "#define STRING_%s \\\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); + unminus(fp, e->name); + fprintf(fp, "\",\\\n"); + } + fprintf(fp, "\n"); + if (dof) { + fprintf(fp, "#ifdef SNMPENUM_FUNCS\n"); + fprintf(fp, "\n"); + gen_enum_funcs(fp, t, 0); + fprintf(fp, "\n"); + fprintf(fp, "#endif\n"); + fprintf(fp, "\n"); + } + fprintf(fp, "#endif /* %s_defined__ */\n", t->name); +} + +/** * Generate helper functions for an enum. This generates code for a c file. * * \param fp file to write to @@ -1529,6 +1579,16 @@ gen_all_enum_funcs(FILE *fp, int ccode) gen_enum_funcs(fp, t, ccode); } +static void +gen_enums(FILE *fp, int dof) +{ + const struct type *t; + + LIST_FOREACH(t, &types, link) + if (t->is_enum || t->is_bits) + gen_enum(fp, t, dof); +} + /** * Extract a given enum to the specified file and optionally generate static * inline helper functions for them. @@ -1546,9 +1606,7 @@ extract_enum(FILE *fp, const char *name, int gen_funcs LIST_FOREACH(t, &types, link) if ((t->is_enum || t->is_bits) && strcmp(t->name, name) == 0) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); + gen_enum(fp, t, gen_funcs); return (0); } return (-1); @@ -1567,11 +1625,8 @@ extract_all_enums(FILE *fp, int gen_funcs) const struct type *t; LIST_FOREACH(t, &types, link) - if (t->is_enum || t->is_bits) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); - } + if (t->is_enum || t->is_bits) + gen_enum(fp, t, gen_funcs); } /** @@ -1579,13 +1634,12 @@ extract_all_enums(FILE *fp, int gen_funcs) * * \param argc number of arguments * \param argv arguments (enum names) - * \param gen_funcs_h generate functions into the header file - * \param gen_funcs_c generate a .c file with functions + * \param gen_funcs which functions to generate */ static void -make_enums(int argc, char *argv[], int gen_funcs_h, int gen_funcs_c) +make_enums(int argc, char *argv[], enum gen_funcs gen_funcs) { - if (gen_funcs_c) { + if (gen_funcs == GEN_FUNCS_C) { if (argc == 0) gen_all_enum_funcs(stdout, 1); else { @@ -1595,30 +1649,58 @@ make_enums(int argc, char *argv[], int gen_funcs_h, in } } else { if (argc == 0) - extract_all_enums(stdout, gen_funcs_h); + extract_all_enums(stdout, gen_funcs == GEN_FUNCS_H); else { for (int i = 0; i < argc; i++) - if (extract_enum(stdout, argv[i], gen_funcs_h)) + if (extract_enum(stdout, argv[i], + gen_funcs == GEN_FUNCS_H)) errx(1, "enum not found: %s", argv[i]); } } } +/** + * Produce the operation tables for the daemon or a module. + * + * \param root tree root + * \param gen_funcs generate enum funcs + */ +static void +make_table(const struct node *root, int gen_funcs) +{ + FILE *fp; + + char fname[MAXPATHLEN + 1]; + sprintf(fname, "%stree.h", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_header(fp, root, PREFIX_LEN, NULL); + + fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); + gen_enums(fp, gen_funcs); + fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); + + fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); + fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); + + fclose(fp); + + sprintf(fname, "%stree.c", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_table(fp, root); + fclose(fp); +} + int main(int argc, char *argv[]) { - int do_extract = 0; - int do_tree = 0; - int do_enums = 0; - int gen_funcs_h = 0; - int gen_funcs_c = 0; - int opt; - struct node *root; - char fname[MAXPATHLEN + 1]; - int tok; - FILE *fp; + enum op op = OP_GEN; + enum gen_funcs gen_funcs = GEN_FUNCS_NONE; + char *infile = NULL; + int opt; while ((opt = getopt(argc, argv, "dEeFfhI:i:lp:t")) != EOF) switch (opt) { @@ -1627,19 +1709,29 @@ main(int argc, char *argv[]) break; case 'E': - do_enums = 1; + if (op != OP_GEN && op != OP_ENUMS) + errx(1, "-E conflicts with earlier options"); + op = OP_ENUMS; break; case 'e': - do_extract = 1; + if (op != OP_GEN && op != OP_EXTRACT) + errx(1, "-e conflicts with earlier options"); + op = OP_EXTRACT; break; case 'F': - gen_funcs_c = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_C) + errx(1, "-F conflicts with -f"); + gen_funcs = GEN_FUNCS_C; break; case 'f': - gen_funcs_h = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_H) + errx(1, "-f conflicts with -F"); + gen_funcs = GEN_FUNCS_H; break; case 'h': @@ -1666,75 +1758,61 @@ main(int argc, char *argv[]) break; case 't': - do_tree = 1; + if (op != OP_GEN && op != OP_TREE) + errx(1, "-t conflicts with earlier options"); + op = OP_TREE; break; } - if (do_extract + do_tree + do_enums > 1) - errx(1, "conflicting options -e/-t/-E"); - if (!do_extract && !do_enums && argc != optind) - errx(1, "no arguments allowed"); - if (do_extract && argc == optind) - errx(1, "no objects specified"); + argc -= optind; + argv += optind; - if ((gen_funcs_h || gen_funcs_c) && (do_extract || do_tree)) - errx(1, "-f and -F not allowed with -e or -t"); - if (gen_funcs_c && !do_enums) - errx(1, "-F requires -E"); - if (gen_funcs_h && gen_funcs_c) - errx(1, "-f and -F are mutually exclusive"); - + /* open input */ if (infile == NULL) { input_new(stdin, NULL, ""); } else { + FILE *fp; if ((fp = fopen(infile, "r")) == NULL) err(1, "%s", infile); input_new(fp, NULL, infile); } - root = parse_top(gettoken()); + /* parse and check input */ + struct node *root = parse_top(gettoken()); + + int tok; while ((tok = gettoken()) != TOK_EOF) merge(&root, parse_top(tok)); if (root) check_tree(root); - if (do_extract) { - while (optind < argc) { - if (gen_extract(stdout, root, argv[optind])) - errx(1, "object not found: %s", argv[optind]); - optind++; - } + /* do what the user has requested */ + switch (op) { + + case OP_EXTRACT: + if (argc == 0) + errx(1, "-e requires arguments"); + + for (int i = 0; i < argc; i++) + if (gen_extract(stdout, root, argv[i])) + errx(1, "object not found: %s", argv[i]); return (0); - } - if (do_enums) { - make_enums(argc - optind, argv + optind, - gen_funcs_h, gen_funcs_c); + + case OP_ENUMS: + make_enums(argc, argv, gen_funcs); return (0); - } - if (do_tree) { + + case OP_TREE: + if (argc != 0) + errx(1, "-t allows no arguments"); gen_tree(root, 0); return (0); - } - sprintf(fname, "%stree.h", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_header(fp, root, PREFIX_LEN, NULL); - fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); - extract_all_enums(fp, gen_funcs_h); - fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); - - fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); - fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); - - fclose(fp); - - sprintf(fname, "%stree.c", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_table(fp, root); - fclose(fp); - - return (0); + case OP_GEN: + if (argc != 0) + errx(1, "tree generation allows no arguments"); + make_table(root, gen_funcs == GEN_FUNCS_H); + return (0); + } } Modified: stable/12/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:04:14 2019 (r346987) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 + * Copyright (c) 2004-2005,2018 * Hartmut Brandt. * All rights reserved. * Copyright (c) 2001-2003 @@ -34,11 +34,13 @@ * * Support functions for SNMP clients. */ -#include +#include #include #include #include #include +#include +#include #include #include #include @@ -58,12 +60,16 @@ #include #endif +#include + #include "support.h" #include "asn1.h" #include "snmp.h" #include "snmpclient.h" #include "snmppriv.h" +#define DEBUG_PARSE 0 + /* global context */ struct snmp_client snmp_client; @@ -924,7 +930,8 @@ open_client_udp(const char *host, const char *port) /* open connection */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; + hints.ai_family = snmp_client.trans == SNMP_TRANS_UDP ? AF_INET: + AF_INET6; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; error = getaddrinfo(snmp_client.chost, snmp_client.cport, &hints, &res0); @@ -1068,6 +1075,7 @@ snmp_open(const char *host, const char *port, const ch switch (snmp_client.trans) { case SNMP_TRANS_UDP: + case SNMP_TRANS_UDP6: if (open_client_udp(host, port) != 0) return (-1); break; @@ -1866,99 +1874,410 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } -/* - * parse a server specification +/** + * Try to get a transport identifier which is a leading alphanumeric string + * (starting with '_' or a letter and including also '_') terminated by + * a double colon. The string may not be empty. The transport identifier + * is optional. * - * [trans::][community@][server][:port] + * \param sc client struct to set errors + * \param strp possible start of transport; updated to point to + * the next character to parse + * + * \return end of transport; equals *strp if there is none; NULL if there + * was an error */ -int -snmp_parse_server(struct snmp_client *sc, const char *str) +static inline const char * +get_transp(struct snmp_client *sc, const char **strp) { - const char *p, *s = str; + const char *p = *strp; - /* look for a double colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { + if (isascii(*p) && (isalpha(*p) || *p == '_')) { + p++; + while (isascii(*p) && (isalnum(*p) || *p == '_')) p++; - continue; + if (p[0] == ':' && p[1] == ':') { + *strp = p + 2; + return (p); } - if (*p == ':' && p[1] == ':') - break; } - if (*p != '\0') { - if (p > s) { - if (p - s == 3 && strncmp(s, "udp", 3) == 0) - sc->trans = SNMP_TRANS_UDP; - else if (p - s == 6 && strncmp(s, "stream", 6) == 0) - sc->trans = SNMP_TRANS_LOC_STREAM; - else if (p - s == 5 && strncmp(s, "dgram", 5) == 0) - sc->trans = SNMP_TRANS_LOC_DGRAM; - else { - seterr(sc, "unknown SNMP transport '%.*s'", - (int)(p - s), s); - return (-1); - } - } - s = p + 2; + if (p[0] == ':' && p[1] == ':') { + seterr(sc, "empty transport specifier"); + return (NULL); } + return (*strp); +} - /* look for a @ */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == '@') - break; +/** + * Try to get community string. Eat everything up to the last @ (if there is + * any) but only if it is not longer than SNMP_COMMUNITY_MAXLEN. Empty + * community strings are legal. + * + * \param sc client struct to set errors + * \param strp possible start of community; updated to the point to + * the next character to parse + * + * \return end of community; equals *strp if there is none; NULL if there + * was an error + */ +static inline const char * +get_comm(struct snmp_client *sc, const char **strp) +{ + const char *p = strrchr(*strp, '@'); + + if (p == NULL) + /* no community string */ + return (*strp); + + if (p - *strp > SNMP_COMMUNITY_MAXLEN) { + seterr(sc, "community string too long '%.*s'", + p - *strp, *strp); + return (NULL); } - if (*p != '\0') { - if (p - s > SNMP_COMMUNITY_MAXLEN) { - seterr(sc, "community string too long"); - return (-1); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv6 address. This starts with an [ and should end with an ] + * and everything between should be not longer than INET6_ADDRSTRLEN and + * parseable by inet_pton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv6 address (the '['); updated to point to + * the next character to parse (the one after the closing ']') + * + * \return end of address (equals *strp + 1 if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv6(struct snmp_client *sc, const char **strp) +{ + char str[INET6_ADDRSTRLEN + IF_NAMESIZE]; + struct addrinfo hints, *res; + int error; + + if (**strp != '[') + return (*strp + 1); + + const char *p = *strp + 1; + while (*p != ']' ) { + if (*p == '\0') { + seterr(sc, "unterminated IPv6 address '%.*s'", + p - *strp, *strp); + return (NULL); } - strncpy(sc->read_community, s, p - s); - sc->read_community[p - s] = '\0'; - strncpy(sc->write_community, s, p - s); - sc->write_community[p - s] = '\0'; - s = p + 1; + p++; } - /* look for a colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == ':') - break; + if (p - *strp > INET6_ADDRSTRLEN + IF_NAMESIZE) { + seterr(sc, "IPv6 address too long '%.*s'", p - *strp, *strp); + return (NULL); } - if (*p == ':') { - if (p > s) { - /* host:port */ - free(sc->chost); - if ((sc->chost = malloc(p - s + 1)) == NULL) { - seterr(sc, "%s", strerror(errno)); - return (-1); - } - strncpy(sc->chost, s, p - s); - sc->chost[p - s] = '\0'; + strncpy(str, *strp + 1, p - (*strp + 1)); + str[p - (*strp + 1)] = '\0'; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME | AI_NUMERICHOST; + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_protocol = IPPROTO_UDP; + error = getaddrinfo(str, NULL, &hints, &res); + if (error != 0) { + seterr(sc, "%s: %s", str, gai_strerror(error)); + return (NULL); + } + freeaddrinfo(res); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv4 address. This starts with a digit and consists of digits + * and dots, is not longer INET_ADDRSTRLEN and must be parseable by + * inet_aton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv4 address; updated to point to the + * next character to parse + * + * \return end of address (equals *strp if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv4(struct snmp_client *sc, const char **strp) +{ + const char *p = *strp; + + while (isascii(*p) && (isdigit(*p) || *p == '.')) + p++; + + if (p - *strp > INET_ADDRSTRLEN) { + seterr(sc, "IPv4 address too long '%.*s'", p - *strp, *strp); + return (NULL); + } + if (*strp == p) + return *strp; + + char str[INET_ADDRSTRLEN + 1]; + strncpy(str, *strp, p - *strp); + str[p - *strp] = '\0'; + + struct in_addr addr; + if (inet_aton(str, &addr) != 1) { + seterr(sc, "illegal IPv4 address '%s'", str); + return (NULL); + } + + *strp = p; + return (p); +} + +/** + * Try to get a hostname. This includes everything up to but not including + * the last colon (if any). There is no length restriction. + * + * \param sc client struct to set errors + * \param strp possible start of hostname; updated to point to the next + * character to parse (the trailing NUL character or the last + * colon) + * + * \return end of address (equals *strp if there is none) + */ +static inline const char * +get_host(struct snmp_client *sc __unused, const char **strp) +{ + const char *p = strrchr(*strp, ':'); + + if (p == NULL) { + *strp += strlen(*strp); + return (*strp); + } + + *strp = p; + return (p); +} + +/** + * Try to get a port number. This start with a colon and extends to the end + * of string. The port number must not be empty. + * + * \param sc client struct to set errors *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Wed May 1 09:05:50 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0245A1585511; Wed, 1 May 2019 09:05:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 944FA6CE27; Wed, 1 May 2019 09:05:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677671F257; Wed, 1 May 2019 09:05:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4195npX072168; Wed, 1 May 2019 09:05:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4195nbh072167; Wed, 1 May 2019 09:05:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905010905.x4195nbh072167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 1 May 2019 09:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346988 - stable/12/contrib/bsnmp/lib X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/contrib/bsnmp/lib X-SVN-Commit-Revision: 346988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 944FA6CE27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 09:05:50 -0000 Author: ae Date: Wed May 1 09:05:48 2019 New Revision: 346988 URL: https://svnweb.freebsd.org/changeset/base/346988 Log: MFC r345843: Follow the declared behaviour that specifies server string format in bsnmpclient(3). snmp_parse_server() function accepts string where some fields can be omitted: [trans::][community@][server][:port] "trans" field can be "udp", "udp6", "dgram" and "stream". "community" can be empty string, if it is omitted, the default value will be used. For read_community it is "public", for write_comminity it is "private". "server" field can be hostname, IPv4 address or IPv6 address. IPv6 address should be specified in brackets "[]". If port is omitted, the default value "snmp" will be used for "udp" and "udp6" transports. So, now for bsnmpget(1) and bsnmwalk(1) it is not required to specify all fields in argument of '-s' option. E.g. # bsnmpget -s 127.1 sysName.0 # bsnmpget -s "udp::127.1" sysName.0 # bsnmpget -s "udp::public@127.1" sysName.0 # bsnmpget -s "udp::public@127.1:161" sysName.0 # bsnmpget -s "udp::[::1]" sysName.0 # bsnmpget -s "udp6::[::1]" sysName.0 # bsnmpget -s "[fe80::1%lo0]" sysName.0 PR: 236664 Reported by: olivier Modified: stable/12/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:04:14 2019 (r346987) +++ stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:05:48 2019 (r346988) @@ -1874,38 +1874,47 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } +static const char *const trans_list[] = { + [SNMP_TRANS_UDP] = "udp::", + [SNMP_TRANS_LOC_DGRAM] = "dgram::", + [SNMP_TRANS_LOC_STREAM] = "stream::", + [SNMP_TRANS_UDP6] = "udp6::", +}; + /** * Try to get a transport identifier which is a leading alphanumeric string - * (starting with '_' or a letter and including also '_') terminated by - * a double colon. The string may not be empty. The transport identifier - * is optional. + * terminated by a double colon. The string may not be empty. The transport + * identifier is optional. * * \param sc client struct to set errors * \param strp possible start of transport; updated to point to * the next character to parse * - * \return end of transport; equals *strp if there is none; NULL if there - * was an error + * \return transport identifier */ -static inline const char * +static inline int get_transp(struct snmp_client *sc, const char **strp) { - const char *p = *strp; + const char *p; + size_t i; - if (isascii(*p) && (isalpha(*p) || *p == '_')) { - p++; - while (isascii(*p) && (isalnum(*p) || *p == '_')) - p++; - if (p[0] == ':' && p[1] == ':') { - *strp = p + 2; - return (p); + for (i = 0; i < nitems(trans_list); i++) { + if (trans_list[i] == NULL || *trans_list[i] == '\0') + continue; + p = strstr(*strp, trans_list[i]); + if (p == *strp) { + *strp += strlen(trans_list[i]); + return ((int)i); } } + + p = *strp; if (p[0] == ':' && p[1] == ':') { seterr(sc, "empty transport specifier"); - return (NULL); + return (-1); } - return (*strp); + /* by default assume UDP */ + return (SNMP_TRANS_UDP); } /** @@ -2143,24 +2152,13 @@ save_str(struct snmp_client *sc, const char *const s[2 int snmp_parse_server(struct snmp_client *sc, const char *str) { -#if DEBUG_PARSE const char *const orig = str; -#endif - - const char *const trans_list[] = { - [SNMP_TRANS_UDP] = "udp", - [SNMP_TRANS_LOC_DGRAM] = "dgram", - [SNMP_TRANS_LOC_STREAM] = "stream", - [SNMP_TRANS_UDP6] = "udp6", - }; - /* parse input */ - const char *const transp[2] = { - str, - get_transp(sc, &str), - }; - if (transp[1] == NULL) + int i, trans = get_transp(sc, &str); + if (trans < 0) return (-1); + /* choose automatically */ + i = orig == str ? -1: trans; const char *const comm[2] = { str, @@ -2206,7 +2204,7 @@ snmp_parse_server(struct snmp_client *sc, const char * } #if DEBUG_PARSE - printf("transp: %zu %zu\n", transp[0] - orig, transp[1] - orig); + printf("transp: %u\n", trans); printf("comm: %zu %zu\n", comm[0] - orig, comm[1] - orig); printf("ipv6: %zu %zu\n", ipv6[0] - orig, ipv6[1] - orig); printf("ipv4: %zu %zu\n", ipv4[0] - orig, ipv4[1] - orig); @@ -2215,69 +2213,73 @@ snmp_parse_server(struct snmp_client *sc, const char * #endif /* analyse and allocate */ - int i = -1; - if (transp[0] != transp[1]) { - for (i = 0; i < (int)nitems(trans_list); i++) { - if (trans_list[i] != NULL && - strlen(trans_list[i]) == (size_t)(transp[1] - - transp[0]) && !strncmp(trans_list[i], transp[0], - transp[1] - transp[0])) - break; - } - - if (i == (int)nitems(trans_list)) { - seterr(sc, "unknown transport specifier '%.*s'", - transp[1] - transp[0], transp[0]); - return (-1); - } - } - char *chost; if (ipv6[0] != ipv6[1]) { if ((chost = save_str(sc, ipv6)) == NULL) return (-1); - if (i == -1) - i = SNMP_TRANS_UDP6; + if (i == -1 || trans == SNMP_TRANS_UDP) + trans = SNMP_TRANS_UDP6; } else if (ipv4[0] != ipv4[1]) { if ((chost = save_str(sc, ipv4)) == NULL) return (-1); if (i == -1) - i = SNMP_TRANS_UDP; + trans = SNMP_TRANS_UDP; } else { if ((chost = save_str(sc, host)) == NULL) return (-1); if (i == -1) { - /* Default transport is UDP unless the host contains - * a slash in which case we default to DGRAM. */ - i = SNMP_TRANS_UDP; + /* + * Default transport is UDP unless the host contains + * a slash in which case we default to DGRAM. + */ for (const char *p = host[0]; p < host[1]; p++) if (*p == '/') { - i = SNMP_TRANS_LOC_DGRAM; + trans = SNMP_TRANS_LOC_DGRAM; break; } } } - char *cport = save_str(sc, port); + char *cport; + + if (port[0] == port[1] && ( + trans == SNMP_TRANS_UDP || trans == SNMP_TRANS_UDP6)) { + /* If port was not specified, use "snmp" name by default */ + cport = strdup("snmp"); + } else + cport = save_str(sc, port); + if (cport == NULL) { free(chost); return (-1); } /* commit */ - sc->trans = i; + sc->trans = trans; + /* + * If community string was specified and it is empty, overwrite it. + * If it was not specified, use default. + */ + if (comm[0] != comm[1] || strrchr(comm[0], '@') != NULL) { + strncpy(sc->read_community, comm[0], comm[1] - comm[0]); + sc->read_community[comm[1] - comm[0]] = '\0'; + strncpy(sc->write_community, comm[0], comm[1] - comm[0]); + sc->write_community[comm[1] - comm[0]] = '\0'; + } - strncpy(sc->read_community, comm[0], comm[1] - comm[0]); - sc->read_community[comm[1] - comm[0]] = '\0'; - strncpy(sc->write_community, comm[0], comm[1] - comm[0]); - sc->write_community[comm[1] - comm[0]] = '\0'; - free(sc->chost); sc->chost = chost; free(sc->cport); sc->cport = cport; +#if DEBUG_PARSE + printf("Committed values:\n"); + printf("trans: %u\n", sc->trans); + printf("comm: '%s'/'%s'\n", sc->read_community, sc->write_community); + printf("host: '%s'\n", sc->chost); + printf("port: '%s'\n", sc->cport); +#endif return (0); } From owner-svn-src-stable-12@freebsd.org Wed May 1 13:42:57 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4966B15976D1; Wed, 1 May 2019 13:42:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E17FE766AF; Wed, 1 May 2019 13:42:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA1622223F; Wed, 1 May 2019 13:42:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41DguxB017961; Wed, 1 May 2019 13:42:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41DguhG017960; Wed, 1 May 2019 13:42:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905011342.x41DguhG017960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 1 May 2019 13:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346991 - stable/12/sys/geom X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/geom X-SVN-Commit-Revision: 346991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E17FE766AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:42:57 -0000 Author: mav Date: Wed May 1 13:42:56 2019 New Revision: 346991 URL: https://svnweb.freebsd.org/changeset/base/346991 Log: MFC r346644: Call delist_dev() before destroy_dev_sched_cb(). destroy_dev_sched_cb() is excessively asynchronous, and during media change retaste new provider may appear sooner then device of the previous one get destroyed. Sponsored by: iXsystems, Inc. Modified: stable/12/sys/geom/geom_dev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/geom_dev.c ============================================================================== --- stable/12/sys/geom/geom_dev.c Wed May 1 13:15:06 2019 (r346990) +++ stable/12/sys/geom/geom_dev.c Wed May 1 13:42:56 2019 (r346991) @@ -838,6 +838,7 @@ g_dev_orphan(struct g_consumer *cp) (void)clear_dumper(curthread); /* Destroy the struct cdev *so we get no more requests */ + delist_dev(dev); destroy_dev_sched_cb(dev, g_dev_callback, cp); } From owner-svn-src-stable-12@freebsd.org Wed May 1 17:30:15 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24804159C3DD; Wed, 1 May 2019 17:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF04A8625C; Wed, 1 May 2019 17:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 981B8249D2; Wed, 1 May 2019 17:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HUEY4033887; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HUEiH033886; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905011730.x41HUEiH033886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 17:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346999 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 346999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF04A8625C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:30:15 -0000 Author: jhb Date: Wed May 1 17:30:14 2019 New Revision: 346999 URL: https://svnweb.freebsd.org/changeset/base/346999 Log: MFC 346063: Don't pre-reserve resources for CPU devices when they are set. CPUs can use shared (RF_SHAREABLE) resources for the I/O port used for entering and exiting C states. If this I/O port is included in an ACPI system resource device, then this happens to still work, but if the port wasn't part of a system resource device, only the first CPU could allocate the I/O port and use C states since resource_list_reserve() was always allocating the resource from nexus0 without RF_SHAREABLE. By avoiding the reservation, the flags from the bus_alloc_resource() in the CPU driver (which include RF_SHAREABLE) are honored. PR: 236513 Modified: stable/12/sys/dev/acpica/acpi.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/acpica/acpi.c ============================================================================== --- stable/12/sys/dev/acpica/acpi.c Wed May 1 17:27:04 2019 (r346998) +++ stable/12/sys/dev/acpica/acpi.c Wed May 1 17:30:14 2019 (r346999) @@ -1347,6 +1347,14 @@ acpi_set_resource(device_t dev, device_t child, int ty return (0); /* + * Don't reserve resources for CPU devices. Some of these + * resources need to be allocated as shareable, but reservations + * are always non-shareable. + */ + if (device_get_devclass(child) == devclass_find("cpu")) + return (0); + + /* * Reserve the resource. * * XXX: Ignores failure for now. Failure here is probably a From owner-svn-src-stable-12@freebsd.org Wed May 1 18:17:43 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F71D159D7BE; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4707A880C5; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20F342526B; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41IHhEr060676; Wed, 1 May 2019 18:17:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IHhgF060675; Wed, 1 May 2019 18:17:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905011817.x41IHhgF060675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 18:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347000 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 347000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4707A880C5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:17:43 -0000 Author: jhb Date: Wed May 1 18:17:42 2019 New Revision: 347000 URL: https://svnweb.freebsd.org/changeset/base/347000 Log: MFC 346066: Refine r330113 to honor the ProducerConsumer flag most of the time. While it is true that the ACPI spec says that the flag is only valid on Extended Address Space Descriptors, examples of other descriptors in the spec use the ProducerConsumer flag explicitly, and real hardware uses it as well. In fact, even in the ASL of the Thunder X2 for which r330113 was a workaround, some devices use this flag on non-Extended Address Space Descriptors correctly. Instead, only ignore the flag for resources associated with the UART devices on the Thunder X2 using the "ARMH0011" HID to identify these devices. This should fix regressions from ignoring this flag in other contexts such as Hyper-V. PR: 235876 Modified: stable/12/sys/dev/acpica/acpi_resource.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_resource.c Wed May 1 17:30:14 2019 (r346999) +++ stable/12/sys/dev/acpica/acpi_resource.c Wed May 1 18:17:42 2019 (r347000) @@ -159,6 +159,7 @@ struct acpi_resource_context { struct acpi_parse_resource_set *set; device_t dev; void *context; + bool ignore_producer_flag; }; #ifdef ACPI_DEBUG_OUTPUT @@ -342,7 +343,7 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context) } if (length <= 0) break; - if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 && + if (!arc->ignore_producer_flag && res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s %s producer\n", name, @@ -431,6 +432,12 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, set->set_init(dev, arg, &arc.context); arc.set = set; arc.dev = dev; + arc.ignore_producer_flag = false; + + /* UARTs on ThunderX2 set ResourceProducer on memory resources. */ + if (acpi_MatchHid(handle, "ARMH0011")) + arc.ignore_producer_flag = true; + status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { printf("can't fetch resources for %s - %s\n", From owner-svn-src-stable-12@freebsd.org Wed May 1 21:26:35 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E7415A125F; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8050F8E355; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55900273F8; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LQYuA064350; Wed, 1 May 2019 21:26:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LQYpp064349; Wed, 1 May 2019 21:26:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012126.x41LQYpp064349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347004 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8050F8E355 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:26:35 -0000 Author: jhb Date: Wed May 1 21:26:33 2019 New Revision: 347004 URL: https://svnweb.freebsd.org/changeset/base/347004 Log: MFC 345659: Use a dedicated malloc type for lagg(4)'s structures. Modified: stable/12/sys/net/if_lagg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Wed May 1 19:35:45 2019 (r347003) +++ stable/12/sys/net/if_lagg.c Wed May 1 21:26:33 2019 (r347004) @@ -111,6 +111,7 @@ static void lagg_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner); #define V_lagg_cloner VNET(lagg_cloner) static const char laggname[] = "lagg"; +static MALLOC_DEFINE(M_LAGG, laggname, "802.3AD Link Aggregation Interface"); static void lagg_capabilities(struct lagg_softc *); static int lagg_port_create(struct lagg_softc *, struct ifnet *); @@ -478,10 +479,10 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd struct ifnet *ifp; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + sc = malloc(sizeof(*sc), M_LAGG, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - free(sc, M_DEVBUF); + free(sc, M_LAGG); return (ENOSPC); } LAGG_SX_INIT(sc); @@ -568,7 +569,7 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_LIST_UNLOCK(); LAGG_SX_DESTROY(sc); - free(sc, M_DEVBUF); + free(sc, M_LAGG); } static void @@ -682,7 +683,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifr.ifr_mtu = oldmtu; } - lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); + lp = malloc(sizeof(struct lagg_port), M_LAGG, M_WAITOK|M_ZERO); lp->lp_softc = sc; /* Check if port is a stacked lagg */ @@ -690,7 +691,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * SLIST_FOREACH(sc_ptr, &V_lagg_list, sc_entries) { if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -701,7 +702,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (lagg_port_checkstacking(sc_ptr) >= LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -812,7 +813,7 @@ lagg_port_destroy_cb(epoch_context_t ec) ifp = lp->lp_ifp; if_rele(ifp); - free(lp, M_DEVBUF); + free(lp, M_LAGG); } static int @@ -1584,7 +1585,7 @@ lagg_setmulti(struct lagg_port *lp) CK_STAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mc = malloc(sizeof(struct lagg_mc), M_DEVBUF, M_NOWAIT); + mc = malloc(sizeof(struct lagg_mc), M_LAGG, M_NOWAIT); if (mc == NULL) { IF_ADDR_WUNLOCK(scifp); return (ENOMEM); @@ -1615,7 +1616,7 @@ lagg_clrmulti(struct lagg_port *lp) SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); if (mc->mc_ifma && lp->lp_detaching == 0) if_delmulti_ifma(mc->mc_ifma); - free(mc, M_DEVBUF); + free(mc, M_LAGG); } return (0); } @@ -2059,7 +2060,7 @@ lagg_lb_attach(struct lagg_softc *sc) struct lagg_lb *lb; LAGG_XLOCK_ASSERT(sc); - lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); + lb = malloc(sizeof(struct lagg_lb), M_LAGG, M_WAITOK | M_ZERO); lb->lb_key = m_ether_tcpip_hash_init(); sc->sc_psc = lb; @@ -2074,7 +2075,7 @@ lagg_lb_detach(struct lagg_softc *sc) lb = (struct lagg_lb *)sc->sc_psc; if (lb != NULL) - free(lb, M_DEVBUF); + free(lb, M_LAGG); } static int From owner-svn-src-stable-12@freebsd.org Wed May 1 21:45:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A009B15A1BA7; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1CE8EDDD; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 214AF2777C; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LjGCJ074489; Wed, 1 May 2019 21:45:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LjFhD074488; Wed, 1 May 2019 21:45:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012145.x41LjFhD074488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347005 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C1CE8EDDD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:45:16 -0000 Author: jhb Date: Wed May 1 21:45:15 2019 New Revision: 347005 URL: https://svnweb.freebsd.org/changeset/base/347005 Log: MFC 345655: Remove nested epochs from lagg(4). lagg_bcast_start appeared to have a bug in that was using the last lagg port structure after exiting the epoch that was keeping that structure alive. However, upon further inspection, the epoch was already entered by the caller (lagg_transmit), so the epoch enter/exit in lagg_bcast_start was actually unnecessary. This commit generally removes uses of the net epoch via LAGG_RLOCK to protect the list of ports when the list of ports was already protected by an existing LAGG_RLOCK in a caller, or the LAGG_XLOCK. It also adds a missing epoch enter/exit in lagg_snd_tag_alloc while accessing the lagg port structures. An ifp is still accessed via an unsafe reference after the epoch is exited, but that is true in the current code and will be fixed in a future change. Modified: stable/12/sys/net/if_lagg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Wed May 1 21:26:33 2019 (r347004) +++ stable/12/sys/net/if_lagg.c Wed May 1 21:45:15 2019 (r347005) @@ -750,7 +750,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * * is predictable and `ifconfig laggN create ...` command * will lead to the same result each time. */ - LAGG_RLOCK(); CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { if (tlp->lp_ifp->if_index < ifp->if_index && ( CK_SLIST_NEXT(tlp, lp_entries) == NULL || @@ -758,7 +757,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifp->if_index)) break; } - LAGG_RUNLOCK(); if (tlp != NULL) CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries); else @@ -1536,14 +1534,17 @@ lagg_snd_tag_alloc(struct ifnet *ifp, struct lagg_lb *lb; uint32_t p; + LAGG_RLOCK(); switch (sc->sc_proto) { case LAGG_PROTO_FAILOVER: lp = lagg_link_active(sc, sc->sc_primary); break; case LAGG_PROTO_LOADBALANCE: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } p = params->hdr.flowid >> sc->flowid_shift; p %= sc->sc_count; lb = (struct lagg_lb *)sc->sc_psc; @@ -1552,16 +1553,22 @@ lagg_snd_tag_alloc(struct ifnet *ifp, break; case LAGG_PROTO_LACP: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); break; default: + LAGG_RUNLOCK(); return (EOPNOTSUPP); } - if (lp == NULL) + if (lp == NULL) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } ifp = lp->lp_ifp; + LAGG_RUNLOCK(); if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) return (EOPNOTSUPP); @@ -1845,12 +1852,18 @@ struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; - struct epoch_tracker net_et; /* * Search a port which reports an active link state. */ + /* + * This is called with either LAGG_RLOCK() held or + * LAGG_XLOCK(sc) held. + */ + if (!in_epoch(net_epoch_preempt)) + LAGG_XLOCK_ASSERT(sc); + if (lp == NULL) goto search; if (LAGG_PORTACTIVE(lp)) { @@ -1863,15 +1876,12 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po goto found; } - search: - epoch_enter_preempt(net_epoch_preempt, &net_et); +search: CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp_next)) { - epoch_exit_preempt(net_epoch_preempt, &net_et); return (lp_next); } } - epoch_exit_preempt(net_epoch_preempt, &net_et); found: return (rval); } @@ -1953,7 +1963,7 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m struct lagg_port *lp, *last = NULL; struct mbuf *m0; - LAGG_RLOCK(); + LAGG_RLOCK_ASSERT(); CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (!LAGG_PORTACTIVE(lp)) continue; @@ -1974,7 +1984,6 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m } last = lp; } - LAGG_RUNLOCK(); if (last == NULL) { m_freem(m); @@ -2087,7 +2096,7 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p rv = 0; bzero(&lb->lb_ports, sizeof(lb->lb_ports)); - LAGG_RLOCK(); + LAGG_XLOCK_ASSERT(sc); CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (lp_next == lp) continue; @@ -2100,7 +2109,6 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } - LAGG_RUNLOCK(); return (rv); } From owner-svn-src-stable-12@freebsd.org Wed May 1 21:54:22 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A3415A1E61; Wed, 1 May 2019 21:54:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3FE08F34C; Wed, 1 May 2019 21:54:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB74E2797B; Wed, 1 May 2019 21:54:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LsLNU079790; Wed, 1 May 2019 21:54:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LsLEx079789; Wed, 1 May 2019 21:54:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012154.x41LsLEx079789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347006 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3FE08F34C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:54:22 -0000 Author: jhb Date: Wed May 1 21:54:21 2019 New Revision: 347006 URL: https://svnweb.freebsd.org/changeset/base/347006 Log: MFC 345712: Don't check the inp socket pointer in in_pcboutput_eagain. Modified: stable/12/sys/netinet/in_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Wed May 1 21:45:15 2019 (r347005) +++ stable/12/sys/netinet/in_pcb.c Wed May 1 21:54:21 2019 (r347006) @@ -3398,14 +3398,9 @@ in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet * void in_pcboutput_eagain(struct inpcb *inp) { - struct socket *socket; bool did_upgrade; if (inp == NULL) - return; - - socket = inp->inp_socket; - if (socket == NULL) return; if (inp->inp_snd_tag == NULL) From owner-svn-src-stable-12@freebsd.org Thu May 2 01:02:27 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC74D1583478; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5334F6E64B; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB7C1ACE; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4212QV2080776; Thu, 2 May 2019 01:02:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4212QQN080775; Thu, 2 May 2019 01:02:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905020102.x4212QQN080775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 2 May 2019 01:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347008 - stable/12/usr.sbin/nfsdumpstate X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5334F6E64B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 01:02:28 -0000 Author: rmacklem Date: Thu May 2 01:02:26 2019 New Revision: 347008 URL: https://svnweb.freebsd.org/changeset/base/347008 Log: MFC: r346709 Add support to nfsdumpstate for printing of INET6 addresses for locks. r346190 added support for printing of INET6 addresses for the "-o" option (all opens) but missed adding support for INET6 addresses for the "-l" option. This patch adds that support. Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Wed May 1 22:12:39 2019 (r347007) +++ stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:02:26 2019 (r347008) @@ -176,6 +176,7 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; + char nbuf[INET6_ADDRSTRLEN]; dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; @@ -183,7 +184,7 @@ dump_lockstate(char *fname) if (nfssvc(NFSSVC_DUMPLOCKS, &dumplocklist) < 0) errx(1, "Can't dump locks for %s\n", fname); - printf("%-11s %-36s %-15s %s\n", + printf("%-11s %-36s %-45s %s\n", "Open/Lock", " Stateid or Lock Range", "Clientaddr", @@ -213,11 +214,26 @@ dump_lockstate(char *fname) lock_flags(lp[cnt].ndlck_flags), lp[cnt].ndlck_first, lp[cnt].ndlck_end); - if (lp[cnt].ndlck_addrfam == AF_INET) - printf("%-15s ", + switch (lp[cnt].ndlck_addrfam) { +#ifdef INET + case AF_INET: + printf("%-45s ", inet_ntoa(lp[cnt].ndlck_cbaddr.sin_addr)); - else - printf("%-15s ", " "); + break; +#endif +#ifdef INET6 + case AF_INET6: + if (inet_ntop(AF_INET6, &lp[cnt].ndlck_cbaddr.sin6_addr, + nbuf, sizeof(nbuf)) != NULL) + printf("%-45s ", nbuf); + else + printf("%-45s ", " "); + break; +#endif + default: + printf("%-45s ", " "); + break; + } for (i = 0; i < lp[cnt].ndlck_owner.nclid_idlen; i++) printf("%02x", lp[cnt].ndlck_owner.nclid_id[i]); printf(" "); From owner-svn-src-stable-12@freebsd.org Thu May 2 02:26:43 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C9415857F3; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE7E70AE3; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035ED285C; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x422QgJX023200; Thu, 2 May 2019 02:26:42 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x422Qge2023199; Thu, 2 May 2019 02:26:42 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905020226.x422Qge2023199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 2 May 2019 02:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DE7E70AE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 02:26:43 -0000 Author: johalun Date: Thu May 2 02:26:42 2019 New Revision: 347012 URL: https://svnweb.freebsd.org/changeset/base/347012 Log: MFC r346712: Don't call cdev_init where cdev_alloc is called. cdev_alloc already handles initialization. Reviewed by: hps Approved by: imp (mentor) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 2 02:08:26 2019 (r347011) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 2 02:26:42 2019 (r347012) @@ -2328,7 +2328,7 @@ __register_chrdev(unsigned int major, unsigned int bas for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add(cdev, makedev(major, i), 1); @@ -2350,7 +2350,7 @@ __register_chrdev_p(unsigned int major, unsigned int b for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); From owner-svn-src-stable-12@freebsd.org Thu May 2 07:33:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05454158BC3B; Thu, 2 May 2019 07:33:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 8DFC8814CF; Thu, 2 May 2019 07:33:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 102CF260354; Thu, 2 May 2019 09:33:24 +0200 (CEST) Subject: Re: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905020226.x422Qge2023199@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 2 May 2019 09:32:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905020226.x422Qge2023199@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8DFC8814CF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 07:33:32 -0000 On 2019-05-02 04:26, Johannes Lundberg wrote: > Author: johalun > Date: Thu May 2 02:26:42 2019 > New Revision: 347012 > URL: https://svnweb.freebsd.org/changeset/base/347012 > > Log: > MFC r346712: > Don't call cdev_init where cdev_alloc is called. cdev_alloc already > handles initialization. > Please also MFC to 11 if possible. --HPS From owner-svn-src-stable-12@freebsd.org Thu May 2 17:43:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C660159C997; Thu, 2 May 2019 17:43:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3DD96A655; Thu, 2 May 2019 17:43:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B079CB8B; Thu, 2 May 2019 17:43:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42HhmH5010442; Thu, 2 May 2019 17:43:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Hhm0k010441; Thu, 2 May 2019 17:43:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905021743.x42Hhm0k010441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 2 May 2019 17:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347026 - stable/12/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/contrib/bsnmp/snmp_mibII X-SVN-Commit-Revision: 347026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3DD96A655 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:43:49 -0000 Author: ae Date: Thu May 2 17:43:47 2019 New Revision: 347026 URL: https://svnweb.freebsd.org/changeset/base/347026 Log: MFC r345798: Create 64bit mibII counters for all interfaces. PR: 157015 Obtained from: Yandex LLC Modified: stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:41:42 2019 (r347025) +++ stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:43:47 2019 (r347026) @@ -373,11 +373,6 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu switch (op) { - again: - if (op != SNMP_OP_GETNEXT) - return (SNMP_ERR_NOSUCHNAME); - /* FALLTHROUGH */ - case SNMP_OP_GETNEXT: if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL) return (SNMP_ERR_NOSUCHNAME); @@ -460,52 +455,36 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu break; case LEAF_ifHCInOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets; break; case LEAF_ifHCInUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets - MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; case LEAF_ifHCOutOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets; break; case LEAF_ifHCOutUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets - MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; From owner-svn-src-stable-12@freebsd.org Fri May 3 00:45:34 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0290A15A57C0; Fri, 3 May 2019 00:45:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE0C8045E; Fri, 3 May 2019 00:45:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C41D193F2; Fri, 3 May 2019 00:45:33 +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 x430jXxp031727; Fri, 3 May 2019 00:45:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x430jWd4031724; Fri, 3 May 2019 00:45:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905030045.x430jWd4031724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 May 2019 00:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347037 - in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Commit-Revision: 347037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BE0C8045E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 00:45:34 -0000 Author: gjb Date: Fri May 3 00:45:31 2019 New Revision: 347037 URL: https://svnweb.freebsd.org/changeset/base/347037 Log: MFC r346959: Reduce the default image size for virtual machine disk images from 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included in hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/Makefile.vm stable/12/release/tools/gce.conf stable/12/release/tools/vmimage.subr Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile.vm stable/11/release/tools/gce.conf stable/11/release/tools/vmimage.subr Directory Properties: stable/11/ (props changed) Modified: stable/12/release/Makefile.vm ============================================================================== --- stable/12/release/Makefile.vm Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/Makefile.vm Fri May 3 00:45:31 2019 (r347037) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: stable/12/release/tools/gce.conf ============================================================================== --- stable/12/release/tools/gce.conf Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/tools/gce.conf Fri May 3 00:45:31 2019 (r347037) @@ -3,9 +3,6 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ Modified: stable/12/release/tools/vmimage.subr ============================================================================== --- stable/12/release/tools/vmimage.subr Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/tools/vmimage.subr Fri May 3 00:45:31 2019 (r347037) @@ -175,6 +175,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 From owner-svn-src-stable-12@freebsd.org Fri May 3 02:03:31 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD7CB1580D6C; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49DB6826B0; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 358711A149; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4323TWJ074473; Fri, 3 May 2019 02:03:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4323TZk074469; Fri, 3 May 2019 02:03:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030203.x4323TZk074469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347038 - in stable/12/sys/fs: nfs nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49DB6826B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:03:31 -0000 Author: rmacklem Date: Fri May 3 02:03:29 2019 New Revision: 347038 URL: https://svnweb.freebsd.org/changeset/base/347038 Log: MFC: r346365 Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes. During inspection of a packet trace, I noticed that an NFSv4.0 mount reported that it supported attributes that are only defined for NFSv4.1. In practice, this bug appears to be benign, since NFSv4.0 clients will not use attributes that were added for NFSv4.1. However, this was not correct and this patch fixes the NFSv4.0 server so that it only supports attributes defined for NFSv4.0. It also adds a definition for NFSv4.1 attributes that can only be set, although it is only defined as 0 for now. This is anticipation of the addition of support for the NFSv4.1 mode+mask attribute soon. Modified: stable/12/sys/fs/nfs/nfs.h stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfs/nfsproto.h stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfs.h ============================================================================== --- stable/12/sys/fs/nfs/nfs.h Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfs.h Fri May 3 02:03:29 2019 (r347038) @@ -423,10 +423,14 @@ typedef struct { (t)->bits[2] = (f)->bits[2]; \ } while (0) -#define NFSSETSUPP_ATTRBIT(b) do { \ +#define NFSSETSUPP_ATTRBIT(b, n) do { \ (b)->bits[0] = NFSATTRBIT_SUPP0; \ - (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); \ - (b)->bits[2] = NFSATTRBIT_SUPP2; \ + (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1); \ + (b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2); \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) #define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32))) @@ -445,16 +449,22 @@ typedef struct { (b)->bits[2] &= ((a)->bits[2]); \ } while (0) -#define NFSCLRNOTFILLABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SUPP0; \ (b)->bits[1] &= NFSATTRBIT_SUPP1; \ (b)->bits[2] &= NFSATTRBIT_SUPP2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) -#define NFSCLRNOTSETABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTSETABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ (b)->bits[1] &= NFSATTRBIT_SETABLE1; \ (b)->bits[2] &= NFSATTRBIT_SETABLE2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ } while (0) #define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2]) Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:03:29 2019 (r347038) @@ -1294,7 +1294,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); /* Some filesystem do not support NFSv4ACL */ if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { @@ -2130,8 +2130,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); - NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits, nd); NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_TIMEACCESSSET); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) @@ -2461,10 +2461,10 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * reply call. */ if (p == NULL && cred == NULL) { - NFSCLRNOTSETABLE_ATTRBIT(retbitp); + NFSCLRNOTSETABLE_ATTRBIT(retbitp, nd); aclp = saclp; } else { - NFSCLRNOTFILLABLE_ATTRBIT(retbitp); + NFSCLRNOTFILLABLE_ATTRBIT(retbitp, nd); naclp = acl_alloc(M_WAITOK); aclp = naclp; } @@ -2534,7 +2534,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount if (NFSISSET_ATTRBIT(retbitp, bitpos)) { switch (bitpos) { case NFSATTRBIT_SUPPORTEDATTRS: - NFSSETSUPP_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); @@ -2936,8 +2936,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount retnum += NFSX_HYPER; break; case NFSATTRBIT_SUPPATTREXCLCREAT: - NFSSETSUPP_ATTRBIT(&attrbits); - NFSCLRNOTSETABLE_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&attrbits, nd); NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); retnum += nfsrv_putattrbit(nd, &attrbits); break; Modified: stable/12/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/12/sys/fs/nfs/nfsproto.h Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:03:29 2019 (r347038) @@ -1086,11 +1086,11 @@ struct nfsv3_sattr { NFSATTRBM_SUPPATTREXCLCREAT) /* - * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and - * NFSATTRBIT_TIMEMODIFYSET. + * These are the set only attributes. */ -#define NFSATTRBIT_SUPPSETONLY (NFSATTRBM_TIMEACCESSSET | \ +#define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) +#define NFSATTRBIT_SUPPSETONLY2 0 /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1107,6 +1107,18 @@ struct nfsv3_sattr { NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) #define NFSATTRBIT_SETABLE2 0 + +/* + * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. + */ +#define NFSATTRBIT_NFSV41_1 \ + (NFSATTRBM_FSLAYOUTTYPE) +#define NFSATTRBIT_NFSV41_2 \ + (NFSATTRBM_LAYOUTTYPE | \ + NFSATTRBM_LAYOUTBLKSIZE | \ + NFSATTRBM_LAYOUTALIGNMENT | \ + NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_SUPPATTREXCLCREAT) /* * Set of attributes that the getattr vnode op needs. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:03:29 2019 (r347038) @@ -2123,7 +2123,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg if (error) goto nfsmout; NFSSET_ATTRBIT(&savbits, &attrbits); - NFSCLRNOTFILLABLE_ATTRBIT(&attrbits); + NFSCLRNOTFILLABLE_ATTRBIT(&attrbits, nd); NFSZERO_ATTRBIT(&rderrbits); NFSSETBIT_ATTRBIT(&rderrbits, NFSATTRBIT_RDATTRERROR); } else { From owner-svn-src-stable-12@freebsd.org Fri May 3 02:44:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D8371581BBA; Fri, 3 May 2019 02:44:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0513B8382F; Fri, 3 May 2019 02:44:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC9D61A7F3; Fri, 3 May 2019 02:44:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432ivri095858; Fri, 3 May 2019 02:44:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432ivwJ095857; Fri, 3 May 2019 02:44:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030244.x432ivwJ095857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347041 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 347041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0513B8382F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:44:58 -0000 Author: rmacklem Date: Fri May 3 02:44:57 2019 New Revision: 347041 URL: https://svnweb.freebsd.org/changeset/base/347041 Log: MFC: r346423 Replace "vp" with NULL to make the code more readable. At the time of this nfsv4_sattr() call, "vp == NULL", so this patch doesn't change the semantics, but I think it makes the code more readable. It also makes it consistent with the nfsv4_sattr() call a few lines above this one. Found during code inspection. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:30:01 2019 (r347040) +++ stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:44:57 2019 (r347041) @@ -2872,7 +2872,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); cverf[0] = *tl++; cverf[1] = *tl; - error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p); + error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p); if (error != 0) goto nfsmout; if (NFSISSET_ATTRBIT(&attrbits, From owner-svn-src-stable-12@freebsd.org Fri May 3 02:58:35 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05849158208A; Fri, 3 May 2019 02:58:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F75C83F3C; Fri, 3 May 2019 02:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52C9D1A9B0; Fri, 3 May 2019 02:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432wYBa001321; Fri, 3 May 2019 02:58:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432wXJc001318; Fri, 3 May 2019 02:58:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030258.x432wXJc001318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347044 - in stable/12/sys/fs: nfs nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F75C83F3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:58:35 -0000 Author: rmacklem Date: Fri May 3 02:58:33 2019 New Revision: 347044 URL: https://svnweb.freebsd.org/changeset/base/347044 Log: MFC: r346424 Add support for the ModeSetMasked attribute to the NFSv4.1 server. I do not know of an extant NFSv4.1 client that currently does a Setattr operation for the ModeSetMasked, but it has been discussed on the linux-nfs mailing list. This patch adds support for doing a Setattr of ModeSetMasked, so that it will work for any future NFSv4.1 client that chooses to do so. Tested via a hacked FreeBSD NFSv4.1 client. Modified: stable/12/sys/fs/nfs/nfsproto.h stable/12/sys/fs/nfsserver/nfs_nfsdport.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:58:33 2019 (r347044) @@ -1090,7 +1090,7 @@ struct nfsv3_sattr { */ #define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SUPPSETONLY2 0 +#define NFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1106,7 +1106,8 @@ struct nfsv3_sattr { NFSATTRBM_OWNERGROUP | \ NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SETABLE2 0 +#define NFSATTRBIT_SETABLE2 \ + (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:58:33 2019 (r347044) @@ -2696,10 +2696,12 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str int attrsum = 0; int i, j; int error, attrsize, bitpos, aclsize, aceerr, retnotsup = 0; - int toclient = 0; + int moderet, toclient = 0; u_char *cp, namestr[NFSV4_SMALLSTR + 1]; uid_t uid; gid_t gid; + u_short mode, mask; /* Same type as va_mode. */ + struct vattr va; error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup); if (error) @@ -2717,6 +2719,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str } else { bitpos = 0; } + moderet = 0; for (; bitpos < NFSATTRBIT_MAX; bitpos++) { if (attrsum > attrsize) { error = NFSERR_BADXDR; @@ -2766,6 +2769,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(i)); break; case NFSATTRBIT_MODE: + moderet = NFSERR_INVAL; /* Can't do MODESETMASKED. */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nvap->na_mode = nfstov_mode(*tl); attrsum += NFSX_UNSIGNED; @@ -2868,6 +2872,32 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; } + break; + case NFSATTRBIT_MODESETMASKED: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + mode = fxdr_unsigned(u_short, *tl++); + mask = fxdr_unsigned(u_short, *tl); + /* + * vp == NULL implies an Open/Create operation. + * This attribute can only be used for Setattr and + * only for NFSv4.1 or higher. + * If moderet != 0, a mode attribute has also been + * specified and this attribute cannot be done in the + * same Setattr operation. + */ + if ((nd->nd_flag & ND_NFSV41) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mode & ~07777) != 0 || (mask & ~07777) != 0 || + vp == NULL) + nd->nd_repstat = NFSERR_INVAL; + else if (moderet == 0) + moderet = VOP_GETATTR(vp, &va, nd->nd_cred); + if (moderet == 0) + nvap->na_mode = (mode & mask) | + (va.va_mode & ~mask); + else + nd->nd_repstat = moderet; + attrsum += 2 * NFSX_UNSIGNED; break; default: nd->nd_repstat = NFSERR_ATTRNOTSUPP; Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:58:33 2019 (r347044) @@ -461,13 +461,18 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int } } if (!nd->nd_repstat && - NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) { + (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE) || + NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))) { NFSVNO_ATTRINIT(&nva2); NFSVNO_SETATTRVAL(&nva2, mode, nva.na_mode); nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p, exp); - if (!nd->nd_repstat) - NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (!nd->nd_repstat) { + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODESETMASKED); + } } #ifdef NFS4_ACL_EXTATTR_NAME From owner-svn-src-stable-12@freebsd.org Fri May 3 03:34:24 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E64311582F62; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89DEC85945; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DFA41B0E3; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433YNut023993; Fri, 3 May 2019 03:34:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433YNll023992; Fri, 3 May 2019 03:34:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030334.x433YNll023992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347046 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 347046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89DEC85945 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:34:24 -0000 Author: mav Date: Fri May 3 03:34:22 2019 New Revision: 347046 URL: https://svnweb.freebsd.org/changeset/base/347046 Log: MFC r346760: Fix minor mismerges. No functional change. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:05:22 2019 (r347045) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:34:22 2019 (r347046) @@ -84,7 +84,7 @@ void range_tree_init(void); void range_tree_fini(void); range_tree_t *range_tree_create_impl(range_tree_ops_t *ops, void *arg, int (*avl_compare)(const void*, const void*), uint64_t gap); - range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); void range_tree_destroy(range_tree_t *rt); boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); range_seg_t *range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size); @@ -108,13 +108,6 @@ void range_tree_clear(range_tree_t *rt, uint64_t start void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); range_seg_t *range_tree_first(range_tree_t *rt); - -void rt_avl_create(range_tree_t *rt, void *arg); -void rt_avl_destroy(range_tree_t *rt, void *arg); -void rt_avl_add(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_remove(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_vacate(range_tree_t *rt, void *arg); -extern struct range_tree_ops rt_avl_ops; void rt_avl_create(range_tree_t *rt, void *arg); void rt_avl_destroy(range_tree_t *rt, void *arg); From owner-svn-src-stable-12@freebsd.org Fri May 3 03:35:37 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA301583037; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8215285BA4; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 572191B0E6; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433ZbE6024175; Fri, 3 May 2019 03:35:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433ZbHP024174; Fri, 3 May 2019 03:35:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030335.x433ZbHP024174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347048 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 347048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8215285BA4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:35:38 -0000 Author: mav Date: Fri May 3 03:35:36 2019 New Revision: 347048 URL: https://svnweb.freebsd.org/changeset/base/347048 Log: MFC r346762: Add mutex_destroy() missed in r334844. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:34:50 2019 (r347047) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:35:36 2019 (r347048) @@ -498,8 +498,10 @@ dsl_pool_close(dsl_pool_t *dp) rrw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); taskq_destroy(dp->dp_vnrele_taskq); - if (dp->dp_blkstats != NULL) + if (dp->dp_blkstats != NULL) { + mutex_destroy(&dp->dp_blkstats->zab_lock); kmem_free(dp->dp_blkstats, sizeof (zfs_all_blkstats_t)); + } kmem_free(dp, sizeof (dsl_pool_t)); } From owner-svn-src-stable-12@freebsd.org Fri May 3 09:38:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE448158A873; Fri, 3 May 2019 09:38:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 49A9F6836E; Fri, 3 May 2019 09:38:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 015A326029D; Fri, 3 May 2019 11:38:45 +0200 (CEST) Subject: Re: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src From: Hans Petter Selasky To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905020226.x422Qge2023199@repo.freebsd.org> Message-ID: Date: Fri, 3 May 2019 11:38:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49A9F6836E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-2.54)[ip: (-8.92), ipnet: 2a01:4f8::/29(-2.06), asn: 24940(-1.70), country: DE(-0.01)]; MX_GOOD(-0.01)[mail.turbocat.net]; NEURAL_HAM_SHORT(-0.84)[-0.842,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 09:38:49 -0000 On 2019-05-02 09:32, Hans Petter Selasky wrote: > On 2019-05-02 04:26, Johannes Lundberg wrote: >> Author: johalun >> Date: Thu May  2 02:26:42 2019 >> New Revision: 347012 >> URL: https://svnweb.freebsd.org/changeset/base/347012 >> >> Log: >>    MFC r346712: >>    Don't call cdev_init where cdev_alloc is called. cdev_alloc already >>    handles initialization. > > Please also MFC to 11 if possible. > I took care of it. --HPS From owner-svn-src-stable-12@freebsd.org Fri May 3 22:54:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45DDC159C92E; Fri, 3 May 2019 22:54:58 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3B0C8BCAF; Fri, 3 May 2019 22:54:57 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C2D427639; Fri, 3 May 2019 22:54:57 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43MsvaV040368; Fri, 3 May 2019 22:54:57 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43Msuao040363; Fri, 3 May 2019 22:54:56 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032254.x43Msuao040363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 22:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347067 - stable/12/lib/msun/src X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/lib/msun/src X-SVN-Commit-Revision: 347067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3B0C8BCAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 22:54:58 -0000 Author: peterj Date: Fri May 3 22:54:56 2019 New Revision: 347067 URL: https://svnweb.freebsd.org/changeset/base/347067 Log: MFC r343953: Replace calls to sin(x) and cos(x) with a single call to sincos(). Replace calls to sinf(x) and cosf(x) with a single call to sincosf(). Approved by: grog, jhb (mentors) Modified: stable/12/lib/msun/src/e_j0.c stable/12/lib/msun/src/e_j0f.c stable/12/lib/msun/src/e_j1.c stable/12/lib/msun/src/e_j1f.c stable/12/lib/msun/src/e_jn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/msun/src/e_j0.c ============================================================================== --- stable/12/lib/msun/src/e_j0.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j0.c Fri May 3 22:54:56 2019 (r347067) @@ -93,8 +93,7 @@ __ieee754_j0(double x) if(ix>=0x7ff00000) return one/(x*x); x = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ @@ -173,8 +172,7 @@ __ieee754_y0(double x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/12/lib/msun/src/e_j0f.c ============================================================================== --- stable/12/lib/msun/src/e_j0f.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j0f.c Fri May 3 22:54:56 2019 (r347067) @@ -55,8 +55,7 @@ __ieee754_j0f(float x) if(ix>=0x7f800000) return one/(x*x); x = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7f000000) { /* Make sure x+x does not overflow. */ @@ -128,8 +127,7 @@ __ieee754_y0f(float x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/12/lib/msun/src/e_j1.c ============================================================================== --- stable/12/lib/msun/src/e_j1.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j1.c Fri May 3 22:54:56 2019 (r347067) @@ -94,8 +94,7 @@ __ieee754_j1(double x) if(ix>=0x7ff00000) return one/x; y = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(y); - c = cos(y); + sincos(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure y+y not overflow */ @@ -159,8 +158,7 @@ __ieee754_y1(double x) /* y1(x<0) = NaN and raise invalid exception. */ if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure x+x not overflow */ Modified: stable/12/lib/msun/src/e_j1f.c ============================================================================== --- stable/12/lib/msun/src/e_j1f.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j1f.c Fri May 3 22:54:56 2019 (r347067) @@ -56,8 +56,7 @@ __ieee754_j1f(float x) if(ix>=0x7f800000) return one/x; y = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(y); - c = cosf(y); + sincosf(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure y+y not overflow */ @@ -114,8 +113,7 @@ __ieee754_y1f(float x) if(ix==0) return -one/vzero; if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure x+x not overflow */ Modified: stable/12/lib/msun/src/e_jn.c ============================================================================== --- stable/12/lib/msun/src/e_jn.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_jn.c Fri May 3 22:54:56 2019 (r347067) @@ -54,7 +54,7 @@ double __ieee754_jn(int n, double x) { int32_t i,hx,ix,lx, sgn; - double a, b, temp, di; + double a, b, c, s, temp, di; double z, w; /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x) @@ -91,11 +91,12 @@ __ieee754_jn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = cos(x)+sin(x); break; - case 1: temp = -cos(x)+sin(x); break; - case 2: temp = -cos(x)-sin(x); break; - case 3: temp = cos(x)-sin(x); break; + case 0: temp = c+s; break; + case 1: temp = -c+s; break; + case 2: temp = -c-s; break; + case 3: temp = c-s; break; } b = invsqrtpi*temp/sqrt(x); } else { @@ -216,7 +217,7 @@ __ieee754_yn(int n, double x) { int32_t i,hx,ix,lx; int32_t sign; - double a, b, temp; + double a, b, c, s, temp; EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; @@ -248,11 +249,12 @@ __ieee754_yn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = sin(x)-cos(x); break; - case 1: temp = -sin(x)-cos(x); break; - case 2: temp = -sin(x)+cos(x); break; - case 3: temp = sin(x)+cos(x); break; + case 0: temp = s-c; break; + case 1: temp = -s-c; break; + case 2: temp = -s+c; break; + case 3: temp = s+c; break; } b = invsqrtpi*temp/sqrt(x); } else { From owner-svn-src-stable-12@freebsd.org Fri May 3 23:02:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51707159CBAB; Fri, 3 May 2019 23:02:16 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7FFB8C1F6; Fri, 3 May 2019 23:02:15 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B27277C9; Fri, 3 May 2019 23:02:15 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N2FPJ045520; Fri, 3 May 2019 23:02:15 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N2FS0045519; Fri, 3 May 2019 23:02:15 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032302.x43N2FS0045519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347069 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 347069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7FFB8C1F6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:02:16 -0000 Author: peterj Date: Fri May 3 23:02:15 2019 New Revision: 347069 URL: https://svnweb.freebsd.org/changeset/base/347069 Log: MFC: r346265 Fix cpufreq(4) on RPI-B Approved by: grog, jhb (mentors) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 22:56:50 2019 (r347068) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 23:02:15 2019 (r347069) @@ -126,6 +126,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2835", 1 }, { "brcm,bcm2836", 1 }, { "brcm,bcm2837", 1 }, { NULL, 0 } From owner-svn-src-stable-12@freebsd.org Fri May 3 23:06:36 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A045B159CDB0; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 431A18C4FC; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24080277DE; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N6ZGK045825; Fri, 3 May 2019 23:06:35 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N6ZPQ045824; Fri, 3 May 2019 23:06:35 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032306.x43N6ZPQ045824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347071 - stable/12/sys/arm/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/sys/arm/conf X-SVN-Commit-Revision: 347071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 431A18C4FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:06:36 -0000 Author: peterj Date: Fri May 3 23:06:35 2019 New Revision: 347071 URL: https://svnweb.freebsd.org/changeset/base/347071 Log: MFC: r346266 Specify correct Ethernet phy for RPI-B Approved by: grog, jhb (mentors) Modified: stable/12/sys/arm/conf/RPI-B Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/conf/RPI-B ============================================================================== --- stable/12/sys/arm/conf/RPI-B Fri May 3 23:02:55 2019 (r347070) +++ stable/12/sys/arm/conf/RPI-B Fri May 3 23:06:35 2019 (r347071) @@ -77,7 +77,7 @@ device da device umass # USB ethernet support -device smcphy +device smscphy device mii device smsc From owner-svn-src-stable-12@freebsd.org Sat May 4 09:01:57 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 661BE15874CD; Sat, 4 May 2019 09:01:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D39177ED5; Sat, 4 May 2019 09:01:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88AA626C; Sat, 4 May 2019 09:01:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4491uCq064929; Sat, 4 May 2019 09:01:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4491uVE064928; Sat, 4 May 2019 09:01:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040901.x4491uVE064928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347080 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D39177ED5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:01:57 -0000 Author: tuexen Date: Sat May 4 09:01:56 2019 New Revision: 347080 URL: https://svnweb.freebsd.org/changeset/base/347080 Log: MFC r343401: Update a comment to reflect the current reality. SYN-cache entries live for abaut 12 seconds, not 45, when default setting are used. MFC r343402: Kill a trailing whitespace character... MFC r343403: Get the arithmetic right... Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 02:45:24 2019 (r347079) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 09:01:56 2019 (r347080) @@ -154,7 +154,12 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. - * 3 retransmits corresponds to a timeout of 3 * (1 + 2 + 4 + 8) == 45 seconds, + * 3 retransmits corresponds to a timeout with default values of + * TCPTV_RTOBASE * ( 1 + + * tcp_syn_backoff[1] + + * tcp_syn_backoff[2] + + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-stable-12@freebsd.org Sat May 4 09:07:55 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1148B158757F; Sat, 4 May 2019 09:07:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C117801CF; Sat, 4 May 2019 09:07:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 712506295; Sat, 4 May 2019 09:07:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4497s4m065223; Sat, 4 May 2019 09:07:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4497seb065221; Sat, 4 May 2019 09:07:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040907.x4497seb065221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347081 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C117801CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:07:55 -0000 Author: tuexen Date: Sat May 4 09:07:53 2019 New Revision: 347081 URL: https://svnweb.freebsd.org/changeset/base/347081 Log: MFC r343525: Fix the detection of ECN-setup SYN-ACK packets. RFC 3168 defines an ECN-setup SYN-ACK packet as on with the ECE flags set and the CWR flags not set. The code was only checking if ECE flag is set. This patch adds the check to verify that the CWR flags is not set. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ Differential Revision: https://reviews.freebsd.org/D18996 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_input.c Sat May 4 09:07:53 2019 (r347081) @@ -2027,7 +2027,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else tp->t_flags |= TF_ACKNOW; - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:07:53 2019 (r347081) @@ -5245,7 +5245,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-stable-12@freebsd.org Sat May 4 09:11:18 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D82D1587651; Sat, 4 May 2019 09:11:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21A43803AB; Sat, 4 May 2019 09:11:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEE7763D7; Sat, 4 May 2019 09:11:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449BHTF067922; Sat, 4 May 2019 09:11:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449BH2L067920; Sat, 4 May 2019 09:11:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040911.x449BH2L067920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347082 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21A43803AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:11:18 -0000 Author: tuexen Date: Sat May 4 09:11:17 2019 New Revision: 347082 URL: https://svnweb.freebsd.org/changeset/base/347082 Log: MFC r343661: When handling SYN-ACK segments in the SYN-RCVD state, set tp->snd_wnd consistently. This inconsistency was observed when working on the bug reported in PR 235256, although it does not fix the reported issue. The fix for the PR will be a separate commit. PR: 235256 Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19033 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Sat May 4 09:07:53 2019 (r347081) +++ stable/12/sys/netinet/tcp_input.c Sat May 4 09:11:17 2019 (r347082) @@ -2402,8 +2402,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == (TF_RCVD_SCALE|TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } + tp->snd_wnd = tiwin; /* * Make transitions: * SYN-RECEIVED -> ESTABLISHED Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:07:53 2019 (r347081) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:11:17 2019 (r347082) @@ -5445,6 +5445,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st tp->ts_recent_age = tcp_ts_getticks(); tp->ts_recent = to->to_tsval; } + tp->snd_wnd = tiwin; /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN flag * is on (half-synchronized state), then queue data for later @@ -5452,7 +5453,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st */ if ((thflags & TH_ACK) == 0) { if (IS_FASTOPEN(tp->t_flags)) { - tp->snd_wnd = tiwin; cc_conn_init(tp); } return (rack_process_data(m, th, so, tp, drop_hdrlen, tlen, @@ -5464,7 +5464,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st if ((tp->t_flags & (TF_RCVD_SCALE | TF_REQ_SCALE)) == (TF_RCVD_SCALE | TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } /* * Make transitions: SYN-RECEIVED -> ESTABLISHED SYN-RECEIVED* -> From owner-svn-src-stable-12@freebsd.org Sat May 4 09:13:53 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF2471587917; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 950D08077D; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9E9643B; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449Dq9s070697; Sat, 4 May 2019 09:13:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449DqdW070696; Sat, 4 May 2019 09:13:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040913.x449DqdW070696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347083 - stable/12/lib/libsysdecode X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/lib/libsysdecode X-SVN-Commit-Revision: 347083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 950D08077D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:13:53 -0000 Author: tuexen Date: Sat May 4 09:13:52 2019 New Revision: 347083 URL: https://svnweb.freebsd.org/changeset/base/347083 Log: MFC r343742: Add missing SCTP_EOR entry. Modified: stable/12/lib/libsysdecode/flags.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libsysdecode/flags.c ============================================================================== --- stable/12/lib/libsysdecode/flags.c Sat May 4 09:11:17 2019 (r347082) +++ stable/12/lib/libsysdecode/flags.c Sat May 4 09:13:52 2019 (r347083) @@ -1208,7 +1208,7 @@ sysdecode_sctp_pr_policy(int policy) static struct name_table sctpsndflags[] = { X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) - X(SCTP_SENDALL) X(SCTP_SACK_IMMEDIATELY) XEND + X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND }; bool From owner-svn-src-stable-12@freebsd.org Sat May 4 09:15:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C2FC1587A17; Sat, 4 May 2019 09:15:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B37B5808E7; Sat, 4 May 2019 09:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E19B643D; Sat, 4 May 2019 09:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449FvBi070843; Sat, 4 May 2019 09:15:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449FvNl070842; Sat, 4 May 2019 09:15:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040915.x449FvNl070842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347084 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B37B5808E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:15:58 -0000 Author: tuexen Date: Sat May 4 09:15:57 2019 New Revision: 347084 URL: https://svnweb.freebsd.org/changeset/base/347084 Log: MFC r343769: Fix an off-by-one error in the input validation of the SCTP_RESET_STREAMS socketoption. This was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:13:52 2019 (r347083) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:15:57 2019 (r347084) @@ -4654,13 +4654,13 @@ sctp_setopt(struct socket *so, int optname, void *optv } for (i = 0; i < strrst->srs_number_streams; i++) { if ((send_in) && - (strrst->srs_stream_list[i] > stcb->asoc.streamincnt)) { + (strrst->srs_stream_list[i] >= stcb->asoc.streamincnt)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } if ((send_out) && - (strrst->srs_stream_list[i] > stcb->asoc.streamoutcnt)) { + (strrst->srs_stream_list[i] >= stcb->asoc.streamoutcnt)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-stable-12@freebsd.org Sat May 4 09:18:20 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6B41587AD5; Sat, 4 May 2019 09:18:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B59E780A22; Sat, 4 May 2019 09:18:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9825E643E; Sat, 4 May 2019 09:18:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449IJnP070998; Sat, 4 May 2019 09:18:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449IJaC070997; Sat, 4 May 2019 09:18:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040918.x449IJaC070997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347085 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B59E780A22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:18:20 -0000 Author: tuexen Date: Sat May 4 09:18:19 2019 New Revision: 347085 URL: https://svnweb.freebsd.org/changeset/base/347085 Log: MFC r343770: Only reduce the PMTU after the send call. The only way to increase it, is via PMTUD. This fixes an MTU issue reported by Timo Voelker. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 09:15:57 2019 (r347084) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 09:18:19 2019 (r347085) @@ -4287,10 +4287,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (net->port) { mtu -= sizeof(struct udphdr); } - if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu < net->mtu) { + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } - net->mtu = mtu; } } else if (ro->ro_rt == NULL) { /* route was freed */ @@ -4645,10 +4647,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (net->port) { mtu -= sizeof(struct udphdr); } - if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu < net->mtu) { + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } - net->mtu = mtu; } } else if (ifp) { if (ND_IFINFO(ifp)->linkmtu && From owner-svn-src-stable-12@freebsd.org Sat May 4 09:25:33 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4DA1587FBF; Sat, 4 May 2019 09:25:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC8181170; Sat, 4 May 2019 09:25:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB3D665F5; Sat, 4 May 2019 09:25:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449PWJV076534; Sat, 4 May 2019 09:25:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449PWlQ076533; Sat, 4 May 2019 09:25:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040925.x449PWlQ076533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347086 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FC8181170 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:25:33 -0000 Author: tuexen Date: Sat May 4 09:25:32 2019 New Revision: 347086 URL: https://svnweb.freebsd.org/changeset/base/347086 Log: MFC r343951: Fix locking for IPPROTO_SCTP level SCTP_DEFAULT_PRINFO socket option. This problem occurred when calling setsockopt() will invalid parameters. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:18:19 2019 (r347085) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:25:32 2019 (r347086) @@ -6209,6 +6209,9 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); if (info->pr_policy > SCTP_PR_SCTP_MAX) { + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-stable-12@freebsd.org Sat May 4 09:28:12 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7822D158805B; Sat, 4 May 2019 09:28:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCAC812CD; Sat, 4 May 2019 09:28:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E850965F6; Sat, 4 May 2019 09:28:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449SBSl076709; Sat, 4 May 2019 09:28:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449SBhD076708; Sat, 4 May 2019 09:28:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040928.x449SBhD076708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347087 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCAC812CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:28:12 -0000 Author: tuexen Date: Sat May 4 09:28:11 2019 New Revision: 347087 URL: https://svnweb.freebsd.org/changeset/base/347087 Log: MFC r343954: Fix a locking bug in the IPPROTO_SCTP level SCTP_EVENT socket option. This occurs when call setsockopt() with invalid parameters. This issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:25:32 2019 (r347086) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:28:11 2019 (r347087) @@ -6115,6 +6115,10 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_INP_RUNLOCK(inp); } } + } else { + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } } break; } From owner-svn-src-stable-12@freebsd.org Sat May 4 10:04:01 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2687E1588C6E; Sat, 4 May 2019 10:04:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC05A827A3; Sat, 4 May 2019 10:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93E1A6CF2; Sat, 4 May 2019 10:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A40vu097624; Sat, 4 May 2019 10:04:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A40IA097623; Sat, 4 May 2019 10:04:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041004.x44A40IA097623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347090 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC05A827A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:04:01 -0000 Author: tuexen Date: Sat May 4 10:04:00 2019 New Revision: 347090 URL: https://svnweb.freebsd.org/changeset/base/347090 Log: MFC r340179: Don't use a function when neither INET nor INET6 are defined. This is a valid case for the userland stack, where this fixes two set-but-not-used warnings in this case. Thanks to Christian Wright for reporting the issue. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 09:47:01 2019 (r347089) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 10:04:00 2019 (r347090) @@ -3733,6 +3733,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, str return (0); } +#if defined(INET) || defined(INET6) static struct sctp_tcb * sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, uint16_t port, @@ -3822,6 +3823,7 @@ sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, } return (NULL); } +#endif static struct mbuf * sctp_add_cookie(struct mbuf *init, int init_offset, @@ -12703,9 +12705,11 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); /* With the lock applied look again */ stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); +#if defined(INET) || defined(INET6) if ((stcb == NULL) && (control != NULL) && (port > 0)) { stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); } +#endif if (stcb == NULL) { SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); From owner-svn-src-stable-12@freebsd.org Sat May 4 10:06:18 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A201588D37; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C75E828E1; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ED826CF3; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A6Ioa097779; Sat, 4 May 2019 10:06:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A6Inw097778; Sat, 4 May 2019 10:06:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041006.x44A6Inw097778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347091 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C75E828E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:06:18 -0000 Author: tuexen Date: Sat May 4 10:06:17 2019 New Revision: 347091 URL: https://svnweb.freebsd.org/changeset/base/347091 Log: MFC r343960: Fix a locking issue in the IPPROTO_SCTP level SCTP_PEER_ADDR_THLDS socket option. The problem affects only setsockopt with invalid parameters. This issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:04:00 2019 (r347090) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:06:17 2019 (r347091) @@ -6335,6 +6335,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } } if (thlds->spt_pathcpthld != 0xffff) { + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } error = EINVAL; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); break; From owner-svn-src-stable-12@freebsd.org Sat May 4 10:09:26 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F9D1588EE2; Sat, 4 May 2019 10:09:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01A7D82AF7; Sat, 4 May 2019 10:09:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEFD16CF6; Sat, 4 May 2019 10:09:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A9PET097954; Sat, 4 May 2019 10:09:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A9PL7097953; Sat, 4 May 2019 10:09:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041009.x44A9PL7097953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347092 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01A7D82AF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:09:26 -0000 Author: tuexen Date: Sat May 4 10:09:25 2019 New Revision: 347092 URL: https://svnweb.freebsd.org/changeset/base/347092 Log: MFC r343961: Fix a locking issue when reporing outbound messages. Modified: stable/12/sys/netinet/sctputil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 10:06:17 2019 (r347091) +++ stable/12/sys/netinet/sctputil.c Sat May 4 10:09:25 2019 (r347092) @@ -3946,7 +3946,7 @@ sctp_report_all_outbound(struct sctp_tcb *stcb, uint16 TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, holds_lock); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 1); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, From owner-svn-src-stable-12@freebsd.org Sat May 4 10:13:38 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93D91589296; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD8682FB3; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 281D76E9B; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44ADcKn003066; Sat, 4 May 2019 10:13:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44ADc79003065; Sat, 4 May 2019 10:13:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041013.x44ADc79003065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347093 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DD8682FB3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:13:39 -0000 Author: tuexen Date: Sat May 4 10:13:37 2019 New Revision: 347093 URL: https://svnweb.freebsd.org/changeset/base/347093 Log: MFC r344048: Improve input validation for raw IPv4 socket using the IP_HDRINCL option. This issue was found by running syzkaller on OpenBSD. Greg Steuck made me aware that the problem might also exist on FreeBSD. Reported by: Greg Steuck Differential Revision: https://reviews.freebsd.org/D18834 Modified: stable/12/sys/netinet/raw_ip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/raw_ip.c ============================================================================== --- stable/12/sys/netinet/raw_ip.c Sat May 4 10:09:25 2019 (r347092) +++ stable/12/sys/netinet/raw_ip.c Sat May 4 10:13:37 2019 (r347093) @@ -454,6 +454,8 @@ rip_output(struct mbuf *m, struct socket *so, ...) u_long dst; int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST; + int cnt; + u_char opttype, optlen, *cp; va_start(ap, so); dst = va_arg(ap, u_long); @@ -527,6 +529,34 @@ rip_output(struct mbuf *m, struct socket *so, ...) INP_RUNLOCK(inp); m_freem(m); return (EINVAL); + } + /* + * Don't allow IP options which do not have the required + * structure as specified in section 3.1 of RFC 791 on + * pages 15-23. + */ + cp = (u_char *)(ip + 1); + cnt = (ip->ip_hl << 2) - sizeof (struct ip); + for (; cnt > 0; cnt -= optlen, cp += optlen) { + opttype = cp[IPOPT_OPTVAL]; + if (opttype == IPOPT_EOL) + break; + if (opttype == IPOPT_NOP) { + optlen = 1; + continue; + } + if (cnt < IPOPT_OLEN + sizeof(u_char)) { + INP_RUNLOCK(inp); + m_freem(m); + return (EINVAL); + } + optlen = cp[IPOPT_OLEN]; + if (optlen < IPOPT_OLEN + sizeof(u_char) || + optlen > cnt) { + INP_RUNLOCK(inp); + m_freem(m); + return (EINVAL); + } } /* * This doesn't allow application to specify ID of zero, From owner-svn-src-stable-12@freebsd.org Sat May 4 10:33:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DE9D15898CF; Sat, 4 May 2019 10:33:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6E1083961; Sat, 4 May 2019 10:33:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F47B71F6; Sat, 4 May 2019 10:33:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AXVft013530; Sat, 4 May 2019 10:33:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AXVFG013529; Sat, 4 May 2019 10:33:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041033.x44AXVFG013529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347094 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6E1083961 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:33:32 -0000 Author: tuexen Date: Sat May 4 10:33:31 2019 New Revision: 347094 URL: https://svnweb.freebsd.org/changeset/base/347094 Log: MFC r344148: Fix a byte ordering issue for the advertised receiver window in ACK segments sent in TIMEWAIT state, which I introduced in r336937. Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_timewait.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_timewait.c ============================================================================== --- stable/12/sys/netinet/tcp_timewait.c Sat May 4 10:13:37 2019 (r347093) +++ stable/12/sys/netinet/tcp_timewait.c Sat May 4 10:33:31 2019 (r347094) @@ -302,7 +302,7 @@ tcp_twstart(struct tcpcb *tp) if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && recwin < (tp->rcv_adv - tp->rcv_nxt)) recwin = (tp->rcv_adv - tp->rcv_nxt); - tw->last_win = htons((u_short)(recwin >> tp->rcv_scale)); + tw->last_win = (u_short)(recwin >> tp->rcv_scale); /* * Set t_recent if timestamps are used on the connection. From owner-svn-src-stable-12@freebsd.org Sat May 4 10:36:18 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1387F1589970; Sat, 4 May 2019 10:36:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC66783A94; Sat, 4 May 2019 10:36:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 944BF71F7; Sat, 4 May 2019 10:36:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AaHvC013708; Sat, 4 May 2019 10:36:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AaGrU013705; Sat, 4 May 2019 10:36:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041036.x44AaGrU013705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347095 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC66783A94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:36:18 -0000 Author: tuexen Date: Sat May 4 10:36:16 2019 New Revision: 347095 URL: https://svnweb.freebsd.org/changeset/base/347095 Log: MFC r344367: Use exponential backoff for retransmitting SYN segments as specified in the TCP RFCs. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18974 Modified: stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 10:36:16 2019 (r347095) @@ -2882,7 +2882,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_syn_backoff[tp->t_rxtshift]); + rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_backoff[tp->t_rxtshift]); else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:36:16 2019 (r347095) @@ -155,11 +155,11 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + - * tcp_syn_backoff[2] + - * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, + * TCPTV_RTOBASE * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 @@ -426,7 +426,7 @@ syncache_timeout(struct syncache *sc, struct syncache_ if (sc->sc_rxmits == 0) rexmt = TCPTV_RTOBASE; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_timer.c Sat May 4 10:36:16 2019 (r347095) @@ -233,9 +233,6 @@ tcp_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } -int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] = - { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 }; - int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; @@ -671,7 +668,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 10:36:16 2019 (r347095) @@ -199,7 +199,6 @@ extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; -extern int tcp_syn_backoff[]; extern int tcp_totbackoff; extern int tcp_rexmit_drop_options; From owner-svn-src-stable-12@freebsd.org Sat May 4 10:38:55 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C89EC1589A25; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABC583C1A; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F73771F9; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44ActCG013869; Sat, 4 May 2019 10:38:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AcsW9013867; Sat, 4 May 2019 10:38:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041038.x44AcsW9013867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347096 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6ABC583C1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:38:56 -0000 Author: tuexen Date: Sat May 4 10:38:54 2019 New Revision: 347096 URL: https://svnweb.freebsd.org/changeset/base/347096 Log: MFC r344368: Reduce the TCP initial retransmission timeout from 3 seconds to 1 second as allowed by RFC 6298. Reviewed by: kbowling@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18941 Modified: stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:36:16 2019 (r347095) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:38:54 2019 (r347096) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_backoff[1] + * tcp_backoff[2] + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 10:36:16 2019 (r347095) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 10:38:54 2019 (r347096) @@ -77,7 +77,7 @@ #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ From owner-svn-src-stable-12@freebsd.org Sat May 4 10:56:59 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42741589FB6; Sat, 4 May 2019 10:56:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A11844F9; Sat, 4 May 2019 10:56:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3512F753C; Sat, 4 May 2019 10:56:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AuwD8024510; Sat, 4 May 2019 10:56:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AuwVG024509; Sat, 4 May 2019 10:56:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041056.x44AuwVG024509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347098 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32A11844F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:56:59 -0000 Author: tuexen Date: Sat May 4 10:56:57 2019 New Revision: 347098 URL: https://svnweb.freebsd.org/changeset/base/347098 Log: MFC r344704: Improve consistency, no functional change. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:48:44 2019 (r347097) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:56:57 2019 (r347098) @@ -1128,10 +1128,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, actual += sizeof(struct sockaddr_in6); } else { #endif - memcpy(sas, sin, sizeof(*sin)); + memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin)); - actual += sizeof(*sin); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); + actual += sizeof(struct sockaddr_in); #ifdef INET6 } #endif @@ -1182,10 +1182,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } - memcpy(sas, sin6, sizeof(*sin6)); + memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin6)); - actual += sizeof(*sin6); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); + actual += sizeof(struct sockaddr_in6); if (actual >= limit) { return (actual); } From owner-svn-src-stable-12@freebsd.org Sat May 4 10:59:14 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DAE1158A080; Sat, 4 May 2019 10:59:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B306584668; Sat, 4 May 2019 10:59:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87B547540; Sat, 4 May 2019 10:59:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AxDbw024662; Sat, 4 May 2019 10:59:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AxDS0024661; Sat, 4 May 2019 10:59:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041059.x44AxDS0024661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347099 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B306584668 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:59:14 -0000 Author: tuexen Date: Sat May 4 10:59:13 2019 New Revision: 347099 URL: https://svnweb.freebsd.org/changeset/base/347099 Log: MFC r344708: Honor the memory limits provided when processing the IPPROTO_SCTP level socket option SCTP_GET_LOCAL_ADDRESSES in a getsockopt() call. Thanks to Thomas Barabosch for reporting the issue which was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:56:57 2019 (r347098) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:59:13 2019 (r347099) @@ -1122,12 +1122,18 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } #ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } in6_sin_2_v4mapsin6(sin, (struct sockaddr_in6 *)sas); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); } else { #endif + if (actual + sizeof(struct sockaddr_in) > limit) { + return (actual); + } memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); @@ -1135,9 +1141,6 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, #ifdef INET6 } #endif - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1182,13 +1185,13 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1202,6 +1205,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } } else { struct sctp_laddr *laddr; + size_t sa_len; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { if (stcb) { @@ -1209,6 +1213,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, continue; } } + sa_len = laddr->ifa->address.sa.sa_len; + if (actual + sa_len > limit) { + return (actual); + } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; switch (laddr->ifa->address.sa.sa_family) { @@ -1226,12 +1234,8 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, /* TSNH */ break; } - sas = (struct sockaddr_storage *)((caddr_t)sas + - laddr->ifa->address.sa.sa_len); - actual += laddr->ifa->address.sa.sa_len; - if (actual >= limit) { - return (actual); - } + sas = (struct sockaddr_storage *)((caddr_t)sas + sa_len); + actual += sa_len; } } return (actual); From owner-svn-src-stable-12@freebsd.org Sat May 4 11:01:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BF4158A18C; Sat, 4 May 2019 11:01:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0ED484863; Sat, 4 May 2019 11:01:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9924D758D; Sat, 4 May 2019 11:01:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B1V9Q025786; Sat, 4 May 2019 11:01:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B1VY9025785; Sat, 4 May 2019 11:01:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041101.x44B1VY9025785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347100 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0ED484863 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:01:32 -0000 Author: tuexen Date: Sat May 4 11:01:31 2019 New Revision: 347100 URL: https://svnweb.freebsd.org/changeset/base/347100 Log: MFC r344721: Report the correct length when using the IPPROTO_SCTP level socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:59:13 2019 (r347099) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:01:31 2019 (r347100) @@ -2240,8 +2240,8 @@ flags_out: SCTP_FIND_STCB(inp, stcb, saddr->sget_assoc_id); if (stcb) { - left = (*optsize) - sizeof(struct sctp_getaddresses); - *optsize = sizeof(struct sctp_getaddresses); + left = (*optsize) - sizeof(sctp_assoc_t); + *optsize = sizeof(sctp_assoc_t); sas = (struct sockaddr_storage *)&saddr->addr[0]; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -2315,7 +2315,7 @@ flags_out: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - *optsize = sizeof(struct sockaddr_storage) + actual; + *optsize = sizeof(sctp_assoc_t) + actual; break; } case SCTP_PEER_ADDR_PARAMS: From owner-svn-src-stable-12@freebsd.org Sat May 4 11:03:11 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2825158A40D; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57DE784D39; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D77676FC; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B3Bck029814; Sat, 4 May 2019 11:03:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B3BVC029813; Sat, 4 May 2019 11:03:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041103.x44B3BVC029813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347101 - stable/12/lib/libc/net X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/lib/libc/net X-SVN-Commit-Revision: 347101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57DE784D39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:03:11 -0000 Author: tuexen Date: Sat May 4 11:03:10 2019 New Revision: 347101 URL: https://svnweb.freebsd.org/changeset/base/347101 Log: MFC r344722: Use correct buffer sizes in sctp_get[lp]addrs(). Modified: stable/12/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/12/lib/libc/net/sctp_sys_calls.c Sat May 4 11:01:31 2019 (r347100) +++ stable/12/lib/libc/net/sctp_sys_calls.c Sat May 4 11:03:10 2019 (r347101) @@ -415,7 +415,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } /* size required is returned in 'asoc' */ - opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) ((size_t)asoc + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -475,9 +475,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd errno = ENOTCONN; return (-1); } - opt_len = (socklen_t) (size_of_addresses + - sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) (size_of_addresses + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; From owner-svn-src-stable-12@freebsd.org Sat May 4 11:05:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3702B158A4BA; Sat, 4 May 2019 11:05:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D309D84E8C; Sat, 4 May 2019 11:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACEC37706; Sat, 4 May 2019 11:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B5v8X029985; Sat, 4 May 2019 11:05:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B5vD9029984; Sat, 4 May 2019 11:05:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041105.x44B5vD9029984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347102 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D309D84E8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:05:58 -0000 Author: tuexen Date: Sat May 4 11:05:57 2019 New Revision: 347102 URL: https://svnweb.freebsd.org/changeset/base/347102 Log: MFC r344723: Handle the case when calling the IPPROTO_SCTP level socket option SCTP_STATUS on an association with no primary path (early state). This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:03:10 2019 (r347101) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:05:57 2019 (r347102) @@ -2644,42 +2644,47 @@ flags_out: sstat->sstat_instrms = stcb->asoc.streamincnt; sstat->sstat_outstrms = stcb->asoc.streamoutcnt; sstat->sstat_fragmentation_point = sctp_get_frag_point(stcb, &stcb->asoc); - memcpy(&sstat->sstat_primary.spinfo_address, - &stcb->asoc.primary_destination->ro._l_addr, - ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); net = stcb->asoc.primary_destination; - ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; - /* - * Again the user can get info from sctp_constants.h - * for what the state of the network is. - */ - if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* It's unconfirmed */ - sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; - } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* It's active */ - sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; - } else { - /* It's inactive */ - sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; - } - sstat->sstat_primary.spinfo_cwnd = net->cwnd; - sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; - sstat->sstat_primary.spinfo_rto = net->RTO; - sstat->sstat_primary.spinfo_mtu = net->mtu; - switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { + if (net != NULL) { + memcpy(&sstat->sstat_primary.spinfo_address, + &stcb->asoc.primary_destination->ro._l_addr, + ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); + ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; + /* + * Again the user can get info from + * sctp_constants.h for what the state of + * the network is. + */ + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* It's active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } + sstat->sstat_primary.spinfo_cwnd = net->cwnd; + sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; + sstat->sstat_primary.spinfo_rto = net->RTO; + sstat->sstat_primary.spinfo_mtu = net->mtu; + switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { #if defined(INET) - case AF_INET: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; + break; #endif #if defined(INET6) - case AF_INET6: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; + break; #endif - default: - break; + default: + break; + } + } else { + memset(&sstat->sstat_primary, 0, sizeof(struct sctp_paddrinfo)); } sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); From owner-svn-src-stable-12@freebsd.org Sat May 4 11:07:37 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5019158A5CC; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7842E85032; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CB867707; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B7aUs030107; Sat, 4 May 2019 11:07:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B7aQT030106; Sat, 4 May 2019 11:07:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041107.x44B7aQT030106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347103 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7842E85032 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:07:37 -0000 Author: tuexen Date: Sat May 4 11:07:35 2019 New Revision: 347103 URL: https://svnweb.freebsd.org/changeset/base/347103 Log: MFC r344724: Allow SCTP stream reconfiguration operations only in ESTABLISHED state. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:05:57 2019 (r347102) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:07:35 2019 (r347103) @@ -4631,6 +4631,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (sizeof(struct sctp_reset_streams) + strrst->srs_number_streams * sizeof(uint16_t) > optsize) { error = EINVAL; @@ -4745,6 +4751,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (stcb->asoc.stream_reset_outstanding) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); error = EALREADY; @@ -4812,6 +4824,12 @@ sctp_setopt(struct socket *so, int optname, void *optv */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); error = EOPNOTSUPP; + SCTP_TCB_UNLOCK(stcb); + break; + } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; SCTP_TCB_UNLOCK(stcb); break; } From owner-svn-src-stable-12@freebsd.org Sat May 4 11:11:04 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED54158A84E; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 738AB851FD; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BDFB7735; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BB4dg030360; Sat, 4 May 2019 11:11:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BB43I030359; Sat, 4 May 2019 11:11:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041111.x44BB43I030359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347104 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 738AB851FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:11:05 -0000 Author: tuexen Date: Sat May 4 11:11:03 2019 New Revision: 347104 URL: https://svnweb.freebsd.org/changeset/base/347104 Log: MFC r344726: Remove debug output. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:07:35 2019 (r347103) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:11:03 2019 (r347104) @@ -630,7 +630,6 @@ connected_type: /* now what about control */ if (control) { if (inp->control) { - SCTP_PRINTF("huh? control set?\n"); sctp_m_freem(inp->control); inp->control = NULL; } @@ -3751,13 +3750,11 @@ sctp_setopt(struct socket *so, int optname, void *optv uint32_t vrf_id; if (optval == NULL) { - SCTP_PRINTF("optval is NULL\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { - SCTP_PRINTF("inp is NULL?\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } From owner-svn-src-stable-12@freebsd.org Sat May 4 11:13:04 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F336158A928; Sat, 4 May 2019 11:13:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABF9085569; Sat, 4 May 2019 11:13:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 843C578B1; Sat, 4 May 2019 11:13:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BD3pO035235; Sat, 4 May 2019 11:13:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BD366035234; Sat, 4 May 2019 11:13:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041113.x44BD366035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347105 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABF9085569 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:13:04 -0000 Author: tuexen Date: Sat May 4 11:13:03 2019 New Revision: 347105 URL: https://svnweb.freebsd.org/changeset/base/347105 Log: MFC r344742: Allocate an assocition id and register the stcb with holding the lock. This avoids a race where stcbs can be found, which are not completely initialized. This was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Sat May 4 11:11:03 2019 (r347104) +++ stable/12/sys/netinet/sctp_pcb.c Sat May 4 11:13:03 2019 (r347105) @@ -4157,11 +4157,9 @@ sctp_aloc_a_assoc_id(struct sctp_inpcb *inp, struct sc struct sctpasochead *head; struct sctp_tcb *lstcb; - SCTP_INP_WLOCK(inp); try_again: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* TSNH */ - SCTP_INP_WUNLOCK(inp); return (0); } /* @@ -4180,8 +4178,7 @@ try_again: head = &inp->sctp_asocidhash[SCTP_PCBHASH_ASOC(id, inp->hashasocidmark)]; LIST_INSERT_HEAD(head, stcb, sctp_tcbasocidhash); stcb->asoc.in_asocid_hash = 1; - SCTP_INP_WUNLOCK(inp); - return id; + return (id); } /* @@ -4344,7 +4341,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd memset(stcb, 0, sizeof(*stcb)); asoc = &stcb->asoc; - asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); SCTP_TCB_LOCK_INIT(stcb); SCTP_TCB_SEND_LOCK_INIT(stcb); stcb->rport = rport; @@ -4355,7 +4351,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd /* failed */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); - LIST_REMOVE(stcb, sctp_tcbasocidhash); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); SCTP_DECR_ASOC_COUNT(); *error = err; @@ -4368,7 +4363,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd /* inpcb freed while alloc going on */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); - LIST_REMOVE(stcb, sctp_tcbasocidhash); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); SCTP_INP_WUNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); @@ -4379,6 +4373,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd } SCTP_TCB_LOCK(stcb); + asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); /* now that my_vtag is set, add it to the hash */ head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* put it in the bucket in the vtag hash of assoc's for the system */ From owner-svn-src-stable-12@freebsd.org Sat May 4 11:15:02 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700BE158AB30; Sat, 4 May 2019 11:15:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17B9D85753; Sat, 4 May 2019 11:15:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4A4878B4; Sat, 4 May 2019 11:15:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BF1no035386; Sat, 4 May 2019 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BF1pB035385; Sat, 4 May 2019 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041115.x44BF1pB035385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347106 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 17B9D85753 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:15:02 -0000 Author: tuexen Date: Sat May 4 11:15:01 2019 New Revision: 347106 URL: https://svnweb.freebsd.org/changeset/base/347106 Log: MFC r344872: After removing an entry from the stream scheduler list, set the pointers to NULL, since we are checking for it in case the element gets inserted again. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:13:03 2019 (r347105) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:15:01 2019 (r347106) @@ -78,9 +78,10 @@ sctp_ss_default_clear(struct sctp_tcb *stcb, struct sc SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.rr.next_spoke); + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.rr.next_spoke); strq->ss_params.rr.next_spoke.tqe_next = NULL; strq->ss_params.rr.next_spoke.tqe_prev = NULL; } @@ -793,12 +794,17 @@ static void sctp_ss_fcfs_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { + struct sctp_stream_queue_pending *sp; + if (clear_values) { if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.list)) { - TAILQ_REMOVE(&asoc->ss_data.out.list, TAILQ_FIRST(&asoc->ss_data.out.list), ss_next); + sp = TAILQ_FIRST(&asoc->ss_data.out.list); + TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); + sp->ss_next.tqe_next = NULL; + sp->ss_next.tqe_prev = NULL; } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -861,6 +867,8 @@ sctp_ss_fcfs_remove(struct sctp_tcb *stcb, struct sctp ((sp->ss_next.tqe_next != NULL) || (sp->ss_next.tqe_prev != NULL))) { TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); + sp->ss_next.tqe_next = NULL; + sp->ss_next.tqe_prev = NULL; } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); From owner-svn-src-stable-12@freebsd.org Sat May 4 11:17:21 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F87158ABD7; Sat, 4 May 2019 11:17:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF71F85892; Sat, 4 May 2019 11:17:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD9478B5; Sat, 4 May 2019 11:17:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BHK7p035535; Sat, 4 May 2019 11:17:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BHKKK035534; Sat, 4 May 2019 11:17:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041117.x44BHKKK035534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347107 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF71F85892 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:17:21 -0000 Author: tuexen Date: Sat May 4 11:17:20 2019 New Revision: 347107 URL: https://svnweb.freebsd.org/changeset/base/347107 Log: MFC r344924: Some cleanup and consistency improvements. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:15:01 2019 (r347106) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:17:20 2019 (r347107) @@ -54,6 +54,9 @@ sctp_ss_default_init(struct sctp_tcb *stcb, struct sct { uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } asoc->ss_data.locked_on_sending = NULL; asoc->ss_data.last_out_stream = NULL; TAILQ_INIT(&asoc->ss_data.out.wheel); @@ -65,8 +68,11 @@ sctp_ss_default_init(struct sctp_tcb *stcb, struct sct for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, &stcb->asoc.strmout[i], - NULL, holds_lock); + NULL, 1); } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } return; } @@ -396,12 +402,13 @@ sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_ SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); if (clear_values) { strq->ss_params.prio.priority = 0; } - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.prio.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.prio.next_spoke); strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; @@ -586,12 +593,13 @@ sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_as SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); if (clear_values) { strq->ss_params.fb.rounds = -1; } - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.fb.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.fb.next_spoke); strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; } @@ -764,6 +772,9 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_a struct sctp_stream_queue_pending *sp; uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } TAILQ_INIT(&asoc->ss_data.out.list); /* * If there is data in the stream queues already, the scheduler of @@ -781,11 +792,14 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_a x++; } if (sp != NULL) { - sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, holds_lock); + sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, 1); add_more = 1; } } n++; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } From owner-svn-src-stable-12@freebsd.org Sat May 4 11:18:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E71158ADB8; Sat, 4 May 2019 11:18:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A450A85A6B; Sat, 4 May 2019 11:18:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BBBC78B6; Sat, 4 May 2019 11:18:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BIdDq035642; Sat, 4 May 2019 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BIdlZ035641; Sat, 4 May 2019 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041118.x44BIdlZ035641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347108 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A450A85A6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:18:40 -0000 Author: tuexen Date: Sat May 4 11:18:39 2019 New Revision: 347108 URL: https://svnweb.freebsd.org/changeset/base/347108 Log: MFC r344925: Fix locking bug. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:17:20 2019 (r347107) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:18:39 2019 (r347108) @@ -4069,10 +4069,12 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { + SCTP_TCB_SEND_LOCK(stcb); stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1); stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value]; stcb->asoc.stream_scheduling_module = av->assoc_value; stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); + SCTP_TCB_SEND_UNLOCK(stcb); SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -4088,10 +4090,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); + SCTP_TCB_SEND_LOCK(stcb); stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1); stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value]; stcb->asoc.stream_scheduling_module = av->assoc_value; stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); + SCTP_TCB_SEND_UNLOCK(stcb); SCTP_TCB_UNLOCK(stcb); } SCTP_INP_RUNLOCK(inp); From owner-svn-src-stable-12@freebsd.org Sat May 4 11:21:42 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46193158B003; Sat, 4 May 2019 11:21:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1A8B85DAA; Sat, 4 May 2019 11:21:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4D067914; Sat, 4 May 2019 11:21:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BLfFO039988; Sat, 4 May 2019 11:21:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BLfs5039987; Sat, 4 May 2019 11:21:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041121.x44BLfs5039987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347109 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1A8B85DAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:21:42 -0000 Author: tuexen Date: Sat May 4 11:21:41 2019 New Revision: 347109 URL: https://svnweb.freebsd.org/changeset/base/347109 Log: MFC r345441: Fix a KASSERT() in tcp_output(). When checking the length of the headers at this point, the IP level options have not been added to the mbuf chain. So don't take them into account. Reviewed by: rrs@ Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Sat May 4 11:18:39 2019 (r347108) +++ stable/12/sys/netinet/tcp_output.c Sat May 4 11:21:41 2019 (r347109) @@ -1283,15 +1283,9 @@ send: m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen; } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", - __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); -#else - KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", - __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); -#endif + KASSERT(len + hdrlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected: %d + %u != %u", + __func__, len, hdrlen, m_length(m, NULL))); #ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ From owner-svn-src-stable-12@freebsd.org Sat May 4 11:24:21 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E3E158B203; Sat, 4 May 2019 11:24:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F01D585FFB; Sat, 4 May 2019 11:24:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0FE87A5C; Sat, 4 May 2019 11:24:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BOKve040980; Sat, 4 May 2019 11:24:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BOJgx040975; Sat, 4 May 2019 11:24:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041124.x44BOJgx040975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347110 - in stable/12: share/man/man4 sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet X-SVN-Commit-Revision: 347110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F01D585FFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:24:21 -0000 Author: tuexen Date: Sat May 4 11:24:19 2019 New Revision: 347110 URL: https://svnweb.freebsd.org/changeset/base/347110 Log: MFC r345458: Add sysctl variable net.inet.tcp.rexmit_initial for setting RTO.Initial used by TCP. Reviewed by: rrs@, 0mp@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19355 Modified: stable/12/share/man/man4/tcp.4 stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Sat May 4 11:21:41 2019 (r347109) +++ stable/12/share/man/man4/tcp.4 Sat May 4 11:24:19 2019 (r347110) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd August 6, 2018 +.Dd March 23, 2019 .Dt TCP 4 .Os .Sh NAME @@ -459,7 +459,7 @@ The actual limit applied to a session's reassembly que the system-calculated automatic limit and the user-specified .Va reass.maxqueuelen limit. -.It Va rexmit_min , rexmit_slop +.It Va rexmit_initial , rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . The slop is @@ -481,6 +481,7 @@ code. For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . +The initial value is used before an RTT measurement has been performed. .It Va initcwnd_segments Enable the ability to specify initial congestion window in number of segments. The default value is 10 as suggested by RFC 6928. Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_subr.c Sat May 4 11:24:19 2019 (r347110) @@ -1082,6 +1082,9 @@ tcp_init(void) tcp_keepintvl = TCPTV_KEEPINTVL; tcp_maxpersistidle = TCPTV_KEEP_IDLE; tcp_msl = TCPTV_MSL; + tcp_rexmit_initial = TCPTV_RTOBASE; + if (tcp_rexmit_initial < 1) + tcp_rexmit_initial = 1; tcp_rexmit_min = TCPTV_MIN; if (tcp_rexmit_min < 1) tcp_rexmit_min = 1; @@ -1660,9 +1663,9 @@ tcp_newtcpcb(struct inpcb *inp) * reasonable initial retransmit time. */ tp->t_srtt = TCPTV_SRTTBASE; - tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; + tp->t_rttvar = ((tcp_rexmit_initial - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; tp->t_rttmin = tcp_rexmit_min; - tp->t_rxtcur = TCPTV_RTOBASE; + tp->t_rxtcur = tcp_rexmit_initial; tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->t_rcvtime = ticks; Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:24:19 2019 (r347110) @@ -155,10 +155,10 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_backoff[1] + - * tcp_backoff[2] + - * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * tcp_rexmit_initial * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ @@ -424,9 +424,10 @@ syncache_timeout(struct syncache *sc, struct syncache_ int rexmt; if (sc->sc_rxmits == 0) - rexmt = TCPTV_RTOBASE; + rexmt = tcp_rexmit_initial; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, + tcp_rexmit_initial * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_timer.c Sat May 4 11:24:19 2019 (r347110) @@ -110,6 +110,11 @@ int tcp_msl; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, CTLTYPE_INT|CTLFLAG_RW, &tcp_msl, 0, sysctl_msec_to_ticks, "I", "Maximum segment lifetime"); +int tcp_rexmit_initial; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT|CTLFLAG_RW, + &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", + "Initial Retransmission Timeout"); + int tcp_rexmit_min; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, CTLTYPE_INT|CTLFLAG_RW, &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I", @@ -668,7 +673,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; + rexmt = tcp_rexmit_initial * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 11:24:19 2019 (r347110) @@ -194,6 +194,7 @@ extern int tcp_keepintvl; /* time between keepalive p extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; +extern int tcp_rexmit_initial; extern int tcp_rexmit_min; extern int tcp_rexmit_slop; extern int tcp_msl; From owner-svn-src-stable-12@freebsd.org Sat May 4 12:02:42 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64E5158C30F; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0A9871B4; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 447568102; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44C2g9Q062007; Sat, 4 May 2019 12:02:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44C2gsF062006; Sat, 4 May 2019 12:02:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041202.x44C2gsF062006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347111 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C0A9871B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:02:43 -0000 Author: tuexen Date: Sat May 4 12:02:41 2019 New Revision: 347111 URL: https://svnweb.freebsd.org/changeset/base/347111 Log: MFC r345460: Limit the number of bytes which can be queued for SCTP sockets. This is joint work with rrs@. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 11:24:19 2019 (r347110) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:02:41 2019 (r347111) @@ -13026,12 +13026,7 @@ sctp_lower_sosend(struct socket *so, /* Calculate the maximum we can send */ inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { - if (non_blocking) { - /* we already checked for non-blocking above. */ - max_len = sndlen; - } else { - max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; - } + max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; } else { max_len = 0; } From owner-svn-src-stable-12@freebsd.org Sat May 4 12:07:02 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAC6158C640; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83767873CD; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508C48103; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44C719c062245; Sat, 4 May 2019 12:07:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44C70cu062244; Sat, 4 May 2019 12:07:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041207.x44C70cu062244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347112 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83767873CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:07:02 -0000 Author: tuexen Date: Sat May 4 12:07:00 2019 New Revision: 347112 URL: https://svnweb.freebsd.org/changeset/base/347112 Log: MFC r345461: Limit the size of messages sent on 1-to-many style SCTP sockets with the SCTP_SENDALL flag. Allow also only one operation per SCTP endpoint. This fixes an issue found by running syzkaller and is joint work with rrs@. Modified: stable/12/sys/netinet/sctp.h stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp.h ============================================================================== --- stable/12/sys/netinet/sctp.h Sat May 4 12:02:41 2019 (r347111) +++ stable/12/sys/netinet/sctp.h Sat May 4 12:07:00 2019 (r347112) @@ -491,6 +491,7 @@ struct sctp_error_auth_invalid_hmac { * time */ #define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst * in sat */ +#define SCTP_MAX_SENDALL_LIMIT 1024 /* Data Chuck Specific Flags */ #define SCTP_DATA_FRAG_MASK 0x03 @@ -516,6 +517,7 @@ struct sctp_error_auth_invalid_hmac { #define SCTP_PCB_FLAGS_BOUNDALL 0x00000004 #define SCTP_PCB_FLAGS_ACCEPTING 0x00000008 #define SCTP_PCB_FLAGS_UNBOUND 0x00000010 +#define SCTP_PCB_FLAGS_SND_ITERATOR_UP 0x00000020 #define SCTP_PCB_FLAGS_CLOSE_IP 0x00040000 #define SCTP_PCB_FLAGS_WAS_CONNECTED 0x00080000 #define SCTP_PCB_FLAGS_WAS_ABORTED 0x00100000 Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 12:02:41 2019 (r347111) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:07:00 2019 (r347112) @@ -6804,6 +6804,10 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UN */ /* now free everything */ + if (ca->inp) { + /* Lets clear the flag to allow others to run. */ + ca->inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + } sctp_m_freem(ca->m); SCTP_FREE(ca, SCTP_M_COPYAL); } @@ -6857,6 +6861,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, int ret; struct sctp_copy_all *ca; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) { + /* There is another. */ + return (EBUSY); + } + if (uio->uio_resid > SCTP_MAX_SENDALL_LIMIT) { + /* You must be less than the max! */ + return (EMSGSIZE); + } SCTP_MALLOC(ca, struct sctp_copy_all *, sizeof(struct sctp_copy_all), SCTP_M_COPYAL); if (ca == NULL) { @@ -6893,6 +6905,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, ca->sndlen += SCTP_BUF_LEN(mat); } } + inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, From owner-svn-src-stable-12@freebsd.org Sat May 4 12:34:13 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF259158D3C2; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 915AC8843A; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69B4285FC; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CYCk8077937; Sat, 4 May 2019 12:34:12 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CYCJw077935; Sat, 4 May 2019 12:34:12 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905041234.x44CYCJw077935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 4 May 2019 12:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347114 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 347114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 915AC8843A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:34:13 -0000 Author: rwatson Date: Sat May 4 12:34:11 2019 New Revision: 347114 URL: https://svnweb.freebsd.org/changeset/base/347114 Log: Merge r346814 from head to stable/12: Add a man page for the DTrace Audit Provider, since we are now growing a set of provider man pages. Sponsored by: DARPA, AFRL Added: stable/12/share/man/man4/dtrace_audit.4 - copied unchanged from r346814, head/share/man/man4/dtrace_audit.4 Modified: stable/12/share/man/man4/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Sat May 4 12:19:02 2019 (r347113) +++ stable/12/share/man/man4/Makefile Sat May 4 12:34:11 2019 (r347114) @@ -893,7 +893,8 @@ _ccd.4= ccd.4 .endif .if ${MK_CDDL} != "no" -_dtrace_provs= dtrace_io.4 \ +_dtrace_provs= dtrace_audit.4 \ + dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ @@ -902,6 +903,8 @@ _dtrace_provs= dtrace_io.4 \ dtrace_tcp.4 \ dtrace_udp.4 \ dtrace_udplite.4 + +MLINKS+= dtrace_audit.4 dtaudit.4 .endif .if ${MK_EFI} != "no" Copied: stable/12/share/man/man4/dtrace_audit.4 (from r346814, head/share/man/man4/dtrace_audit.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/dtrace_audit.4 Sat May 4 12:34:11 2019 (r347114, copy of r346814, head/share/man/man4/dtrace_audit.4) @@ -0,0 +1,178 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Robert N. M. Watson +.\" +.\" This software was developed by BAE Systems, the University of Cambridge +.\" Computer Laboratory, and Memorial University under DARPA/AFRL contract +.\" FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing +.\" (TC) research program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 28, 2019 +.Dt DTRACE_AUDIT 4 +.Os +.Sh NAME +.Nm dtrace_audit +.Nd A DTrace provider for tracing +.Xr audit 4 +events +.Sh SYNOPSIS +.Pp +.Fn audit:event:aue_*:commit "char *eventname" "struct audit_record *ar" +.Fn audit:event:aue_*:bsm "char *eventname" "struct audit_record *ar" "const void *" "size_t" +.Pp +To compile this module into the kernel, place the following in your kernel +configuration file: +.Pp +.Bd -literal -offset indent +.Cd "options DTAUDIT" +.Ed +.Pp +Alternatively, to load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dtaudit_load="YES" +.Ed +.Sh DESCRIPTION +The DTrace +.Nm dtaudit +provider allows users to trace events in the kernel security auditing +subsystem, +.Xr audit 4 . +.Xr audit 4 +provides detailed logging of a configurable set of security-relevant system +calls, including key arguments (such as file paths) and return values that are +copied race-free as the system call proceeds. +The +.Nm dtaudit +provider allows DTrace scripts to selectively enable in-kernel audit-record +capture for system calls, and then access those records in either the +in-kernel format or BSM format (\c +.Xr audit.log 5 ) +when the system call completes. +While the in-kernel audit record data structure is subject to change as the +kernel changes over time, it is a much more friendly interface for use in D +scripts than either those available via the DTrace system-call provider or the +BSM trail itself. +.Ss Configuration +The +.Nm dtaudit +provider relies on +.Xr audit 4 +being compiled into the kernel. +.Nm dtaudit +probes become available only once there is an event-to-name mapping installed +in the kernel, normally done by +.Xr auditd 8 +during the boot process, if audit is enabled in +.Xr rc.conf 5 : +.Bd -literal -offset indent +auditd_enable="YES" +.Ed +.Pp +If +.Nm dtaudit +probes are required earlier in boot -- for example, in single-user mode -- or +without enabling +.Xr audit 4 , +they can be preloaded in the boot loader by adding this line to +.Xr loader.conf 5 . +.Bd -literal -offset indent +audit_event_load="YES" +.Ed +.Ss Probes +The +.Fn audit:event:aue_*:commit +probes fire synchronously during system-call return, giving access to two +arguments: a +.Vt char * +audit event name, and +the +.Vt struct audit_record * +in-kernel audit record. +Because the probe fires in system-call return, the user thread has not yet +regained control, and additional information from the thread and process +remains available for capture by the script. +.Pp +The +.Fn audit:event:aue_*:bsm +probes fire asynchonously from system-call return, following BSM conversion +and just prior to being written to disk, giving access to four arguments: a +.Vt char * +audit event name, the +.Vt struct audit_record * +in-kernel audit record, a +.Vt const void * +pointer to the converted BSM record, and a +.Vt size_t +for the length of the BSM record. +.Sh IMPLEMENTATION NOTES +When a set of +.Nm dtaudit +probes are registered, corresponding in-kernel audit records will be captured +and their probes will fire regardless of whether the +.Xr audit 4 +subsystem itself would have captured the record for the purposes of writing it +to the audit trail, or for delivery to a +.Xr auditpipe 4 . +In-kernel audit records allocated only because of enabled +.Xr dtaudit 4 +probes will not be unnecessarily written to the audit trail or enabled pipes. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr audit 4 , +.Xr audit.log 5 , +.Xr loader.conf 5 , +.Xr rc.conf 5 , +.Xr auditd 8 +.Sh HISTORY +The +.Nm dtaudit +provider first appeared in +.Fx 12.0 . +.Sh AUTHORS +This software and this manual page were developed by BAE Systems, the +University of Cambridge Computer Laboratory, and Memorial University under +DARPA/AFRL contract +.Pq FA8650-15-C-7558 +.Pq Do CADETS Dc , +as part of the DARPA Transparent Computing (TC) research program. +The +.Nm dtaudit +provider and this manual page were written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.Sh BUGS +Because +.Xr audit 4 +maintains its primary event-to-name mapping database in userspace, that +database must be loaded into the kernel before +.Nm dtaudit +probes become available. +.Pp +.Nm dtaudit +is only able to provide access to system-call audit events, not the full +scope of userspace events, such as those relating to login, password change, +and so on. From owner-svn-src-stable-12@freebsd.org Sat May 4 12:35:14 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18BA2158D43D; Sat, 4 May 2019 12:35:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B20568856C; Sat, 4 May 2019 12:35:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C11B85FD; Sat, 4 May 2019 12:35:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CZDgP078052; Sat, 4 May 2019 12:35:13 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CZDpu078050; Sat, 4 May 2019 12:35:13 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905041235.x44CZDpu078050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 4 May 2019 12:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347115 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 347115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B20568856C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:35:14 -0000 Author: rwatson Date: Sat May 4 12:35:12 2019 New Revision: 347115 URL: https://svnweb.freebsd.org/changeset/base/347115 Log: Merge r346846 from head to stable/12: Update the audit(4) man page to talk about dtaudit(4), and also add a dtaudit(4) cross reference to auditpipe(4). Sponsored by: DARPA, AFRL Modified: stable/12/share/man/man4/audit.4 stable/12/share/man/man4/auditpipe.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/audit.4 ============================================================================== --- stable/12/share/man/man4/audit.4 Sat May 4 12:34:11 2019 (r347114) +++ stable/12/share/man/man4/audit.4 Sat May 4 12:35:12 2019 (r347115) @@ -1,6 +1,11 @@ -.\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2006, 2019 Robert N. M. Watson .\" All rights reserved. .\" +.\" This software was developed in part by BAE Systems, the University of +.\" Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL +.\" contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent +.\" Computing (TC) research program. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd April 28, 2019 .Dt AUDIT 4 .Os .Sh NAME @@ -74,6 +79,12 @@ Audit pipe special devices, discussed in provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. +.Ss DTrace Audit Provider +The DTrace Audit Provider, +.Xr dtaudit 4 , +allows D scripts to enable capture of in-kernel audit records for kernel audit +event types, and then process their contents during audit commit or BSM +generation. .Sh SEE ALSO .Xr auditreduce 1 , .Xr praudit 1 , @@ -88,6 +99,7 @@ to track users and events in a fine-grained manner. .Xr setauid 2 , .Xr libbsm 3 , .Xr auditpipe 4 , +.Xr dtaudit 4 , .Xr audit.log 5 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: stable/12/share/man/man4/auditpipe.4 ============================================================================== --- stable/12/share/man/man4/auditpipe.4 Sat May 4 12:34:11 2019 (r347114) +++ stable/12/share/man/man4/auditpipe.4 Sat May 4 12:35:12 2019 (r347115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2018 +.Dd April 28, 2019 .Dt AUDITPIPE 4 .Os .Sh NAME @@ -221,6 +221,7 @@ to review the default audit trail. .Xr poll 2 , .Xr select 2 , .Xr audit 4 , +.Xr dtaudit 4 , .Xr audit_control 5 , .Xr audit 8 , .Xr auditd 8 From owner-svn-src-stable-12@freebsd.org Sat May 4 12:49:57 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44CBA158D798; Sat, 4 May 2019 12:49:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE36288AED; Sat, 4 May 2019 12:49:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACEF187A9; Sat, 4 May 2019 12:49:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cnu5N083279; Sat, 4 May 2019 12:49:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Cnt7K083274; Sat, 4 May 2019 12:49:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041249.x44Cnt7K083274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347116 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE36288AED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:49:57 -0000 Author: tuexen Date: Sat May 4 12:49:55 2019 New Revision: 347116 URL: https://svnweb.freebsd.org/changeset/base/347116 Log: MFC r345465: Fix a signed/unsigned bug when receiving SCTP messages. This is joint work with rrs@. MFC r345466: Fox more signed unsigned issues. This time on the send path. This is joint work with rrs@ and was found by running syzkaller. MFC r345467: Fix build issue for the userland stack. Joint work with rrs@. Modified: stable/12/sys/netinet/sctp_output.c stable/12/sys/netinet/sctp_structs.h stable/12/sys/netinet/sctputil.c stable/12/sys/netinet/sctputil.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:49:55 2019 (r347116) @@ -6813,10 +6813,10 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UN } static struct mbuf * -sctp_copy_out_all(struct uio *uio, int len) +sctp_copy_out_all(struct uio *uio, ssize_t len) { struct mbuf *ret, *at; - int left, willcpy, cancpy, error; + ssize_t left, willcpy, cancpy, error; ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAITOK, 1, MT_DATA); if (ret == NULL) { @@ -6831,17 +6831,17 @@ sctp_copy_out_all(struct uio *uio, int len) at = ret; while (left > 0) { /* Align data to the end */ - error = uiomove(mtod(at, caddr_t), willcpy, uio); + error = uiomove(mtod(at, caddr_t), (int)willcpy, uio); if (error) { err_out_now: sctp_m_freem(at); return (NULL); } - SCTP_BUF_LEN(at) = willcpy; + SCTP_BUF_LEN(at) = (int)willcpy; SCTP_BUF_NEXT_PKT(at) = SCTP_BUF_NEXT(at) = 0; left -= willcpy; if (left > 0) { - SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAITOK, 1, MT_DATA); + SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg((unsigned int)left, 0, M_WAITOK, 1, MT_DATA); if (SCTP_BUF_NEXT(at) == NULL) { goto err_out_now; } @@ -6889,7 +6889,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, ca->sndrcv.sinfo_flags &= ~SCTP_SENDALL; /* get length and mbuf chain */ if (uio) { - ca->sndlen = (int)uio->uio_resid; + ca->sndlen = uio->uio_resid; ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); @@ -12387,7 +12387,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, struct sctp_sndrcvinfo *srcv, struct uio *uio, struct sctp_nets *net, - int max_send_len, + ssize_t max_send_len, int user_marks_eor, int *error) { @@ -12533,7 +12533,7 @@ sctp_lower_sosend(struct socket *so, struct thread *p ) { - unsigned int sndlen = 0, max_len; + ssize_t sndlen = 0, max_len; int error, len; struct mbuf *top = NULL; int queue_only = 0, queue_only_for_init = 0; @@ -12555,7 +12555,8 @@ sctp_lower_sosend(struct socket *so, int got_all_of_the_send = 0; int hold_tcblock = 0; int non_blocking = 0; - uint32_t local_add_more, local_soresv = 0; + uint32_t local_add_more; + ssize_t local_soresv = 0; uint16_t port; uint16_t sinfo_flags; sctp_assoc_t sinfo_assoc_id; @@ -12585,12 +12586,12 @@ sctp_lower_sosend(struct socket *so, SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } - sndlen = (unsigned int)uio->uio_resid; + sndlen = uio->uio_resid; } else { top = SCTP_HEADER_TO_CHAIN(i_pak); sndlen = SCTP_HEADER_LEN(i_pak); } - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zu\n", (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -12859,7 +12860,7 @@ sctp_lower_sosend(struct socket *so, } /* would we block? */ if (non_blocking) { - uint32_t amount; + ssize_t amount; if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); @@ -12880,7 +12881,7 @@ sctp_lower_sosend(struct socket *so, error = EWOULDBLOCK; goto out_unlocked; } - stcb->asoc.sb_send_resv += sndlen; + stcb->asoc.sb_send_resv += (uint32_t)sndlen; SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } else { @@ -12944,7 +12945,7 @@ sctp_lower_sosend(struct socket *so, /* Are we aborting? */ if (srcv->sinfo_flags & SCTP_ABORT) { struct mbuf *mm; - int tot_demand, tot_out = 0, max_out; + ssize_t tot_demand, tot_out = 0, max_out; SCTP_STAT_INCR(sctps_sends_with_abort); if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || @@ -12978,7 +12979,7 @@ sctp_lower_sosend(struct socket *so, error = EMSGSIZE; goto out; } - mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAITOK, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg((unsigned int)tot_demand, 0, M_WAITOK, 1, MT_DATA); } if (mm == NULL) { SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -12998,7 +12999,7 @@ sctp_lower_sosend(struct socket *so, ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons((uint16_t)(sizeof(struct sctp_paramhdr) + tot_out)); ph++; - SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr); + SCTP_BUF_LEN(mm) = (int)(tot_out + sizeof(struct sctp_paramhdr)); if (top == NULL) { error = uiomove((caddr_t)ph, (int)tot_out, uio); if (error) { @@ -13079,7 +13080,7 @@ sctp_lower_sosend(struct socket *so, * For non-eeor the whole message must fit in * the socket send buffer. */ - local_add_more = sndlen; + local_add_more = (uint32_t)sndlen; } len = 0; if (non_blocking) { @@ -13229,14 +13230,14 @@ skip_preblock: if ((max_len > SCTP_BASE_SYSCTL(sctp_add_more_threshold)) || (max_len && (SCTP_SB_LIMIT_SND(so) < SCTP_BASE_SYSCTL(sctp_add_more_threshold))) || - (uio->uio_resid && (uio->uio_resid <= (int)max_len))) { + (uio->uio_resid && (uio->uio_resid <= max_len))) { sndout = 0; new_tail = NULL; if (hold_tcblock) { SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } - mm = sctp_copy_resume(uio, max_len, user_marks_eor, &error, &sndout, &new_tail); + mm = sctp_copy_resume(uio, (int)max_len, user_marks_eor, &error, &sndout, &new_tail); if ((mm == NULL) || error) { if (mm) { sctp_m_freem(mm); @@ -13299,7 +13300,7 @@ skip_preblock: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - sctp_prune_prsctp(stcb, asoc, srcv, sndlen); + sctp_prune_prsctp(stcb, asoc, srcv, (int)sndlen); inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; @@ -13421,7 +13422,7 @@ skip_preblock: min(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTP_SB_LIMIT_SND(so)))) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_INTO_BLK, - asoc, (size_t)uio->uio_resid); + asoc, uio->uio_resid); } be.error = 0; stcb->block_entry = &be; Modified: stable/12/sys/netinet/sctp_structs.h ============================================================================== --- stable/12/sys/netinet/sctp_structs.h Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctp_structs.h Sat May 4 12:49:55 2019 (r347116) @@ -166,7 +166,7 @@ struct sctp_copy_all { struct sctp_inpcb *inp; /* ep */ struct mbuf *m; struct sctp_sndrcvinfo sndrcv; - int sndlen; + ssize_t sndlen; int cnt_sent; int cnt_failed; }; Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctputil.c Sat May 4 12:49:55 2019 (r347116) @@ -546,7 +546,7 @@ sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_c } void -sctp_log_block(uint8_t from, struct sctp_association *asoc, size_t sendlen) +sctp_log_block(uint8_t from, struct sctp_association *asoc, ssize_t sendlen) { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; @@ -5219,8 +5219,9 @@ sctp_sorecvmsg(struct socket *so, * */ struct sctp_inpcb *inp = NULL; - int my_len = 0; - int cp_len = 0, error = 0; + ssize_t my_len = 0; + ssize_t cp_len = 0; + int error = 0; struct sctp_queued_to_read *control = NULL, *ctl = NULL, *nxt = NULL; struct mbuf *m = NULL; struct sctp_tcb *stcb = NULL; @@ -5229,7 +5230,7 @@ sctp_sorecvmsg(struct socket *so, int out_flags = 0, in_flags = 0; int block_allowed = 1; uint32_t freed_so_far = 0; - uint32_t copied_so_far = 0; + ssize_t copied_so_far = 0; int in_eeor_mode = 0; int no_rcv_needed = 0; uint32_t rwnd_req = 0; @@ -5573,7 +5574,7 @@ found_one: * will go to the sctp_user_rcvd() that will not * lock until it KNOWs it MUST send a WUP-SACK. */ - freed_so_far = stcb->freed_by_sorcv_sincelast; + freed_so_far = (uint32_t)stcb->freed_by_sorcv_sincelast; stcb->freed_by_sorcv_sincelast = 0; } } @@ -5728,8 +5729,8 @@ get_more_data: m = control->data; while (m) { /* Move out all we can */ - cp_len = (int)uio->uio_resid; - my_len = (int)SCTP_BUF_LEN(m); + cp_len = uio->uio_resid; + my_len = SCTP_BUF_LEN(m); if (cp_len > my_len) { /* not enough in this buf */ cp_len = my_len; @@ -5739,7 +5740,7 @@ get_more_data: hold_rlock = 0; } if (cp_len > 0) - error = uiomove(mtod(m, char *), cp_len, uio); + error = uiomove(mtod(m, char *), (int)cp_len, uio); /* re-read */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { goto release; @@ -5784,7 +5785,7 @@ get_more_data: control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } copied_so_far += cp_len; - freed_so_far += cp_len; + freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; atomic_subtract_int(&control->length, cp_len); control->data = sctp_m_free(m); @@ -5824,9 +5825,9 @@ get_more_data: } if ((in_flags & MSG_PEEK) == 0) { SCTP_BUF_RESV_UF(m, cp_len); - SCTP_BUF_LEN(m) -= cp_len; + SCTP_BUF_LEN(m) -= (int)cp_len; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { - sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); + sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len); } atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); if ((control->do_not_ref_stcb == 0) && @@ -5834,7 +5835,7 @@ get_more_data: atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); } copied_so_far += cp_len; - freed_so_far += cp_len; + freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, @@ -6062,7 +6063,7 @@ wait_some_more: control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, SCTP_BUF_LEN(m)); } sctp_sbfree(control, stcb, &so->so_rcv, m); - freed_so_far += SCTP_BUF_LEN(m); + freed_so_far += (uint32_t)SCTP_BUF_LEN(m); freed_so_far += MSIZE; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, Modified: stable/12/sys/netinet/sctputil.h ============================================================================== --- stable/12/sys/netinet/sctputil.h Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctputil.h Sat May 4 12:49:55 2019 (r347116) @@ -367,7 +367,7 @@ void sctp_log_closing(struct sctp_inpcb *inp, struct s void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from); void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t); -void sctp_log_block(uint8_t, struct sctp_association *, size_t); +void sctp_log_block(uint8_t, struct sctp_association *, ssize_t); void sctp_log_rwnd(uint8_t, uint32_t, uint32_t, uint32_t); void sctp_log_rwnd_set(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t); int sctp_fill_stat_log(void *, size_t *); From owner-svn-src-stable-12@freebsd.org Sat May 4 12:52:25 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFAF158D9A6; Sat, 4 May 2019 12:52:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 085A288EA7; Sat, 4 May 2019 12:52:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D379C893D; Sat, 4 May 2019 12:52:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CqOKH087992; Sat, 4 May 2019 12:52:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CqOlQ087991; Sat, 4 May 2019 12:52:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041252.x44CqOlQ087991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347117 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 085A288EA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:52:25 -0000 Author: tuexen Date: Sat May 4 12:52:24 2019 New Revision: 347117 URL: https://svnweb.freebsd.org/changeset/base/347117 Log: MFC r345494: Fix the handling of fragmented unordered messages when using DATA chunks and FORWARD-TSN. This bug was reported in https://github.com/sctplab/usrsctp/issues/286 for the userland stack. This is joint work with rrs@. Modified: stable/12/sys/netinet/sctp_indata.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Sat May 4 12:49:55 2019 (r347116) +++ stable/12/sys/netinet/sctp_indata.c Sat May 4 12:52:24 2019 (r347117) @@ -947,6 +947,15 @@ sctp_inject_old_unordered_data(struct sctp_tcb *stcb, SCTPDBG(SCTP_DEBUG_XXX, "chunk is a first fsn: %u becomes fsn_included\n", chk->rec.data.fsn); + at = TAILQ_FIRST(&control->reasm); + if (at && SCTP_TSN_GT(chk->rec.data.fsn, at->rec.data.fsn)) { + /* + * The first chunk in the reassembly is a smaller + * TSN than this one, even though this has a first, + * it must be from a subsequent msg. + */ + goto place_chunk; + } if (control->first_frag_seen) { /* * In old un-ordered we can reassembly on one From owner-svn-src-stable-12@freebsd.org Sat May 4 12:54:25 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3140B158DAC1; Sat, 4 May 2019 12:54:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDB8089121; Sat, 4 May 2019 12:54:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8B31894C; Sat, 4 May 2019 12:54:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CsOGb088262; Sat, 4 May 2019 12:54:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CsOcQ088261; Sat, 4 May 2019 12:54:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041254.x44CsOcQ088261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347118 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDB8089121 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:54:25 -0000 Author: tuexen Date: Sat May 4 12:54:24 2019 New Revision: 347118 URL: https://svnweb.freebsd.org/changeset/base/347118 Log: MFC r345504: Improve locking when tearing down an SCTP association. This is joint work with rrs@ and the issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Sat May 4 12:52:24 2019 (r347117) +++ stable/12/sys/netinet/sctp_pcb.c Sat May 4 12:54:24 2019 (r347118) @@ -4982,6 +4982,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc * in case. */ /* anything on the wheel needs to be removed */ + SCTP_TCB_SEND_LOCK(stcb); for (i = 0; i < asoc->streamoutcnt; i++) { struct sctp_stream_out *outs; @@ -4990,7 +4991,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 0); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 1); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { @@ -5012,6 +5013,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); } } + SCTP_TCB_SEND_UNLOCK(stcb); /* sa_ignore FREED_MEMORY */ TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) { TAILQ_REMOVE(&asoc->resetHead, strrst, next_resp); From owner-svn-src-stable-12@freebsd.org Sat May 4 12:56:10 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD26158DBB1; Sat, 4 May 2019 12:56:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2D5989341; Sat, 4 May 2019 12:56:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB200894F; Sat, 4 May 2019 12:56:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cu904088585; Sat, 4 May 2019 12:56:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Cu9ZY088584; Sat, 4 May 2019 12:56:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041256.x44Cu9ZY088584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347119 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2D5989341 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:56:10 -0000 Author: tuexen Date: Sat May 4 12:56:09 2019 New Revision: 347119 URL: https://svnweb.freebsd.org/changeset/base/347119 Log: MFC r345505: Initialize scheduler specific data for the FCFS scheduler. This is joint work with rrs@. The issue was reported by using syzkaller. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 12:54:24 2019 (r347118) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 12:56:09 2019 (r347119) @@ -838,6 +838,8 @@ sctp_ss_fcfs_init_stream(struct sctp_tcb *stcb, struct stcb->asoc.ss_data.last_out_stream = strq; } } + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; return; } From owner-svn-src-stable-12@freebsd.org Sat May 4 12:57:56 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C65158DC79; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 291238955F; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026D98952; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cvtrm088823; Sat, 4 May 2019 12:57:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CvtV9088822; Sat, 4 May 2019 12:57:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041257.x44CvtV9088822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347120 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 291238955F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:57:57 -0000 Author: tuexen Date: Sat May 4 12:57:55 2019 New Revision: 347120 URL: https://svnweb.freebsd.org/changeset/base/347120 Log: MFC r345525: Fix a double free of an SCTP association in an error path. This is joint work with rrs@. The issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 12:56:09 2019 (r347119) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 12:57:55 2019 (r347120) @@ -1481,8 +1481,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error); /* Fill in the return id */ if (error) { - (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7); goto out_now; } a_id = (sctp_assoc_t *)optval; From owner-svn-src-stable-12@freebsd.org Sat May 4 13:00:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F25158DF3A; Sat, 4 May 2019 13:00:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05191897E8; Sat, 4 May 2019 13:00:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2DEE8962; Sat, 4 May 2019 13:00:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D0d9C089184; Sat, 4 May 2019 13:00:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D0ddH089183; Sat, 4 May 2019 13:00:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041300.x44D0ddH089183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347121 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05191897E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:00:40 -0000 Author: tuexen Date: Sat May 4 13:00:39 2019 New Revision: 347121 URL: https://svnweb.freebsd.org/changeset/base/347121 Log: MFC r346134: Fix an SCTP related locking issue. Don't report that the TCB_SEND_LOCK is owned, when it is not. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctputil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 12:57:55 2019 (r347120) +++ stable/12/sys/netinet/sctputil.c Sat May 4 13:00:39 2019 (r347121) @@ -3995,7 +3995,7 @@ sctp_abort_notification(struct sctp_tcb *stcb, uint8_t return; } /* Tell them we lost the asoc */ - sctp_report_all_outbound(stcb, error, 1, so_locked); + sctp_report_all_outbound(stcb, error, 0, so_locked); if (from_peer) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); } else { From owner-svn-src-stable-12@freebsd.org Sat May 4 13:02:47 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DF8158DFF9; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5E189B93; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A4328B0D; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D2kqv094412; Sat, 4 May 2019 13:02:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D2k0c094411; Sat, 4 May 2019 13:02:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041302.x44D2k0c094411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347122 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B5E189B93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:02:47 -0000 Author: tuexen Date: Sat May 4 13:02:46 2019 New Revision: 347122 URL: https://svnweb.freebsd.org/changeset/base/347122 Log: MFC r346182: When sending IPv4 packets on a SOCK_RAW socket using the IP_HDRINCL option, ensure that the ip_hl field is valid. Furthermore, ensure that the complete IPv4 header is contained in the first mbuf. Finally, move the length checks before relying on them when accessing fields of the IPv4 header. Reported by: jtl@ Reviewed by: jtl@ Differential Revision: https://reviews.freebsd.org/D19181 Modified: stable/12/sys/netinet/raw_ip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/raw_ip.c ============================================================================== --- stable/12/sys/netinet/raw_ip.c Sat May 4 13:00:39 2019 (r347121) +++ stable/12/sys/netinet/raw_ip.c Sat May 4 13:02:46 2019 (r347122) @@ -454,7 +454,7 @@ rip_output(struct mbuf *m, struct socket *so, ...) u_long dst; int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST; - int cnt; + int cnt, hlen; u_char opttype, optlen, *cp; va_start(ap, so); @@ -510,33 +510,40 @@ rip_output(struct mbuf *m, struct socket *so, ...) m_freem(m); return(EMSGSIZE); } - INP_RLOCK(inp); ip = mtod(m, struct ip *); - error = prison_check_ip4(inp->inp_cred, &ip->ip_src); - if (error != 0) { - INP_RUNLOCK(inp); - m_freem(m); - return (error); + hlen = ip->ip_hl << 2; + if (m->m_len < hlen) { + m = m_pullup(m, hlen); + if (m == NULL) + return (EINVAL); + ip = mtod(m, struct ip *); } + INP_RLOCK(inp); /* * Don't allow both user specified and setsockopt options, * and don't allow packet length sizes that will crash. */ - if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) - || (ntohs(ip->ip_len) != m->m_pkthdr.len) - || (ntohs(ip->ip_len) < (ip->ip_hl << 2))) { + if ((hlen < sizeof (*ip)) + || ((hlen > sizeof (*ip)) && inp->inp_options) + || (ntohs(ip->ip_len) != m->m_pkthdr.len)) { INP_RUNLOCK(inp); m_freem(m); return (EINVAL); } + error = prison_check_ip4(inp->inp_cred, &ip->ip_src); + if (error != 0) { + INP_RUNLOCK(inp); + m_freem(m); + return (error); + } /* * Don't allow IP options which do not have the required * structure as specified in section 3.1 of RFC 791 on * pages 15-23. */ cp = (u_char *)(ip + 1); - cnt = (ip->ip_hl << 2) - sizeof (struct ip); + cnt = hlen - sizeof (struct ip); for (; cnt > 0; cnt -= optlen, cp += optlen) { opttype = cp[IPOPT_OPTVAL]; if (opttype == IPOPT_EOL) From owner-svn-src-stable-12@freebsd.org Sat May 4 13:05:22 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81041158E145; Sat, 4 May 2019 13:05:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A0589DCF; Sat, 4 May 2019 13:05:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F19BD8B0E; Sat, 4 May 2019 13:05:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D5LOv094582; Sat, 4 May 2019 13:05:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D5LvI094581; Sat, 4 May 2019 13:05:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041305.x44D5LvI094581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347123 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27A0589DCF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:05:22 -0000 Author: tuexen Date: Sat May 4 13:05:21 2019 New Revision: 347123 URL: https://svnweb.freebsd.org/changeset/base/347123 Log: MFC r346197: When sending a routing message, don't allow the user to set the RTF_RNH_LOCKED flag in rtm_flags, since this flag is used only internally. Reviewed by: ae@ Differential Revision: https://reviews.freebsd.org/D19898 Modified: stable/12/sys/net/rtsock.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/rtsock.c ============================================================================== --- stable/12/sys/net/rtsock.c Sat May 4 13:02:46 2019 (r347122) +++ stable/12/sys/net/rtsock.c Sat May 4 13:05:21 2019 (r347123) @@ -615,6 +615,8 @@ route_output(struct mbuf *m, struct socket *so, ...) if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) senderr(EINVAL); + if (rtm->rtm_flags & RTF_RNH_LOCKED) + senderr(EINVAL); info.rti_flags = rtm->rtm_flags; if (info.rti_info[RTAX_DST] == NULL || info.rti_info[RTAX_DST]->sa_family >= AF_MAX || From owner-svn-src-stable-12@freebsd.org Sat May 4 13:43:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC82B158F029; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E3488AE5A; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F5BA91A7; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Dhm1l015368; Sat, 4 May 2019 13:43:48 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44DhmN7015367; Sat, 4 May 2019 13:43:48 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905041343.x44DhmN7015367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 4 May 2019 13:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347124 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 347124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E3488AE5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:43:50 -0000 Author: rgrimes Date: Sat May 4 13:43:48 2019 New Revision: 347124 URL: https://svnweb.freebsd.org/changeset/base/347124 Log: MFC: r346715: Acpi MADT table correction for VM_MAXCPU > 21 The bhyve acpi MADT table was given a static space of 256 (0x100) bytes, this is enough space to allow VM_MAXCPU to be 21, this patch changes that so VM_MAXCPU can be of arbitrary value and not overflow the space by actually calculating the space needed for the table. PR: 212782 Reviewed by: Patrick Mooney Approved by: bde (mentor, implicit), jhb (maintainer) Differential Revision: https://reviews.freebsd.org/D18815 Modified: stable/12/usr.sbin/bhyve/acpi.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bhyve/acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/12/usr.sbin/bhyve/acpi.c Sat May 4 13:05:21 2019 (r347123) +++ stable/12/usr.sbin/bhyve/acpi.c Sat May 4 13:43:48 2019 (r347124) @@ -39,7 +39,9 @@ * The tables are placed in the guest's ROM area just below 1MB physical, * above the MPTable. * - * Layout + * Layout (No longer correct at FADT and beyond due to properly + * calculating the size of the MADT to allow for changes to + * VM_MAXCPU above 21 which overflows this layout.) * ------ * RSDP -> 0xf2400 (36 bytes fixed) * RSDT -> 0xf2440 (36 bytes + 4*7 table addrs, 4 used) @@ -74,18 +76,31 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" /* - * Define the base address of the ACPI tables, and the offsets to - * the individual tables + * Define the base address of the ACPI tables, the sizes of some tables, + * and the offsets to the individual tables, */ #define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 -#define FADT_OFFSET 0x200 -#define HPET_OFFSET 0x340 -#define MCFG_OFFSET 0x380 -#define FACS_OFFSET 0x3C0 -#define DSDT_OFFSET 0x400 +/* + * The MADT consists of: + * 44 Fixed Header + * 8 * maxcpu Processor Local APIC entries + * 12 I/O APIC entry + * 2 * 10 Interrupt Source Override entires + * 6 Local APIC NMI entry + */ +#define MADT_SIZE (44 + VM_MAXCPU*8 + 12 + 2*10 + 6) +#define FADT_OFFSET (MADT_OFFSET + MADT_SIZE) +#define FADT_SIZE 0x140 +#define HPET_OFFSET (FADT_OFFSET + FADT_SIZE) +#define HPET_SIZE 0x40 +#define MCFG_OFFSET (HPET_OFFSET + HPET_SIZE) +#define MCFG_SIZE 0x40 +#define FACS_OFFSET (MCFG_OFFSET + MCFG_SIZE) +#define FACS_SIZE 0x40 +#define DSDT_OFFSET (FACS_OFFSET + FACS_SIZE) #define BHYVE_ASL_TEMPLATE "bhyve.XXXXXXX" #define BHYVE_ASL_SUFFIX ".aml" From owner-svn-src-stable-12@freebsd.org Sat May 4 13:55:53 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A444158F44A; Sat, 4 May 2019 13:55:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1B6A8B49E; Sat, 4 May 2019 13:55:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6314934C; Sat, 4 May 2019 13:55:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44DtqKj020771; Sat, 4 May 2019 13:55:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Dtq8p020770; Sat, 4 May 2019 13:55:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041355.x44Dtq8p020770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347125 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 347125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1B6A8B49E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:55:53 -0000 Author: tuexen Date: Sat May 4 13:55:51 2019 New Revision: 347125 URL: https://svnweb.freebsd.org/changeset/base/347125 Log: MFC r346400: Improve input validation for the socket option IPV6_CHECKSUM. When using the IPPROTO_IPV6 level socket option IPV6_CHECKSUM on a raw IPv6 socket, ensure that the value is either -1 or a non-negative even number. MFC r346401: Avoid a buffer overwrite in rip6_output() when computing the checksum as requested by the user via the IPPROTO_IPV6 level socket option IPV6_CHECKSUM. The check if there are enough bytes in the packet to store the checksum at the requested offset was wrong by 1. MFC r346402: When a checksum has to be computed for a received IPv6 packet because it is requested by the application using the IPPROTO_IPV6 level socket option IPV6_CHECKSUM on a raw socket, ensure that the packet contains enough bytes to contain the checksum at the specified offset. MFC r346406: When an IPv6 packet is received for a raw socket which has the IPPROTO_IPV6 level socket option IPV6_CHECKSUM enabled and the checksum check fails, drop the message. Without this fix, an ICMP6 message was sent indicating a parameter problem. Thanks to bz@ for suggesting a way to simplify this fix. Reviewed by: bz@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19966 Differential Revision: https://reviews.freebsd.org/D19967 Differential Revision: https://reviews.freebsd.org/D19968 Differential Revision: https://reviews.freebsd.org/D19969 Modified: stable/12/sys/netinet6/ip6_output.c stable/12/sys/netinet6/raw_ip6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/ip6_output.c ============================================================================== --- stable/12/sys/netinet6/ip6_output.c Sat May 4 13:43:48 2019 (r347124) +++ stable/12/sys/netinet6/ip6_output.c Sat May 4 13:55:51 2019 (r347125) @@ -2216,8 +2216,11 @@ ip6_raw_ctloutput(struct socket *so, struct sockopt *s sizeof(optval)); if (error) break; - if ((optval % 2) != 0) { - /* the API assumes even offset values */ + if (optval < -1 || (optval % 2) != 0) { + /* + * The API assumes non-negative even offset + * values or -1 as a special value. + */ error = EINVAL; } else if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { Modified: stable/12/sys/netinet6/raw_ip6.c ============================================================================== --- stable/12/sys/netinet6/raw_ip6.c Sat May 4 13:43:48 2019 (r347124) +++ stable/12/sys/netinet6/raw_ip6.c Sat May 4 13:55:51 2019 (r347125) @@ -239,9 +239,16 @@ rip6_input(struct mbuf **mp, int *offp, int proto) } if (in6p->in6p_cksum != -1) { RIP6STAT_INC(rip6s_isum); - if (in6_cksum(m, proto, *offp, + if (m->m_pkthdr.len - (*offp + in6p->in6p_cksum) < 2 || + in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { RIP6STAT_INC(rip6s_badsum); + /* + * Drop the received message, don't send an + * ICMP6 message. Set proto to IPPROTO_NONE + * to achieve that. + */ + proto = IPPROTO_NONE; goto skip_2; } } @@ -495,7 +502,7 @@ rip6_output(struct mbuf *m, struct socket *so, ...) off = offsetof(struct icmp6_hdr, icmp6_cksum); else off = in6p->in6p_cksum; - if (plen < off + 1) { + if (plen < off + 2) { error = EINVAL; goto bad; } From owner-svn-src-stable-12@freebsd.org Sat May 4 13:58:46 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C6D158F4F9; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 367A38B5EF; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10917934E; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Dwjao020945; Sat, 4 May 2019 13:58:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Dwjbr020943; Sat, 4 May 2019 13:58:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041358.x44Dwjbr020943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347126 - stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 347126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 367A38B5EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:58:46 -0000 Author: tuexen Date: Sat May 4 13:58:45 2019 New Revision: 347126 URL: https://svnweb.freebsd.org/changeset/base/347126 Log: MFC r346854: Some test scripts use ncat --sctp --listen port to run an SCTP discard server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sat May 4 13:55:51 2019 (r347125) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sat May 4 13:58:45 2019 (r347126) @@ -58,36 +58,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <= 7 ? "yes" : "no"); - printf("ip:::receive (%d) - %s\n", ipreceive, ipreceive >= 7 ? "yes" : "no"); - printf("sctp:::send (%d) - %s\n", sctpsend, sctpsend >= 7 ? "yes" : "no"); - printf("sctp:::receive (%d) - %s\n", sctpreceive, sctpreceive >= 7 ? "yes" : "no"); + printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); + printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no"); + printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no"); } EODTRACE Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sat May 4 13:55:51 2019 (r347125) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sat May 4 13:58:45 2019 (r347126) @@ -61,36 +61,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <