From owner-svn-src-stable-12@freebsd.org Mon Aug 19 07:40:43 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7290AB963; Mon, 19 Aug 2019 07:40:43 +0000 (UTC) (envelope-from avg@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 46Bm7H3lTTz4Qsn; Mon, 19 Aug 2019 07:40:43 +0000 (UTC) (envelope-from avg@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 626C9F439; Mon, 19 Aug 2019 07:40:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7J7ehOZ019022; Mon, 19 Aug 2019 07:40:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7J7ehHb019021; Mon, 19 Aug 2019 07:40:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908190740.x7J7ehHb019021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Aug 2019 07:40: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: r351206 - stable/12/share/man/man8 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/share/man/man8 X-SVN-Commit-Revision: 351206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 07:40:43 -0000 Author: avg Date: Mon Aug 19 07:40:42 2019 New Revision: 351206 URL: https://svnweb.freebsd.org/changeset/base/351206 Log: MFC r350701,r350702: rc.8: add a reference to service(8) Modified: stable/12/share/man/man8/rc.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man8/rc.8 ============================================================================== --- stable/12/share/man/man8/rc.8 Mon Aug 19 05:24:42 2019 (r351205) +++ stable/12/share/man/man8/rc.8 Mon Aug 19 07:40:42 2019 (r351206) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 29, 2018 +.Dd August 7, 2019 .Dt RC 8 .Os .Sh NAME @@ -89,8 +89,13 @@ The directories contain scripts which will be automatically executed at boot time and shutdown time. .Pp -The sysrc(8) command provides a scripting interface to modify system -config files. +The +.Xr service 8 +command provides a convenient interface to manage rc.d services. +.Pp +The +.Xr sysrc 8 +command provides a scripting interface to modify system config files. .Ss Operation of Nm .Bl -enum .It @@ -214,7 +219,7 @@ Call each script in turn using which sets .Va $1 to -.Dq Li stop , +.Dq Li faststop , and sources the script in a subshell. .El .Ss Contents of Nm rc.d/ @@ -556,6 +561,7 @@ is unnecessary, but is often included. .Xr rcorder 8 , .Xr reboot 8 , .Xr savecore 8 , +.Xr service 8 , .Xr sysrc 8 .Sh HISTORY The From owner-svn-src-stable-12@freebsd.org Mon Aug 19 07:45:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98802ABC5A; Mon, 19 Aug 2019 07:45:40 +0000 (UTC) (envelope-from avg@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 46BmF02P1nz4RQ1; Mon, 19 Aug 2019 07:45:40 +0000 (UTC) (envelope-from avg@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 2F932F606; Mon, 19 Aug 2019 07:45:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7J7jd0f025293; Mon, 19 Aug 2019 07:45:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7J7jd0R025292; Mon, 19 Aug 2019 07:45:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908190745.x7J7jd0R025292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Aug 2019 07:45: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: r351208 - stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 351208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 07:45:40 -0000 Author: avg Date: Mon Aug 19 07:45:39 2019 New Revision: 351208 URL: https://svnweb.freebsd.org/changeset/base/351208 Log: MFC r350893: Allow ZVOL bookmarks to be listed recursively PR: 197821 Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Mon Aug 19 07:42:09 2019 (r351207) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Mon Aug 19 07:45:39 2019 (r351208) @@ -445,13 +445,13 @@ zfs_for_each(int argc, char **argv, int flags, zfs_typ /* * If we're recursive, then we always allow filesystems as - * arguments. If we also are interested in snapshots, then we - * can take volumes as well. + * arguments. If we also are interested in snapshots or + * bookmarks, then we can take volumes as well. */ argtype = types; if (flags & ZFS_ITER_RECURSE) { argtype |= ZFS_TYPE_FILESYSTEM; - if (types & ZFS_TYPE_SNAPSHOT) + if (types & (ZFS_TYPE_SNAPSHOT | ZFS_TYPE_BOOKMARK)) argtype |= ZFS_TYPE_VOLUME; } From owner-svn-src-stable-12@freebsd.org Mon Aug 19 17:27:07 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D3FDCC448; Mon, 19 Aug 2019 17:27:07 +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 46C17v2DMLz44d6; Mon, 19 Aug 2019 17:27:07 +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 2E1711E02F; Mon, 19 Aug 2019 17:27:07 +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 x7JHR7dE082532; Mon, 19 Aug 2019 17:27:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7JHR6W1082530; Mon, 19 Aug 2019 17:27:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908191727.x7JHR6W1082530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Aug 2019 17:27:06 +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: r351222 - in stable: 11/share/man/man9 12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man9 12/share/man/man9 X-SVN-Commit-Revision: 351222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 17:27:07 -0000 Author: jhb Date: Mon Aug 19 17:27:06 2019 New Revision: 351222 URL: https://svnweb.freebsd.org/changeset/base/351222 Log: MFC 348969: Document sysctl nodes that translate their values. This documents the behavior of sysctl_msec_to_ticks. The MFC does not document SYSCTL_{ADD,}_SBINTIME_[UM]SEC since those are only present in head. Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/sysctl.9 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/sysctl.9 Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Mon Aug 19 17:26:04 2019 (r351221) +++ stable/12/share/man/man9/Makefile Mon Aug 19 17:27:06 2019 (r351222) @@ -2021,6 +2021,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_INT.9 \ sysctl.9 SYSCTL_INT_WITH_LABEL.9 \ sysctl.9 SYSCTL_LONG.9 \ + sysctl.9 sysctl_msec_to_ticks.9 \ sysctl.9 SYSCTL_NODE.9 \ sysctl.9 SYSCTL_NODE_WITH_LABEL.9 \ sysctl.9 SYSCTL_OPAQUE.9 \ Modified: stable/12/share/man/man9/sysctl.9 ============================================================================== --- stable/12/share/man/man9/sysctl.9 Mon Aug 19 17:26:04 2019 (r351221) +++ stable/12/share/man/man9/sysctl.9 Mon Aug 19 17:27:06 2019 (r351222) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2018 +.Dd June 11, 2019 .Dt SYSCTL 9 .Os .Sh NAME @@ -60,6 +60,7 @@ .Nm SYSCTL_INT , .Nm SYSCTL_INT_WITH_LABEL , .Nm SYSCTL_LONG , +.Nm sysctl_msec_to_ticks , .Nm SYSCTL_NODE , .Nm SYSCTL_NODE_WITH_LABEL , .Nm SYSCTL_OPAQUE , @@ -352,6 +353,8 @@ .Fn SYSCTL_INT parent number name ctlflags ptr val descr .Fn SYSCTL_INT_WITH_LABEL parent number name ctlflags ptr val descr label .Fn SYSCTL_LONG parent number name ctlflags ptr val descr +.Ft int +.Fn sysctl_msec_to_ticks SYSCTL_HANDLER_ARGS .Fn SYSCTL_NODE parent number name ctlflags handler descr .Fn SYSCTL_NODE_WITH_LABEL parent number name ctlflags handler descr label .Fn SYSCTL_OPAQUE parent number name ctlflags ptr len format descr @@ -372,6 +375,7 @@ .Fn SYSCTL_UINT parent number name ctlflags ptr val descr .Fn SYSCTL_ULONG parent number name ctlflags ptr val descr .Fn SYSCTL_UQUAD parent number name ctlflags ptr val descr + .Sh DESCRIPTION The .Nm SYSCTL @@ -501,6 +505,38 @@ Labels should only be applied to siblings that are str and encode the same type of value, as aggregation is of no use otherwise. .El +.Sh NODE VALUE TYPES +Most of the macros and functions used to create sysctl nodes export a +read-only constant or in-kernel variable whose type matches the type +of the node's value. +For example, +.Fn SYSCTL_INT +reports the raw value of an associated variable of type +.Vt int . +However, nodes may also export a value that is a translatation of an internal +representation. +.Pp +The +.Fn sysctl_msec_to_ticks +handler can be used with +.Fn SYSCTL_PROC +or +.Fn SYSCTL_ADD_PROC +to export a millisecond time interval. +When using this handler, +the +.Fa arg2 +parameter points to an in-kernel variable of type +.Vt int +which stores a tick count suitable for use with functions like +.Xr tsleep 9 . +The +.Fn sysctl_msec_to_ticks +function converts this value to milliseconds when reporting the node's value. +Similarly, +.Fn sysctl_msec_to_ticks +accepts new values in milliseconds and stores an equivalent value in ticks to +.Fa *arg2 . .Sh CREATING ROOT NODES Sysctl MIBs or OIDs are created in a hierarchical tree. The nodes at the bottom of the tree are called root nodes, and have no From owner-svn-src-stable-12@freebsd.org Mon Aug 19 18:50:57 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96B49CE9A2; Mon, 19 Aug 2019 18:50:57 +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 46C30d3Xf7z4BQS; Mon, 19 Aug 2019 18:50:57 +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 5B4AE1EF2E; Mon, 19 Aug 2019 18:50:57 +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 x7JIovak031007; Mon, 19 Aug 2019 18:50:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7JIovCX031004; Mon, 19 Aug 2019 18:50:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908191850.x7JIovCX031004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Aug 2019 18:50: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: r351228 - in stable: 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 351228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 18:50:57 -0000 Author: jhb Date: Mon Aug 19 18:50:56 2019 New Revision: 351228 URL: https://svnweb.freebsd.org/changeset/base/351228 Log: MFC 348791: Fix debug trace after removal of pdu_overhead. Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/tom/t4_tls.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.c Mon Aug 19 18:15:17 2019 (r351227) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.c Mon Aug 19 18:50:56 2019 (r351228) @@ -1584,8 +1584,8 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head sbappendstream_locked(sb, m, 0); rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; #ifdef VERBOSE_TRACES - CTR5(KTR_CXGBE, "%s: tid %u PDU overhead %d rx_credits %u rcv_wnd %u", - __func__, tid, pdu_overhead, rx_credits, tp->rcv_wnd); + CTR4(KTR_CXGBE, "%s: tid %u rx_credits %u rcv_wnd %u", + __func__, tid, rx_credits, tp->rcv_wnd); #endif if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { rx_credits = send_rx_credits(sc, toep, rx_credits); From owner-svn-src-stable-12@freebsd.org Mon Aug 19 21:59:03 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43586D3280; Mon, 19 Aug 2019 21:59:03 +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 46C79g11sLz4TRG; Mon, 19 Aug 2019 21:59:03 +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 F3E7C21197; Mon, 19 Aug 2019 21:59:02 +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 x7JLx2rh053289; Mon, 19 Aug 2019 21:59:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7JLx2Ur053288; Mon, 19 Aug 2019 21:59:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908192159.x7JLx2Ur053288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Aug 2019 21:59:02 +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: r351234 - in stable: 11/sys/vm 12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/vm 12/sys/vm X-SVN-Commit-Revision: 351234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 21:59:03 -0000 Author: jhb Date: Mon Aug 19 21:59:02 2019 New Revision: 351234 URL: https://svnweb.freebsd.org/changeset/base/351234 Log: MFC 348874: Remove an overly-aggressive assertion. While it is true that the new vmspace passed to vmspace_switch_aio will always have a valid reference due to the AIO job or the extra reference on the original vmspace in the worker thread, it is not true that the old vmspace being switched away from will have more than one reference. Specifically, when a process with queued AIO jobs exits, the exit hook in aio_proc_rundown will only ensure that all of the AIO jobs have completed or been cancelled. However, the last AIO job might have completed and woken up the exiting process before the worker thread servicing that job has switched back to its original vmspace. In that case, the process might finish exiting dropping its reference to the vmspace before the worker thread resulting in the worker thread dropping the last reference. Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Mon Aug 19 21:45:25 2019 (r351233) +++ stable/12/sys/vm/vm_map.c Mon Aug 19 21:59:02 2019 (r351234) @@ -453,18 +453,17 @@ vmspace_acquire_ref(struct proc *p) /* * Switch between vmspaces in an AIO kernel process. * - * The AIO kernel processes switch to and from a user process's - * vmspace while performing an I/O operation on behalf of a user - * process. The new vmspace is either the vmspace of a user process - * obtained from an active AIO request or the initial vmspace of the - * AIO kernel process (when it is idling). Because user processes - * will block to drain any active AIO requests before proceeding in - * exit() or execve(), the vmspace reference count for these vmspaces - * can never be 0. This allows for a much simpler implementation than - * the loop in vmspace_acquire_ref() above. Similarly, AIO kernel - * processes hold an extra reference on their initial vmspace for the - * life of the process so that this guarantee is true for any vmspace - * passed as 'newvm'. + * The new vmspace is either the vmspace of a user process obtained + * from an active AIO request or the initial vmspace of the AIO kernel + * process (when it is idling). Because user processes will block to + * drain any active AIO requests before proceeding in exit() or + * execve(), the reference count for vmspaces from AIO requests can + * never be 0. Similarly, AIO kernel processes hold an extra + * reference on their initial vmspace for the life of the process. As + * a result, the 'newvm' vmspace always has a non-zero reference + * count. This permits an additional reference on 'newvm' to be + * acquired via a simple atomic increment rather than the loop in + * vmspace_acquire_ref() above. */ void vmspace_switch_aio(struct vmspace *newvm) @@ -489,9 +488,6 @@ vmspace_switch_aio(struct vmspace *newvm) /* Activate the new mapping. */ pmap_activate(curthread); - /* Remove the daemon's reference to the old address space. */ - KASSERT(oldvm->vm_refcnt > 1, - ("vmspace_switch_aio: oldvm dropping last reference")); vmspace_free(oldvm); } From owner-svn-src-stable-12@freebsd.org Mon Aug 19 22:31:05 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D589D3B2B; Mon, 19 Aug 2019 22:31:05 +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 46C7td1Kd8z4W1S; Mon, 19 Aug 2019 22:31:05 +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 10A342171D; Mon, 19 Aug 2019 22:31:05 +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 x7JMV49R074202; Mon, 19 Aug 2019 22:31:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7JMV48w074200; Mon, 19 Aug 2019 22:31:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908192231.x7JMV48w074200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Aug 2019 22:31: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: r351236 - in stable: 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 351236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 22:31:05 -0000 Author: jhb Date: Mon Aug 19 22:31:04 2019 New Revision: 351236 URL: https://svnweb.freebsd.org/changeset/base/351236 Log: MFC 349467: Hold an explicit reference on the socket for the aiotx task. Previously, the aiotx task relied on the aio jobs in the queue to hold a reference on the socket. However, when the last job is completed, there is nothing left to hold a reference to the socket buffer lock used to check if the queue is empty. In addition, if the last job on the queue is cancelled, the task can run with no queued jobs holding a reference to the socket buffer lock the task uses to notice the queue is empty. Fix these races by holding an explicit reference on the socket when the task is queued and dropping that reference when the task completes. Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c stable/12/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 19 22:25:28 2019 (r351235) +++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 19 22:31:04 2019 (r351236) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom.h" static void t4_aiotx_cancel(struct kaiocb *job); -static void t4_aiotx_queue_toep(struct toepcb *toep); +static void t4_aiotx_queue_toep(struct socket *so, struct toepcb *toep); static size_t aiotx_mbuf_pgoff(struct mbuf *m) @@ -787,7 +787,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (sowwakeup) { if (!TAILQ_EMPTY( &toep->aiotx_jobq)) - t4_aiotx_queue_toep( + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); } else @@ -831,7 +831,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } if (sowwakeup) { if (!TAILQ_EMPTY(&toep->aiotx_jobq)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); } else SOCKBUF_UNLOCK(sb); @@ -1825,7 +1825,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header tls_ofld->sb_off -= plen; } if (!TAILQ_EMPTY(&toep->aiotx_jobq)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); /* unlocks so_snd */ } SOCKBUF_UNLOCK_ASSERT(sb); @@ -2199,10 +2199,10 @@ static void t4_aiotx_task(void *context, int pending) { struct toepcb *toep = context; - struct inpcb *inp = toep->inp; - struct socket *so = inp->inp_socket; + struct socket *so; struct kaiocb *job; + so = toep->aiotx_so; CURVNET_SET(toep->vnet); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { @@ -2213,15 +2213,17 @@ t4_aiotx_task(void *context, int pending) t4_aiotx_process_job(toep, so, job); } - toep->aiotx_task_active = false; + toep->aiotx_so = NULL; SOCKBUF_UNLOCK(&so->so_snd); CURVNET_RESTORE(); free_toepcb(toep); + SOCK_LOCK(so); + sorele(so); } static void -t4_aiotx_queue_toep(struct toepcb *toep) +t4_aiotx_queue_toep(struct socket *so, struct toepcb *toep) { SOCKBUF_LOCK_ASSERT(&toep->inp->inp_socket->so_snd); @@ -2229,9 +2231,10 @@ t4_aiotx_queue_toep(struct toepcb *toep) CTR3(KTR_CXGBE, "%s: queueing aiotx task for tid %d, active = %s", __func__, toep->tid, toep->aiotx_so != NULL ? "true" : "false"); #endif - if (toep->aiotx_task_active) + if (toep->aiotx_so != NULL) return; - toep->aiotx_task_active = true; + soref(so); + toep->aiotx_so = so; hold_toepcb(toep); soaio_enqueue(&toep->aiotx_task); } @@ -2288,7 +2291,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j panic("new job was cancelled"); TAILQ_INSERT_TAIL(&toep->aiotx_jobq, job, list); if (sowriteable(so)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); SOCKBUF_UNLOCK(&so->so_snd); return (0); } Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tom.h Mon Aug 19 22:25:28 2019 (r351235) +++ stable/12/sys/dev/cxgbe/tom/t4_tom.h Mon Aug 19 22:31:04 2019 (r351236) @@ -197,7 +197,7 @@ struct toepcb { TAILQ_HEAD(, kaiocb) aiotx_jobq; struct task aiotx_task; - bool aiotx_task_active; + struct socket *aiotx_so; /* Tx software descriptor */ uint8_t txsd_total; From owner-svn-src-stable-12@freebsd.org Mon Aug 19 23:57:37 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA737D5746; Mon, 19 Aug 2019 23:57:37 +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 46C9pT5w2Dz4bHf; Mon, 19 Aug 2019 23:57:37 +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 A8A772271B; Mon, 19 Aug 2019 23:57:37 +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 x7JNvbAC024699; Mon, 19 Aug 2019 23:57:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7JNvbKE024698; Mon, 19 Aug 2019 23:57:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908192357.x7JNvbKE024698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Aug 2019 23:57: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: r351242 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 351242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 19 Aug 2019 23:57:38 -0000 Author: jhb Date: Mon Aug 19 23:57:37 2019 New Revision: 351242 URL: https://svnweb.freebsd.org/changeset/base/351242 Log: MFC 349616: Fix description of debug.obsolete_panic. Modified: stable/12/sys/kern/subr_bus.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/subr_bus.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/subr_bus.c ============================================================================== --- stable/12/sys/kern/subr_bus.c Mon Aug 19 23:09:38 2019 (r351241) +++ stable/12/sys/kern/subr_bus.c Mon Aug 19 23:57:37 2019 (r351242) @@ -5894,8 +5894,9 @@ devctl2_init(void) */ static int obsolete_panic = 0; SYSCTL_INT(_debug, OID_AUTO, obsolete_panic, CTLFLAG_RWTUN, &obsolete_panic, 0, - "Bus debug level"); -/* 0 - don't panic, 1 - panic if already obsolete, 2 - panic if deprecated */ + "Panic when obsolete features are used (0 = never, 1 = if osbolete, " + "2 = if deprecated)"); + static void gone_panic(int major, int running, const char *msg) { From owner-svn-src-stable-12@freebsd.org Tue Aug 20 00:50:18 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3956FD6782; Tue, 20 Aug 2019 00:50:18 +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 46CBzG0ZCDz4f6R; Tue, 20 Aug 2019 00:50:18 +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 E4FA22303A; Tue, 20 Aug 2019 00:50:17 +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 x7K0oHJD055832; Tue, 20 Aug 2019 00:50:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7K0oH4v055829; Tue, 20 Aug 2019 00:50:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908200050.x7K0oH4v055829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 20 Aug 2019 00:50: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: r351243 - in stable: 11/sys/kgssapi/krb5 12/sys/kgssapi/krb5 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/kgssapi/krb5 12/sys/kgssapi/krb5 X-SVN-Commit-Revision: 351243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 20 Aug 2019 00:50:18 -0000 Author: jhb Date: Tue Aug 20 00:50:17 2019 New Revision: 351243 URL: https://svnweb.freebsd.org/changeset/base/351243 Log: MFC 348875: Add warnings for Kerberos GSS algorithms deprecated in RFCs 6649 and 8429. All of these algorithms are explicitly marked SHOULD NOT in one of these RFCs. Specifically, RFC 6649 deprecates all algorithms using DES as well as the "export-friendly" variant of RC4. RFC 8429 deprecates Triple DES and the remaining RC4 algorithms. Relnotes: yes Modified: stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c stable/12/sys/kgssapi/krb5/kcrypto_des.c stable/12/sys/kgssapi/krb5/kcrypto_des3.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kgssapi/krb5/kcrypto_arcfour.c stable/11/sys/kgssapi/krb5/kcrypto_des.c stable/11/sys/kgssapi/krb5/kcrypto_des3.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c Mon Aug 19 23:57:37 2019 (r351242) +++ stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c Tue Aug 20 00:50:17 2019 (r351243) @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); static void arcfour_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; ks->ks_priv = NULL; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "RC4 cipher for Kerberos GSS"); } static void Modified: stable/12/sys/kgssapi/krb5/kcrypto_des.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_des.c Mon Aug 19 23:57:37 2019 (r351242) +++ stable/12/sys/kgssapi/krb5/kcrypto_des.c Tue Aug 20 00:50:17 2019 (r351243) @@ -53,11 +53,15 @@ struct des1_state { static void des1_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des1_state *ds; ds = malloc(sizeof(struct des1_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des lock", NULL, MTX_DEF); ks->ks_priv = ds; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "DES cipher for Kerberos GSS"); } static void Modified: stable/12/sys/kgssapi/krb5/kcrypto_des3.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_des3.c Mon Aug 19 23:57:37 2019 (r351242) +++ stable/12/sys/kgssapi/krb5/kcrypto_des3.c Tue Aug 20 00:50:17 2019 (r351243) @@ -54,11 +54,15 @@ struct des3_state { static void des3_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des3_state *ds; ds = malloc(sizeof(struct des3_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des3 lock", NULL, MTX_DEF); ks->ks_priv = ds; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "DES3 cipher for Kerberos GSS"); } static void From owner-svn-src-stable-12@freebsd.org Tue Aug 20 01:30:36 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88412D7521; Tue, 20 Aug 2019 01:30:36 +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 46CCsm35Z2z3CQ6; Tue, 20 Aug 2019 01:30:36 +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 4BE3723788; Tue, 20 Aug 2019 01:30:36 +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 x7K1Ua3Q079441; Tue, 20 Aug 2019 01:30:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7K1UaB6079440; Tue, 20 Aug 2019 01:30:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908200130.x7K1UaB6079440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 20 Aug 2019 01:30: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: r351246 - in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Commit-Revision: 351246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 20 Aug 2019 01:30:36 -0000 Author: jhb Date: Tue Aug 20 01:30:35 2019 New Revision: 351246 URL: https://svnweb.freebsd.org/changeset/base/351246 Log: MFC 348876: Add warnings to /dev/crypto for deprecated algorithms. These algorithms are deprecated algorithms that will have no in-kernel consumers in FreeBSD 13. Specifically, deprecate the following algorithms: - ARC4 - Blowfish - CAST128 - DES - 3DES - MD5-HMAC - Skipjack Relnotes: yes Modified: stable/12/sys/opencrypto/cryptodev.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/opencrypto/cryptodev.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/opencrypto/cryptodev.c ============================================================================== --- stable/12/sys/opencrypto/cryptodev.c Tue Aug 20 01:26:02 2019 (r351245) +++ stable/12/sys/opencrypto/cryptodev.c Tue Aug 20 01:30:35 2019 (r351246) @@ -386,6 +386,9 @@ cryptof_ioctl( struct crypt_op copc; struct crypt_kop kopc; #endif + static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; + static struct timeval skipwarn, tdeswarn; + static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; switch (cmd) { case CIOCGSESSION: @@ -406,18 +409,28 @@ cryptof_ioctl( case 0: break; case CRYPTO_DES_CBC: + if (ratecheck(&deswarn, &warninterval)) + gone_in(13, "DES cipher via /dev/crypto"); txform = &enc_xform_des; break; case CRYPTO_3DES_CBC: + if (ratecheck(&tdeswarn, &warninterval)) + gone_in(13, "3DES cipher via /dev/crypto"); txform = &enc_xform_3des; break; case CRYPTO_BLF_CBC: + if (ratecheck(&blfwarn, &warninterval)) + gone_in(13, "Blowfish cipher via /dev/crypto"); txform = &enc_xform_blf; break; case CRYPTO_CAST_CBC: + if (ratecheck(&castwarn, &warninterval)) + gone_in(13, "CAST128 cipher via /dev/crypto"); txform = &enc_xform_cast5; break; case CRYPTO_SKIPJACK_CBC: + if (ratecheck(&skipwarn, &warninterval)) + gone_in(13, "Skipjack cipher via /dev/crypto"); txform = &enc_xform_skipjack; break; case CRYPTO_AES_CBC: @@ -430,6 +443,8 @@ cryptof_ioctl( txform = &enc_xform_null; break; case CRYPTO_ARC4: + if (ratecheck(&arc4warn, &warninterval)) + gone_in(13, "ARC4 cipher via /dev/crypto"); txform = &enc_xform_arc4; break; case CRYPTO_CAMELLIA_CBC: @@ -458,6 +473,9 @@ cryptof_ioctl( case 0: break; case CRYPTO_MD5_HMAC: + if (ratecheck(&md5warn, &warninterval)) + gone_in(13, + "MD5-HMAC authenticator via /dev/crypto"); thash = &auth_hash_hmac_md5; break; case CRYPTO_POLY1305: From owner-svn-src-stable-12@freebsd.org Tue Aug 20 17:45:23 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 131BDD6D48; Tue, 20 Aug 2019 17:45:23 +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 46CdVV6lWRz4bCX; Tue, 20 Aug 2019 17:45:22 +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 E26FE6D84; Tue, 20 Aug 2019 17:45:22 +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 x7KHjMJ6060634; Tue, 20 Aug 2019 17:45:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7KHjMJQ060633; Tue, 20 Aug 2019 17:45:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908201745.x7KHjMJQ060633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Aug 2019 17:45:22 +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: r351255 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 351255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 20 Aug 2019 17:45:23 -0000 Author: emaste Date: Tue Aug 20 17:45:22 2019 New Revision: 351255 URL: https://svnweb.freebsd.org/changeset/base/351255 Log: MFC r351254: mqueuefs: fix compat32 struct file leak In a compat32 error case we previously leaked a struct file. Submitted by: Karsten König, Secfault Security Security: CVE-2019-5603 Modified: stable/12/sys/kern/uipc_mqueue.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_mqueue.c ============================================================================== --- stable/12/sys/kern/uipc_mqueue.c Tue Aug 20 17:44:03 2019 (r351254) +++ stable/12/sys/kern/uipc_mqueue.c Tue Aug 20 17:45:22 2019 (r351255) @@ -2798,7 +2798,7 @@ freebsd32_kmq_timedsend(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2807,6 +2807,7 @@ freebsd32_kmq_timedsend(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } From owner-svn-src-stable-12@freebsd.org Tue Aug 20 17:53:17 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A580D73A6; Tue, 20 Aug 2019 17:53:17 +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 46Cdgd06Rmz4cmK; Tue, 20 Aug 2019 17:53:17 +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 D98306F52; Tue, 20 Aug 2019 17:53:16 +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 x7KHrGCR067244; Tue, 20 Aug 2019 17:53:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7KHrGpx067243; Tue, 20 Aug 2019 17:53:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908201753.x7KHrGpx067243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Aug 2019 17:53: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: r351264 - stable/12/sys/dev/sound/midi X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/sound/midi X-SVN-Commit-Revision: 351264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 20 Aug 2019 17:53:17 -0000 Author: markj Date: Tue Aug 20 17:53:16 2019 New Revision: 351264 URL: https://svnweb.freebsd.org/changeset/base/351264 Log: MFC r351262: Use a sleepable lock for midistat functions. Security: CVE-2019-5612 Modified: stable/12/sys/dev/sound/midi/midi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/midi/midi.c ============================================================================== --- stable/12/sys/dev/sound/midi/midi.c Tue Aug 20 17:52:28 2019 (r351263) +++ stable/12/sys/dev/sound/midi/midi.c Tue Aug 20 17:53:16 2019 (r351264) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -49,10 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include +#include #include #include #include @@ -187,10 +186,9 @@ TAILQ_HEAD(, snd_midi) midi_devs; * /dev/midistat variables and declarations, protected by midistat_lock */ -static struct mtx midistat_lock; +static struct sx midistat_lock; static int midistat_isopen = 0; static struct sbuf midistat_sbuf; -static int midistat_bufptr; static struct cdev *midistat_dev; /* @@ -289,7 +287,7 @@ midi_init(kobj_class_t cls, int unit, int channel, voi MIDI_TYPE *buf; MIDI_DEBUG(1, printf("midiinit: unit %d/%d.\n", unit, channel)); - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); /* * Protect against call with existing unit/channel or auto-allocate a * new unit number. @@ -316,13 +314,8 @@ midi_init(kobj_class_t cls, int unit, int channel, voi unit = i + 1; MIDI_DEBUG(1, printf("midiinit #2: unit %d/%d.\n", unit, channel)); - m = malloc(sizeof(*m), M_MIDI, M_NOWAIT | M_ZERO); - if (m == NULL) - goto err0; - - m->synth = malloc(sizeof(*m->synth), M_MIDI, M_NOWAIT | M_ZERO); - if (m->synth == NULL) - goto err1; + m = malloc(sizeof(*m), M_MIDI, M_WAITOK | M_ZERO); + m->synth = malloc(sizeof(*m->synth), M_MIDI, M_WAITOK | M_ZERO); kobj_init((kobj_t)m->synth, &midisynth_class); m->synth->m = m; kobj_init((kobj_t)m, cls); @@ -331,7 +324,7 @@ midi_init(kobj_class_t cls, int unit, int channel, voi MIDI_DEBUG(1, printf("midiinit queues %d/%d.\n", inqsize, outqsize)); if (!inqsize && !outqsize) - goto err2; + goto err1; mtx_init(&m->lock, "raw midi", NULL, 0); mtx_init(&m->qlock, "q raw midi", NULL, 0); @@ -356,9 +349,8 @@ midi_init(kobj_class_t cls, int unit, int channel, voi if ((inqsize && !MIDIQ_BUF(m->inq)) || (outqsize && !MIDIQ_BUF(m->outq))) - goto err3; + goto err2; - m->busy = 0; m->flags = 0; m->unit = unit; @@ -366,14 +358,14 @@ midi_init(kobj_class_t cls, int unit, int channel, voi m->cookie = cookie; if (MPU_INIT(m, cookie)) - goto err3; + goto err2; mtx_unlock(&m->lock); mtx_unlock(&m->qlock); TAILQ_INSERT_TAIL(&midi_devs, m, link); - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); m->dev = make_dev(&midi_cdevsw, MIDIMKMINOR(unit, MIDI_DEV_RAW, channel), @@ -382,16 +374,19 @@ midi_init(kobj_class_t cls, int unit, int channel, voi return m; -err3: mtx_destroy(&m->qlock); +err2: + mtx_destroy(&m->qlock); mtx_destroy(&m->lock); if (MIDIQ_BUF(m->inq)) free(MIDIQ_BUF(m->inq), M_MIDI); if (MIDIQ_BUF(m->outq)) free(MIDIQ_BUF(m->outq), M_MIDI); -err2: free(m->synth, M_MIDI); -err1: free(m, M_MIDI); -err0: mtx_unlock(&midistat_lock); +err1: + free(m->synth, M_MIDI); + free(m, M_MIDI); +err0: + sx_xunlock(&midistat_lock); MIDI_DEBUG(1, printf("midi_init ended in error\n")); return NULL; } @@ -409,7 +404,7 @@ midi_uninit(struct snd_midi *m) int err; err = EBUSY; - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); mtx_lock(&m->lock); if (m->busy) { if (!(m->rchan || m->wchan)) @@ -428,8 +423,10 @@ midi_uninit(struct snd_midi *m) if (!err) goto exit; -err: mtx_unlock(&m->lock); -exit: mtx_unlock(&midistat_lock); +err: + mtx_unlock(&m->lock); +exit: + sx_xunlock(&midistat_lock); return err; } @@ -941,27 +938,22 @@ midistat_open(struct cdev *i_dev, int flags, int mode, int error; MIDI_DEBUG(1, printf("midistat_open\n")); - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); if (midistat_isopen) { - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return EBUSY; } midistat_isopen = 1; - mtx_unlock(&midistat_lock); - if (sbuf_new(&midistat_sbuf, NULL, 4096, SBUF_AUTOEXTEND) == NULL) { error = ENXIO; - mtx_lock(&midistat_lock); goto out; } - mtx_lock(&midistat_lock); - midistat_bufptr = 0; error = (midistat_prepare(&midistat_sbuf) > 0) ? 0 : ENOMEM; - -out: if (error) +out: + if (error) midistat_isopen = 0; - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return error; } @@ -969,40 +961,40 @@ static int midistat_close(struct cdev *i_dev, int flags, int mode, struct thread *td) { MIDI_DEBUG(1, printf("midistat_close\n")); - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); if (!midistat_isopen) { - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return EBADF; } sbuf_delete(&midistat_sbuf); midistat_isopen = 0; - - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return 0; } static int -midistat_read(struct cdev *i_dev, struct uio *buf, int flag) +midistat_read(struct cdev *i_dev, struct uio *uio, int flag) { - int l, err; + long l; + int err; MIDI_DEBUG(4, printf("midistat_read\n")); - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); if (!midistat_isopen) { - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return EBADF; } - l = min(buf->uio_resid, sbuf_len(&midistat_sbuf) - midistat_bufptr); + if (uio->uio_offset < 0 || uio->uio_offset > sbuf_len(&midistat_sbuf)) { + sx_xunlock(&midistat_lock); + return EINVAL; + } err = 0; + l = lmin(uio->uio_resid, sbuf_len(&midistat_sbuf) - uio->uio_offset); if (l > 0) { - mtx_unlock(&midistat_lock); - err = uiomove(sbuf_data(&midistat_sbuf) + midistat_bufptr, l, - buf); - mtx_lock(&midistat_lock); - } else - l = 0; - midistat_bufptr += l; - mtx_unlock(&midistat_lock); + err = uiomove(sbuf_data(&midistat_sbuf) + uio->uio_offset, l, + uio); + } + sx_xunlock(&midistat_lock); return err; } @@ -1015,7 +1007,7 @@ midistat_prepare(struct sbuf *s) { struct snd_midi *m; - mtx_assert(&midistat_lock, MA_OWNED); + sx_assert(&midistat_lock, SA_XLOCKED); sbuf_printf(s, "FreeBSD Midi Driver (midi2)\n"); if (TAILQ_EMPTY(&midi_devs)) { @@ -1378,8 +1370,7 @@ midisynth_bender(void *n, uint8_t chn, uint16_t val) static int midi_destroy(struct snd_midi *m, int midiuninit) { - - mtx_assert(&midistat_lock, MA_OWNED); + sx_assert(&midistat_lock, SA_XLOCKED); mtx_assert(&m->lock, MA_OWNED); MIDI_DEBUG(3, printf("midi_destroy\n")); @@ -1405,8 +1396,8 @@ midi_destroy(struct snd_midi *m, int midiuninit) static int midi_load(void) { - mtx_init(&midistat_lock, "midistat lock", NULL, 0); - TAILQ_INIT(&midi_devs); /* Initialize the queue. */ + sx_init(&midistat_lock, "midistat lock"); + TAILQ_INIT(&midi_devs); midistat_dev = make_dev(&midistat_cdevsw, MIDIMKMINOR(0, MIDI_DEV_MIDICTL, 0), @@ -1423,7 +1414,7 @@ midi_unload(void) MIDI_DEBUG(1, printf("midi_unload()\n")); retval = EBUSY; - mtx_lock(&midistat_lock); + sx_xlock(&midistat_lock); if (midistat_isopen) goto exit0; @@ -1436,20 +1427,19 @@ midi_unload(void) if (retval) goto exit1; } - - mtx_unlock(&midistat_lock); /* XXX */ - + sx_xunlock(&midistat_lock); destroy_dev(midistat_dev); + /* * Made it here then unload is complete */ - mtx_destroy(&midistat_lock); + sx_destroy(&midistat_lock); return 0; exit1: mtx_unlock(&m->lock); exit0: - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); if (retval) MIDI_DEBUG(2, printf("midi_unload: failed\n")); return retval; @@ -1498,13 +1488,11 @@ midimapper_open(void *arg1, void **cookie) int retval = 0; struct snd_midi *m; - mtx_lock(&midistat_lock); - + sx_xlock(&midistat_lock); TAILQ_FOREACH(m, &midi_devs, link) { retval++; } - - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return retval; } @@ -1520,17 +1508,15 @@ midimapper_fetch_synth(void *arg, void *cookie, int un struct snd_midi *m; int retval = 0; - mtx_lock(&midistat_lock); - + sx_xlock(&midistat_lock); TAILQ_FOREACH(m, &midi_devs, link) { if (unit == retval) { - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return (kobj_t)m->synth; } retval++; } - - mtx_unlock(&midistat_lock); + sx_xunlock(&midistat_lock); return NULL; } From owner-svn-src-stable-12@freebsd.org Tue Aug 20 20:15:33 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7783EDBA8C; Tue, 20 Aug 2019 20:15:33 +0000 (UTC) (envelope-from erj@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 46Chqn24Wlz3NjY; Tue, 20 Aug 2019 20:15:33 +0000 (UTC) (envelope-from erj@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 1F914891F; Tue, 20 Aug 2019 20:15:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7KKFWFj055923; Tue, 20 Aug 2019 20:15:32 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7KKFWLv055921; Tue, 20 Aug 2019 20:15:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201908202015.x7KKFWLv055921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 20 Aug 2019 20:15: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: r351276 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 351276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 20 Aug 2019 20:15:33 -0000 Author: erj Date: Tue Aug 20 20:15:32 2019 New Revision: 351276 URL: https://svnweb.freebsd.org/changeset/base/351276 Log: MFC various iflib fixes from head Included revisions: r347418 - iflib: use default ntxd and rxd when user value is not power of 2 r348372 - iflib: provide probe wrapper for vendor drivers r350306 - iflib: fix dangling device softc pointer r350507 - iflib: remove kobject class reference increment r350509 - iflib: Prevent kernel panic caused by loading driver with a specific interrupt configuration r351152 - iflib: add iflib_deregister to help cleanup on exit Sponsored by: Intel Corporation Modified: stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Tue Aug 20 20:04:16 2019 (r351275) +++ stable/12/sys/net/iflib.c Tue Aug 20 20:15:32 2019 (r351276) @@ -707,6 +707,7 @@ static void iflib_altq_if_start(if_t ifp); static int iflib_altq_if_transmit(if_t ifp, struct mbuf *m); #endif static int iflib_register(if_ctx_t); +static void iflib_deregister(if_ctx_t); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); static void iflib_add_device_sysctl_post(if_ctx_t ctx); @@ -4350,6 +4351,18 @@ iflib_device_probe(device_t dev) return (ENXIO); } +int +iflib_device_probe_vendor(device_t dev) +{ + int probe; + + probe = iflib_device_probe(dev); + if (probe == BUS_PROBE_DEFAULT) + return (BUS_PROBE_VENDOR); + else + return (probe); +} + static void iflib_reset_qvalues(if_ctx_t ctx) { @@ -4360,9 +4373,6 @@ iflib_reset_qvalues(if_ctx_t ctx) scctx->isc_txrx_budget_bytes_max = IFLIB_MAX_TX_BYTES; scctx->isc_tx_qdepth = IFLIB_DEFAULT_TX_QDEPTH; - /* - * XXX sanity check that ntxd & nrxd are a power of 2 - */ if (ctx->ifc_sysctl_ntxqs != 0) scctx->isc_ntxqsets = ctx->ifc_sysctl_ntxqs; if (ctx->ifc_sysctl_nrxqs != 0) @@ -4393,6 +4403,11 @@ iflib_reset_qvalues(if_ctx_t ctx) i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_max[i]; } + if (!powerof2(scctx->isc_nrxd[i])) { + device_printf(dev, "nrxd%d: %d is not a power of 2 - using default value of %d\n", + i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); + scctx->isc_nrxd[i] = sctx->isc_nrxd_default[i]; + } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4406,6 +4421,11 @@ iflib_reset_qvalues(if_ctx_t ctx) i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_max[i]; } + if (!powerof2(scctx->isc_ntxd[i])) { + device_printf(dev, "ntxd%d: %d is not a power of 2 - using default value of %d\n", + i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); + scctx->isc_ntxd[i] = sctx->isc_ntxd_default[i]; + } } } @@ -4482,7 +4502,7 @@ iflib_device_register(device_t dev, void *sc, if_share if_softc_ctx_t scctx; kobjop_desc_t kobj_desc; kobj_method_t *kobj_method; - int err, i, msix, rid; + int err, msix, rid; uint16_t main_rxq, main_txq; ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); @@ -4534,23 +4554,6 @@ iflib_device_register(device_t dev, void *sc, if_share /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); - for (i = 0; i < sctx->isc_nrxqs; i++) { - if (!powerof2(scctx->isc_nrxd[i])) { - /* round down instead? */ - device_printf(dev, - "# RX descriptors must be a power of 2\n"); - err = EINVAL; - goto fail_iflib_detach; - } - } - for (i = 0; i < sctx->isc_ntxqs; i++) { - if (!powerof2(scctx->isc_ntxd[i])) { - device_printf(dev, - "# TX descriptors must be a power of 2"); - err = EINVAL; - goto fail_iflib_detach; - } - } if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION) @@ -4676,7 +4679,7 @@ iflib_device_register(device_t dev, void *sc, if_share err); goto fail_queues; } - } else { + } else if (scctx->isc_intr != IFLIB_INTR_MSIX) { rid = 0; if (scctx->isc_intr == IFLIB_INTR_MSI) { MPASS(msix == 1); @@ -4686,6 +4689,11 @@ iflib_device_register(device_t dev, void *sc, if_share device_printf(dev, "iflib_legacy_setup failed %d\n", err); goto fail_queues; } + } else { + device_printf(dev, + "Cannot use iflib with only 1 MSI-X interrupt!\n"); + err = ENODEV; + goto fail_intr_free; } ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac); @@ -4725,11 +4733,13 @@ fail_intr_free: fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail_iflib_detach: + taskqgroup_detach(qgroup_if_config_tqg, &ctx->ifc_admin_task); IFDI_DETACH(ctx); fail_unlock: CTX_UNLOCK(ctx); + iflib_deregister(ctx); fail_ctx_free: + device_set_softc(ctx->ifc_dev, NULL); if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); free(ctx, M_IFLIB); @@ -4768,9 +4778,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc scctx = &ctx->ifc_softc_ctx; ifp = ctx->ifc_ifp; - /* - * XXX sanity check that ntxd & nrxd are a power of 2 - */ iflib_reset_qvalues(ctx); CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { @@ -4834,23 +4841,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); - for (i = 0; i < sctx->isc_nrxqs; i++) { - if (!powerof2(scctx->isc_nrxd[i])) { - /* round down instead? */ - device_printf(dev, - "# RX descriptors must be a power of 2\n"); - err = EINVAL; - goto fail_iflib_detach; - } - } - for (i = 0; i < sctx->isc_ntxqs; i++) { - if (!powerof2(scctx->isc_ntxd[i])) { - device_printf(dev, - "# TX descriptors must be a power of 2"); - err = EINVAL; - goto fail_iflib_detach; - } - } if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION) @@ -4941,6 +4931,7 @@ fail_iflib_detach: IFDI_DETACH(ctx); fail_unlock: CTX_UNLOCK(ctx); + iflib_deregister(ctx); fail_ctx_free: free(ctx->ifc_softc, M_IFLIB); free(ctx, M_IFLIB); @@ -4957,15 +4948,7 @@ iflib_pseudo_deregister(if_ctx_t ctx) struct taskqgroup *tqg; iflib_fl_t fl; - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); - ether_ifdetach(ifp); - /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ - CTX_LOCK_DESTROY(ctx); /* XXX drain any dependent tasks */ tqg = qgroup_if_io_tqg; for (txq = ctx->ifc_txqs, i = 0; i < NTXQSETS(ctx); i++, txq++) { @@ -4986,10 +4969,11 @@ iflib_pseudo_deregister(if_ctx_t ctx) if (ctx->ifc_vflr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &ctx->ifc_vflr_task); - if_free(ifp); - iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); + + iflib_deregister(ctx); + if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); free(ctx, M_IFLIB); @@ -5075,19 +5059,19 @@ iflib_device_deregister(if_ctx_t ctx) CTX_UNLOCK(ctx); /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ - CTX_LOCK_DESTROY(ctx); - device_set_softc(ctx->ifc_dev, NULL); iflib_free_intr_mem(ctx); bus_generic_detach(dev); - if_free(ifp); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); + + iflib_deregister(ctx); + + device_set_softc(ctx->ifc_dev, NULL); if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); unref_ctx_core_offset(ctx); - STATE_LOCK_DESTROY(ctx); free(ctx, M_IFLIB); return (0); } @@ -5239,6 +5223,8 @@ iflib_module_event_handler(module_t mod, int what, voi static void _iflib_assert(if_shared_ctx_t sctx) { + int i; + MPASS(sctx->isc_tx_maxsize); MPASS(sctx->isc_tx_maxsegsize); @@ -5246,12 +5232,25 @@ _iflib_assert(if_shared_ctx_t sctx) MPASS(sctx->isc_rx_nsegments); MPASS(sctx->isc_rx_maxsegsize); - MPASS(sctx->isc_nrxd_min[0]); - MPASS(sctx->isc_nrxd_max[0]); - MPASS(sctx->isc_nrxd_default[0]); - MPASS(sctx->isc_ntxd_min[0]); - MPASS(sctx->isc_ntxd_max[0]); - MPASS(sctx->isc_ntxd_default[0]); + MPASS(sctx->isc_nrxqs >= 1 && sctx->isc_nrxqs <= 8); + for (i = 0; i < sctx->isc_nrxqs; i++) { + MPASS(sctx->isc_nrxd_min[i]); + MPASS(powerof2(sctx->isc_nrxd_min[i])); + MPASS(sctx->isc_nrxd_max[i]); + MPASS(powerof2(sctx->isc_nrxd_max[i])); + MPASS(sctx->isc_nrxd_default[i]); + MPASS(powerof2(sctx->isc_nrxd_default[i])); + } + + MPASS(sctx->isc_ntxqs >= 1 && sctx->isc_ntxqs <= 8); + for (i = 0; i < sctx->isc_ntxqs; i++) { + MPASS(sctx->isc_ntxd_min[i]); + MPASS(powerof2(sctx->isc_ntxd_min[i])); + MPASS(sctx->isc_ntxd_max[i]); + MPASS(powerof2(sctx->isc_ntxd_max[i])); + MPASS(sctx->isc_ntxd_default[i]); + MPASS(powerof2(sctx->isc_ntxd_default[i])); + } } static void @@ -5290,7 +5289,6 @@ iflib_register(if_ctx_t ctx) */ kobj_init((kobj_t) ctx, (kobj_class_t) driver); kobj_class_compile((kobj_class_t) driver); - driver->refs++; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setsoftc(ifp, ctx); @@ -5318,6 +5316,36 @@ iflib_register(if_ctx_t ctx) iflib_media_change, iflib_media_status); return (0); +} + +static void +iflib_deregister(if_ctx_t ctx) +{ + if_t ifp = ctx->ifc_ifp; + + /* Remove all media */ + ifmedia_removeall(&ctx->ifc_media); + + /* Unregister VLAN events */ + if (ctx->ifc_vlan_attach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); + ctx->ifc_vlan_attach_event = NULL; + } + if (ctx->ifc_vlan_detach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); + ctx->ifc_vlan_detach_event = NULL; + } + + /* Release kobject reference */ + kobj_delete((kobj_t) ctx, NULL); + + /* Free the ifnet structure */ + if_free(ifp); + + STATE_LOCK_DESTROY(ctx); + + /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ + CTX_LOCK_DESTROY(ctx); } static int Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Tue Aug 20 20:04:16 2019 (r351275) +++ stable/12/sys/net/iflib.h Tue Aug 20 20:15:32 2019 (r351276) @@ -393,6 +393,13 @@ int iflib_device_suspend(device_t); int iflib_device_resume(device_t); int iflib_device_shutdown(device_t); +/* + * Use this instead of iflib_device_probe if the driver should report + * BUS_PROBE_VENDOR instead of BUS_PROBE_DEFAULT. (For example, an out-of-tree + * driver based on iflib). + */ +int iflib_device_probe_vendor(device_t); + int iflib_device_iov_init(device_t, uint16_t, const nvlist_t *); void iflib_device_iov_uninit(device_t); From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:15:07 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0554CCC53; Wed, 21 Aug 2019 16:15:07 +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 46DCRv5bYcz48CG; Wed, 21 Aug 2019 16:15:07 +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 A19FA1E3B9; Wed, 21 Aug 2019 16:15:07 +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 x7LGF7Ji086559; Wed, 21 Aug 2019 16:15:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGF7cX086558; Wed, 21 Aug 2019 16:15:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211615.x7LGF7cX086558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:15:07 +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: r351334 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 351334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:15:07 -0000 Author: markj Date: Wed Aug 21 16:15:07 2019 New Revision: 351334 URL: https://svnweb.freebsd.org/changeset/base/351334 Log: MFC r350458: Use VNASSERT() in checked VOP wrappers. Modified: stable/12/sys/sys/vnode.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/vnode.h ============================================================================== --- stable/12/sys/sys/vnode.h Wed Aug 21 16:11:12 2019 (r351333) +++ stable/12/sys/sys/vnode.h Wed Aug 21 16:15:07 2019 (r351334) @@ -826,27 +826,30 @@ void vop_rename_fail(struct vop_rename_args *ap); #define VOP_LOCK(vp, flags) VOP_LOCK1(vp, flags, __FILE__, __LINE__) -#ifdef INVARIANTS +#ifdef INVARIANTS #define VOP_ADD_WRITECOUNT_CHECKED(vp, cnt) \ do { \ int error_; \ \ error_ = VOP_ADD_WRITECOUNT((vp), (cnt)); \ - MPASS(error_ == 0); \ + VNASSERT(error_ == 0, (vp), ("VOP_ADD_WRITECOUNT returned %d", \ + error_)); \ } while (0) #define VOP_SET_TEXT_CHECKED(vp) \ do { \ int error_; \ \ error_ = VOP_SET_TEXT((vp)); \ - MPASS(error_ == 0); \ + VNASSERT(error_ == 0, (vp), ("VOP_SET_TEXT returned %d", \ + error_)); \ } while (0) #define VOP_UNSET_TEXT_CHECKED(vp) \ do { \ int error_; \ \ error_ = VOP_UNSET_TEXT((vp)); \ - MPASS(error_ == 0); \ + VNASSERT(error_ == 0, (vp), ("VOP_UNSET_TEXT returned %d", \ + error_)); \ } while (0) #else #define VOP_ADD_WRITECOUNT_CHECKED(vp, cnt) VOP_ADD_WRITECOUNT((vp), (cnt)) From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:15:41 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39627CCCBF; Wed, 21 Aug 2019 16:15:41 +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 46DCSY0hZ1z48KL; Wed, 21 Aug 2019 16:15:41 +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 ED6621E3BA; Wed, 21 Aug 2019 16:15:40 +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 x7LGFeAe086635; Wed, 21 Aug 2019 16:15:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGFekF086634; Wed, 21 Aug 2019 16:15:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211615.x7LGFekF086634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:15:40 +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: r351335 - stable/12/sbin/iscontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/iscontrol X-SVN-Commit-Revision: 351335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:15:41 -0000 Author: markj Date: Wed Aug 21 16:15:40 2019 New Revision: 351335 URL: https://svnweb.freebsd.org/changeset/base/351335 Log: MFC r350779: Fix formatting. PR: 239726 Modified: stable/12/sbin/iscontrol/iscontrol.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/iscontrol/iscontrol.8 ============================================================================== --- stable/12/sbin/iscontrol/iscontrol.8 Wed Aug 21 16:15:07 2019 (r351334) +++ stable/12/sbin/iscontrol/iscontrol.8 Wed Aug 21 16:15:40 2019 (r351335) @@ -129,7 +129,7 @@ RFC 3720 The .Nm utility appeared in -Fx 7.0 . +.Fx 7.0 . .Sh BUGS .Nm should probably load the iscsi_initiator module if needed. From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:16:18 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 075D6CCD53; Wed, 21 Aug 2019 16:16:18 +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 46DCTF613xz48Rb; Wed, 21 Aug 2019 16:16:17 +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 AF7221E3BC; Wed, 21 Aug 2019 16:16:17 +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 x7LGGH2U086723; Wed, 21 Aug 2019 16:16:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGGHZC086722; Wed, 21 Aug 2019 16:16:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211616.x7LGGHZC086722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:16: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: r351336 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 351336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:16:18 -0000 Author: markj Date: Wed Aug 21 16:16:17 2019 New Revision: 351336 URL: https://svnweb.freebsd.org/changeset/base/351336 Log: MFC r350780: Add a reference to the NFSv3 RFC. PR: 239721 Modified: stable/12/usr.sbin/mountd/mountd.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.8 ============================================================================== --- stable/12/usr.sbin/mountd/mountd.8 Wed Aug 21 16:15:40 2019 (r351335) +++ stable/12/usr.sbin/mountd/mountd.8 Wed Aug 21 16:16:17 2019 (r351336) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 24, 2016 +.Dd August 1, 2019 .Dt MOUNTD 8 .Os .Sh NAME @@ -54,7 +54,7 @@ server specification; see .%T "Network File System Protocol Specification" , RFC1094, Appendix A and .%T "NFS: Network File System Version 3 Protocol Specification" , -Appendix I. +RFC1813, Appendix I. .Pp The following options are available: .Bl -tag -width indent From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:16:53 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A95C6CCE5E; Wed, 21 Aug 2019 16:16:53 +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 46DCTx3y6Kz48g7; Wed, 21 Aug 2019 16:16:53 +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 693841E3CA; Wed, 21 Aug 2019 16:16:53 +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 x7LGGrsM086804; Wed, 21 Aug 2019 16:16:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGGrSa086803; Wed, 21 Aug 2019 16:16:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211616.x7LGGrSa086803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:16:53 +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: r351337 - stable/12/usr.bin/whois X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/whois X-SVN-Commit-Revision: 351337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:16:53 -0000 Author: markj Date: Wed Aug 21 16:16:52 2019 New Revision: 351337 URL: https://svnweb.freebsd.org/changeset/base/351337 Log: MFC r350781: Update RFC references in the whois(1) man page. PR: 239720 Modified: stable/12/usr.bin/whois/whois.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/whois/whois.1 ============================================================================== --- stable/12/usr.bin/whois/whois.1 Wed Aug 21 16:16:17 2019 (r351336) +++ stable/12/usr.bin/whois/whois.1 Wed Aug 21 16:16:52 2019 (r351337) @@ -28,7 +28,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 25, 2016 +.Dd August 1, 2019 .Dt WHOIS 1 .Os .Sh NAME @@ -272,13 +272,21 @@ to return a brief description of its object type: .Pp .Dl Ic whois -r -- '-t domain' -.Sh SEE ALSO +.Sh STANDARDS .Rs -.%A Ken Harrenstien -.%A Vic White +.%A K. Harrenstien +.%A M. Stahl +.%A E. Feinler +.%D October 1985 +.%R RFC 954 .%T NICNAME/WHOIS -.%D 1 March 1982 -.%O RFC 812 +.Re +.Pp +.Rs +.%A L. Daigle +.%D September 2004 +.%R RFC 3912 +.%T WHOIS Protocol Specification .Re .Sh HISTORY The From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:17:23 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8A0FCCFD2; Wed, 21 Aug 2019 16:17:23 +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 46DCVW42d6z48qh; Wed, 21 Aug 2019 16:17:23 +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 6DF221E3CD; Wed, 21 Aug 2019 16:17:23 +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 x7LGHN9S086888; Wed, 21 Aug 2019 16:17:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGHNNT086887; Wed, 21 Aug 2019 16:17:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211617.x7LGHNNT086887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:17: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: r351338 - stable/12/usr.bin/du X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/du X-SVN-Commit-Revision: 351338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:17:23 -0000 Author: markj Date: Wed Aug 21 16:17:22 2019 New Revision: 351338 URL: https://svnweb.freebsd.org/changeset/base/351338 Log: MFC r350782: Flesh out the STANDARDS and AUTHORS sections in the du(1) man page. PR: 239722 Modified: stable/12/usr.bin/du/du.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/du/du.1 ============================================================================== --- stable/12/usr.bin/du/du.1 Wed Aug 21 16:16:52 2019 (r351337) +++ stable/12/usr.bin/du/du.1 Wed Aug 21 16:17:22 2019 (r351338) @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd August 8, 2017 +.Dd August 1, 2019 .Dt DU 1 .Os .Sh NAME @@ -221,8 +221,78 @@ Also display a grand total at the end: .Xr fts 3 , .Xr symlink 7 , .Xr quot 8 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2008 +specification. +.Pp +The flags +.Op Fl cdhP , +as well as the +.Ev BLOCKSIZE +environment variable, +are extensions to that specification. +.Pp +The flag +.Op Fl r +is accepted but ignored, for compatibility with systems implementing +the obsolete +.St -xcu5 +standard. .Sh HISTORY -A +The .Nm -command appeared in +utility and its +.Fl a +and +.Fl s +options first appeared in .At v1 . +.Pp +The +.Fl r +option first appeared in +.At III +and is available since +.Fx 3.5 . +The +.Fl k +and +.Fl x +options first appeared in +.Bx 4.3 Reno +and +.Fl H +in +.Bx 4.4 . +The +.Fl c +and +.Fl L +options first appeared in the GNU fileutils; +.Fl L +and +.Fl P +are available since +.Bx 4.4 Lite1 , +.Fl c +since +.Fx 2.2.6 . +The +.Fl d +option first appeared in +.Fx 2.2 , +.Fl h +first appeared in +.Fx 4.0 . +.Sh AUTHORS +.An -nosplit +This version of +.Nm +was written by +.An Chris Newcomb +for +.Bx 4.3 Reno +in 1989. From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:17:54 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9FC6CD149; Wed, 21 Aug 2019 16:17:54 +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 46DCW64KlSz4960; Wed, 21 Aug 2019 16:17:54 +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 736891E3DC; Wed, 21 Aug 2019 16:17:54 +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 x7LGHsp6086970; Wed, 21 Aug 2019 16:17:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGHs3E086969; Wed, 21 Aug 2019 16:17:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211617.x7LGHs3E086969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:17: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: r351339 - stable/12/lib/libarchive/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libarchive/tests X-SVN-Commit-Revision: 351339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:17:54 -0000 Author: markj Date: Wed Aug 21 16:17:54 2019 New Revision: 351339 URL: https://svnweb.freebsd.org/changeset/base/351339 Log: MFC r350423: Remove a duplicate file listing in the libarchive tests. Modified: stable/12/lib/libarchive/tests/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libarchive/tests/Makefile ============================================================================== --- stable/12/lib/libarchive/tests/Makefile Wed Aug 21 16:17:22 2019 (r351338) +++ stable/12/lib/libarchive/tests/Makefile Wed Aug 21 16:17:54 2019 (r351339) @@ -581,7 +581,6 @@ ${PACKAGE}FILES+= test_read_format_zip_jar.jar.uu ${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu ${PACKAGE}FILES+= test_read_format_zip_lzma_alone_leak.zipx.uu ${PACKAGE}FILES+= test_read_format_zip_lzma.zipx.uu -${PACKAGE}FILES+= test_read_format_zip_lzma.zipx.uu ${PACKAGE}FILES+= test_read_format_zip_lzma_multi.zipx.uu ${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu ${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:18:33 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3484BCD303; Wed, 21 Aug 2019 16:18:33 +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 46DCWs0Mmcz49MC; Wed, 21 Aug 2019 16:18:33 +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 E3E711E3DD; Wed, 21 Aug 2019 16:18:32 +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 x7LGIW1r087048; Wed, 21 Aug 2019 16:18:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGIWij087047; Wed, 21 Aug 2019 16:18:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211618.x7LGIWij087047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:18: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: r351340 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 351340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:18:33 -0000 Author: markj Date: Wed Aug 21 16:18:32 2019 New Revision: 351340 URL: https://svnweb.freebsd.org/changeset/base/351340 Log: MFC r350002: Fix reference counting in pmap_ts_referenced() on RISC-V. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Wed Aug 21 16:17:54 2019 (r351339) +++ stable/12/sys/riscv/riscv/pmap.c Wed Aug 21 16:18:32 2019 (r351340) @@ -3940,12 +3940,12 @@ pmap_ts_referenced(vm_page_t m) pt_entry_t *l3, l3e; vm_paddr_t pa; vm_offset_t va; - int md_gen, pvh_gen, ret; + int cleared, md_gen, not_cleared, pvh_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); SLIST_INIT(&free); - ret = 0; + cleared = 0; pa = VM_PAGE_TO_PHYS(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(pa); @@ -3953,6 +3953,7 @@ pmap_ts_referenced(vm_page_t m) rw_rlock(&pvh_global_lock); rw_wlock(lock); retry: + not_cleared = 0; if ((pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL) goto small_mappings; pv = pvf; @@ -4003,8 +4004,9 @@ retry: (l2e & PTE_SW_WIRED) == 0) { pmap_clear_bits(l2, PTE_A); pmap_invalidate_page(pmap, va); - } - ret++; + cleared++; + } else + not_cleared++; } PMAP_UNLOCK(pmap); /* Rotate the PV list if it has more than one entry. */ @@ -4013,7 +4015,7 @@ retry: TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); pvh->pv_gen++; } - if (ret >= PMAP_TS_REFERENCED_MAX) + if (cleared + not_cleared >= PMAP_TS_REFERENCED_MAX) goto out; } while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf); small_mappings: @@ -4052,8 +4054,9 @@ small_mappings: */ pmap_clear_bits(l3, PTE_A); pmap_invalidate_page(pmap, pv->pv_va); - } - ret++; + cleared++; + } else + not_cleared++; } PMAP_UNLOCK(pmap); /* Rotate the PV list if it has more than one entry. */ @@ -4062,13 +4065,13 @@ small_mappings: TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; } - } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && ret < - PMAP_TS_REFERENCED_MAX); + } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && cleared + + not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); rw_runlock(&pvh_global_lock); vm_page_free_pages_toq(&free, false); - return (ret); + return (cleared + not_cleared); } /* From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:19:07 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FF46CD3EB; Wed, 21 Aug 2019 16:19:07 +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 46DCXW0XB1z49WT; Wed, 21 Aug 2019 16:19:07 +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 0D4AE1E3DE; Wed, 21 Aug 2019 16:19:07 +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 x7LGJ6H5087121; Wed, 21 Aug 2019 16:19:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGJ625087120; Wed, 21 Aug 2019 16:19:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211619.x7LGJ625087120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:19:06 +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: r351341 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 351341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:19:07 -0000 Author: markj Date: Wed Aug 21 16:19:06 2019 New Revision: 351341 URL: https://svnweb.freebsd.org/changeset/base/351341 Log: MFC r350003: pmap_clear_modify() needs to clear PTE_W. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Wed Aug 21 16:18:32 2019 (r351340) +++ stable/12/sys/riscv/riscv/pmap.c Wed Aug 21 16:19:06 2019 (r351341) @@ -4177,7 +4177,7 @@ restart: m)); l3 = pmap_l2_to_l3(l2, pv->pv_va); if ((pmap_load(l3) & (PTE_D | PTE_W)) == (PTE_D | PTE_W)) { - pmap_clear_bits(l3, PTE_D); + pmap_clear_bits(l3, PTE_D | PTE_W); pmap_invalidate_page(pmap, pv->pv_va); } PMAP_UNLOCK(pmap); From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:21:27 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A92FCD65C; Wed, 21 Aug 2019 16:21:27 +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 46DCbC28KYz49l4; Wed, 21 Aug 2019 16:21:27 +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 128691E545; Wed, 21 Aug 2019 16:21:27 +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 x7LGLQ2u088022; Wed, 21 Aug 2019 16:21:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGLQqS088021; Wed, 21 Aug 2019 16:21:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211621.x7LGLQqS088021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:21: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: r351342 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 351342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:21:27 -0000 Author: markj Date: Wed Aug 21 16:21:26 2019 New Revision: 351342 URL: https://svnweb.freebsd.org/changeset/base/351342 Log: MFC r344670: Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:24:59 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30F67CD86E; Wed, 21 Aug 2019 16:24:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DCgG4vGCz4BXJ; Wed, 21 Aug 2019 16:24:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd43.google.com with SMTP id j4so5702060iop.11; Wed, 21 Aug 2019 09:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fAbj/cPBtzZKsAoXrkohFJhSwgv1I+2Ug04eVfx8VVM=; b=GQvuqBy1yxmSVk6L3fIKMjylgVg4OvODTU2uaxC0pkjMzyJxdAS8jjvfF3Yg2sYa8Z 3hQPm+Oq8Qbn5JMHd/FqYKXRptlrBszFNubeMvidx1e6Zst0R+Rhw7Yt2aC7uq9ux/eG HfL8aj6CW98lRyE8D4hTRYlkeuMH8iJXAwq4nIYw0C4r/T14DSXI6AL822+PAPsyZsPR cIONKb8uM5Qyx9RxIEra166FNm0AjOpgOUeUhQ81Z2cnfQ9q0zjvmIyFuRXWwLQuA/od BBRiIkANIETKAuUMoc+cv2nirsPvZ3el1xa6QxvfWNmxfx7zgCiqAUMBj3kzuyOhHIzP VjrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fAbj/cPBtzZKsAoXrkohFJhSwgv1I+2Ug04eVfx8VVM=; b=rttx6U+qIzoJRMuIdlQxw7L5izChcmnV98F7ee3CRVFiFnink4V3n2rWy8xaTOo+7I 7psfAaupH9r9Y8Bvw8oKd3dPUL/TWp1Y3pABodmE3SKUPiNEaDop0nhYSktVfTT5DnPP EuHA5aI5sYWH88jSs/w0vpvez9ELQsdcs+jMS2POsc8pljgjAIyXl1TQawIQ7I/Sxo9z UOtHEivAzMeRaCF/tIADqCkWtgRJ4zFyX84PUcIAOsiUnssvk043SYXpjQMptPbUE8HY z5VdK1rGYF9ZW3wyZd13i3CXPvSWItHl9OjxkOZeGDVeU1IWSW+xgOgSLv6ELXqNNsNv s5ow== X-Gm-Message-State: APjAAAUHGBpKOpBNUNyR/joGGtS9+reGc7bvegYCDX/EmcxCiHFxEgnZ xDc3lz8w9VbCGn6qiYsCeXjcgN2h X-Google-Smtp-Source: APXvYqwANV2dkXnFNwv6rQTD9LgJFk7Ecmx8Lmud78c9KpoQCKzuQGCIwPh8zOfgEVPcWLkVzEwa/w== X-Received: by 2002:a02:c64a:: with SMTP id k10mr11009381jan.22.1566404697183; Wed, 21 Aug 2019 09:24:57 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-124.dsl.bell.ca. [184.145.252.124]) by smtp.gmail.com with ESMTPSA id y25sm21713530iol.59.2019.08.21.09.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 09:24:56 -0700 (PDT) Sender: Mark Johnston Date: Wed, 21 Aug 2019 12:24:54 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r351342 - stable/12 Message-ID: <20190821162454.GB91995@raichu> References: <201908211621.x7LGLQqS088021@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908211621.x7LGLQqS088021@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46DCgG4vGCz4BXJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GQvuqBy1; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d43 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-3.26 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.63)[ip: (2.15), ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-2.35), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.92)[-0.924,0]; RCVD_IN_DNSWL_NONE(0.00)[3.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[124.252.145.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] 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, 21 Aug 2019 16:24:59 -0000 On Wed, Aug 21, 2019 at 04:21:26PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed Aug 21 16:21:26 2019 > New Revision: 351342 > URL: https://svnweb.freebsd.org/changeset/base/351342 > > Log: > MFC r344670: > Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors. > > Modified: > Directory Properties: > stable/12/ (props changed) This had already been merged, but the mergeinfo was missing. From owner-svn-src-stable-12@freebsd.org Wed Aug 21 16:27:19 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E530FCD972; Wed, 21 Aug 2019 16:27:19 +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 46DCjz4rDkz4Bgj; Wed, 21 Aug 2019 16:27:19 +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 880C01E5B4; Wed, 21 Aug 2019 16:27:19 +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 x7LGRJln092877; Wed, 21 Aug 2019 16:27:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LGRJ73092876; Wed, 21 Aug 2019 16:27:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211627.x7LGRJ73092876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 16:27: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: r351343 - stable/12/sys/riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/conf X-SVN-Commit-Revision: 351343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 16:27:20 -0000 Author: markj Date: Wed Aug 21 16:27:19 2019 New Revision: 351343 URL: https://svnweb.freebsd.org/changeset/base/351343 Log: MFC r342731: Configure hz=100 in the QEMU target. Modified: stable/12/sys/riscv/conf/QEMU Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/conf/QEMU ============================================================================== --- stable/12/sys/riscv/conf/QEMU Wed Aug 21 16:21:26 2019 (r351342) +++ stable/12/sys/riscv/conf/QEMU Wed Aug 21 16:27:19 2019 (r351343) @@ -6,4 +6,5 @@ include "GENERIC" ident QEMU +options HZ=100 options ROOTDEVNAME=\"ufs:/dev/vtbd0\" From owner-svn-src-stable-12@freebsd.org Wed Aug 21 18:28:42 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50B18D02F8; Wed, 21 Aug 2019 18:28:42 +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 46DGQ21VSCz4Jrj; Wed, 21 Aug 2019 18:28:42 +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 1588F1FB39; Wed, 21 Aug 2019 18:28:42 +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 x7LISflu064464; Wed, 21 Aug 2019 18:28:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LIScxE064447; Wed, 21 Aug 2019 18:28:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908211828.x7LIScxE064447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Aug 2019 18:28: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: r351345 - in stable/12/sys: compat/freebsd32 dev/bhnd/nvram dev/drm2 fs/devfs fs/ext2fs fs/fuse kern mips/broadcom rpc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 dev/bhnd/nvram dev/drm2 fs/devfs fs/ext2fs fs/fuse kern mips/broadcom rpc X-SVN-Commit-Revision: 351345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 18:28:42 -0000 Author: markj Date: Wed Aug 21 18:28:38 2019 New Revision: 351345 URL: https://svnweb.freebsd.org/changeset/base/351345 Log: MFC r350421: Avoid relying on header pollution from sys/refcount.h. Modified: stable/12/sys/compat/freebsd32/freebsd32_capability.c stable/12/sys/dev/bhnd/nvram/bhnd_nvram_data_tlv.c stable/12/sys/dev/bhnd/nvram/bhnd_nvram_store.c stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value.c stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value_prf.c stable/12/sys/dev/drm2/drmP.h stable/12/sys/fs/devfs/devfs_vnops.c stable/12/sys/fs/ext2fs/ext2_vnops.c stable/12/sys/fs/fuse/fuse_vnops.c stable/12/sys/kern/kern_event.c stable/12/sys/kern/kern_sig.c stable/12/sys/kern/sys_process.c stable/12/sys/kern/uipc_shm.c stable/12/sys/mips/broadcom/bhnd_nexus.c stable/12/sys/rpc/svc_vc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/freebsd32/freebsd32_capability.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_capability.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/compat/freebsd32/freebsd32_capability.c Wed Aug 21 18:28:38 2019 (r351345) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/dev/bhnd/nvram/bhnd_nvram_data_tlv.c ============================================================================== --- stable/12/sys/dev/bhnd/nvram/bhnd_nvram_data_tlv.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/dev/bhnd/nvram/bhnd_nvram_data_tlv.c Wed Aug 21 18:28:38 2019 (r351345) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include #include +#include #include #include #else /* !_KERNEL */ Modified: stable/12/sys/dev/bhnd/nvram/bhnd_nvram_store.c ============================================================================== --- stable/12/sys/dev/bhnd/nvram/bhnd_nvram_store.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/dev/bhnd/nvram/bhnd_nvram_store.c Wed Aug 21 18:28:38 2019 (r351345) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #ifdef _KERNEL Modified: stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value.c ============================================================================== --- stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value.c Wed Aug 21 18:28:38 2019 (r351345) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #ifdef _KERNEL Modified: stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value_prf.c ============================================================================== --- stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value_prf.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/dev/bhnd/nvram/bhnd_nvram_value_prf.c Wed Aug 21 18:28:38 2019 (r351345) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #ifdef _KERNEL Modified: stable/12/sys/dev/drm2/drmP.h ============================================================================== --- stable/12/sys/dev/drm2/drmP.h Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/dev/drm2/drmP.h Wed Aug 21 18:28:38 2019 (r351345) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_vnops.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/fs/devfs/devfs_vnops.c Wed Aug 21 18:28:38 2019 (r351345) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vnops.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/fs/ext2fs/ext2_vnops.c Wed Aug 21 18:28:38 2019 (r351345) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include Modified: stable/12/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vnops.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/fs/fuse/fuse_vnops.c Wed Aug 21 18:28:38 2019 (r351345) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/kern/kern_event.c Wed Aug 21 18:28:38 2019 (r351345) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/kern/kern_sig.c Wed Aug 21 18:28:38 2019 (r351345) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/kern/sys_process.c Wed Aug 21 18:28:38 2019 (r351345) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: stable/12/sys/kern/uipc_shm.c ============================================================================== --- stable/12/sys/kern/uipc_shm.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/kern/uipc_shm.c Wed Aug 21 18:28:38 2019 (r351345) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/mips/broadcom/bhnd_nexus.c ============================================================================== --- stable/12/sys/mips/broadcom/bhnd_nexus.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/mips/broadcom/bhnd_nexus.c Wed Aug 21 18:28:38 2019 (r351345) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/rpc/svc_vc.c ============================================================================== --- stable/12/sys/rpc/svc_vc.c Wed Aug 21 18:13:02 2019 (r351344) +++ stable/12/sys/rpc/svc_vc.c Wed Aug 21 18:28:38 2019 (r351345) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include From owner-svn-src-stable-12@freebsd.org Wed Aug 21 22:42:12 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5002D677E; Wed, 21 Aug 2019 22:42:12 +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 46DN2X3tYRz4fky; Wed, 21 Aug 2019 22:42:12 +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 67C0022A87; Wed, 21 Aug 2019 22:42:12 +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 x7LMgC3o022235; Wed, 21 Aug 2019 22:42:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LMg9jA022221; Wed, 21 Aug 2019 22:42:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908212242.x7LMg9jA022221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 21 Aug 2019 22:42: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: r351358 - in stable: 11/share/man/man9 11/sys/kern 11/sys/kgssapi/krb5 11/sys/netipsec 11/sys/opencrypto 11/sys/sys 12/share/man/man9 12/sys/kern 12/sys/kgssapi/krb5 12/sys/netipsec 12/... X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man9 11/sys/kern 11/sys/kgssapi/krb5 11/sys/netipsec 11/sys/opencrypto 11/sys/sys 12/share/man/man9 12/sys/kern 12/sys/kgssapi/krb5 12/sys/netipsec 12/sys/opencrypto 12/sys/sys X-SVN-Commit-Revision: 351358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 22:42:12 -0000 Author: jhb Date: Wed Aug 21 22:42:08 2019 New Revision: 351358 URL: https://svnweb.freebsd.org/changeset/base/351358 Log: MFC 348970,348974: Make the warning intervals for deprecated crypto algorithms tunable. 348970: Make the warning intervals for deprecated crypto algorithms tunable. New sysctl/tunables can now set the interval (in seconds) between rate-limited crypto warnings. The new sysctls are: - kern.cryptodev_warn_interval for /dev/crypto - net.inet.ipsec.crypto_warn_interval for IPsec - kern.kgssapi_warn_interval for KGSSAPI 348974: Move declaration of warninterval out from under COMPAT_FREEBSD32. This fixes builds of kernels without COMPAT_FREEBSD32. Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/sysctl.9 stable/12/sys/kern/kern_sysctl.c stable/12/sys/kgssapi/krb5/kcrypto.c stable/12/sys/kgssapi/krb5/kcrypto.h stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c stable/12/sys/kgssapi/krb5/kcrypto_des.c stable/12/sys/kgssapi/krb5/kcrypto_des3.c stable/12/sys/netipsec/ipsec.c stable/12/sys/netipsec/ipsec.h stable/12/sys/netipsec/xform_ah.c stable/12/sys/netipsec/xform_esp.c stable/12/sys/opencrypto/cryptodev.c stable/12/sys/sys/sysctl.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/sysctl.9 stable/11/sys/kern/kern_sysctl.c stable/11/sys/kgssapi/krb5/kcrypto.c stable/11/sys/kgssapi/krb5/kcrypto.h stable/11/sys/kgssapi/krb5/kcrypto_arcfour.c stable/11/sys/kgssapi/krb5/kcrypto_des.c stable/11/sys/kgssapi/krb5/kcrypto_des3.c stable/11/sys/netipsec/ipsec.c stable/11/sys/netipsec/ipsec.h stable/11/sys/netipsec/xform_ah.c stable/11/sys/netipsec/xform_esp.c stable/11/sys/opencrypto/cryptodev.c stable/11/sys/sys/sysctl.h Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/share/man/man9/Makefile Wed Aug 21 22:42:08 2019 (r351358) @@ -2006,6 +2006,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ADD_S64.9 \ sysctl.9 SYSCTL_ADD_STRING.9 \ sysctl.9 SYSCTL_ADD_STRUCT.9 \ + sysctl.9 SYSCTL_ADD_TIMEVAL_SEC.9 \ sysctl.9 SYSCTL_ADD_U8.9 \ sysctl.9 SYSCTL_ADD_U16.9 \ sysctl.9 SYSCTL_ADD_U32.9 \ @@ -2034,6 +2035,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_S64.9 \ sysctl.9 SYSCTL_STRING.9 \ sysctl.9 SYSCTL_STRUCT.9 \ + sysctl.9 SYSCTL_TIMEVAL_SEC.9 \ sysctl.9 SYSCTL_U8.9 \ sysctl.9 SYSCTL_U16.9 \ sysctl.9 SYSCTL_U32.9 \ Modified: stable/12/share/man/man9/sysctl.9 ============================================================================== --- stable/12/share/man/man9/sysctl.9 Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/share/man/man9/sysctl.9 Wed Aug 21 22:42:08 2019 (r351358) @@ -45,6 +45,7 @@ .Nm SYSCTL_ADD_STRING , .Nm SYSCTL_ADD_CONST_STRING , .Nm SYSCTL_ADD_STRUCT , +.Nm SYSCTL_ADD_TIMEVAL_SEC , .Nm SYSCTL_ADD_U8 , .Nm SYSCTL_ADD_U16 , .Nm SYSCTL_ADD_U32 , @@ -74,6 +75,7 @@ .Nm SYSCTL_STRING , .Nm SYSCTL_CONST_STRING , .Nm SYSCTL_STRUCT , +.Nm SYSCTL_TIMEVAL_SEC , .Nm SYSCTL_U8 , .Nm SYSCTL_U16 , .Nm SYSCTL_U32 , @@ -249,6 +251,16 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_TIMEVAL_SEC +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "struct timeval *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_U8 .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -368,6 +380,7 @@ .Fn SYSCTL_STRING parent number name ctlflags arg len descr .Fn SYSCTL_CONST_STRING parent number name ctlflags arg descr .Fn SYSCTL_STRUCT parent number name ctlflags ptr struct_type descr +.Fn SYSCTL_TIMEVAL_SEC parent number name ctlflags ptr descr .Fn SYSCTL_U8 parent number name ctlflags ptr val descr .Fn SYSCTL_U16 parent number name ctlflags ptr val descr .Fn SYSCTL_U32 parent number name ctlflags ptr val descr @@ -537,6 +550,21 @@ Similarly, .Fn sysctl_msec_to_ticks accepts new values in milliseconds and stores an equivalent value in ticks to .Fa *arg2 . +.Pp +The +.Fn SYSCTL_ADD_TIMEVAL_SEC +function and +.Fn SYSCTL_TIMEVAL_SEC +macro create nodes which export an in-kernel variable of type +.Vt struct timeval . +These nodes do not export full value of the associated structure. +Instead, they export a count in seconds as a simple integer which is +stored in the +.Fa tv_sec +field of the associated variable. +This function and macro are intended to be used with variables which +store a non-negative interval rather than an absolute time. +As a result, they reject attempts to store negative values. .Sh CREATING ROOT NODES Sysctl MIBs or OIDs are created in a hierarchical tree. The nodes at the bottom of the tree are called root nodes, and have no @@ -614,6 +642,7 @@ Static sysctls are declared using one of the .Fn SYSCTL_STRING , .Fn SYSCTL_CONST_STRING , .Fn SYSCTL_STRUCT , +.Fn SYSCTL_TIMEVAL_SEC , .Fn SYSCTL_U8 , .Fn SYSCTL_U16 , .Fn SYSCTL_U32 , @@ -640,6 +669,7 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_STRING , .Fn SYSCTL_ADD_CONST_STRING , .Fn SYSCTL_ADD_STRUCT , +.Fn SYSCTL_ADD_TIMEVAL_SEC , .Fn SYSCTL_ADD_U8 , .Fn SYSCTL_ADD_U16 , .Fn SYSCTL_ADD_U32 , Modified: stable/12/sys/kern/kern_sysctl.c ============================================================================== --- stable/12/sys/kern/kern_sysctl.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kern/kern_sysctl.c Wed Aug 21 22:42:08 2019 (r351358) @@ -1694,6 +1694,30 @@ retry: } /* + * Convert seconds to a struct timeval. Intended for use with + * intervals and thus does not permit negative seconds. + */ +int +sysctl_sec_to_timeval(SYSCTL_HANDLER_ARGS) +{ + struct timeval *tv; + int error, secs; + + tv = arg1; + secs = tv->tv_sec; + + error = sysctl_handle_int(oidp, &secs, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (secs < 0) + return (EINVAL); + tv->tv_sec = secs; + + return (0); +} + +/* * Transfer functions to/from kernel space. * XXX: rather untested at this point */ Modified: stable/12/sys/kgssapi/krb5/kcrypto.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kgssapi/krb5/kcrypto.c Wed Aug 21 22:42:08 2019 (r351358) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -49,6 +50,11 @@ static struct krb5_encryption_class *krb5_encryption_c &krb5_arcfour_56_encryption_class, NULL }; + +struct timeval krb5_warn_interval = { .tv_sec = 3600, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, kgssapi_warn_interval, CTLFLAG_RW, + &krb5_warn_interval, + "Delay in seconds between warnings of deprecated KGSSAPI crypto."); struct krb5_encryption_class * krb5_find_encryption_class(int etype) Modified: stable/12/sys/kgssapi/krb5/kcrypto.h ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto.h Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kgssapi/krb5/kcrypto.h Wed Aug 21 22:42:08 2019 (r351358) @@ -101,6 +101,7 @@ extern struct krb5_encryption_class krb5_aes128_encryp extern struct krb5_encryption_class krb5_aes256_encryption_class; extern struct krb5_encryption_class krb5_arcfour_encryption_class; extern struct krb5_encryption_class krb5_arcfour_56_encryption_class; +extern struct timeval krb5_warn_interval; static __inline void krb5_set_key(struct krb5_key_state *ks, const void *keydata) Modified: stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kgssapi/krb5/kcrypto_arcfour.c Wed Aug 21 22:42:08 2019 (r351358) @@ -47,10 +47,9 @@ static void arcfour_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; ks->ks_priv = NULL; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "RC4 cipher for Kerberos GSS"); } Modified: stable/12/sys/kgssapi/krb5/kcrypto_des.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_des.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kgssapi/krb5/kcrypto_des.c Wed Aug 21 22:42:08 2019 (r351358) @@ -54,13 +54,12 @@ static void des1_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des1_state *ds; ds = malloc(sizeof(struct des1_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des lock", NULL, MTX_DEF); ks->ks_priv = ds; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "DES cipher for Kerberos GSS"); } Modified: stable/12/sys/kgssapi/krb5/kcrypto_des3.c ============================================================================== --- stable/12/sys/kgssapi/krb5/kcrypto_des3.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/kgssapi/krb5/kcrypto_des3.c Wed Aug 21 22:42:08 2019 (r351358) @@ -55,13 +55,12 @@ static void des3_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des3_state *ds; ds = malloc(sizeof(struct des3_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des3 lock", NULL, MTX_DEF); ks->ks_priv = ds; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "DES3 cipher for Kerberos GSS"); } Modified: stable/12/sys/netipsec/ipsec.c ============================================================================== --- stable/12/sys/netipsec/ipsec.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/netipsec/ipsec.c Wed Aug 21 22:42:08 2019 (r351358) @@ -216,6 +216,11 @@ SYSCTL_INT(_net_inet_ipsec, OID_AUTO, filtertunnel, SYSCTL_VNET_PCPUSTAT(_net_inet_ipsec, OID_AUTO, ipsecstats, struct ipsecstat, ipsec4stat, "IPsec IPv4 statistics."); +struct timeval ipsec_warn_interval = { .tv_sec = 1, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_net_inet_ipsec, OID_AUTO, crypto_warn_interval, CTLFLAG_RW, + &ipsec_warn_interval, + "Delay in seconds between warnings of deprecated IPsec crypto algorithms."); + #ifdef REGRESSION /* * When set to 1, IPsec will send packets with the same sequence number. Modified: stable/12/sys/netipsec/ipsec.h ============================================================================== --- stable/12/sys/netipsec/ipsec.h Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/netipsec/ipsec.h Wed Aug 21 22:42:08 2019 (r351358) @@ -287,6 +287,8 @@ VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, async_crypto); VNET_DECLARE(int, natt_cksum_policy); +extern struct timeval ipsec_warn_interval; + #define IPSECSTAT_INC(name) \ VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1) #define V_ip4_esp_trans_deflev VNET(ip4_esp_trans_deflev) Modified: stable/12/sys/netipsec/xform_ah.c ============================================================================== --- stable/12/sys/netipsec/xform_ah.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/netipsec/xform_ah.c Wed Aug 21 22:42:08 2019 (r351358) @@ -109,7 +109,6 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_ah, IPSECCTL_STATS, sta static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */ static struct timeval md5warn, ripewarn, kpdkmd5warn, kpdksha1warn; -static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; static int ah_input_cb(struct cryptop*); static int ah_output_cb(struct cryptop*); @@ -189,19 +188,19 @@ ah_init0(struct secasvar *sav, struct xformsw *xsp, st switch (sav->alg_auth) { case SADB_AALG_MD5HMAC: - if (ratecheck(&md5warn, &warninterval)) + if (ratecheck(&md5warn, &ipsec_warn_interval)) gone_in(13, "MD5-HMAC authenticator for IPsec"); break; case SADB_X_AALG_RIPEMD160HMAC: - if (ratecheck(&ripewarn, &warninterval)) + if (ratecheck(&ripewarn, &ipsec_warn_interval)) gone_in(13, "RIPEMD160-HMAC authenticator for IPsec"); break; case SADB_X_AALG_MD5: - if (ratecheck(&kpdkmd5warn, &warninterval)) + if (ratecheck(&kpdkmd5warn, &ipsec_warn_interval)) gone_in(13, "Keyed-MD5 authenticator for IPsec"); break; case SADB_X_AALG_SHA: - if (ratecheck(&kpdksha1warn, &warninterval)) + if (ratecheck(&kpdksha1warn, &ipsec_warn_interval)) gone_in(13, "Keyed-SHA1 authenticator for IPsec"); break; } Modified: stable/12/sys/netipsec/xform_esp.c ============================================================================== --- stable/12/sys/netipsec/xform_esp.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/netipsec/xform_esp.c Wed Aug 21 22:42:08 2019 (r351358) @@ -95,7 +95,6 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_esp, IPSECCTL_STATS, st "ESP statistics (struct espstat, netipsec/esp_var.h"); static struct timeval deswarn, blfwarn, castwarn, camelliawarn; -static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); @@ -162,19 +161,19 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) switch (sav->alg_enc) { case SADB_EALG_DESCBC: - if (ratecheck(&deswarn, &warninterval)) + if (ratecheck(&deswarn, &ipsec_warn_interval)) gone_in(13, "DES cipher for IPsec"); break; case SADB_X_EALG_BLOWFISHCBC: - if (ratecheck(&blfwarn, &warninterval)) + if (ratecheck(&blfwarn, &ipsec_warn_interval)) gone_in(13, "Blowfish cipher for IPsec"); break; case SADB_X_EALG_CAST128CBC: - if (ratecheck(&castwarn, &warninterval)) + if (ratecheck(&castwarn, &ipsec_warn_interval)) gone_in(13, "CAST cipher for IPsec"); break; case SADB_X_EALG_CAMELLIACBC: - if (ratecheck(&camelliawarn, &warninterval)) + if (ratecheck(&camelliawarn, &ipsec_warn_interval)) gone_in(13, "Camellia cipher for IPsec"); break; } Modified: stable/12/sys/opencrypto/cryptodev.c ============================================================================== --- stable/12/sys/opencrypto/cryptodev.c Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/opencrypto/cryptodev.c Wed Aug 21 22:42:08 2019 (r351358) @@ -294,6 +294,11 @@ struct fcrypt { int sesn; }; +static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_interval, CTLFLAG_RW, + &warninterval, + "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); + static int cryptof_ioctl(struct file *, u_long, void *, struct ucred *, struct thread *); static int cryptof_stat(struct file *, struct stat *, @@ -388,7 +393,6 @@ cryptof_ioctl( #endif static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; static struct timeval skipwarn, tdeswarn; - static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; switch (cmd) { case CIOCGSESSION: Modified: stable/12/sys/sys/sysctl.h ============================================================================== --- stable/12/sys/sys/sysctl.h Wed Aug 21 22:18:07 2019 (r351357) +++ stable/12/sys/sys/sysctl.h Wed Aug 21 22:42:08 2019 (r351358) @@ -216,6 +216,8 @@ int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARG int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); +int sysctl_sec_to_timeval(SYSCTL_HANDLER_ARGS); + int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); @@ -815,6 +817,24 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ __ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr), \ + NULL); \ +}) + +/* OID expressing a struct timeval as seconds */ +#define SYSCTL_TIMEVAL_SEC(parent, nbr, name, access, ptr, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + (ptr), 0, sysctl_sec_to_timeval, "I", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) +#define SYSCTL_ADD_TIMEVAL_SEC(ctx, parent, nbr, name, access, ptr, descr) \ +({ \ + struct timeval *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + __ptr, 0, sysctl_sec_to_timeval, "I", __DESCR(descr), \ NULL); \ }) From owner-svn-src-stable-12@freebsd.org Wed Aug 21 23:44:46 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3A4ED7A1F; Wed, 21 Aug 2019 23:44:46 +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 46DPQk5CS2z3Fbp; Wed, 21 Aug 2019 23:44:46 +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 954AA23567; Wed, 21 Aug 2019 23:44:46 +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 x7LNikJO058491; Wed, 21 Aug 2019 23:44:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7LNikcv058490; Wed, 21 Aug 2019 23:44:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908212344.x7LNikcv058490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 21 Aug 2019 23:44: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: r351362 - in stable: 11/usr.bin/netstat 12/usr.bin/netstat X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/netstat 12/usr.bin/netstat X-SVN-Commit-Revision: 351362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 21 Aug 2019 23:44:46 -0000 Author: jhb Date: Wed Aug 21 23:44:46 2019 New Revision: 351362 URL: https://svnweb.freebsd.org/changeset/base/351362 Log: MFC 350666: Tidy up the list of auth and encryption algorithms for IPsec stats. - Use keyed-md5 and keyed_sha1 instead of md5 and sha1 to match the names accepted by setkey and to also avoid confusion since these are not "plain" MD5 or SHA1. - Remove always-true #ifdef's to make the source a bit easier to read. - Add missing mappings for tcp-md5, camellia-cbc, and aes-gmac. Modified: stable/12/usr.bin/netstat/ipsec.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/netstat/ipsec.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/netstat/ipsec.c ============================================================================== --- stable/12/usr.bin/netstat/ipsec.c Wed Aug 21 23:43:58 2019 (r351361) +++ stable/12/usr.bin/netstat/ipsec.c Wed Aug 21 23:44:46 2019 (r351362) @@ -125,33 +125,18 @@ static struct val2str ipsec_ahnames[] = { { SADB_AALG_NONE, "none", }, { SADB_AALG_MD5HMAC, "hmac-md5", }, { SADB_AALG_SHA1HMAC, "hmac-sha1", }, - { SADB_X_AALG_MD5, "md5", }, - { SADB_X_AALG_SHA, "sha", }, + { SADB_X_AALG_MD5, "keyed-md5", }, + { SADB_X_AALG_SHA, "keyed-sha1", }, { SADB_X_AALG_NULL, "null", }, -#ifdef SADB_X_AALG_SHA2_256 { SADB_X_AALG_SHA2_256, "hmac-sha2-256", }, -#endif -#ifdef SADB_X_AALG_SHA2_384 { SADB_X_AALG_SHA2_384, "hmac-sha2-384", }, -#endif -#ifdef SADB_X_AALG_SHA2_512 { SADB_X_AALG_SHA2_512, "hmac-sha2-512", }, -#endif -#ifdef SADB_X_AALG_RIPEMD160HMAC { SADB_X_AALG_RIPEMD160HMAC, "hmac-ripemd160", }, -#endif -#ifdef SADB_X_AALG_AES_XCBC_MAC { SADB_X_AALG_AES_XCBC_MAC, "aes-xcbc-mac", }, -#endif -#ifdef SADB_X_AALG_AES128GMAC + { SADB_X_AALG_TCP_MD5, "tcp-md5", }, { SADB_X_AALG_AES128GMAC, "aes-gmac-128", }, -#endif -#ifdef SADB_X_AALG_AES192GMAC { SADB_X_AALG_AES192GMAC, "aes-gmac-192", }, -#endif -#ifdef SADB_X_AALG_AES256GMAC { SADB_X_AALG_AES256GMAC, "aes-gmac-256", }, -#endif { -1, NULL }, }; @@ -162,15 +147,11 @@ static struct val2str ipsec_espnames[] = { { SADB_EALG_NULL, "null", }, { SADB_X_EALG_CAST128CBC, "cast128-cbc", }, { SADB_X_EALG_BLOWFISHCBC, "blowfish-cbc", }, -#ifdef SADB_X_EALG_RIJNDAELCBC { SADB_X_EALG_RIJNDAELCBC, "rijndael-cbc", }, -#endif -#ifdef SADB_X_EALG_AESCTR + { SADB_X_EALG_CAMELLIACBC, "camellia-cbc", }, { SADB_X_EALG_AESCTR, "aes-ctr", }, -#endif -#ifdef SADB_X_EALG_AESGCM16 { SADB_X_EALG_AESGCM16, "aes-gcm-16", }, -#endif + { SADB_X_EALG_AESGMAC, "aes-gmac", }, { -1, NULL }, }; From owner-svn-src-stable-12@freebsd.org Thu Aug 22 00:33:23 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1300D8D8F; Thu, 22 Aug 2019 00:33:23 +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 46DQVq3ZBzz3JNJ; Thu, 22 Aug 2019 00:33:23 +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 4268523E7C; Thu, 22 Aug 2019 00:33:23 +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 x7M0XNNM087958; Thu, 22 Aug 2019 00:33:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7M0XNtf087957; Thu, 22 Aug 2019 00:33:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908220033.x7M0XNtf087957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Aug 2019 00:33: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: r351367 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 351367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 22 Aug 2019 00:33:23 -0000 Author: emaste Date: Thu Aug 22 00:33:22 2019 New Revision: 351367 URL: https://svnweb.freebsd.org/changeset/base/351367 Log: arch.7: add default tool chain table MFC r351035: arch.7: add tool chain table MFC r351036: arch.7: add deprecation notice for GCC 4.2.1 MFC r351037: arch.7: clarify that the table shows the default tool chain MFC r351063: arch.7: be explicit about the future for unmigrated GCC 4.2.1 archs Modified: stable/12/share/man/man7/arch.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/arch.7 ============================================================================== --- stable/12/share/man/man7/arch.7 Thu Aug 22 00:19:41 2019 (r351366) +++ stable/12/share/man/man7/arch.7 Thu Aug 22 00:33:22 2019 (r351367) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd August 14, 2019 .Dt ARCH 7 .Os .Sh NAME @@ -295,6 +295,50 @@ is 8 bytes on all supported architectures except i386. .Fx 11.0 , armv6 used the softfp ABI even though it supported only processors with a floating point unit. +.Ss Default Tool Chain +.Fx uses a variety of tool chain components for the supported CPU +architectures: +.Xr clang 1 +and +.Xr ld.lld 1 +provided by the base system, +GNU +.Xr gcc 1 +and Binutils +.Xr ld 1 , +or an external toolchain compiler and linker provided by a port or package. +This table shows the default tool chain for each architecture. +.Bl -column -offset indent "Sy Architecture" "Sy Compiler" "Sy Linker" +.It Sy Architecture Ta Sy Compiler Ta Sy Linker +.It aarch64 Ta Clang Ta lld +.It amd64 Ta Clang Ta lld +.It arm Ta Clang Ta GNU ld 2.17.50 +.It armv6 Ta Clang Ta GNU ld 2.17.50 +.It armv7 Ta Clang Ta lld +.It i386 Ta Clang Ta lld +.It mips Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mipsel Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mipselhf Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mipshf Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mipsn32 Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mips64 Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mips64el Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mips64elhf Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mips64hf Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It powerpc Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It powerpcspe Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It powerpc64 Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It riscv64 Ta GCC(1) Ta GNU ld(1) +.It riscv64sf Ta GCC(1) Ta GNU ld(1) +.It sparc64 Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.El +.Pp +(1) External toolchain provided by ports/packages. +.Pp +Note that GCC 4.2.1 is deprecated, and scheduled for removal on 2020-03-31. +Any CPU architectures not migrated by then +(to either base system Clang or external toolchain) +may be removed from the tree after that date. .Ss Predefined Macros The compiler provides a number of predefined macros. Some of these provide architecture-specific details and are explained below. From owner-svn-src-stable-12@freebsd.org Thu Aug 22 07:17:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B59FFDFA57; Thu, 22 Aug 2019 07:17:49 +0000 (UTC) (envelope-from avg@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 46DbTT4MN9z47mQ; Thu, 22 Aug 2019 07:17:49 +0000 (UTC) (envelope-from avg@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 78846749; Thu, 22 Aug 2019 07:17:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7M7HnOH025664; Thu, 22 Aug 2019 07:17:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7M7Hnep025663; Thu, 22 Aug 2019 07:17:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908220717.x7M7Hnep025663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 22 Aug 2019 07:17: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: r351383 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 351383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 22 Aug 2019 07:17:49 -0000 Author: avg Date: Thu Aug 22 07:17:49 2019 New Revision: 351383 URL: https://svnweb.freebsd.org/changeset/base/351383 Log: MFC r350894: a stop gap fix for a race between dnode_hold and dnode_sync_free The race was introduced in r337669, the large dnode feature import from ZoL. The problem was debugged by ZoL developers and then, independently, on FreeBSD. The fix is an early proposal by Brian Behlendorf: https://github.com/behlendorf/zfs/commit/50f32ed74e42aa28522e9681fb8ae55239fa33a7 This fix never went into ZoL. A larger change that was committed later included a different solution because of the re-worked code. Ideally, we want to revert this fix and re-synchronize FreeBSD large dnode code with that in illumos (or newer ZoL). illumos has a later import of the feature from ZoL that does not have the bug. PR: 236480 Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Aug 22 06:14:06 2019 (r351382) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Aug 22 07:17:49 2019 (r351383) @@ -1324,7 +1324,9 @@ dnode_hold_impl(objset_t *os, uint64_t object, int fla mutex_enter(&dn->dn_mtx); type = dn->dn_type; if (dn->dn_free_txg || - ((flag & DNODE_MUST_BE_FREE) && !refcount_is_zero(&dn->dn_holds))) { + ((flag & DNODE_MUST_BE_ALLOCATED) && type == DMU_OT_NONE) || + ((flag & DNODE_MUST_BE_FREE) && + (type != DMU_OT_NONE || !refcount_is_zero(&dn->dn_holds)))) { mutex_exit(&dn->dn_mtx); zrl_remove(&dnh->dnh_zrlock); dbuf_rele(db, FTAG); From owner-svn-src-stable-12@freebsd.org Thu Aug 22 07:37:36 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5384CDFF0E; Thu, 22 Aug 2019 07:37:36 +0000 (UTC) (envelope-from tsoome@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 46DbwJ2Jw6z48Yx; Thu, 22 Aug 2019 07:37:36 +0000 (UTC) (envelope-from tsoome@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 31D1FB04; Thu, 22 Aug 2019 07:37:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7M7ba1n037731; Thu, 22 Aug 2019 07:37:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7M7bYrE037721; Thu, 22 Aug 2019 07:37:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908220737.x7M7bYrE037721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 22 Aug 2019 07:37: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: r351384 - in stable/12: cddl/contrib/opensolaris/lib/libzfs/common stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolari... X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/lib/libzfs/common stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts/common/os sys/cddl/... X-SVN-Commit-Revision: 351384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 22 Aug 2019 07:37:36 -0000 Author: tsoome Date: Thu Aug 22 07:37:34 2019 New Revision: 351384 URL: https://svnweb.freebsd.org/changeset/base/351384 Log: loader: support com.delphix:removing MFC r348353: boot1.efi should also provide Calloc MFC r350772: loader: support com.delphix:removing MFC r350825: loader: add error check for vdev_indirect calls As prerequisite, we need Calloc in boot1 so we would not conflict with libsa. We should support removing vdev from boot pool. Update loader zfs reader to support com.delphix:removing. Relnotes: yes Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/12/stand/efi/boot1/Makefile stable/12/stand/efi/boot1/boot1.c stable/12/stand/i386/gptzfsboot/Makefile stable/12/stand/i386/zfsboot/Makefile stable/12/stand/libsa/zfs/Makefile.inc stable/12/stand/libsa/zfs/zfsimpl.c stable/12/sys/cddl/boot/zfs/zfsimpl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/os/list.c stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/list.h stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/list_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/note.h stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Aug 22 07:37:34 2019 (r351384) @@ -3300,13 +3300,6 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *pat return (zfs_error(hdl, EZFS_BADVERSION, msg)); } - if (!islog && !avail_spare && !l2cache && zpool_is_bootable(zhp)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "root pool can not have removed devices, " - "because GRUB does not understand them")); - return (zfs_error(hdl, EINVAL, msg)); - } - zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) Modified: stable/12/stand/efi/boot1/Makefile ============================================================================== --- stable/12/stand/efi/boot1/Makefile Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/efi/boot1/Makefile Thu Aug 22 07:37:34 2019 (r351384) @@ -30,6 +30,8 @@ SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein +CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common + CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: stable/12/stand/efi/boot1/boot1.c ============================================================================== --- stable/12/stand/efi/boot1/boot1.c Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/efi/boot1/boot1.c Thu Aug 22 07:37:34 2019 (r351384) @@ -56,10 +56,11 @@ static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCO static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; /* - * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * Provide Malloc / Free / Calloc backed by EFIs AllocatePool / FreePool which ensures * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from * EFI methods. */ + void * Malloc(size_t len, const char *file __unused, int line __unused) { @@ -76,6 +77,19 @@ Free(void *buf, const char *file __unused, int line __ { if (buf != NULL) (void)BS->FreePool(buf); +} + +void * +Calloc(size_t n1, size_t n2, const char *file, int line) +{ + size_t bytes; + void *res; + + bytes = n1 * n2; + if ((res = Malloc(bytes, file, line)) != NULL) + bzero(res, bytes); + + return (res); } /* Modified: stable/12/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/12/stand/i386/gptzfsboot/Makefile Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/i386/gptzfsboot/Makefile Thu Aug 22 07:37:34 2019 (r351384) @@ -28,6 +28,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast \ Modified: stable/12/stand/i386/zfsboot/Makefile ============================================================================== --- stable/12/stand/i386/zfsboot/Makefile Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/i386/zfsboot/Makefile Thu Aug 22 07:37:34 2019 (r351384) @@ -27,6 +27,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ Modified: stable/12/stand/libsa/zfs/Makefile.inc ============================================================================== --- stable/12/stand/libsa/zfs/Makefile.inc Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/libsa/zfs/Makefile.inc Thu Aug 22 07:37:34 2019 (r351384) @@ -1,13 +1,15 @@ # $FreeBSD$ .PATH: ${ZFSSRC} -SRCS+= zfs.c skein.c skein_block.c +SRCS+= zfs.c skein.c skein_block.c list.c # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall Modified: stable/12/stand/libsa/zfs/zfsimpl.c ============================================================================== --- stable/12/stand/libsa/zfs/zfsimpl.c Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/stand/libsa/zfs/zfsimpl.c Thu Aug 22 07:37:34 2019 (r351384) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "zfsimpl.h" #include "zfssubr.c" @@ -46,6 +47,58 @@ struct zfsmount { static struct zfsmount zfsmount __unused; /* + * The indirect_child_t represents the vdev that we will read from, when we + * need to read all copies of the data (e.g. for scrub or reconstruction). + * For plain (non-mirror) top-level vdevs (i.e. is_vdev is not a mirror), + * ic_vdev is the same as is_vdev. However, for mirror top-level vdevs, + * ic_vdev is a child of the mirror. + */ +typedef struct indirect_child { + void *ic_data; + vdev_t *ic_vdev; +} indirect_child_t; + +/* + * The indirect_split_t represents one mapped segment of an i/o to the + * indirect vdev. For non-split (contiguously-mapped) blocks, there will be + * only one indirect_split_t, with is_split_offset==0 and is_size==io_size. + * For split blocks, there will be several of these. + */ +typedef struct indirect_split { + list_node_t is_node; /* link on iv_splits */ + + /* + * is_split_offset is the offset into the i/o. + * This is the sum of the previous splits' is_size's. + */ + uint64_t is_split_offset; + + vdev_t *is_vdev; /* top-level vdev */ + uint64_t is_target_offset; /* offset on is_vdev */ + uint64_t is_size; + int is_children; /* number of entries in is_child[] */ + + /* + * is_good_child is the child that we are currently using to + * attempt reconstruction. + */ + int is_good_child; + + indirect_child_t is_child[1]; /* variable-length */ +} indirect_split_t; + +/* + * The indirect_vsd_t is associated with each i/o to the indirect vdev. + * It is the "Vdev-Specific Data" in the zio_t's io_vsd. + */ +typedef struct indirect_vsd { + boolean_t iv_split_block; + boolean_t iv_reconstruct; + + list_t iv_splits; /* list of indirect_split_t's */ +} indirect_vsd_t; + +/* * List of all vdevs, chained through v_alllink. */ static vdev_list_t zfs_vdevs; @@ -63,6 +116,8 @@ static const char *features_for_read[] = { "org.illumos:skein", "org.zfsonlinux:large_dnode", "com.joyent:multi_vdev_crash_dump", + "com.delphix:device_removal", + "com.delphix:obsolete_counts", NULL }; @@ -85,6 +140,18 @@ static int zfs_rlookup(const spa_t *spa, uint64_t objn static int zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t integer_size, uint64_t num_integers, void *value); +static int objset_get_dnode(const spa_t *, const objset_phys_t *, uint64_t, + dnode_phys_t *); +static int dnode_read(const spa_t *, const dnode_phys_t *, off_t, void *, + size_t); +static int vdev_indirect_read(vdev_t *, const blkptr_t *, void *, off_t, + size_t); +static int vdev_mirror_read(vdev_t *, const blkptr_t *, void *, off_t, size_t); +vdev_indirect_mapping_t *vdev_indirect_mapping_open(spa_t *, objset_phys_t *, + uint64_t); +vdev_indirect_mapping_entry_phys_t * + vdev_indirect_mapping_duplicate_adjacent_entries(vdev_t *, uint64_t, + uint64_t, uint64_t *); static void zfs_init(void) @@ -162,7 +229,7 @@ xdr_uint64_t(const unsigned char **xdr, uint64_t *lp) static int nvlist_find(const unsigned char *nvlist, const char *name, int type, - int* elementsp, void *valuep) + int *elementsp, void *valuep) { const unsigned char *p, *pair; int junk; @@ -427,13 +494,512 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_verify(vdev->spa, bp, buf)) - return (EIO); + if (bp != NULL) + return (zio_checksum_verify(vdev->spa, bp, buf)); return (0); } +typedef struct remap_segment { + vdev_t *rs_vd; + uint64_t rs_offset; + uint64_t rs_asize; + uint64_t rs_split_offset; + list_node_t rs_node; +} remap_segment_t; + +static remap_segment_t * +rs_alloc(vdev_t *vd, uint64_t offset, uint64_t asize, uint64_t split_offset) +{ + remap_segment_t *rs = malloc(sizeof (remap_segment_t)); + + if (rs != NULL) { + rs->rs_vd = vd; + rs->rs_offset = offset; + rs->rs_asize = asize; + rs->rs_split_offset = split_offset; + } + + return (rs); +} + +vdev_indirect_mapping_t * +vdev_indirect_mapping_open(spa_t *spa, objset_phys_t *os, + uint64_t mapping_object) +{ + vdev_indirect_mapping_t *vim; + vdev_indirect_mapping_phys_t *vim_phys; + int rc; + + vim = calloc(1, sizeof (*vim)); + if (vim == NULL) + return (NULL); + + vim->vim_dn = calloc(1, sizeof (*vim->vim_dn)); + if (vim->vim_dn == NULL) { + free(vim); + return (NULL); + } + + rc = objset_get_dnode(spa, os, mapping_object, vim->vim_dn); + if (rc != 0) { + free(vim->vim_dn); + free(vim); + return (NULL); + } + + vim->vim_spa = spa; + vim->vim_phys = malloc(sizeof (*vim->vim_phys)); + if (vim->vim_phys == NULL) { + free(vim->vim_dn); + free(vim); + return (NULL); + } + + vim_phys = (vdev_indirect_mapping_phys_t *)DN_BONUS(vim->vim_dn); + *vim->vim_phys = *vim_phys; + + vim->vim_objset = os; + vim->vim_object = mapping_object; + vim->vim_entries = NULL; + + vim->vim_havecounts = + (vim->vim_dn->dn_bonuslen > VDEV_INDIRECT_MAPPING_SIZE_V0); + return (vim); +} + +/* + * Compare an offset with an indirect mapping entry; there are three + * possible scenarios: + * + * 1. The offset is "less than" the mapping entry; meaning the + * offset is less than the source offset of the mapping entry. In + * this case, there is no overlap between the offset and the + * mapping entry and -1 will be returned. + * + * 2. The offset is "greater than" the mapping entry; meaning the + * offset is greater than the mapping entry's source offset plus + * the entry's size. In this case, there is no overlap between + * the offset and the mapping entry and 1 will be returned. + * + * NOTE: If the offset is actually equal to the entry's offset + * plus size, this is considered to be "greater" than the entry, + * and this case applies (i.e. 1 will be returned). Thus, the + * entry's "range" can be considered to be inclusive at its + * start, but exclusive at its end: e.g. [src, src + size). + * + * 3. The last case to consider is if the offset actually falls + * within the mapping entry's range. If this is the case, the + * offset is considered to be "equal to" the mapping entry and + * 0 will be returned. + * + * NOTE: If the offset is equal to the entry's source offset, + * this case applies and 0 will be returned. If the offset is + * equal to the entry's source plus its size, this case does + * *not* apply (see "NOTE" above for scenario 2), and 1 will be + * returned. + */ static int +dva_mapping_overlap_compare(const void *v_key, const void *v_array_elem) +{ + const uint64_t *key = v_key; + const vdev_indirect_mapping_entry_phys_t *array_elem = + v_array_elem; + uint64_t src_offset = DVA_MAPPING_GET_SRC_OFFSET(array_elem); + + if (*key < src_offset) { + return (-1); + } else if (*key < src_offset + DVA_GET_ASIZE(&array_elem->vimep_dst)) { + return (0); + } else { + return (1); + } +} + +/* + * Return array entry. + */ +static vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_entry(vdev_indirect_mapping_t *vim, uint64_t index) +{ + uint64_t size; + off_t offset = 0; + int rc; + + if (vim->vim_phys->vimp_num_entries == 0) + return (NULL); + + if (vim->vim_entries == NULL) { + uint64_t bsize; + + bsize = vim->vim_dn->dn_datablkszsec << SPA_MINBLOCKSHIFT; + size = vim->vim_phys->vimp_num_entries * + sizeof (*vim->vim_entries); + if (size > bsize) { + size = bsize / sizeof (*vim->vim_entries); + size *= sizeof (*vim->vim_entries); + } + vim->vim_entries = malloc(size); + if (vim->vim_entries == NULL) + return (NULL); + vim->vim_num_entries = size / sizeof (*vim->vim_entries); + offset = index * sizeof (*vim->vim_entries); + } + + /* We have data in vim_entries */ + if (offset == 0) { + if (index >= vim->vim_entry_offset && + index <= vim->vim_entry_offset + vim->vim_num_entries) { + index -= vim->vim_entry_offset; + return (&vim->vim_entries[index]); + } + offset = index * sizeof (*vim->vim_entries); + } + + vim->vim_entry_offset = index; + size = vim->vim_num_entries * sizeof (*vim->vim_entries); + rc = dnode_read(vim->vim_spa, vim->vim_dn, offset, vim->vim_entries, + size); + if (rc != 0) { + /* Read error, invalidate vim_entries. */ + free(vim->vim_entries); + vim->vim_entries = NULL; + return (NULL); + } + index -= vim->vim_entry_offset; + return (&vim->vim_entries[index]); +} + +/* + * Returns the mapping entry for the given offset. + * + * It's possible that the given offset will not be in the mapping table + * (i.e. no mapping entries contain this offset), in which case, the + * return value value depends on the "next_if_missing" parameter. + * + * If the offset is not found in the table and "next_if_missing" is + * B_FALSE, then NULL will always be returned. The behavior is intended + * to allow consumers to get the entry corresponding to the offset + * parameter, iff the offset overlaps with an entry in the table. + * + * If the offset is not found in the table and "next_if_missing" is + * B_TRUE, then the entry nearest to the given offset will be returned, + * such that the entry's source offset is greater than the offset + * passed in (i.e. the "next" mapping entry in the table is returned, if + * the offset is missing from the table). If there are no entries whose + * source offset is greater than the passed in offset, NULL is returned. + */ +static vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_entry_for_offset(vdev_indirect_mapping_t *vim, + uint64_t offset) +{ + ASSERT(vim->vim_phys->vimp_num_entries > 0); + + vdev_indirect_mapping_entry_phys_t *entry; + + uint64_t last = vim->vim_phys->vimp_num_entries - 1; + uint64_t base = 0; + + /* + * We don't define these inside of the while loop because we use + * their value in the case that offset isn't in the mapping. + */ + uint64_t mid; + int result; + + while (last >= base) { + mid = base + ((last - base) >> 1); + + entry = vdev_indirect_mapping_entry(vim, mid); + if (entry == NULL) + break; + result = dva_mapping_overlap_compare(&offset, entry); + + if (result == 0) { + break; + } else if (result < 0) { + last = mid - 1; + } else { + base = mid + 1; + } + } + return (entry); +} + +/* + * Given an indirect vdev and an extent on that vdev, it duplicates the + * physical entries of the indirect mapping that correspond to the extent + * to a new array and returns a pointer to it. In addition, copied_entries + * is populated with the number of mapping entries that were duplicated. + * + * Finally, since we are doing an allocation, it is up to the caller to + * free the array allocated in this function. + */ +vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_duplicate_adjacent_entries(vdev_t *vd, uint64_t offset, + uint64_t asize, uint64_t *copied_entries) +{ + vdev_indirect_mapping_entry_phys_t *duplicate_mappings = NULL; + vdev_indirect_mapping_t *vim = vd->v_mapping; + uint64_t entries = 0; + + vdev_indirect_mapping_entry_phys_t *first_mapping = + vdev_indirect_mapping_entry_for_offset(vim, offset); + ASSERT3P(first_mapping, !=, NULL); + + vdev_indirect_mapping_entry_phys_t *m = first_mapping; + while (asize > 0) { + uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); + uint64_t inner_offset = offset - DVA_MAPPING_GET_SRC_OFFSET(m); + uint64_t inner_size = MIN(asize, size - inner_offset); + + offset += inner_size; + asize -= inner_size; + entries++; + m++; + } + + size_t copy_length = entries * sizeof (*first_mapping); + duplicate_mappings = malloc(copy_length); + if (duplicate_mappings != NULL) + bcopy(first_mapping, duplicate_mappings, copy_length); + else + entries = 0; + + *copied_entries = entries; + + return (duplicate_mappings); +} + +static vdev_t * +vdev_lookup_top(spa_t *spa, uint64_t vdev) +{ + vdev_t *rvd; + + STAILQ_FOREACH(rvd, &spa->spa_vdevs, v_childlink) + if (rvd->v_id == vdev) + break; + + return (rvd); +} + +/* + * This is a callback for vdev_indirect_remap() which allocates an + * indirect_split_t for each split segment and adds it to iv_splits. + */ +static void +vdev_indirect_gather_splits(uint64_t split_offset, vdev_t *vd, uint64_t offset, + uint64_t size, void *arg) +{ + int n = 1; + zio_t *zio = arg; + indirect_vsd_t *iv = zio->io_vsd; + + if (vd->v_read == vdev_indirect_read) + return; + + if (vd->v_read == vdev_mirror_read) + n = vd->v_nchildren; + + indirect_split_t *is = + malloc(offsetof(indirect_split_t, is_child[n])); + if (is == NULL) { + zio->io_error = ENOMEM; + return; + } + bzero(is, offsetof(indirect_split_t, is_child[n])); + + is->is_children = n; + is->is_size = size; + is->is_split_offset = split_offset; + is->is_target_offset = offset; + is->is_vdev = vd; + + /* + * Note that we only consider multiple copies of the data for + * *mirror* vdevs. We don't for "replacing" or "spare" vdevs, even + * though they use the same ops as mirror, because there's only one + * "good" copy under the replacing/spare. + */ + if (vd->v_read == vdev_mirror_read) { + int i = 0; + vdev_t *kid; + + STAILQ_FOREACH(kid, &vd->v_children, v_childlink) { + is->is_child[i++].ic_vdev = kid; + } + } else { + is->is_child[0].ic_vdev = vd; + } + + list_insert_tail(&iv->iv_splits, is); +} + +static void +vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) +{ + list_t stack; + spa_t *spa = vd->spa; + zio_t *zio = arg; + + list_create(&stack, sizeof (remap_segment_t), + offsetof(remap_segment_t, rs_node)); + + for (remap_segment_t *rs = rs_alloc(vd, offset, asize, 0); + rs != NULL; rs = list_remove_head(&stack)) { + vdev_t *v = rs->rs_vd; + uint64_t num_entries = 0; + /* vdev_indirect_mapping_t *vim = v->v_mapping; */ + vdev_indirect_mapping_entry_phys_t *mapping = + vdev_indirect_mapping_duplicate_adjacent_entries(v, + rs->rs_offset, rs->rs_asize, &num_entries); + + for (uint64_t i = 0; i < num_entries; i++) { + vdev_indirect_mapping_entry_phys_t *m = &mapping[i]; + uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); + uint64_t dst_offset = DVA_GET_OFFSET(&m->vimep_dst); + uint64_t dst_vdev = DVA_GET_VDEV(&m->vimep_dst); + uint64_t inner_offset = rs->rs_offset - + DVA_MAPPING_GET_SRC_OFFSET(m); + uint64_t inner_size = + MIN(rs->rs_asize, size - inner_offset); + vdev_t *dst_v = vdev_lookup_top(spa, dst_vdev); + + if (dst_v->v_read == vdev_indirect_read) { + list_insert_head(&stack, + rs_alloc(dst_v, dst_offset + inner_offset, + inner_size, rs->rs_split_offset)); + } + vdev_indirect_gather_splits(rs->rs_split_offset, dst_v, + dst_offset + inner_offset, + inner_size, arg); + + /* + * vdev_indirect_gather_splits can have memory + * allocation error, we can not recover from it. + */ + if (zio->io_error != 0) + break; + + rs->rs_offset += inner_size; + rs->rs_asize -= inner_size; + rs->rs_split_offset += inner_size; + } + + free(mapping); + free(rs); + if (zio->io_error != 0) + break; + } + + list_destroy(&stack); +} + +static void +vdev_indirect_map_free(zio_t *zio) +{ + indirect_vsd_t *iv = zio->io_vsd; + indirect_split_t *is; + + while ((is = list_head(&iv->iv_splits)) != NULL) { + for (int c = 0; c < is->is_children; c++) { + indirect_child_t *ic = &is->is_child[c]; + free(ic->ic_data); + } + list_remove(&iv->iv_splits, is); + free(is); + } + free(iv); +} + +static int +vdev_indirect_read(vdev_t *vdev, const blkptr_t *bp, void *buf, + off_t offset, size_t bytes) +{ + zio_t zio = { 0 }; + spa_t *spa = vdev->spa; + indirect_vsd_t *iv = malloc(sizeof (*iv)); + indirect_split_t *first; + int rc = EIO; + + if (iv == NULL) + return (ENOMEM); + bzero(iv, sizeof (*iv)); + + list_create(&iv->iv_splits, + sizeof (indirect_split_t), offsetof(indirect_split_t, is_node)); + + zio.io_spa = spa; + zio.io_bp = (blkptr_t *)bp; + zio.io_data = buf; + zio.io_size = bytes; + zio.io_offset = offset; + zio.io_vd = vdev; + zio.io_vsd = iv; + + if (vdev->v_mapping == NULL) { + vdev_indirect_config_t *vic; + + vic = &vdev->vdev_indirect_config; + vdev->v_mapping = vdev_indirect_mapping_open(spa, + &spa->spa_mos, vic->vic_mapping_object); + } + + vdev_indirect_remap(vdev, offset, bytes, &zio); + if (zio.io_error != 0) + return (zio.io_error); + + first = list_head(&iv->iv_splits); + if (first->is_size == zio.io_size) { + /* + * This is not a split block; we are pointing to the entire + * data, which will checksum the same as the original data. + * Pass the BP down so that the child i/o can verify the + * checksum, and try a different location if available + * (e.g. on a mirror). + * + * While this special case could be handled the same as the + * general (split block) case, doing it this way ensures + * that the vast majority of blocks on indirect vdevs + * (which are not split) are handled identically to blocks + * on non-indirect vdevs. This allows us to be less strict + * about performance in the general (but rare) case. + */ + rc = first->is_vdev->v_read(first->is_vdev, zio.io_bp, + zio.io_data, first->is_target_offset, bytes); + } else { + iv->iv_split_block = B_TRUE; + /* + * Read one copy of each split segment, from the + * top-level vdev. Since we don't know the + * checksum of each split individually, the child + * zio can't ensure that we get the right data. + * E.g. if it's a mirror, it will just read from a + * random (healthy) leaf vdev. We have to verify + * the checksum in vdev_indirect_io_done(). + */ + for (indirect_split_t *is = list_head(&iv->iv_splits); + is != NULL; is = list_next(&iv->iv_splits, is)) { + char *ptr = zio.io_data; + + rc = is->is_vdev->v_read(is->is_vdev, zio.io_bp, + ptr + is->is_split_offset, is->is_target_offset, + is->is_size); + } + if (zio_checksum_verify(spa, zio.io_bp, zio.io_data)) + rc = ECKSUM; + else + rc = 0; + } + + vdev_indirect_map_free(&zio); + if (rc == 0) + rc = zio.io_error; + + return (rc); +} + +static int vdev_disk_read(vdev_t *vdev, const blkptr_t *bp, void *buf, off_t offset, size_t bytes) { @@ -499,6 +1065,7 @@ static vdev_t * vdev_create(uint64_t guid, vdev_read_t *_read) { vdev_t *vdev; + vdev_indirect_config_t *vic; vdev = malloc(sizeof(vdev_t)); memset(vdev, 0, sizeof(vdev_t)); @@ -506,8 +1073,9 @@ vdev_create(uint64_t guid, vdev_read_t *_read) vdev->v_guid = guid; vdev->v_state = VDEV_STATE_OFFLINE; vdev->v_read = _read; - vdev->v_phys_read = 0; - vdev->v_read_priv = 0; + + vic = &vdev->vdev_indirect_config; + vic->vic_prev_indirect_vdev = UINT64_MAX; STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); return (vdev); @@ -541,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde && strcmp(type, VDEV_TYPE_FILE) #endif && strcmp(type, VDEV_TYPE_RAIDZ) + && strcmp(type, VDEV_TYPE_INDIRECT) && strcmp(type, VDEV_TYPE_REPLACING)) { printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); return (EIO); @@ -569,7 +1138,23 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde vdev = vdev_create(guid, vdev_raidz_read); else if (!strcmp(type, VDEV_TYPE_REPLACING)) vdev = vdev_create(guid, vdev_replacing_read); - else + else if (!strcmp(type, VDEV_TYPE_INDIRECT)) { + vdev_indirect_config_t *vic; + + vdev = vdev_create(guid, vdev_indirect_read); + vdev->v_state = VDEV_STATE_HEALTHY; + vic = &vdev->vdev_indirect_config; + + nvlist_find(nvlist, + ZPOOL_CONFIG_INDIRECT_OBJECT, DATA_TYPE_UINT64, + NULL, &vic->vic_mapping_object); + nvlist_find(nvlist, + ZPOOL_CONFIG_INDIRECT_BIRTHS, DATA_TYPE_UINT64, + NULL, &vic->vic_births_object); + nvlist_find(nvlist, + ZPOOL_CONFIG_PREV_INDIRECT_VDEV, DATA_TYPE_UINT64, + NULL, &vic->vic_prev_indirect_vdev); + } else vdev = vdev_create(guid, vdev_disk_read); vdev->v_id = id; @@ -592,20 +1177,24 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde path += 5; vdev->v_name = strdup(path); } else { + char *name; + if (!strcmp(type, "raidz")) { - if (vdev->v_nparity == 1) - vdev->v_name = "raidz1"; - else if (vdev->v_nparity == 2) - vdev->v_name = "raidz2"; - else if (vdev->v_nparity == 3) - vdev->v_name = "raidz3"; - else { - printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); + if (vdev->v_nparity < 1 || + vdev->v_nparity > 3) { + printf("ZFS: can only boot from disk, " + "mirror, raidz1, raidz2 and raidz3 " + "vdevs\n"); return (EIO); } + asprintf(&name, "%s%d-%jd", type, + vdev->v_nparity, id); } else { - vdev->v_name = strdup(type); + asprintf(&name, "%s-%jd", type, id); } + if (name == NULL) + return (ENOMEM); + vdev->v_name = name; } } else { is_new = 0; @@ -2229,11 +2818,49 @@ check_mos_features(const spa_t *spa) } static int -zfs_spa_init(spa_t *spa) +load_nvlist(spa_t *spa, uint64_t obj, unsigned char **value) { dnode_phys_t dir; + size_t size; int rc; + unsigned char *nv; + *value = NULL; + if ((rc = objset_get_dnode(spa, &spa->spa_mos, obj, &dir)) != 0) + return (rc); + if (dir.dn_type != DMU_OT_PACKED_NVLIST && + dir.dn_bonustype != DMU_OT_PACKED_NVLIST_SIZE) { + return (EIO); + } + + if (dir.dn_bonuslen != sizeof (uint64_t)) + return (EIO); + + size = *(uint64_t *)DN_BONUS(&dir); + nv = malloc(size); + if (nv == NULL) + return (ENOMEM); + + rc = dnode_read(spa, &dir, 0, nv, size); + if (rc != 0) { + free(nv); + nv = NULL; + return (rc); + } + *value = nv; + return (rc); +} + +static int +zfs_spa_init(spa_t *spa) +{ + dnode_phys_t dir; + uint64_t config_object; + unsigned char *nvlist; + char *type; + const unsigned char *nv; + int nkids, rc; + if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) { printf("ZFS: can't read MOS of pool %s\n", spa->spa_name); return (EIO); @@ -2257,8 +2884,77 @@ zfs_spa_init(spa_t *spa) rc = check_mos_features(spa); if (rc != 0) { printf("ZFS: pool %s is not supported\n", spa->spa_name); + return (rc); } + rc = zap_lookup(spa, &dir, DMU_POOL_CONFIG, + sizeof (config_object), 1, &config_object); + if (rc != 0) { + printf("ZFS: can not read MOS %s\n", DMU_POOL_CONFIG); + return (EIO); + } + rc = load_nvlist(spa, config_object, &nvlist); + if (rc != 0) + return (rc); + + /* Update vdevs from MOS config. */ + if (nvlist_find(nvlist + 4, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, + NULL, &nv)) { + rc = EIO; + goto done; + } + + if (nvlist_find(nv, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, + NULL, &type)) { + printf("ZFS: can't find vdev details\n"); + rc = ENOENT; + goto done; + } + if (strcmp(type, VDEV_TYPE_ROOT) != 0) { + rc = ENOENT; + goto done; + } + + rc = nvlist_find(nv, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, + &nkids, &nv); + if (rc != 0) + goto done; + + for (int i = 0; i < nkids; i++) { + vdev_t *vd, *prev, *kid = NULL; + rc = vdev_init_from_nvlist(nv, NULL, &kid, 0); + if (rc != 0) { + printf("vdev_init_from_nvlist: %d\n", rc); + break; + } + kid->spa = spa; + prev = NULL; + STAILQ_FOREACH(vd, &spa->spa_vdevs, v_childlink) { + /* Already present? */ + if (kid->v_id == vd->v_id) { + kid = NULL; + break; + } + if (vd->v_id > kid->v_id) { + if (prev == NULL) { + STAILQ_INSERT_HEAD(&spa->spa_vdevs, + kid, v_childlink); + } else { + STAILQ_INSERT_AFTER(&spa->spa_vdevs, + prev, kid, v_childlink); + } + kid = NULL; + break; + } + prev = vd; + } + if (kid != NULL) + STAILQ_INSERT_TAIL(&spa->spa_vdevs, kid, v_childlink); + nv = nvlist_next(nv); + } + rc = 0; +done: + free(nvlist); return (rc); } Modified: stable/12/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/12/sys/cddl/boot/zfs/zfsimpl.h Thu Aug 22 07:17:49 2019 (r351383) +++ stable/12/sys/cddl/boot/zfs/zfsimpl.h Thu Aug 22 07:37:34 2019 (r351384) @@ -715,6 +715,9 @@ typedef enum { #define ZPOOL_CONFIG_CHILDREN "children" #define ZPOOL_CONFIG_ID "id" #define ZPOOL_CONFIG_GUID "guid" +#define ZPOOL_CONFIG_INDIRECT_OBJECT "com.delphix:indirect_object" +#define ZPOOL_CONFIG_INDIRECT_BIRTHS "com.delphix:indirect_births" +#define ZPOOL_CONFIG_PREV_INDIRECT_VDEV "com.delphix:prev_indirect_vdev" #define ZPOOL_CONFIG_PATH "path" #define ZPOOL_CONFIG_DEVID "devid" #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" @@ -758,6 +761,7 @@ typedef enum { #define VDEV_TYPE_SPARE "spare" #define VDEV_TYPE_LOG "log" #define VDEV_TYPE_L2CACHE "l2cache" +#define VDEV_TYPE_INDIRECT "indirect" /* * This is needed in userland to report the minimum necessary device size. @@ -850,7 +854,7 @@ struct uberblock { */ #define DNODE_SHIFT 9 /* 512 bytes */ #define DN_MIN_INDBLKSHIFT 12 /* 4k */ -#define DN_MAX_INDBLKSHIFT 14 /* 16k */ +#define DN_MAX_INDBLKSHIFT 17 /* 128k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ #define DN_MAX_OBJECT_SHIFT 48 /* 256 trillion (zfs_fid_t limit) */ @@ -1217,6 +1221,9 @@ typedef struct dsl_dataset_phys { #define DMU_POOL_HISTORY "history" #define DMU_POOL_PROPS "pool_props" #define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" +#define DMU_POOL_REMOVING "com.delphix:removing" +#define DMU_POOL_OBSOLETE_BPOBJ "com.delphix:obsolete_bpobj" +#define DMU_POOL_CONDENSING_INDIRECT "com.delphix:condensing_indirect" #define ZAP_MAGIC 0x2F52AB2ABULL @@ -1530,6 +1537,116 @@ typedef int vdev_read_t(struct vdev *vdev, const blkpt typedef STAILQ_HEAD(vdev_list, vdev) vdev_list_t; +typedef struct vdev_indirect_mapping_entry_phys { + /* + * Decode with DVA_MAPPING_* macros. + * Contains: + * the source offset (low 63 bits) + * the one-bit "mark", used for garbage collection (by zdb) + */ + uint64_t vimep_src; + + /* + * Note: the DVA's asize is 24 bits, and can thus store ranges + * up to 8GB. + */ + dva_t vimep_dst; +} vdev_indirect_mapping_entry_phys_t; + +#define DVA_MAPPING_GET_SRC_OFFSET(vimep) \ + BF64_GET_SB((vimep)->vimep_src, 0, 63, SPA_MINBLOCKSHIFT, 0) +#define DVA_MAPPING_SET_SRC_OFFSET(vimep, x) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Thu Aug 22 08:47:19 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CAEAC23E9; Thu, 22 Aug 2019 08:47:19 +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 46DdSl1KBGz4CnM; Thu, 22 Aug 2019 08:47:19 +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 0ECCA17E6; Thu, 22 Aug 2019 08:47:19 +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 x7M8lIIj078816; Thu, 22 Aug 2019 08:47:18 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7M8lIAA078815; Thu, 22 Aug 2019 08:47:18 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201908220847.x7M8lIAA078815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 22 Aug 2019 08:47: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: r351386 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 351386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 22 Aug 2019 08:47:19 -0000 Author: ae Date: Thu Aug 22 08:47:18 2019 New Revision: 351386 URL: https://svnweb.freebsd.org/changeset/base/351386 Log: MFC r351071: Fix rule truncation on external action module unloading. Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Thu Aug 22 07:52:06 2019 (r351385) +++ stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Thu Aug 22 08:47:18 2019 (r351386) @@ -391,19 +391,19 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f cmd->arg1 != eaction_id) return (0); /* - * If instance_id is specified, we need to truncate the - * rule length. Check if there is O_EXTERNAL_INSTANCE opcode. + * Check if there is O_EXTERNAL_INSTANCE opcode, we need + * to truncate the rule length. * * NOTE: F_LEN(cmd) must be 1 for O_EXTERNAL_ACTION opcode, * and rule length should be enough to keep O_EXTERNAL_INSTANCE * opcode, thus we do check for l > 1. */ l = rule->cmd + rule->cmd_len - cmd; - if (instance_id != 0 && l > 1) { + if (l > 1) { MPASS(F_LEN(cmd) == 1); icmd = cmd + 1; - if (icmd->opcode != O_EXTERNAL_INSTANCE || - icmd->arg1 != instance_id) + if (icmd->opcode == O_EXTERNAL_INSTANCE && + instance_id != 0 && icmd->arg1 != instance_id) return (0); /* * Since named_object related to this instance will be From owner-svn-src-stable-12@freebsd.org Thu Aug 22 11:32:06 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF710C5FEB; Thu, 22 Aug 2019 11:32:06 +0000 (UTC) (envelope-from bapt@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 46Dj6t5Nmrz4MTY; Thu, 22 Aug 2019 11:32:06 +0000 (UTC) (envelope-from bapt@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 8006B3808; Thu, 22 Aug 2019 11:32:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7MBW6cj078420; Thu, 22 Aug 2019 11:32:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7MBW3Rk078405; Thu, 22 Aug 2019 11:32:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201908221132.x7MBW3Rk078405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 22 Aug 2019 11:32: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: r351390 - stable/12/contrib/mandoc X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/contrib/mandoc X-SVN-Commit-Revision: 351390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 22 Aug 2019 11:32:06 -0000 Author: bapt Date: Thu Aug 22 11:32:03 2019 New Revision: 351390 URL: https://svnweb.freebsd.org/changeset/base/351390 Log: MFC r350351: Update mandoc to cvs snapshot 2019-07-23 This snapshot among other things includes a fix for a crash of mandoc with empty tbl reported by rea@ (his regression test has been incorporated upstream) Deleted: stable/12/contrib/mandoc/libroff.h Modified: stable/12/contrib/mandoc/Makefile.depend stable/12/contrib/mandoc/TODO stable/12/contrib/mandoc/arch.c stable/12/contrib/mandoc/cgi.c stable/12/contrib/mandoc/configure stable/12/contrib/mandoc/dbm.c stable/12/contrib/mandoc/dbm_map.h stable/12/contrib/mandoc/eqn.7 stable/12/contrib/mandoc/eqn_html.c stable/12/contrib/mandoc/html.c stable/12/contrib/mandoc/html.h stable/12/contrib/mandoc/lib.in stable/12/contrib/mandoc/main.c stable/12/contrib/mandoc/man.7 stable/12/contrib/mandoc/man_html.c stable/12/contrib/mandoc/man_term.c stable/12/contrib/mandoc/man_validate.c stable/12/contrib/mandoc/mandoc.1 stable/12/contrib/mandoc/mandoc.c stable/12/contrib/mandoc/mandoc.css stable/12/contrib/mandoc/mandoc.h stable/12/contrib/mandoc/mandoc_char.7 stable/12/contrib/mandoc/mandoc_headers.3 stable/12/contrib/mandoc/mandoc_msg.c stable/12/contrib/mandoc/mandocdb.c stable/12/contrib/mandoc/manpath.c stable/12/contrib/mandoc/mansearch.c stable/12/contrib/mandoc/mansearch.h stable/12/contrib/mandoc/mdoc.7 stable/12/contrib/mandoc/mdoc_argv.c stable/12/contrib/mandoc/mdoc_markdown.c stable/12/contrib/mandoc/mdoc_term.c stable/12/contrib/mandoc/mdoc_validate.c stable/12/contrib/mandoc/out.c stable/12/contrib/mandoc/read.c stable/12/contrib/mandoc/roff.7 stable/12/contrib/mandoc/roff.c stable/12/contrib/mandoc/roff_html.c stable/12/contrib/mandoc/tag.c stable/12/contrib/mandoc/tbl_html.c stable/12/contrib/mandoc/tbl_term.c stable/12/contrib/mandoc/term.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/mandoc/Makefile.depend ============================================================================== --- stable/12/contrib/mandoc/Makefile.depend Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/Makefile.depend Thu Aug 22 11:32:03 2019 (r351390) @@ -29,7 +29,7 @@ dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h mandoc_parse.h eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h eqn.h libmandoc.h eqn_parse.h -eqn_html.o: eqn_html.c config.h mandoc.h eqn.h out.h html.h +eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h eqn_term.o: eqn_term.c config.h eqn.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h lib.o: lib.c config.h roff.h libmdoc.h lib.in @@ -37,16 +37,16 @@ main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_x man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_term.o: man_term.c config.h mandoc_aux.h roff.h man.h out.h term.h main.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h tag.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandoc_msg.o: mandoc_msg.c mandoc.h +mandoc_msg.o: mandoc_msg.c config.h mandoc.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h -manpath.o: manpath.c config.h mandoc_aux.h manconf.h +manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h @@ -67,10 +67,10 @@ roff_term.o: roff_term.c mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h st.o: st.c config.h mandoc.h roff.h libmdoc.h -tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h tag.h tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h -tbl_html.o: tbl_html.c config.h mandoc.h tbl.h out.h html.h +tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h Modified: stable/12/contrib/mandoc/TODO ============================================================================== --- stable/12/contrib/mandoc/TODO Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/TODO Thu Aug 22 11:32:03 2019 (r351390) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.289 2019/03/04 13:01:57 schwarze Exp $ +* $Id: TODO,v 1.295 2019/06/11 16:04:36 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -62,6 +62,27 @@ are mere guesses, and some may be wrong. needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 loc ** exist *** algo *** size * imp *** +- .als only works for macros in mandoc, not for user-defined strings. + Also, the "val" field in struct roffkv would have to be replaced + with a pointer to a reference-counted wrapper, and an alias + would have to point to the same wrapper as the original. + .als to undefined does nothing; the alias is not created. + .rm'ing the original leaves the alias to point to the old value. + .de .als .de changes both, but + .de .als .rm .de only changes the new value, not the alias. + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist ** algo ** size ** imp * + +- roff string condition comparisons fail when vars contain quotes: + .ds s ' + .if '\*s'' \&... + hard to fix because of the basic architecture (string replacement + happens before roff(7) syntax parsing) + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist *** algo *** size ** imp * + --- missing mdoc features ---------------------------------------------- - .Bl -column .Xo support is missing @@ -263,6 +284,9 @@ are mere guesses, and some may be wrong. http://ikiwiki.info/plugins/contrib/mandoc/ https://github.com/schmonz/ikiwiki/compare/mandoc Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + +- check compatibility with + https://git.sr.ht/~sircmpwn/scdoc - check features of the Slackware man.conf(5) format Carsten Kunze Wed, 11 Mar 2015 17:57:24 +0100 Modified: stable/12/contrib/mandoc/arch.c ============================================================================== --- stable/12/contrib/mandoc/arch.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/arch.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: arch.c,v 1.14 2019/03/04 13:01:57 schwarze Exp $ */ +/* $Id: arch.c,v 1.15 2019/05/21 07:52:00 schwarze Exp $ */ /* * Copyright (c) 2017, 2019 Ingo Schwarze * @@ -26,7 +26,7 @@ arch_valid(const char *arch, enum mandoc_os os) const char *openbsd_arch[] = { "alpha", "amd64", "arm64", "armv7", "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", - "octeon", "sgi", "socppc", "sparc64", NULL + "octeon", "sgi", "sparc64", NULL }; const char *netbsd_arch[] = { "acorn26", "acorn32", "algor", "alpha", "amiga", Modified: stable/12/contrib/mandoc/cgi.c ============================================================================== --- stable/12/contrib/mandoc/cgi.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/cgi.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.166 2019/03/06 12:32:41 schwarze Exp $ */ +/* $Id: cgi.c,v 1.167 2019/07/10 12:49:20 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze @@ -869,7 +869,6 @@ resp_format(const struct req *req, const char *file) memset(&conf, 0, sizeof(conf)); conf.fragment = 1; conf.style = mandoc_strdup(CSS_DIR "/mandoc.css"); - conf.toc = 1; usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S", scriptname, *scriptname == '\0' ? "" : "/", Modified: stable/12/contrib/mandoc/configure ============================================================================== --- stable/12/contrib/mandoc/configure Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/configure Thu Aug 22 11:32:03 2019 (r351390) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.70 2019/03/06 16:04:31 schwarze Exp $ +# $Id: configure,v 1.71 2019/07/01 22:56:24 schwarze Exp $ # # Copyright (c) 2014-2019 Ingo Schwarze # @@ -529,7 +529,7 @@ fi echo "extern char *mkdtemp(char *);" if [ ${HAVE_PROGNAME} -eq 0 ]; then - echo "extern const char *getprogname(void);" + echo "extern const char *getprogname(void);" echo "extern void setprogname(const char *);" fi Modified: stable/12/contrib/mandoc/dbm.c ============================================================================== --- stable/12/contrib/mandoc/dbm.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/dbm.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: dbm.c,v 1.6 2018/11/19 19:22:07 schwarze Exp $ */ +/* $Id: dbm.c,v 1.7 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -233,7 +233,7 @@ static struct dbm_res page_bytitle(enum iter arg_iter, const struct dbm_match *arg_match) { static const struct dbm_match *match; - static const char *cp; + static const char *cp; static int32_t ip; struct dbm_res res = {-1, 0}; @@ -315,7 +315,7 @@ page_byarch(const struct dbm_match *arg_match) static const struct dbm_match *match; struct dbm_res res = {-1, 0}; static int32_t ip; - const char *cp; + const char *cp; /* Initialize for a new iteration. */ Modified: stable/12/contrib/mandoc/dbm_map.h ============================================================================== --- stable/12/contrib/mandoc/dbm_map.h Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/dbm_map.h Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: dbm_map.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ +/* $Id: dbm_map.h,v 1.2 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * Private interface for low-level routines for the map-based version + * Private interface for low-level routines for the map-based version * of the mandoc database, for read-only access. * To be used by dbm*.c only. */ Modified: stable/12/contrib/mandoc/eqn.7 ============================================================================== --- stable/12/contrib/mandoc/eqn.7 Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/eqn.7 Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -.\" $Id: eqn.7,v 1.37 2017/09/04 10:35:27 schwarze Exp $ +.\" $Id: eqn.7,v 1.38 2019/04/23 17:57:49 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons .\" Copyright (c) 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 4 2017 $ +.Dd $Mdocdate: April 23 2019 $ .Dt EQN 7 .Os .Sh NAME @@ -470,7 +470,7 @@ commands are also ignored. .%T System for Typesetting Mathematics .%J Communications of the ACM .%V 18 -.%P 151\(en157 +.%P pp. 151\(en157 .%D March, 1975 .Re .Rs Modified: stable/12/contrib/mandoc/eqn_html.c ============================================================================== --- stable/12/contrib/mandoc/eqn_html.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/eqn_html.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: eqn_html.c,v 1.18 2018/12/13 05:23:38 schwarze Exp $ */ +/* $Id: eqn_html.c,v 1.19 2019/03/17 18:21:45 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2017 Ingo Schwarze @@ -26,6 +26,7 @@ #include #include "mandoc.h" +#include "roff.h" #include "eqn.h" #include "out.h" #include "html.h" Modified: stable/12/contrib/mandoc/html.c ============================================================================== --- stable/12/contrib/mandoc/html.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/html.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.254 2019/03/03 13:02:11 schwarze Exp $ */ +/* $Id: html.c,v 1.255 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze @@ -120,6 +120,7 @@ static void print_ctag(struct html *, struct tag *); static int print_escape(struct html *, char); static int print_encode(struct html *, const char *, const char *, int); static void print_href(struct html *, const char *, const char *, int); +static void print_metaf(struct html *); void * @@ -222,55 +223,49 @@ print_gen_head(struct html *h) print_tagq(h, t); } -void -print_metaf(struct html *h, enum mandoc_esc deco) +int +html_setfont(struct html *h, enum mandoc_esc font) { - enum htmlfont font; - - switch (deco) { + switch (font) { case ESCAPE_FONTPREV: font = h->metal; break; case ESCAPE_FONTITALIC: - font = HTMLFONT_ITALIC; - break; case ESCAPE_FONTBOLD: - font = HTMLFONT_BOLD; - break; case ESCAPE_FONTBI: - font = HTMLFONT_BI; - break; case ESCAPE_FONTCW: - font = HTMLFONT_CW; + case ESCAPE_FONTROMAN: break; case ESCAPE_FONT: - case ESCAPE_FONTROMAN: - font = HTMLFONT_NONE; + font = ESCAPE_FONTROMAN; break; default: - return; + return 0; } + h->metal = h->metac; + h->metac = font; + return 1; +} +static void +print_metaf(struct html *h) +{ if (h->metaf) { print_tagq(h, h->metaf); h->metaf = NULL; } - - h->metal = h->metac; - h->metac = font; - - switch (font) { - case HTMLFONT_ITALIC: + switch (h->metac) { + case ESCAPE_FONTITALIC: h->metaf = print_otag(h, TAG_I, ""); break; - case HTMLFONT_BOLD: + case ESCAPE_FONTBOLD: h->metaf = print_otag(h, TAG_B, ""); break; - case HTMLFONT_BI: + case ESCAPE_FONTBI: h->metaf = print_otag(h, TAG_B, ""); print_otag(h, TAG_I, ""); break; - case HTMLFONT_CW: + case ESCAPE_FONTCW: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); break; default: @@ -479,7 +474,8 @@ print_encode(struct html *h, const char *p, const char case ESCAPE_FONTROMAN: if (0 == norecurse) { h->flags |= HTML_NOSPACE; - print_metaf(h, esc); + if (html_setfont(h, esc)) + print_metaf(h); h->flags &= ~HTML_NOSPACE; } continue; @@ -806,27 +802,9 @@ print_text(struct html *h, const char *word) print_word(h, " "); } - assert(NULL == h->metaf); - switch (h->metac) { - case HTMLFONT_ITALIC: - h->metaf = print_otag(h, TAG_I, ""); - break; - case HTMLFONT_BOLD: - h->metaf = print_otag(h, TAG_B, ""); - break; - case HTMLFONT_BI: - h->metaf = print_otag(h, TAG_B, ""); - print_otag(h, TAG_I, ""); - break; - case HTMLFONT_CW: - h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); - break; - default: - print_indent(h); - break; - } - - assert(word); + assert(h->metaf == NULL); + print_metaf(h); + print_indent(h); if ( ! print_encode(h, word, NULL, 0)) { if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; @@ -834,7 +812,7 @@ print_text(struct html *h, const char *word) } else h->flags |= HTML_NOSPACE | HTML_NONEWLINE; - if (h->metaf) { + if (h->metaf != NULL) { print_tagq(h, h->metaf); h->metaf = NULL; } Modified: stable/12/contrib/mandoc/html.h ============================================================================== --- stable/12/contrib/mandoc/html.h Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/html.h Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.102 2019/03/01 10:57:18 schwarze Exp $ */ +/* $Id: html.h,v 1.103 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2017, 2018, 2019 Ingo Schwarze @@ -69,15 +69,6 @@ enum htmltag { TAG_MAX }; -enum htmlfont { - HTMLFONT_NONE = 0, - HTMLFONT_BOLD, - HTMLFONT_ITALIC, - HTMLFONT_BI, - HTMLFONT_CW, - HTMLFONT_MAX -}; - struct tag { struct tag *next; int refcnt; @@ -111,8 +102,8 @@ struct html { char *base_includes; /* base for include href */ char *style; /* style-sheet URI */ struct tag *metaf; /* current open font scope */ - enum htmlfont metal; /* last used font */ - enum htmlfont metac; /* current font mode */ + enum mandoc_esc metal; /* last used font */ + enum mandoc_esc metac; /* current font mode */ int oflags; /* output options */ #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ #define HTML_TOC (1 << 1) /* emit a table of contents */ @@ -128,7 +119,6 @@ void roff_html_pre(struct html *, const struct roff void print_gen_comment(struct html *, struct roff_node *); void print_gen_decls(struct html *); void print_gen_head(struct html *); -void print_metaf(struct html *, enum mandoc_esc); struct tag *print_otag(struct html *, enum htmltag, const char *, ...); void print_tagq(struct html *, const struct tag *); void print_stagq(struct html *, const struct tag *); @@ -141,3 +131,4 @@ void print_endline(struct html *); void html_close_paragraph(struct html *); enum roff_tok html_fillmode(struct html *, enum roff_tok); char *html_make_id(const struct roff_node *, int); +int html_setfont(struct html *, enum mandoc_esc); Modified: stable/12/contrib/mandoc/lib.in ============================================================================== --- stable/12/contrib/mandoc/lib.in Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/lib.in Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: lib.in,v 1.21 2019/03/04 17:35:21 schwarze Exp $ */ +/* $Id: lib.in,v 1.22 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * Copyright (c) 2009, 2012 Joerg Sonnenberger @@ -43,7 +43,7 @@ LINE("libcipher", "FreeSec Crypt Library (libcipher, \ LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") -LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") +LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") Modified: stable/12/contrib/mandoc/main.c ============================================================================== --- stable/12/contrib/mandoc/main.c Thu Aug 22 10:21:07 2019 (r351389) +++ stable/12/contrib/mandoc/main.c Thu Aug 22 11:32:03 2019 (r351390) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */ +/* $Id: main.c,v 1.332 2019/07/19 20:27:25 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze @@ -21,6 +21,7 @@ #include #include #include /* MACHINE */ +#include #include #include @@ -97,13 +98,10 @@ static int fs_lookup(const struct manpaths *, static int fs_search(const struct mansearch *, const struct manpaths *, int, char**, struct manpage **, size_t *); -static int koptions(int *, char *); -static void moptions(int *, char *); static void outdata_alloc(struct curparse *); static void parse(struct curparse *, int, const char *); -static void passthrough(const char *, int, int); +static void passthrough(int, int); static pid_t spawn_pager(struct tag_files *); -static int toptions(struct curparse *, char *); static void usage(enum argmode) __attribute__((__noreturn__)); static int woptions(struct curparse *, char *); @@ -125,7 +123,7 @@ main(int argc, char *argv[]) char *conf_file, *defpaths, *auxpaths; char *oarg, *tagarg; unsigned char *uc; - size_t i, sz; + size_t i, sz, ssz; int prio, best_prio; enum outmode outmode; int fd, startdir; @@ -154,10 +152,11 @@ main(int argc, char *argv[]) return mandocdb(argc, argv); #if HAVE_PLEDGE - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); + return mandoc_msg_getrc(); + } #endif - #if HAVE_SANDBOX_INIT if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) errx((int)MANDOCLEVEL_SYSERR, "sandbox_init"); @@ -221,19 +220,29 @@ main(int argc, char *argv[]) outmode = OUTMODE_ALL; break; case 'I': - if (strncmp(optarg, "os=", 3)) { - warnx("-I %s: Bad argument", optarg); - return (int)MANDOCLEVEL_BADARG; + if (strncmp(optarg, "os=", 3) != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } if (curp.os_s != NULL) { - warnx("-I %s: Duplicate argument", optarg); - return (int)MANDOCLEVEL_BADARG; + mandoc_msg(MANDOCERR_BADARG_DUPE, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } curp.os_s = mandoc_strdup(optarg + 3); break; case 'K': - if ( ! koptions(&options, optarg)) - return (int)MANDOCLEVEL_BADARG; + options &= ~(MPARSE_UTF8 | MPARSE_LATIN1); + if (strcmp(optarg, "utf-8") == 0) + options |= MPARSE_UTF8; + else if (strcmp(optarg, "iso-8859-1") == 0) + options |= MPARSE_LATIN1; + else if (strcmp(optarg, "us-ascii") != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-K %s", optarg); + return mandoc_msg_getrc(); + } break; case 'k': search.argmode = ARG_EXPR; @@ -264,12 +273,37 @@ main(int argc, char *argv[]) search.sec = optarg; break; case 'T': - if ( ! toptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (strcmp(optarg, "ascii") == 0) + curp.outtype = OUTT_ASCII; + else if (strcmp(optarg, "lint") == 0) { + curp.outtype = OUTT_LINT; + mandoc_msg_setoutfile(stdout); + mandoc_msg_setmin(MANDOCERR_BASE); + } else if (strcmp(optarg, "tree") == 0) + curp.outtype = OUTT_TREE; + else if (strcmp(optarg, "man") == 0) + curp.outtype = OUTT_MAN; + else if (strcmp(optarg, "html") == 0) + curp.outtype = OUTT_HTML; + else if (strcmp(optarg, "markdown") == 0) + curp.outtype = OUTT_MARKDOWN; + else if (strcmp(optarg, "utf8") == 0) + curp.outtype = OUTT_UTF8; + else if (strcmp(optarg, "locale") == 0) + curp.outtype = OUTT_LOCALE; + else if (strcmp(optarg, "ps") == 0) + curp.outtype = OUTT_PS; + else if (strcmp(optarg, "pdf") == 0) + curp.outtype = OUTT_PDF; + else { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-T %s", optarg); + return mandoc_msg_getrc(); + } break; case 'W': - if ( ! woptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (woptions(&curp, optarg) == -1) + return mandoc_msg_getrc(); break; case 'w': outmode = OUTMODE_FLN; @@ -305,12 +339,9 @@ main(int argc, char *argv[]) search.outkey = oarg; else { while (oarg != NULL) { - thisarg = oarg; if (manconf_output(&conf.output, - strsep(&oarg, ","), 0) == 0) - continue; - warnx("-O %s: Bad argument", thisarg); - return (int)MANDOCLEVEL_BADARG; + strsep(&oarg, ","), 0) == -1) + return mandoc_msg_getrc(); } } } @@ -334,9 +365,13 @@ main(int argc, char *argv[]) } #if HAVE_PLEDGE - if (!use_pager) - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (use_pager == 0) { + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } + } #endif /* Parse arguments. */ @@ -361,7 +396,7 @@ main(int argc, char *argv[]) } else if (argc > 1 && ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || - (isalpha(uc[1]) && uc[2] == '\0'))) || + isalpha(uc[1]))) || (uc[0] == 'n' && uc[1] == '\0'))) { search.sec = (char *)uc; argv++; @@ -426,7 +461,7 @@ main(int argc, char *argv[]) usage(search.argmode); if (sz == 0 && search.argmode == ARG_NAME) - fs_search(&search, &conf.manpath, + (void)fs_search(&search, &conf.manpath, argc, argv, &res, &sz); if (search.argmode == ARG_NAME) { @@ -434,7 +469,10 @@ main(int argc, char *argv[]) if (strchr(argv[c], '/') == NULL) continue; if (access(argv[c], R_OK) == -1) { - warn("%s", argv[c]); + mandoc_msg_setinfilename(argv[c]); + mandoc_msg(MANDOCERR_BADARG_BAD, + 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); continue; } res = mandoc_reallocarray(res, @@ -442,6 +480,7 @@ main(int argc, char *argv[]) res[sz].file = mandoc_strdup(argv[c]); res[sz].names = NULL; res[sz].output = NULL; + res[sz].bits = 0; res[sz].ipath = SIZE_MAX; res[sz].sec = 10; res[sz].form = FORM_SRC; @@ -464,7 +503,7 @@ main(int argc, char *argv[]) if (outmode == OUTMODE_ONE) { argc = 1; - best_prio = 20; + best_prio = 40; } else if (outmode == OUTMODE_ALL) argc = (int)sz; @@ -483,10 +522,21 @@ main(int argc, char *argv[]) sec = res[i].file; sec += strcspn(sec, "123456789"); if (sec[0] == '\0') - continue; + continue; /* No section at all. */ prio = sec_prios[sec[0] - '1']; - if (sec[1] != '/') - prio += 10; + if (search.sec != NULL) { + ssz = strlen(search.sec); + if (strncmp(sec, search.sec, ssz) == 0) + sec += ssz; + } else + sec++; /* Prefer without suffix. */ + if (*sec != '/') + prio += 10; /* Wrong dir name. */ + if (search.sec != NULL && + (strlen(sec) <= ssz + 3 || + strcmp(sec + strlen(sec) - ssz, + search.sec) != 0)) + prio += 20; /* Wrong file ext. */ if (prio >= best_prio) continue; best_prio = prio; @@ -508,16 +558,26 @@ main(int argc, char *argv[]) #if HAVE_PLEDGE if (use_pager) { - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } else { - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } #endif - if (search.argmode == ARG_FILE) - moptions(&options, auxpaths); + if (search.argmode == ARG_FILE && auxpaths != NULL) { + if (strcmp(auxpaths, "doc") == 0) + options |= MPARSE_MDOC; + else if (strcmp(auxpaths, "an") == 0) + options |= MPARSE_MAN; + } mchars_alloc(); curp.mp = mparse_alloc(options, curp.os_e, curp.os_s); @@ -525,7 +585,8 @@ main(int argc, char *argv[]) if (argc < 1) { if (use_pager) { tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } thisarg = ""; mandoc_msg_setinfilename(thisarg); @@ -558,30 +619,31 @@ main(int argc, char *argv[]) } else thisarg = *argv; + mandoc_msg_setinfilename(thisarg); fd = mparse_open(curp.mp, thisarg); if (fd != -1) { if (use_pager) { use_pager = 0; tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } - mandoc_msg_setinfilename(thisarg); if (resp == NULL || resp->form == FORM_SRC) parse(&curp, fd, thisarg); else - passthrough(resp->file, fd, - conf.output.synopsisonly); - mandoc_msg_setinfilename(NULL); + passthrough(fd, conf.output.synopsisonly); if (ferror(stdout)) { if (tag_files != NULL) { - warn("%s", tag_files->ofn); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s: %s", tag_files->ofn, + strerror(errno)); tag_unlink(); tag_files = NULL; } else - warn("stdout"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); break; } @@ -591,9 +653,11 @@ main(int argc, char *argv[]) terminal_sepline(curp.outdata); } } else - mandoc_msg(MANDOCERR_FILE, 0, 0, - "%s: %s", thisarg, strerror(errno)); + mandoc_msg(resp == NULL ? MANDOCERR_BADARG_BAD : + MANDOCERR_OPEN, 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); + if (curp.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) break; @@ -684,8 +748,8 @@ out: continue; if (pid == -1) { - warn("wait"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WAIT, 0, 0, + "%s", strerror(errno)); break; } if (!WIFSTOPPED(status)) @@ -694,14 +758,16 @@ out: signum = WSTOPSIG(status); } tag_unlink(); - } + } else if (curp.outtype != OUTT_LINT && + (search.argmode == ARG_FILE || sz > 0)) + mandoc_msg_summary(); + return (int)mandoc_msg_getrc(); } static void usage(enum argmode argmode) { - switch (argmode) { case ARG_FILE: fputs("usage: mandoc [-ac] [-I os=name] " @@ -732,6 +798,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, const char *sec, const char *arch, const char *name, struct manpage **res, size_t *ressz) { + struct stat sb; glob_t globinfo; struct manpage *page; char *file; @@ -741,13 +808,13 @@ fs_lookup(const struct manpaths *paths, size_t ipath, form = FORM_SRC; mandoc_asprintf(&file, "%s/man%s/%s.%s", paths->paths[ipath], sec, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); mandoc_asprintf(&file, "%s/cat%s/%s.0", paths->paths[ipath], sec, name); - if (access(file, R_OK) != -1) { + if (stat(file, &sb) != -1) { form = FORM_CAT; goto found; } @@ -756,7 +823,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, if (arch != NULL) { mandoc_asprintf(&file, "%s/man%s/%s/%s.%s", paths->paths[ipath], sec, arch, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); } @@ -765,37 +832,42 @@ fs_lookup(const struct manpaths *paths, size_t ipath, paths->paths[ipath], sec, name); globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH) - warn("%s: glob", file); + mandoc_msg(MANDOCERR_GLOB, 0, 0, + "%s: %s", file, strerror(errno)); free(file); if (globres == 0) file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); - if (globres == 0) - goto found; + if (globres == 0) { + if (stat(file, &sb) != -1) + goto found; + free(file); + } if (res != NULL || ipath + 1 != paths->sz) - return 0; + return -1; mandoc_asprintf(&file, "%s.%s", name, sec); - globres = access(file, R_OK); + globres = stat(file, &sb); free(file); - return globres != -1; + return globres; found: warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); if (res == NULL) { free(file); - return 1; + return 0; } - *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); + *res = mandoc_reallocarray(*res, ++*ressz, sizeof(**res)); page = *res + (*ressz - 1); page->file = file; page->names = NULL; page->output = NULL; + page->bits = NAME_FILE & NAME_MASK; page->ipath = ipath; page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10; page->form = form; - return 1; + return 0; } static int @@ -817,14 +889,14 @@ fs_search(const struct mansearch *cfg, const struct ma for (ipath = 0; ipath < paths->sz; ipath++) { if (cfg->sec != NULL) { if (fs_lookup(paths, ipath, cfg->sec, - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } else for (isec = 0; isec < nsec; isec++) if (fs_lookup(paths, ipath, sections[isec], - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } if (res != NULL && *ressz == lastsz && strchr(*argv, '/') == NULL) { @@ -843,7 +915,7 @@ fs_search(const struct mansearch *cfg, const struct ma argv++; argc--; } - return 0; + return -1; } static void @@ -950,7 +1022,7 @@ check_xr(void) search.firstmatch = 1; if (mansearch(&search, &paths, 1, &xr->name, NULL, &sz)) continue; - if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) + if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz) != -1) continue; if (xr->count == 1) mandoc_msg(MANDOCERR_XR_BAD, xr->line, @@ -990,34 +1062,34 @@ outdata_alloc(struct curparse *curp) } static void -passthrough(const char *file, int fd, int synopsis_only) +passthrough(int fd, int synopsis_only) { const char synb[] = "S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS"; const char synr[] = "SYNOPSIS"; FILE *stream; - const char *syscall; char *line, *cp; size_t linesz; ssize_t len, written; - int print; + int lno, print; + stream = NULL; line = NULL; linesz = 0; if (fflush(stdout) == EOF) { - syscall = "fflush"; - goto fail; + mandoc_msg(MANDOCERR_FFLUSH, 0, 0, "%s", strerror(errno)); + goto done; } - if ((stream = fdopen(fd, "r")) == NULL) { close(fd); - syscall = "fdopen"; - goto fail; + mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno)); + goto done; } - print = 0; + lno = print = 0; while ((len = getline(&line, &linesz, stream)) != -1) { + lno++; cp = line; if (synopsis_only) { if (print) { @@ -1035,97 +1107,23 @@ passthrough(const char *file, int fd, int synopsis_onl } } for (; len > 0; len -= written) { - if ((written = write(STDOUT_FILENO, cp, len)) != -1) - continue; - fclose(stream); - syscall = "write"; - goto fail; + if ((written = write(STDOUT_FILENO, cp, len)) == -1) { + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); + goto done; + } } } + if (ferror(stream)) + mandoc_msg(MANDOCERR_GETLINE, lno, 0, "%s", strerror(errno)); - if (ferror(stream)) { - fclose(stream); - syscall = "getline"; - goto fail; - } - done: free(line); - fclose(stream); - return; - -fail: - free(line); - warn("%s: SYSERR: %s", file, syscall); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + if (stream != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Fri Aug 23 10:11:11 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34485DFFAB; Fri, 23 Aug 2019 10:11:11 +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 46FHH30gRpz4ZDs; Fri, 23 Aug 2019 10:11:11 +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 124011B019; Fri, 23 Aug 2019 10:11:11 +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 x7NABAxt083545; Fri, 23 Aug 2019 10:11:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7NABA5D083544; Fri, 23 Aug 2019 10:11:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201908231011.x7NABA5D083544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 23 Aug 2019 10:11:10 +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: r351419 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 351419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 23 Aug 2019 10:11:11 -0000 Author: ae Date: Fri Aug 23 10:11:10 2019 New Revision: 351419 URL: https://svnweb.freebsd.org/changeset/base/351419 Log: MFC r350974: Since ipvoly is used for checksum calculation, part of original IP header is zeroed. This part includes ip_ttl field, that can be used later in IP_MINTTL socket option handling. PR: 239799 Modified: stable/12/sys/netinet/tcp_input.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Fri Aug 23 07:24:36 2019 (r351418) +++ stable/12/sys/netinet/tcp_input.c Fri Aug 23 10:11:10 2019 (r351419) @@ -576,6 +576,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) int optlen = 0; #ifdef INET int len; + uint8_t ipttl; #endif int tlen = 0, off; int drop_hdrlen; @@ -698,6 +699,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) * Checksum extended TCP header and data. */ len = off0 + tlen; + ipttl = ip->ip_ttl; bzero(ipov->ih_x1, sizeof(ipov->ih_x1)); ipov->ih_len = htons(tlen); th->th_sum = in_cksum(m, len); @@ -706,6 +708,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) /* Reset TOS bits */ ip->ip_tos = iptos; /* Re-initialization for later version check */ + ip->ip_ttl = ipttl; ip->ip_v = IPVERSION; ip->ip_hl = off0 >> 2; } From owner-svn-src-stable-12@freebsd.org Fri Aug 23 16:18:25 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BF1AC8F63; Fri, 23 Aug 2019 16:18:25 +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 46FRQn4N6Lz3wdT; Fri, 23 Aug 2019 16:18:25 +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 5EA391F2DF; Fri, 23 Aug 2019 16:18:25 +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 x7NGIP07098254; Fri, 23 Aug 2019 16:18:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7NGIPvQ098253; Fri, 23 Aug 2019 16:18:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908231618.x7NGIPvQ098253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Aug 2019 16:18: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: r351426 - stable/12/usr.bin/vtfontcvt X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/vtfontcvt X-SVN-Commit-Revision: 351426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 23 Aug 2019 16:18:25 -0000 Author: emaste Date: Fri Aug 23 16:18:25 2019 New Revision: 351426 URL: https://svnweb.freebsd.org/changeset/base/351426 Log: vtfontcvt: improve BDF and hex font parsing MFC r348661: vtfontcvt: rework height/width setting Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and consistently use set_height and set_width. Submitted by: Dmitry Wagin MFC r348662: vtfontcvt: include width and height in verbose info Submitted by: Dmitry Wagin MFC r348668: vtfontcvt: zero memory allocated by xmalloc Submitted by: Dmitry Wagin MFC r348692: vtfontcvt: exit on error if the input font has too many glyphs The kernel has a limit of 131072 glyphs in a font; add the same check to vtfontcvt so that we won't create a font file that the kernel will not load. MFC r348796: vtfontcvt: allow out-of-order glyphs Reported by: mi MFC r349049: vtfontcvt: add comments in add_glyph MFC r349100: vtfontcvt: improve BDF and hex font parsing Support larger font sizes. Submitted by: Dmitry Wagin (original version) MFC r349101: vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 warning MFC r349105: vtfontcvt: initialize another variable to quiet GCC warning I believe this case could be triggered by a broken .bdf font. MFC r349107: vtfontcvt: improve .bdf verification Previously we would crash if the BBX y-offset was outside of the font bounding box. Reported by: afl fuzzer MFC r349108: vtfontcvt: improve .bdf validation Previously if we had a BBX entry that had invalid values (e.g. bounding box outside of font bounding box) and failed sscanf (e.g., because it had fewer than four values) we skipped the BBX value validation and then triggered an assertion failure. Reported by: afl fuzzer MFC r349111: vtfontcvt: correct typo in hex parsing update Submitted by: Dmitry Wagin MFC r349333: vtfontcvt: improve .bdf validation Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing or invalid values and and failed sscanf, we would proceeded with partially initialized bounding box / device width variables. Reported by: afl fuzzer (FONTBOUNDINGBOX) PR: 205707 Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/12/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:03:23 2019 (r351425) +++ stable/12/usr.bin/vtfontcvt/vtfontcvt.c Fri Aug 23 16:18:25 2019 (r351426) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #define VFNT_MAP_NORMAL_RH 1 #define VFNT_MAP_BOLD 2 #define VFNT_MAP_BOLD_RH 3 +#define VFNT_MAXGLYPHS 131072 +#define VFNT_MAXDIMENSION 128 static unsigned int width = 8, wbytes, height = 16; @@ -101,7 +103,7 @@ xmalloc(size_t size) { void *m; - if ((m = malloc(size)) == NULL) + if ((m = calloc(1, size)) == NULL) errx(1, "memory allocation failure"); return (m); } @@ -109,7 +111,7 @@ xmalloc(size_t size) static int add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) { - struct mapping *mp; + struct mapping *mp, *mp_temp; struct mapping_list *ml; mapping_total++; @@ -120,10 +122,19 @@ add_mapping(struct glyph *gl, unsigned int c, unsigned mp->m_length = 0; ml = &maps[map_idx]; - if (TAILQ_LAST(ml, mapping_list) != NULL && - TAILQ_LAST(ml, mapping_list)->m_char >= c) - errx(1, "Bad ordering at character %u", c); - TAILQ_INSERT_TAIL(ml, mp, m_list); + if (TAILQ_LAST(ml, mapping_list) == NULL || + TAILQ_LAST(ml, mapping_list)->m_char < c) { + /* Common case: empty list or new char at end of list. */ + TAILQ_INSERT_TAIL(ml, mp, m_list); + } else { + /* Find insertion point for char; cannot be at end. */ + TAILQ_FOREACH(mp_temp, ml, m_list) { + if (mp_temp->m_char >= c) { + TAILQ_INSERT_BEFORE(mp_temp, mp, m_list); + break; + } + } + } map_count[map_idx]++; mapping_unique++; @@ -165,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, glyph_total++; glyph_count[map_idx]++; + /* Return existing glyph if we have an identical one. */ hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH; SLIST_FOREACH(gl, &glyph_hash[hash], g_hash) { if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { @@ -173,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, } } + /* Allocate new glyph. */ gl = xmalloc(sizeof *gl); gl->g_data = xmalloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); @@ -183,6 +196,8 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, SLIST_INSERT_HEAD(&glyph_hash[hash], gl, g_hash); glyph_unique++; + if (glyph_unique > VFNT_MAXGLYPHS) + errx(1, "too many glyphs (%u)", glyph_unique); return (gl); } @@ -208,112 +223,243 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * return (0); } - +/* + * Right-shift glyph row by _shift_ bits. Row _len_ bits wide, _size_ bytes. + */ static int -parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, - unsigned int dwidth) +rshift_row(uint8_t *line, size_t size, size_t len, size_t shift) { - uint8_t *p; - unsigned int i, subline; + size_t d, s, i; + uint16_t t; - if (dwidth != width && dwidth != width * 2) - errx(1, "Bitmap with unsupported width %u!", dwidth); + assert(size > 0 && len > 0); + assert(size * 8 >= len); - /* Move pixel data right to simplify splitting double characters. */ - line >>= (howmany(dwidth, 8) * 8) - dwidth; + if (shift == 0) + return (0); - for (i = dwidth / width; i > 0; i--) { - p = (i == 2) ? right : left; + d = shift / 8; + s = 8 - shift % 8; + i = howmany(len, 8); - subline = line & ((1 << width) - 1); - subline <<= (howmany(width, 8) * 8) - width; + while (i > 0) { + i--; - if (wbytes == 1) { - *p = subline; - } else if (wbytes == 2) { - *p++ = subline >> 8; - *p = subline; - } else { - errx(1, "Unsupported wbytes %u!", wbytes); - } + t = *(line + i); + *(line + i) = 0; - line >>= width; + t <<= s; + + if (i + d + 1 < size) + *(line + i + d + 1) |= (uint8_t)t; + if (i + d < size) + *(line + i + d) = t >> 8; } + return (0); +} +/* + * Split double-width characters into left and right half. Single-width + * characters in _left_ only. + */ +static int +split_row(uint8_t *left, uint8_t *right, uint8_t *line, size_t w) +{ + size_t s, i; + + s = wbytes * 8 - width; + + memcpy(left, line, wbytes); + *(left + wbytes - 1) &= 0xFF << s; + + if (w > width) { /* Double-width character. */ + uint8_t t; + + for (i = 0; i < wbytes; i++) { + t = *(line + wbytes + i - 1); + t <<= 8 - s; + t |= *(line + wbytes + i) >> s; + *(right + i) = t; + } + *(right + wbytes - 1) &= 0xFF << s; + } return (0); } +static void +set_height(int h) +{ + if (h <= 0 || h > VFNT_MAXDIMENSION) + errx(1, "invalid height %d", h); + height = h; +} + +static void +set_width(int w) +{ + if (w <= 0 || w > VFNT_MAXDIMENSION) + errx(1, "invalid width %d", w); + width = w; + wbytes = howmany(width, 8); +} + static int parse_bdf(FILE *fp, unsigned int map_idx) { - char *ln; + char *line, *ln, *p; size_t length; - uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; - unsigned int curchar = 0, dwidth = 0, i, line; + uint8_t *bytes, *bytes_r; + unsigned int curchar = 0, i, j, linenum = 0, bbwbytes; + int bbw, bbh, bbox, bboy; /* Glyph bounding box. */ + int fbbw = 0, fbbh, fbbox, fbboy; /* Font bounding box. */ + int dwidth = 0, dwy = 0; + int rv = -1; + char spc = '\0'; + /* + * Step 1: Parse FONT logical font descriptor and FONTBOUNDINGBOX + * bounding box. + */ while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; ln[length - 1] = '\0'; - if (strncmp(ln, "ENCODING ", 9) == 0) { - curchar = atoi(ln + 9); + if (strncmp(ln, "FONT ", 5) == 0) { + p = ln + 5; + i = 0; + while ((p = strchr(p, '-')) != NULL) { + p++; + i++; + if (i == 11) { + spc = *p; + break; + } + } + } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0) { + if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, + &fbboy) != 4) + errx(1, "invalid FONTBOUNDINGBOX at line %u", + linenum); + set_width(fbbw); + set_height(fbbh); + break; } + } + if (fbbw == 0) + errx(1, "broken font header"); + if (spc != 'c' && spc != 'C') + errx(1, "font spacing \"C\" (character cell) required"); + /* Step 2: Validate DWIDTH (Device Width) of all glyphs. */ + while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; + ln[length - 1] = '\0'; + if (strncmp(ln, "DWIDTH ", 7) == 0) { - dwidth = atoi(ln + 7); + if (sscanf(ln + 7, "%d %d", &dwidth, &dwy) != 2) + errx(1, "invalid DWIDTH at line %u", linenum); + if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) + errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", + dwidth, dwy, linenum); + if (dwidth < fbbw) + set_width(dwidth); } + } - if (strncmp(ln, "BITMAP", 6) == 0 && + /* Step 3: Restart at the beginning of the file and read glyph data. */ + dwidth = bbw = bbh = 0; + rewind(fp); + linenum = 0; + bbwbytes = 0; /* GCC 4.2.1 "may be used uninitialized" workaround. */ + bytes = xmalloc(wbytes * height); + bytes_r = xmalloc(wbytes * height); + line = xmalloc(wbytes * 2); + while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; + ln[length - 1] = '\0'; + + if (strncmp(ln, "ENCODING ", 9) == 0) { + curchar = atoi(ln + 9); + } else if (strncmp(ln, "DWIDTH ", 7) == 0) { + dwidth = atoi(ln + 7); + } else if (strncmp(ln, "BBX ", 4) == 0) { + if (sscanf(ln + 4, "%d %d %d %d", &bbw, &bbh, &bbox, + &bboy) != 4) + errx(1, "invalid BBX at line %u", linenum); + if (bbw < 1 || bbh < 1 || bbw > fbbw || bbh > fbbh || + bbox < fbbox || bboy < fbboy || + bbh + bboy > fbbh + fbboy) + errx(1, "broken bitmap with BBX %d %d %d %d at line %u", + bbw, bbh, bbox, bboy, linenum); + bbwbytes = howmany(bbw, 8); + } else if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + if (dwidth == 0 || bbw == 0 || bbh == 0) + errx(1, "broken char header at line %u!", + linenum); + memset(bytes, 0, wbytes * height); + memset(bytes_r, 0, wbytes * height); + /* - * Assume that the next _height_ lines are bitmap - * data. ENDCHAR is allowed to terminate the bitmap + * Assume that the next _bbh_ lines are bitmap data. + * ENDCHAR is allowed to terminate the bitmap * early but is not otherwise checked; any extra data * is ignored. */ - for (i = 0; i < height; i++) { + for (i = (fbbh + fbboy) - (bbh + bboy); + i < (unsigned int)((fbbh + fbboy) - bboy); i++) { if ((ln = fgetln(fp, &length)) == NULL) - errx(1, "Unexpected EOF!"); + errx(1, "unexpected EOF"); + linenum++; ln[length - 1] = '\0'; - if (strcmp(ln, "ENDCHAR") == 0) { - memset(bytes + i * wbytes, 0, - (height - i) * wbytes); - memset(bytes_r + i * wbytes, 0, - (height - i) * wbytes); + if (strcmp(ln, "ENDCHAR") == 0) break; + if (strlen(ln) < bbwbytes * 2) + errx(1, "broken bitmap at line %u", + linenum); + memset(line, 0, wbytes * 2); + for (j = 0; j < bbwbytes; j++) { + unsigned int val; + if (sscanf(ln + j * 2, "%2x", &val) == + 0) + break; + *(line + j) = (uint8_t)val; } - sscanf(ln, "%x", &line); - if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) - return (1); + + rv = rshift_row(line, wbytes * 2, bbw, + bbox - fbbox); + if (rv != 0) + goto out; + + rv = split_row(bytes + i * wbytes, + bytes_r + i * wbytes, line, dwidth); + if (rv != 0) + goto out; } - if (add_char(curchar, map_idx, bytes, - dwidth == width * 2 ? bytes_r : NULL) != 0) - return (1); + rv = add_char(curchar, map_idx, bytes, + dwidth > (int)width ? bytes_r : NULL); + if (rv != 0) + goto out; + + dwidth = bbw = bbh = 0; } } - return (0); +out: + free(bytes); + free(bytes_r); + free(line); + return (rv); } -static void -set_width(int w) -{ - - if (w <= 0 || w > 128) - errx(1, "invalid width %d", w); - width = w; - wbytes = howmany(width, 8); -} - static int parse_hex(FILE *fp, unsigned int map_idx) { char *ln, *p; - char fmt_str[8]; size_t length; - uint8_t *bytes = NULL, *bytes_r = NULL; - unsigned curchar = 0, i, line, chars_per_row, dwidth; + uint8_t *bytes = NULL, *bytes_r = NULL, *line = NULL; + unsigned curchar = 0, gwidth, gwbytes, i, j, chars_per_row; int rv = 0; while ((ln = fgetln(fp, &length)) != NULL) { @@ -322,7 +468,7 @@ parse_hex(FILE *fp, unsigned int map_idx) if (strncmp(ln, "# Height: ", 10) == 0) { if (bytes != NULL) errx(1, "malformed input: Height tag after font data"); - height = atoi(ln + 10); + set_height(atoi(ln + 10)); } else if (strncmp(ln, "# Width: ", 9) == 0) { if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); @@ -331,36 +477,46 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); + line = xmalloc(wbytes * 2); } /* ln is guaranteed to have a colon here. */ p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; - dwidth = width; - if (chars_per_row / 2 > (width + 7) / 8) - dwidth *= 2; /* Double-width character. */ - snprintf(fmt_str, sizeof(fmt_str), "%%%ux", - chars_per_row); + if (chars_per_row < wbytes * 2) + errx(1, + "malformed input: broken bitmap, character %06x", + curchar); + gwidth = width * 2; + gwbytes = howmany(gwidth, 8); + if (chars_per_row < gwbytes * 2 || gwidth <= 8) { + gwidth = width; /* Single-width character. */ + gwbytes = wbytes; + } for (i = 0; i < height; i++) { - sscanf(p, fmt_str, &line); - p += chars_per_row; - if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) { - rv = 1; - goto out; + for (j = 0; j < gwbytes; j++) { + unsigned int val; + if (sscanf(p + j * 2, "%2x", &val) == 0) + break; + *(line + j) = (uint8_t)val; } + rv = split_row(bytes + i * wbytes, + bytes_r + i * wbytes, line, gwidth); + if (rv != 0) + goto out; + p += gwbytes * 2; } - if (add_char(curchar, map_idx, bytes, - dwidth == width * 2 ? bytes_r : NULL) != 0) { - rv = 1; + rv = add_char(curchar, map_idx, bytes, + gwidth != width ? bytes_r : NULL); + if (rv != 0) goto out; - } } } out: free(bytes); free(bytes_r); + free(line); return (rv); } @@ -512,6 +668,8 @@ print_font_info(void) { printf( "Statistics:\n" +"- width: %6u\n" +"- height: %6u\n" "- glyph_total: %6u\n" "- glyph_normal: %6u\n" "- glyph_normal_right: %6u\n" @@ -530,6 +688,7 @@ print_font_info(void) "- mapping_bold_right_folded: %6u\n" "- mapping_unique: %6u\n" "- mapping_dupe: %6u\n", + width, height, glyph_total, glyph_count[0], glyph_count[1], @@ -547,7 +706,7 @@ print_font_info(void) int main(int argc, char *argv[]) { - int ch, val, verbose = 0; + int ch, verbose = 0; assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); @@ -555,16 +714,13 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "h:vw:")) != -1) { switch (ch) { case 'h': - val = atoi(optarg); - if (val <= 0 || val > 128) - errx(1, "Invalid height %d", val); - height = val; + height = atoi(optarg); break; case 'v': verbose = 1; break; case 'w': - set_width(atoi(optarg)); + width = atoi(optarg); break; case '?': default: @@ -577,7 +733,8 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 3) usage(); - wbytes = howmany(width, 8); + set_width(width); + set_height(height); if (parse_file(argv[0], VFNT_MAP_NORMAL) != 0) return (1); From owner-svn-src-stable-12@freebsd.org Fri Aug 23 17:40:10 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 706AACA9C5; Fri, 23 Aug 2019 17:40:10 +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 46FTF634rPz41lx; Fri, 23 Aug 2019 17:40:10 +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 4B96720147; Fri, 23 Aug 2019 17:40:10 +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 x7NHeAmZ045657; Fri, 23 Aug 2019 17:40:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7NHdxIl045565; Fri, 23 Aug 2019 17:39:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908231739.x7NHdxIl045565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Aug 2019 17:39: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: r351431 - in stable/12/contrib/telnet: arpa libtelnet telnet telnetd X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/contrib/telnet: arpa libtelnet telnet telnetd X-SVN-Commit-Revision: 351431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 23 Aug 2019 17:40:10 -0000 Author: emaste Date: Fri Aug 23 17:39:59 2019 New Revision: 351431 URL: https://svnweb.freebsd.org/changeset/base/351431 Log: MFC r351070: telnet: remove 3rd clause from Berkeley copyrights Per the July 22, 1999 letter (in /COPYRIGHT) from William Hoskins Director, Office of Technology Licensing University of California, Berkeley Modified: stable/12/contrib/telnet/arpa/telnet.h stable/12/contrib/telnet/libtelnet/auth-proto.h stable/12/contrib/telnet/libtelnet/auth.c stable/12/contrib/telnet/libtelnet/auth.h stable/12/contrib/telnet/libtelnet/enc-proto.h stable/12/contrib/telnet/libtelnet/enc_des.c stable/12/contrib/telnet/libtelnet/encrypt.c stable/12/contrib/telnet/libtelnet/encrypt.h stable/12/contrib/telnet/libtelnet/genget.c stable/12/contrib/telnet/libtelnet/getent.c stable/12/contrib/telnet/libtelnet/kerberos.c stable/12/contrib/telnet/libtelnet/kerberos5.c stable/12/contrib/telnet/libtelnet/key-proto.h stable/12/contrib/telnet/libtelnet/krb4encpwd.c stable/12/contrib/telnet/libtelnet/misc-proto.h stable/12/contrib/telnet/libtelnet/misc.c stable/12/contrib/telnet/libtelnet/misc.h stable/12/contrib/telnet/libtelnet/read_password.c stable/12/contrib/telnet/libtelnet/rsaencpwd.c stable/12/contrib/telnet/telnet/authenc.c stable/12/contrib/telnet/telnet/commands.c stable/12/contrib/telnet/telnet/defines.h stable/12/contrib/telnet/telnet/externs.h stable/12/contrib/telnet/telnet/fdset.h stable/12/contrib/telnet/telnet/general.h stable/12/contrib/telnet/telnet/main.c stable/12/contrib/telnet/telnet/network.c stable/12/contrib/telnet/telnet/ring.c stable/12/contrib/telnet/telnet/ring.h stable/12/contrib/telnet/telnet/sys_bsd.c stable/12/contrib/telnet/telnet/telnet.1 stable/12/contrib/telnet/telnet/telnet.c stable/12/contrib/telnet/telnet/terminal.c stable/12/contrib/telnet/telnet/types.h stable/12/contrib/telnet/telnet/utilities.c stable/12/contrib/telnet/telnetd/authenc.c stable/12/contrib/telnet/telnetd/defs.h stable/12/contrib/telnet/telnetd/ext.h stable/12/contrib/telnet/telnetd/global.c stable/12/contrib/telnet/telnetd/pathnames.h stable/12/contrib/telnet/telnetd/slc.c stable/12/contrib/telnet/telnetd/state.c stable/12/contrib/telnet/telnetd/sys_term.c stable/12/contrib/telnet/telnetd/telnetd.8 stable/12/contrib/telnet/telnetd/telnetd.c stable/12/contrib/telnet/telnetd/telnetd.h stable/12/contrib/telnet/telnetd/termstat.c stable/12/contrib/telnet/telnetd/utility.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/telnet/arpa/telnet.h ============================================================================== --- stable/12/contrib/telnet/arpa/telnet.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/arpa/telnet.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/auth-proto.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/auth-proto.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/auth.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/auth.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/auth.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/auth.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/auth.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/auth.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/enc-proto.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/enc-proto.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/enc-proto.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/enc_des.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/enc_des.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/enc_des.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/encrypt.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/encrypt.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/encrypt.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/encrypt.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/encrypt.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/encrypt.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/genget.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/genget.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/genget.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/getent.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/getent.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/getent.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/kerberos.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/kerberos.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/kerberos.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/kerberos5.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/kerberos5.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/kerberos5.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/key-proto.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/key-proto.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/key-proto.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/krb4encpwd.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/krb4encpwd.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/krb4encpwd.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/misc-proto.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/misc-proto.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/misc-proto.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/misc.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/misc.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/misc.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/misc.h ============================================================================== --- stable/12/contrib/telnet/libtelnet/misc.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/misc.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/read_password.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/read_password.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/read_password.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/libtelnet/rsaencpwd.c ============================================================================== --- stable/12/contrib/telnet/libtelnet/rsaencpwd.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/libtelnet/rsaencpwd.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/authenc.c ============================================================================== --- stable/12/contrib/telnet/telnet/authenc.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/authenc.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/commands.c ============================================================================== --- stable/12/contrib/telnet/telnet/commands.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/commands.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/defines.h ============================================================================== --- stable/12/contrib/telnet/telnet/defines.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/defines.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/externs.h ============================================================================== --- stable/12/contrib/telnet/telnet/externs.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/externs.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/fdset.h ============================================================================== --- stable/12/contrib/telnet/telnet/fdset.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/fdset.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/general.h ============================================================================== --- stable/12/contrib/telnet/telnet/general.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/general.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/main.c ============================================================================== --- stable/12/contrib/telnet/telnet/main.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/main.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/network.c ============================================================================== --- stable/12/contrib/telnet/telnet/network.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/network.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/ring.c ============================================================================== --- stable/12/contrib/telnet/telnet/ring.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/ring.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/ring.h ============================================================================== --- stable/12/contrib/telnet/telnet/ring.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/ring.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- stable/12/contrib/telnet/telnet/sys_bsd.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/sys_bsd.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/telnet.1 ============================================================================== --- stable/12/contrib/telnet/telnet/telnet.1 Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/telnet.1 Fri Aug 23 17:39:59 2019 (r351431) @@ -9,11 +9,7 @@ .\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/12/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/12/contrib/telnet/telnet/telnet.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/telnet.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/terminal.c ============================================================================== --- stable/12/contrib/telnet/telnet/terminal.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/terminal.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/types.h ============================================================================== --- stable/12/contrib/telnet/telnet/types.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/types.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnet/utilities.c ============================================================================== --- stable/12/contrib/telnet/telnet/utilities.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnet/utilities.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/authenc.c ============================================================================== --- stable/12/contrib/telnet/telnetd/authenc.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/authenc.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/defs.h ============================================================================== --- stable/12/contrib/telnet/telnetd/defs.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/defs.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/ext.h ============================================================================== --- stable/12/contrib/telnet/telnetd/ext.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/ext.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/global.c ============================================================================== --- stable/12/contrib/telnet/telnetd/global.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/global.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/pathnames.h ============================================================================== --- stable/12/contrib/telnet/telnetd/pathnames.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/pathnames.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/slc.c ============================================================================== --- stable/12/contrib/telnet/telnetd/slc.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/slc.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/state.c ============================================================================== --- stable/12/contrib/telnet/telnetd/state.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/state.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/sys_term.c ============================================================================== --- stable/12/contrib/telnet/telnetd/sys_term.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/sys_term.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/telnetd.8 ============================================================================== --- stable/12/contrib/telnet/telnetd/telnetd.8 Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/telnetd.8 Fri Aug 23 17:39:59 2019 (r351431) @@ -9,11 +9,7 @@ .\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/12/contrib/telnet/telnetd/telnetd.c ============================================================================== --- stable/12/contrib/telnet/telnetd/telnetd.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/telnetd.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/telnetd.h ============================================================================== --- stable/12/contrib/telnet/telnetd/telnetd.h Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/telnetd.h Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/termstat.c ============================================================================== --- stable/12/contrib/telnet/telnetd/termstat.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/termstat.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/12/contrib/telnet/telnetd/utility.c ============================================================================== --- stable/12/contrib/telnet/telnetd/utility.c Fri Aug 23 16:42:39 2019 (r351430) +++ stable/12/contrib/telnet/telnetd/utility.c Fri Aug 23 17:39:59 2019 (r351431) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-stable-12@freebsd.org Sat Aug 24 00:36:00 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0707D2A0A; Sat, 24 Aug 2019 00:36:00 +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 46FfSw49Qpz4RD0; Sat, 24 Aug 2019 00:36:00 +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 70E1F24D92; Sat, 24 Aug 2019 00:36:00 +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 x7O0a0aB099177; Sat, 24 Aug 2019 00:36:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7O0a0CV099175; Sat, 24 Aug 2019 00:36:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908240036.x7O0a0CV099175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 24 Aug 2019 00:36: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: r351449 - in stable: 11/sys/amd64/amd64 11/sys/i386/i386 12/sys/amd64/amd64 12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/amd64/amd64 11/sys/i386/i386 12/sys/amd64/amd64 12/sys/i386/i386 X-SVN-Commit-Revision: 351449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 24 Aug 2019 00:36:00 -0000 Author: jhb Date: Sat Aug 24 00:35:59 2019 New Revision: 351449 URL: https://svnweb.freebsd.org/changeset/base/351449 Log: MFC 350551: Don't reset memory attributes when mapping physical addresses for ACPI. Previously, AcpiOsMemory was using pmap_mapbios which would always map the requested address Write-Back (WB). For several AMD Ryzen laptops, the BIOS uses AcpiOsMemory to directly access the PCI MCFG region in order to access PCI config registers. This has the side effect of remapping the MCFG region in the direct map as WB instead of UC hanging the laptops during boot. On the one laptop I examined in detail, the _PIC global method used to switch from 8259A PICs to I/O APICs uses a pair of PCI config space registers at offset 0x84 in the device at 0:0:0 to as a pair of address/data registers to access an indirect register in the chipset and clear a single bit to switch modes. To fix, alter the semantics of pmap_mapbios() such that it does not modify the attributes of any existing mappings and instead uses the existing attributes. If a new mapping is created, this new mapping uses WB (the default memory attribute). Special thanks to the gentleman whose name I don't have who brought two affected laptops to the hacker lounge at BSDCan. Direct access to the affected systems permitted finding the root cause within an hour or so. PR: 231760, 236899 Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/i386/i386/pmap.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/i386/i386/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Sat Aug 24 00:01:19 2019 (r351448) +++ stable/12/sys/amd64/amd64/pmap.c Sat Aug 24 00:35:59 2019 (r351449) @@ -1102,6 +1102,13 @@ static caddr_t crashdumpmap; #define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ #define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ +/* + * Internal flags for pmap_mapdev_internal() and + * pmap_change_attr_locked(). + */ +#define MAPDEV_FLUSHCACHE 0x0000001 /* Flush cache after mapping. */ +#define MAPDEV_SETATTR 0x0000002 /* Modify existing attrs. */ + static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); @@ -1122,7 +1129,7 @@ static pv_entry_t pmap_pvh_remove(struct md_page *pvh, vm_offset_t va); static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, - bool noflush); + int flags); static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); @@ -7713,7 +7720,7 @@ pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mas * NOT real memory. */ static void * -pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, int mode, bool noflush) +pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, int mode, int flags) { struct pmap_preinit_mapping *ppim; vm_offset_t va, offset; @@ -7747,7 +7754,8 @@ pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, in for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { ppim = pmap_preinit_mapping + i; if (ppim->pa == pa && ppim->sz == size && - ppim->mode == mode) + (ppim->mode == mode || + (flags & MAPDEV_SETATTR) == 0)) return ((void *)(ppim->va + offset)); } /* @@ -7756,9 +7764,12 @@ pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, in */ if (pa < dmaplimit && pa + size <= dmaplimit) { va = PHYS_TO_DMAP(pa); - PMAP_LOCK(kernel_pmap); - i = pmap_change_attr_locked(va, size, mode, noflush); - PMAP_UNLOCK(kernel_pmap); + if ((flags & MAPDEV_SETATTR) != 0) { + PMAP_LOCK(kernel_pmap); + i = pmap_change_attr_locked(va, size, mode, flags); + PMAP_UNLOCK(kernel_pmap); + } else + i = 0; if (!i) return ((void *)(va + offset)); } @@ -7769,7 +7780,7 @@ pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, in for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - if (!noflush) + if ((flags & MAPDEV_FLUSHCACHE) != 0) pmap_invalidate_cache_range(va, va + tmpsize); return ((void *)(va + offset)); } @@ -7778,28 +7789,31 @@ void * pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) { - return (pmap_mapdev_internal(pa, size, mode, false)); + return (pmap_mapdev_internal(pa, size, mode, MAPDEV_FLUSHCACHE | + MAPDEV_SETATTR)); } void * pmap_mapdev(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_internal(pa, size, PAT_UNCACHEABLE, false)); + return (pmap_mapdev_attr(pa, size, PAT_UNCACHEABLE)); } void * pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_internal(pa, size, PAT_UNCACHEABLE, true)); + return (pmap_mapdev_internal(pa, size, PAT_UNCACHEABLE, + MAPDEV_SETATTR)); } void * pmap_mapbios(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_internal(pa, size, PAT_WRITE_BACK, false)); + return (pmap_mapdev_internal(pa, size, PAT_WRITE_BACK, + MAPDEV_FLUSHCACHE)); } void @@ -7938,13 +7952,13 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int m int error; PMAP_LOCK(kernel_pmap); - error = pmap_change_attr_locked(va, size, mode, false); + error = pmap_change_attr_locked(va, size, mode, MAPDEV_FLUSHCACHE); PMAP_UNLOCK(kernel_pmap); return (error); } static int -pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool noflush) +pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, int flags) { vm_offset_t base, offset, tmpva; vm_paddr_t pa_start, pa_end, pa_end1; @@ -8061,7 +8075,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode, noflush); + pa_end - pa_start, mode, flags); if (error != 0) break; /* Start physical address run. */ @@ -8091,7 +8105,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode, noflush); + pa_end - pa_start, mode, flags); if (error != 0) break; /* Start physical address run. */ @@ -8119,7 +8133,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode, noflush); + pa_end - pa_start, mode, flags); if (error != 0) break; /* Start physical address run. */ @@ -8134,7 +8148,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size pa_end1 = MIN(pa_end, dmaplimit); if (pa_start != pa_end1) error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), - pa_end1 - pa_start, mode, noflush); + pa_end1 - pa_start, mode, flags); } /* @@ -8143,7 +8157,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - if (!noflush) + if ((flags & MAPDEV_FLUSHCACHE) != 0) pmap_invalidate_cache_range(base, tmpva); } return (error); Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Sat Aug 24 00:01:19 2019 (r351448) +++ stable/12/sys/i386/i386/pmap.c Sat Aug 24 00:35:59 2019 (r351449) @@ -292,6 +292,11 @@ int pti; #define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ #define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ +/* + * Internal flags for pmap_mapdev_internal(). + */ +#define MAPDEV_SETATTR 0x0000001 /* Modify existing attrs. */ + static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, boolean_t try); @@ -5466,11 +5471,12 @@ pmap_pde_attr(pd_entry_t *pde, int cache_bits) * routine is intended to be used for mapping device memory, * NOT real memory. */ -void * -pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) +static void * +pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, int mode, int flags) { struct pmap_preinit_mapping *ppim; vm_offset_t va, offset; + vm_page_t m; vm_size_t tmpsize; int i; @@ -5478,9 +5484,11 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mo size = round_page(offset + size); pa = pa & PG_FRAME; - if (pa < PMAP_MAP_LOW && pa + size <= PMAP_MAP_LOW) + if (pa < PMAP_MAP_LOW && pa + size <= PMAP_MAP_LOW) { va = pa + PMAP_MAP_LOW; - else if (!pmap_initialized) { + if ((flags & MAPDEV_SETATTR) == 0) + return ((void *)(va + offset)); + } else if (!pmap_initialized) { va = 0; for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { ppim = pmap_preinit_mapping + i; @@ -5503,21 +5511,38 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mo for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { ppim = pmap_preinit_mapping + i; if (ppim->pa == pa && ppim->sz == size && - ppim->mode == mode) + (ppim->mode == mode || + (flags & MAPDEV_SETATTR) == 0)) return ((void *)(ppim->va + offset)); } va = kva_alloc(size); if (va == 0) panic("%s: Couldn't allocate KVA", __func__); } - for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) + for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) { + if ((flags & MAPDEV_SETATTR) == 0 && pmap_initialized) { + m = PHYS_TO_VM_PAGE(pa); + if (m != NULL && VM_PAGE_TO_PHYS(m) == pa) { + pmap_kenter_attr(va + tmpsize, pa + tmpsize, + m->md.pat_mode); + continue; + } + } pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); + } pmap_invalidate_range(kernel_pmap, va, va + tmpsize); pmap_invalidate_cache_range(va, va + size); return ((void *)(va + offset)); } void * +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) +{ + + return (pmap_mapdev_internal(pa, size, mode, MAPDEV_SETATTR)); +} + +void * pmap_mapdev(vm_paddr_t pa, vm_size_t size) { @@ -5528,7 +5553,7 @@ void * pmap_mapbios(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_attr(pa, size, PAT_WRITE_BACK)); + return (pmap_mapdev_internal(pa, size, PAT_WRITE_BACK, 0)); } void From owner-svn-src-stable-12@freebsd.org Sat Aug 24 12:51:47 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DFB4DF592; Sat, 24 Aug 2019 12:51:47 +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 46Fynv3Bn4z3D57; Sat, 24 Aug 2019 12:51:47 +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 4F6465557; Sat, 24 Aug 2019 12:51:47 +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 x7OCpljV034130; Sat, 24 Aug 2019 12:51:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7OCpkJF034125; Sat, 24 Aug 2019 12:51:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908241251.x7OCpkJF034125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 24 Aug 2019 12:51: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: r351451 - stable/12/lib/libthr/thread X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libthr/thread X-SVN-Commit-Revision: 351451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 24 Aug 2019 12:51:47 -0000 Author: kib Date: Sat Aug 24 12:51:46 2019 New Revision: 351451 URL: https://svnweb.freebsd.org/changeset/base/351451 Log: MFC r351349: Fix _pthread_cancel_enter() and _pthread_cancel_leave() jmptable entries. PR: 240022 Modified: stable/12/lib/libthr/thread/thr_cancel.c stable/12/lib/libthr/thread/thr_init.c stable/12/lib/libthr/thread/thr_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libthr/thread/thr_cancel.c ============================================================================== --- stable/12/lib/libthr/thread/thr_cancel.c Sat Aug 24 01:28:39 2019 (r351450) +++ stable/12/lib/libthr/thread/thr_cancel.c Sat Aug 24 12:51:46 2019 (r351451) @@ -43,6 +43,8 @@ __weak_reference(_thr_setcanceltype, pthread_setcancel __weak_reference(_thr_setcanceltype, _pthread_setcanceltype); __weak_reference(_Tthr_testcancel, pthread_testcancel); __weak_reference(_Tthr_testcancel, _pthread_testcancel); +__weak_reference(_Tthr_cancel_enter, _pthread_cancel_enter); +__weak_reference(_Tthr_cancel_leave, _pthread_cancel_leave); static inline void testcancel(struct pthread *curthread) @@ -173,13 +175,13 @@ _thr_cancel_leave(struct pthread *curthread, int mayca } void -_pthread_cancel_enter(int maycancel) +_Tthr_cancel_enter(int maycancel) { _thr_cancel_enter2(_get_curthread(), maycancel); } void -_pthread_cancel_leave(int maycancel) +_Tthr_cancel_leave(int maycancel) { _thr_cancel_leave(_get_curthread(), maycancel); } Modified: stable/12/lib/libthr/thread/thr_init.c ============================================================================== --- stable/12/lib/libthr/thread/thr_init.c Sat Aug 24 01:28:39 2019 (r351450) +++ stable/12/lib/libthr/thread/thr_init.c Sat Aug 24 12:51:46 2019 (r351451) @@ -265,8 +265,8 @@ static pthread_func_t jmp_table[][2] = { [PJT_TESTCANCEL] = {DUAL_ENTRY(_Tthr_testcancel)}, [PJT_CLEANUP_POP_IMP] = {DUAL_ENTRY(__thr_cleanup_pop_imp)}, [PJT_CLEANUP_PUSH_IMP] = {DUAL_ENTRY(__thr_cleanup_push_imp)}, - [PJT_CANCEL_ENTER] = {DUAL_ENTRY(_thr_cancel_enter)}, - [PJT_CANCEL_LEAVE] = {DUAL_ENTRY(_thr_cancel_leave)}, + [PJT_CANCEL_ENTER] = {DUAL_ENTRY(_Tthr_cancel_enter)}, + [PJT_CANCEL_LEAVE] = {DUAL_ENTRY(_Tthr_cancel_leave)}, [PJT_MUTEX_CONSISTENT] = {DUAL_ENTRY(_Tthr_mutex_consistent)}, [PJT_MUTEXATTR_GETROBUST] = {DUAL_ENTRY(_thr_mutexattr_getrobust)}, [PJT_MUTEXATTR_SETROBUST] = {DUAL_ENTRY(_thr_mutexattr_setrobust)}, Modified: stable/12/lib/libthr/thread/thr_private.h ============================================================================== --- stable/12/lib/libthr/thread/thr_private.h Sat Aug 24 01:28:39 2019 (r351450) +++ stable/12/lib/libthr/thread/thr_private.h Sat Aug 24 12:51:46 2019 (r351451) @@ -1028,6 +1028,8 @@ void __thr_cleanup_pop_imp(int); void _thr_cleanup_push(void (*)(void *), void *); void _thr_cleanup_pop(int); void _Tthr_testcancel(void); +void _Tthr_cancel_enter(int); +void _Tthr_cancel_leave(int); int _thr_cancel(pthread_t); int _thr_atfork(void (*)(void), void (*)(void), void (*)(void)); int _thr_attr_destroy(pthread_attr_t *);