From owner-svn-src-stable@freebsd.org Sun Nov 25 00:32:24 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C64113F8B6; Sun, 25 Nov 2018 00:32:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BEF86DBAE; Sun, 25 Nov 2018 00:32:24 +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 0D04915749; Sun, 25 Nov 2018 00:32:24 +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 wAP0WNoG047327; Sun, 25 Nov 2018 00:32:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAP0WNPF047326; Sun, 25 Nov 2018 00:32:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811250032.wAP0WNPF047326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 25 Nov 2018 00:32: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: r340915 - stable/12/sys/dev/proto X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/dev/proto X-SVN-Commit-Revision: 340915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BEF86DBAE X-Spamd-Result: default: False [1.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.302,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 00:32:24 -0000 Author: emaste Date: Sun Nov 25 00:32:23 2018 New Revision: 340915 URL: https://svnweb.freebsd.org/changeset/base/340915 Log: MFC r340771: proto: change device permissions to 0600 C Turt reports that the driver is not thread safe and may have exploitable races. Note that the proto device is intended for prototyping and development, and is not for use on production systems. From the man page: SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the proto driver is inherently insecure. It is not advisable to use this driver on a production machine. The proto device is not included in any of FreeBSD's kernel config files (although the module is built). The issues in the proto device still need to be fixed, and the device is inherently (and intentionally) insecure, but it might as well be limited to root only. admbugs: 782 Reported by: C Turt Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/proto/proto_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/proto/proto_core.c ============================================================================== --- stable/12/sys/dev/proto/proto_core.c Sat Nov 24 21:52:10 2018 (r340914) +++ stable/12/sys/dev/proto/proto_core.c Sun Nov 25 00:32:23 2018 (r340915) @@ -196,7 +196,7 @@ proto_attach(device_t dev) case SYS_RES_MEMORY: case SYS_RES_IOPORT: r->r_size = rman_get_size(r->r_d.res); - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); r->r_u.cdev->si_drv1 = sc; @@ -204,7 +204,7 @@ proto_attach(device_t dev) break; case PROTO_RES_PCICFG: r->r_size = 4096; - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/pcicfg", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; @@ -212,7 +212,7 @@ proto_attach(device_t dev) case PROTO_RES_BUSDMA: r->r_d.busdma = proto_busdma_attach(sc); r->r_size = 0; /* no read(2) nor write(2) */ - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/busdma", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; From owner-svn-src-stable@freebsd.org Sun Nov 25 00:34:01 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81CF113F984; Sun, 25 Nov 2018 00:34:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5923E6DD18; Sun, 25 Nov 2018 00:34:01 +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 3698615754; Sun, 25 Nov 2018 00:34:01 +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 wAP0Y092048262; Sun, 25 Nov 2018 00:34:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAP0Y0ea048261; Sun, 25 Nov 2018 00:34:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811250034.wAP0Y0ea048261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 25 Nov 2018 00:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340916 - stable/11/sys/dev/proto X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/proto X-SVN-Commit-Revision: 340916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5923E6DD18 X-Spamd-Result: default: False [1.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.302,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 00:34:02 -0000 Author: emaste Date: Sun Nov 25 00:34:00 2018 New Revision: 340916 URL: https://svnweb.freebsd.org/changeset/base/340916 Log: MFC r340771: proto: change device permissions to 0600 C Turt reports that the driver is not thread safe and may have exploitable races. Note that the proto device is intended for prototyping and development, and is not for use on production systems. From the man page: SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the proto driver is inherently insecure. It is not advisable to use this driver on a production machine. The proto device is not included in any of FreeBSD's kernel config files (although the module is built). The issues in the proto device still need to be fixed, and the device is inherently (and intentionally) insecure, but it might as well be limited to root only. admbugs: 782 Reported by: C Turt Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/proto/proto_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/proto/proto_core.c ============================================================================== --- stable/11/sys/dev/proto/proto_core.c Sun Nov 25 00:32:23 2018 (r340915) +++ stable/11/sys/dev/proto/proto_core.c Sun Nov 25 00:34:00 2018 (r340916) @@ -196,7 +196,7 @@ proto_attach(device_t dev) case SYS_RES_MEMORY: case SYS_RES_IOPORT: r->r_size = rman_get_size(r->r_d.res); - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); r->r_u.cdev->si_drv1 = sc; @@ -204,7 +204,7 @@ proto_attach(device_t dev) break; case PROTO_RES_PCICFG: r->r_size = 4096; - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/pcicfg", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; @@ -212,7 +212,7 @@ proto_attach(device_t dev) case PROTO_RES_BUSDMA: r->r_d.busdma = proto_busdma_attach(sc); r->r_size = 0; /* no read(2) nor write(2) */ - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/busdma", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; From owner-svn-src-stable@freebsd.org Sun Nov 25 17:39:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EF47113ADF7; Sun, 25 Nov 2018 17:39: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B733E6EF95; Sun, 25 Nov 2018 17:39: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 98CC11FF02; Sun, 25 Nov 2018 17:39:41 +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 wAPHdflE073427; Sun, 25 Nov 2018 17:39:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPHdfDA073426; Sun, 25 Nov 2018 17:39:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811251739.wAPHdfDA073426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Nov 2018 17:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340919 - stable/12/sys/amd64/ia32 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/amd64/ia32 X-SVN-Commit-Revision: 340919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B733E6EF95 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.13)[0.128,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 17:39:42 -0000 Author: markj Date: Sun Nov 25 17:39:41 2018 New Revision: 340919 URL: https://svnweb.freebsd.org/changeset/base/340919 Log: MFC r340772: Clear unused bytes in ia32_osendsig(). Modified: stable/12/sys/amd64/ia32/ia32_signal.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/12/sys/amd64/ia32/ia32_signal.c Sun Nov 25 11:15:01 2018 (r340918) +++ stable/12/sys/amd64/ia32/ia32_signal.c Sun Nov 25 17:39:41 2018 (r340919) @@ -364,12 +364,14 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo)); if (SIGISMEMBER(psp->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ sf.sf_arg2 = (register_t)&fp->sf_siginfo; sf.sf_siginfo.si_signo = sig; sf.sf_siginfo.si_code = ksi->ksi_code; sf.sf_ah = (uintptr_t)catcher; + sf.sf_addr = 0; } else { /* Old FreeBSD-style arguments. */ sf.sf_arg2 = ksi->ksi_code; From owner-svn-src-stable@freebsd.org Sun Nov 25 17:44:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C157A113B116; Sun, 25 Nov 2018 17:44:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6F26F448; Sun, 25 Nov 2018 17:44:31 +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 3B6CF200C0; Sun, 25 Nov 2018 17:44:31 +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 wAPHiVNA078210; Sun, 25 Nov 2018 17:44:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPHiVfW078209; Sun, 25 Nov 2018 17:44:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811251744.wAPHiVfW078209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Nov 2018 17:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340920 - stable/11/sys/amd64/ia32 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/amd64/ia32 X-SVN-Commit-Revision: 340920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F6F26F448 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.13)[0.128,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 17:44:31 -0000 Author: markj Date: Sun Nov 25 17:44:30 2018 New Revision: 340920 URL: https://svnweb.freebsd.org/changeset/base/340920 Log: MFC r340772: Clear unused bytes in ia32_osendsig(). Modified: stable/11/sys/amd64/ia32/ia32_signal.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/11/sys/amd64/ia32/ia32_signal.c Sun Nov 25 17:39:41 2018 (r340919) +++ stable/11/sys/amd64/ia32/ia32_signal.c Sun Nov 25 17:44:30 2018 (r340920) @@ -363,12 +363,14 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo)); if (SIGISMEMBER(psp->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ sf.sf_arg2 = (register_t)&fp->sf_siginfo; sf.sf_siginfo.si_signo = sig; sf.sf_siginfo.si_code = ksi->ksi_code; sf.sf_ah = (uintptr_t)catcher; + sf.sf_addr = 0; } else { /* Old FreeBSD-style arguments. */ sf.sf_arg2 = ksi->ksi_code; From owner-svn-src-stable@freebsd.org Sun Nov 25 17:46:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5643D113B20E; Sun, 25 Nov 2018 17:46:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8BAE6F5D6; Sun, 25 Nov 2018 17:46:39 +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 C3F40200C3; Sun, 25 Nov 2018 17:46:39 +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 wAPHkd2s078369; Sun, 25 Nov 2018 17:46:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPHkbWm078356; Sun, 25 Nov 2018 17:46:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811251746.wAPHkbWm078356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Nov 2018 17:46: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: r340921 - in stable/12/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 340921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8BAE6F5D6 X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_SHORT(0.15)[0.153,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 17:46:40 -0000 Author: markj Date: Sun Nov 25 17:46:37 2018 New Revision: 340921 URL: https://svnweb.freebsd.org/changeset/base/340921 Log: MFC r340783: Plug some networking sysctl leaks. Modified: stable/12/sys/kern/uipc_socket.c stable/12/sys/kern/uipc_usrreq.c stable/12/sys/netinet/in_pcb.c stable/12/sys/netinet/ip_divert.c stable/12/sys/netinet/raw_ip.c stable/12/sys/netinet/sctp_sysctl.c stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/udp_usrreq.c stable/12/sys/netinet6/ip6_mroute.c stable/12/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_socket.c ============================================================================== --- stable/12/sys/kern/uipc_socket.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/kern/uipc_socket.c Sun Nov 25 17:46:37 2018 (r340921) @@ -4007,6 +4007,7 @@ void sotoxsocket(struct socket *so, struct xsocket *xso) { + bzero(xso, sizeof(*xso)); xso->xso_len = sizeof *xso; xso->xso_so = (uintptr_t)so; xso->so_type = so->so_type; @@ -4025,8 +4026,6 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->so_incqlen = so->sol_incqlen; xso->so_qlimit = so->sol_qlimit; xso->so_oobmark = 0; - bzero(&xso->so_snd, sizeof(xso->so_snd)); - bzero(&xso->so_rcv, sizeof(xso->so_rcv)); } else { xso->so_state |= so->so_qstate; xso->so_qlen = xso->so_incqlen = xso->so_qlimit = 0; Modified: stable/12/sys/kern/uipc_usrreq.c ============================================================================== --- stable/12/sys/kern/uipc_usrreq.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/kern/uipc_usrreq.c Sun Nov 25 17:46:37 2018 (r340921) @@ -1812,7 +1812,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) /* * OK, now we're committed to doing something. */ - xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK); + xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO); UNP_LINK_RLOCK(); gencnt = unp_gencnt; n = unp_count; Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/in_pcb.c Sun Nov 25 17:46:37 2018 (r340921) @@ -2883,11 +2883,10 @@ void in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi) { + bzero(xi, sizeof(*xi)); xi->xi_len = sizeof(struct xinpcb); if (inp->inp_socket) sotoxsocket(inp->inp_socket, &xi->xi_socket); - else - bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; xi->inp_ppcb = (uintptr_t)inp->inp_ppcb; Modified: stable/12/sys/netinet/ip_divert.c ============================================================================== --- stable/12/sys/netinet/ip_divert.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/ip_divert.c Sun Nov 25 17:46:37 2018 (r340921) @@ -664,6 +664,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/12/sys/netinet/raw_ip.c ============================================================================== --- stable/12/sys/netinet/raw_ip.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/raw_ip.c Sun Nov 25 17:46:37 2018 (r340921) @@ -1060,6 +1060,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) n = V_ripcbinfo.ipi_count; INP_INFO_WUNLOCK(&V_ripcbinfo); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/12/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/12/sys/netinet/sctp_sysctl.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/sctp_sysctl.c Sun Nov 25 17:46:37 2018 (r340921) @@ -395,6 +395,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); } + memset(&xinpcb, 0, sizeof(xinpcb)); + memset(&xstcb, 0, sizeof(xstcb)); + memset(&xraddr, 0, sizeof(xraddr)); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/tcp_subr.c Sun Nov 25 17:46:37 2018 (r340921) @@ -556,6 +556,7 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) cnt++; #endif if (req->oldptr != NULL) { + bzero(&tfi, sizeof(tfi)); tfi.tfi_refcnt = f->tf_fb->tfb_refcnt; tfi.tfi_id = f->tf_fb->tfb_id; (void)strncpy(tfi.tfi_alias, f->tf_name, @@ -2154,6 +2155,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n + m; xig.xig_gen = gencnt; @@ -3215,8 +3217,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x struct tcpcb *tp = intotcpcb(inp); sbintime_t now; + bzero(xt, sizeof(*xt)); if (inp->inp_flags & INP_TIMEWAIT) { - bzero(xt, sizeof(struct xtcpcb)); xt->t_state = TCPS_TIME_WAIT; } else { xt->t_state = tp->t_state; @@ -3244,7 +3246,6 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); - bzero(xt->xt_logid, TCP_LOG_ID_LEN); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: stable/12/sys/netinet/udp_usrreq.c ============================================================================== --- stable/12/sys/netinet/udp_usrreq.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet/udp_usrreq.c Sun Nov 25 17:46:37 2018 (r340921) @@ -887,6 +887,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/12/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/12/sys/netinet6/ip6_mroute.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/netinet6/ip6_mroute.c Sun Nov 25 17:46:37 2018 (r340921) @@ -203,7 +203,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS) struct mif6_sctl *out; int error; - out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK); + out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, + M_WAITOK | M_ZERO); for (int i = 0; i < MAXMIFS; i++) { out[i].m6_flags = mif6table[i].m6_flags; out[i].m6_rate_limit = mif6table[i].m6_rate_limit; Modified: stable/12/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- stable/12/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 17:44:30 2018 (r340920) +++ stable/12/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 17:46:37 2018 (r340921) @@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = 0; From owner-svn-src-stable@freebsd.org Sun Nov 25 18:00:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DCFC113B9CB; Sun, 25 Nov 2018 18:00:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B3A6FF70; Sun, 25 Nov 2018 18:00: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 8AD2B20285; Sun, 25 Nov 2018 18:00:52 +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 wAPI0qpA084020; Sun, 25 Nov 2018 18:00:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPI0ojq084011; Sun, 25 Nov 2018 18:00:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811251800.wAPI0ojq084011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Nov 2018 18:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340923 - in stable/11/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 340923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5B3A6FF70 X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.15)[0.153,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 18:00:55 -0000 Author: markj Date: Sun Nov 25 18:00:50 2018 New Revision: 340923 URL: https://svnweb.freebsd.org/changeset/base/340923 Log: MFC r340783: Plug some networking sysctl leaks. Modified: stable/11/sys/kern/uipc_socket.c stable/11/sys/kern/uipc_usrreq.c stable/11/sys/netinet/ip_divert.c stable/11/sys/netinet/raw_ip.c stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/tcp_subr.c stable/11/sys/netinet/udp_usrreq.c stable/11/sys/netinet6/ip6_mroute.c stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_socket.c ============================================================================== --- stable/11/sys/kern/uipc_socket.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/kern/uipc_socket.c Sun Nov 25 18:00:50 2018 (r340923) @@ -3597,6 +3597,7 @@ void sotoxsocket(struct socket *so, struct xsocket *xso) { + bzero(xso, sizeof(*xso)); xso->xso_len = sizeof *xso; xso->xso_so = so; xso->so_type = so->so_type; Modified: stable/11/sys/kern/uipc_usrreq.c ============================================================================== --- stable/11/sys/kern/uipc_usrreq.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/kern/uipc_usrreq.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1606,7 +1606,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) /* * OK, now we're committed to doing something. */ - xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK); + xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO); UNP_LIST_LOCK(); gencnt = unp_gencnt; n = unp_count; Modified: stable/11/sys/netinet/ip_divert.c ============================================================================== --- stable/11/sys/netinet/ip_divert.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/ip_divert.c Sun Nov 25 18:00:50 2018 (r340923) @@ -667,6 +667,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/raw_ip.c ============================================================================== --- stable/11/sys/netinet/raw_ip.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/raw_ip.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1044,6 +1044,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) n = V_ripcbinfo.ipi_count; INP_INFO_RUNLOCK(&V_ripcbinfo); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/sctp_sysctl.c Sun Nov 25 18:00:50 2018 (r340923) @@ -393,6 +393,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); } + memset(&xinpcb, 0, sizeof(xinpcb)); + memset(&xstcb, 0, sizeof(xstcb)); + memset(&xraddr, 0, sizeof(xraddr)); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/tcp_subr.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1710,6 +1710,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n + m; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet/udp_usrreq.c ============================================================================== --- stable/11/sys/netinet/udp_usrreq.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet/udp_usrreq.c Sun Nov 25 18:00:50 2018 (r340923) @@ -849,6 +849,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: stable/11/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/11/sys/netinet6/ip6_mroute.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/netinet6/ip6_mroute.c Sun Nov 25 18:00:50 2018 (r340923) @@ -202,7 +202,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS) struct mif6_sctl *out; int error; - out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK); + out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, + M_WAITOK | M_ZERO); for (int i = 0; i < MAXMIFS; i++) { out[i].m6_flags = mif6table[i].m6_flags; out[i].m6_rate_limit = mif6table[i].m6_rate_limit; Modified: stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 17:56:49 2018 (r340922) +++ stable/11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 25 18:00:50 2018 (r340923) @@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = 0; From owner-svn-src-stable@freebsd.org Mon Nov 26 10:47:01 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 935A4115478E; Mon, 26 Nov 2018 10:47:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38D1C6AF2A; Mon, 26 Nov 2018 10:47:01 +0000 (UTC) (envelope-from eugen@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 19C842996; Mon, 26 Nov 2018 10:47:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQAl0Rb004976; Mon, 26 Nov 2018 10:47:00 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQAl0Fe004975; Mon, 26 Nov 2018 10:47:00 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261047.wAQAl0Fe004975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 10:47: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: r340934 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38D1C6AF2A X-Spamd-Result: default: False [0.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_HAM_SHORT(-0.29)[-0.291,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 10:47:01 -0000 Author: eugen Date: Mon Nov 26 10:47:00 2018 New Revision: 340934 URL: https://svnweb.freebsd.org/changeset/base/340934 Log: MFC r339807: Prevent multicast code from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/12/sys/netinet/in_mcast.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_mcast.c ============================================================================== --- stable/12/sys/netinet/in_mcast.c Mon Nov 26 08:16:33 2018 (r340933) +++ stable/12/sys/netinet/in_mcast.c Mon Nov 26 10:47:00 2018 (r340934) @@ -1444,6 +1444,7 @@ static int inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) { struct group_source_req gsr; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -1481,9 +1482,11 @@ inp_block_unblock_source(struct inpcb *inp, struct soc ssa->sin.sin_len = sizeof(struct sockaddr_in); ssa->sin.sin_addr = mreqs.imr_sourceaddr; - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } if (sopt->sopt_name == IP_BLOCK_SOURCE) doblock = 1; @@ -1969,7 +1972,6 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop * * Returns NULL if no ifp could be found. * - * SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP. * FUTURE: Implement IPv4 source-address selection. */ static struct ifnet * @@ -1987,7 +1989,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, ifp = NULL; if (!in_nullhost(ina)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(ina, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { fibnum = inp ? inp->inp_inc.inc_fibnum : 0; if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0) @@ -2332,6 +2336,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop { struct group_source_req gsr; struct ip_mreq_source mreqs; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -2390,9 +2395,11 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * XXX NOTE WELL: The RFC 3678 API is preferred because * using an IPv4 address as a key is racy. */ - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", __func__, ntohl(mreqs.imr_interface.s_addr), ifp); @@ -2560,6 +2567,7 @@ out_inp_locked: static int inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) { + struct rm_priotracker in_ifa_tracker; struct in_addr addr; struct ip_mreqn mreqn; struct ifnet *ifp; @@ -2598,7 +2606,9 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt if (in_nullhost(addr)) { ifp = NULL; } else { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(addr, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ifp == NULL) return (EADDRNOTAVAIL); } From owner-svn-src-stable@freebsd.org Mon Nov 26 10:50:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E50DA1154986; Mon, 26 Nov 2018 10:50:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C68E6B1F6; Mon, 26 Nov 2018 10:50:50 +0000 (UTC) (envelope-from eugen@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 6E66529AF; Mon, 26 Nov 2018 10:50:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQAooqe005226; Mon, 26 Nov 2018 10:50:50 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQAooag005225; Mon, 26 Nov 2018 10:50:50 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261050.wAQAooag005225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 10:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340935 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 340935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C68E6B1F6 X-Spamd-Result: default: False [0.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.291,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 10:50:51 -0000 Author: eugen Date: Mon Nov 26 10:50:50 2018 New Revision: 340935 URL: https://svnweb.freebsd.org/changeset/base/340935 Log: MFC r339807: Prevent multicast code from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/11/sys/netinet/in_mcast.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_mcast.c ============================================================================== --- stable/11/sys/netinet/in_mcast.c Mon Nov 26 10:47:00 2018 (r340934) +++ stable/11/sys/netinet/in_mcast.c Mon Nov 26 10:50:50 2018 (r340935) @@ -1339,6 +1339,7 @@ static int inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) { struct group_source_req gsr; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -1376,9 +1377,11 @@ inp_block_unblock_source(struct inpcb *inp, struct soc ssa->sin.sin_len = sizeof(struct sockaddr_in); ssa->sin.sin_addr = mreqs.imr_sourceaddr; - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } if (sopt->sopt_name == IP_BLOCK_SOURCE) doblock = 1; @@ -1874,7 +1877,6 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop * * Returns NULL if no ifp could be found. * - * SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP. * FUTURE: Implement IPv4 source-address selection. */ static struct ifnet * @@ -1892,7 +1894,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, ifp = NULL; if (!in_nullhost(ina)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(ina, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { fibnum = inp ? inp->inp_inc.inc_fibnum : 0; if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0) @@ -2224,6 +2228,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop { struct group_source_req gsr; struct ip_mreq_source mreqs; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -2282,9 +2287,11 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * XXX NOTE WELL: The RFC 3678 API is preferred because * using an IPv4 address as a key is racy. */ - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", __func__, ntohl(mreqs.imr_interface.s_addr), ifp); @@ -2444,6 +2451,7 @@ out_inp_locked: static int inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) { + struct rm_priotracker in_ifa_tracker; struct in_addr addr; struct ip_mreqn mreqn; struct ifnet *ifp; @@ -2482,7 +2490,9 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt if (in_nullhost(addr)) { ifp = NULL; } else { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(addr, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ifp == NULL) return (EADDRNOTAVAIL); } From owner-svn-src-stable@freebsd.org Mon Nov 26 10:51:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E7C1154B3E; Mon, 26 Nov 2018 10:51:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5C66B505; Mon, 26 Nov 2018 10:51:40 +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 1F8572AE7; Mon, 26 Nov 2018 10:51:40 +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 wAQApdSR008320; Mon, 26 Nov 2018 10:51:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQApdCQ008319; Mon, 26 Nov 2018 10:51:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811261051.wAQApdCQ008319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Nov 2018 10:51: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: r340936 - stable/12/libexec/rtld-elf/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E5C66B505 X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 10:51:40 -0000 Author: kib Date: Mon Nov 26 10:51:39 2018 New Revision: 340936 URL: https://svnweb.freebsd.org/changeset/base/340936 Log: MFC r340842: Silence gcc warnings. Modified: stable/12/libexec/rtld-elf/amd64/reloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/12/libexec/rtld-elf/amd64/reloc.c Mon Nov 26 10:50:50 2018 (r340935) +++ stable/12/libexec/rtld-elf/amd64/reloc.c Mon Nov 26 10:51:39 2018 (r340936) @@ -138,6 +138,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int int r; r = -1; + symval = 0; + def = NULL; + /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). From owner-svn-src-stable@freebsd.org Mon Nov 26 10:53:18 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B811154C49; Mon, 26 Nov 2018 10:53:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97DF06B7C4; Mon, 26 Nov 2018 10:53:17 +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 791E42B2E; Mon, 26 Nov 2018 10:53:17 +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 wAQArHOh010303; Mon, 26 Nov 2018 10:53:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQArHuT010302; Mon, 26 Nov 2018 10:53:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811261053.wAQArHuT010302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Nov 2018 10:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340937 - stable/11/libexec/rtld-elf/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 97DF06B7C4 X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 10:53:18 -0000 Author: kib Date: Mon Nov 26 10:53:17 2018 New Revision: 340937 URL: https://svnweb.freebsd.org/changeset/base/340937 Log: MFC r340842: Silence gcc warnings. Modified: stable/11/libexec/rtld-elf/amd64/reloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/amd64/reloc.c Mon Nov 26 10:51:39 2018 (r340936) +++ stable/11/libexec/rtld-elf/amd64/reloc.c Mon Nov 26 10:53:17 2018 (r340937) @@ -136,6 +136,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int int r; r = -1; + symval = 0; + def = NULL; + /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). From owner-svn-src-stable@freebsd.org Mon Nov 26 11:05:27 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6220115508E; Mon, 26 Nov 2018 11:05:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B69F6C5DC; Mon, 26 Nov 2018 11:05:27 +0000 (UTC) (envelope-from eugen@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 2CB342CD9; Mon, 26 Nov 2018 11:05:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB5RVh015547; Mon, 26 Nov 2018 11:05:27 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB5RCZ015546; Mon, 26 Nov 2018 11:05:27 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261105.wAQB5RCZ015546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:05:27 +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: r340940 - stable/12/sbin/route X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/route X-SVN-Commit-Revision: 340940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B69F6C5DC X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:05:27 -0000 Author: eugen Date: Mon Nov 26 11:05:26 2018 New Revision: 340940 URL: https://svnweb.freebsd.org/changeset/base/340940 Log: MFC r339811: route(8): correctly return exit status when "-q" flag is used. Previously, route returned 1 in case of error properly signalling failure but "route -q" it returned 0 for same case. Fix it. PR: 186333 Modified: stable/12/sbin/route/route.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/route/route.c ============================================================================== --- stable/12/sbin/route/route.c Mon Nov 26 11:04:35 2018 (r340939) +++ stable/12/sbin/route/route.c Mon Nov 26 11:05:26 2018 (r340940) @@ -1050,10 +1050,13 @@ newroute(int argc, char **argv) } printf("\n"); } + } - fibnum = 0; - TAILQ_FOREACH(fl, &fibl_head, fl_next) { - if (fl->fl_error != 0) { + fibnum = 0; + TAILQ_FOREACH(fl, &fibl_head, fl_next) { + if (fl->fl_error != 0) { + error = 1; + if (!qflag) { printf("%s %s %s", cmd, (nrflags & F_ISHOST) ? "host" : "net", dest); if (*gateway) @@ -1087,7 +1090,6 @@ newroute(int argc, char **argv) break; } printf(": %s\n", errmsg); - error = 1; } } } From owner-svn-src-stable@freebsd.org Mon Nov 26 11:06:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF38D115512D; Mon, 26 Nov 2018 11:06:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2366C79E; Mon, 26 Nov 2018 11:06:40 +0000 (UTC) (envelope-from hselasky@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 2FA242CDB; Mon, 26 Nov 2018 11:06:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB6eab015677; Mon, 26 Nov 2018 11:06:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB6ecl015676; Mon, 26 Nov 2018 11:06:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261106.wAQB6ecl015676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:06: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: r340941 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F2366C79E X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:06:40 -0000 Author: hselasky Date: Mon Nov 26 11:06:39 2018 New Revision: 340941 URL: https://svnweb.freebsd.org/changeset/base/340941 Log: MFC r340479: Implement ktime_get_ts64() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Mon Nov 26 11:05:26 2018 (r340940) +++ stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Mon Nov 26 11:06:39 2018 (r340941) @@ -176,6 +176,7 @@ timeval_to_ktime(struct timeval tv) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) +#define ktime_get_ts64(ts) ktime_get_ts(ts) static inline int64_t ktime_get_ns(void) From owner-svn-src-stable@freebsd.org Mon Nov 26 11:07:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132CD115519F; Mon, 26 Nov 2018 11:07:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A70886C8F6; Mon, 26 Nov 2018 11:07:43 +0000 (UTC) (envelope-from hselasky@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 889DA2CDC; Mon, 26 Nov 2018 11:07:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB7hZP015780; Mon, 26 Nov 2018 11:07:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB7hp4015779; Mon, 26 Nov 2018 11:07:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261107.wAQB7hp4015779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340942 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A70886C8F6 X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.62)[0.623,0]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:07:44 -0000 Author: hselasky Date: Mon Nov 26 11:07:43 2018 New Revision: 340942 URL: https://svnweb.freebsd.org/changeset/base/340942 Log: MFC r340479: Implement ktime_get_ts64() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Mon Nov 26 11:06:39 2018 (r340941) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Mon Nov 26 11:07:43 2018 (r340942) @@ -176,6 +176,7 @@ timeval_to_ktime(struct timeval tv) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) +#define ktime_get_ts64(ts) ktime_get_ts(ts) static inline int64_t ktime_get_ns(void) From owner-svn-src-stable@freebsd.org Mon Nov 26 11:08:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48242115521F; Mon, 26 Nov 2018 11:08:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDF416CA36; Mon, 26 Nov 2018 11:08:38 +0000 (UTC) (envelope-from eugen@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 BE9692CDD; Mon, 26 Nov 2018 11:08:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB8cX7015888; Mon, 26 Nov 2018 11:08:38 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB8ccV015887; Mon, 26 Nov 2018 11:08:38 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261108.wAQB8ccV015887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340943 - stable/11/sbin/route X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/route X-SVN-Commit-Revision: 340943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDF416CA36 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:08:39 -0000 Author: eugen Date: Mon Nov 26 11:08:38 2018 New Revision: 340943 URL: https://svnweb.freebsd.org/changeset/base/340943 Log: MFC r339811: route(8): correctly return exit status when "-q" flag is used. Previously, route returned 1 in case of error properly signalling failure but "route -q" returned 0 in the same case. Fix it. PR: 186333 Modified: stable/11/sbin/route/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/route/route.c ============================================================================== --- stable/11/sbin/route/route.c Mon Nov 26 11:07:43 2018 (r340942) +++ stable/11/sbin/route/route.c Mon Nov 26 11:08:38 2018 (r340943) @@ -1047,10 +1047,13 @@ newroute(int argc, char **argv) } printf("\n"); } + } - fibnum = 0; - TAILQ_FOREACH(fl, &fibl_head, fl_next) { - if (fl->fl_error != 0) { + fibnum = 0; + TAILQ_FOREACH(fl, &fibl_head, fl_next) { + if (fl->fl_error != 0) { + error = 1; + if (!qflag) { printf("%s %s %s", cmd, (nrflags & F_ISHOST) ? "host" : "net", dest); if (*gateway) @@ -1084,7 +1087,6 @@ newroute(int argc, char **argv) break; } printf(": %s\n", errmsg); - error = 1; } } } From owner-svn-src-stable@freebsd.org Mon Nov 26 11:08:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C63D115526B; Mon, 26 Nov 2018 11:08:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8C586CB58; Mon, 26 Nov 2018 11:08:55 +0000 (UTC) (envelope-from hselasky@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 CA3FF2CDF; Mon, 26 Nov 2018 11:08:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB8te0015955; Mon, 26 Nov 2018 11:08:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB8tf8015954; Mon, 26 Nov 2018 11:08:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261108.wAQB8tf8015954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340944 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8C586CB58 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:08:56 -0000 Author: hselasky Date: Mon Nov 26 11:08:55 2018 New Revision: 340944 URL: https://svnweb.freebsd.org/changeset/base/340944 Log: MFC r340480: Define asm macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Nov 26 11:08:38 2018 (r340943) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Nov 26 11:08:55 2018 (r340944) @@ -138,6 +138,8 @@ #define printk(...) printf(__VA_ARGS__) #define vprintk(f, a) vprintf(f, a) +#define asm __asm + extern void linux_dump_stack(void); #define dump_stack() linux_dump_stack() From owner-svn-src-stable@freebsd.org Mon Nov 26 11:09:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD8211552DD; Mon, 26 Nov 2018 11:09:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA066CCBF; Mon, 26 Nov 2018 11:09:52 +0000 (UTC) (envelope-from hselasky@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 2121E2CE0; Mon, 26 Nov 2018 11:09:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB9quq016052; Mon, 26 Nov 2018 11:09:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB9qRu016051; Mon, 26 Nov 2018 11:09:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261109.wAQB9qRu016051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340945 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3EA066CCBF X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:09:52 -0000 Author: hselasky Date: Mon Nov 26 11:09:51 2018 New Revision: 340945 URL: https://svnweb.freebsd.org/changeset/base/340945 Log: MFC r340480: Define asm macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Nov 26 11:08:55 2018 (r340944) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Nov 26 11:09:51 2018 (r340945) @@ -138,6 +138,8 @@ #define printk(...) printf(__VA_ARGS__) #define vprintk(f, a) vprintf(f, a) +#define asm __asm + extern void linux_dump_stack(void); #define dump_stack() linux_dump_stack() From owner-svn-src-stable@freebsd.org Mon Nov 26 11:11:03 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E68E11553D2; Mon, 26 Nov 2018 11:11:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5F0E6CEB2; Mon, 26 Nov 2018 11:11:02 +0000 (UTC) (envelope-from hselasky@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 B6CF52DF7; Mon, 26 Nov 2018 11:11:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBB2uO016999; Mon, 26 Nov 2018 11:11:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBB2V1016998; Mon, 26 Nov 2018 11:11:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261111.wAQBB2V1016998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:11: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: r340946 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5F0E6CEB2 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:11:03 -0000 Author: hselasky Date: Mon Nov 26 11:11:02 2018 New Revision: 340946 URL: https://svnweb.freebsd.org/changeset/base/340946 Log: MFC r340621: Be more verbose when a sysctl fails to unregister. Print name of sysctl in question. Sponsored by: Mellanox Technologies Modified: stable/12/sys/kern/kern_sysctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sysctl.c ============================================================================== --- stable/12/sys/kern/kern_sysctl.c Mon Nov 26 11:09:51 2018 (r340945) +++ stable/12/sys/kern/kern_sysctl.c Mon Nov 26 11:11:02 2018 (r340946) @@ -565,8 +565,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) * being unloaded afterwards. It should not be a panic() * for normal use. */ - if (error) - printf("%s: failed to unregister sysctl\n", __func__); + if (error) { + printf("%s: failed(%d) to unregister sysctl(%s)\n", + __func__, error, oidp->oid_name); + } } /* Initialize a new context to keep track of dynamically added sysctls. */ From owner-svn-src-stable@freebsd.org Mon Nov 26 11:11:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C60441155436; Mon, 26 Nov 2018 11:11:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6965B6D17F; Mon, 26 Nov 2018 11:11:54 +0000 (UTC) (envelope-from hselasky@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 4B9D92E3D; Mon, 26 Nov 2018 11:11:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBBs5S017789; Mon, 26 Nov 2018 11:11:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBBs8F017788; Mon, 26 Nov 2018 11:11:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261111.wAQBBs8F017788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340947 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6965B6D17F X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:11:55 -0000 Author: hselasky Date: Mon Nov 26 11:11:53 2018 New Revision: 340947 URL: https://svnweb.freebsd.org/changeset/base/340947 Log: MFC r340621: Be more verbose when a sysctl fails to unregister. Print name of sysctl in question. Sponsored by: Mellanox Technologies Modified: stable/11/sys/kern/kern_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sysctl.c ============================================================================== --- stable/11/sys/kern/kern_sysctl.c Mon Nov 26 11:11:02 2018 (r340946) +++ stable/11/sys/kern/kern_sysctl.c Mon Nov 26 11:11:53 2018 (r340947) @@ -479,8 +479,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) * being unloaded afterwards. It should not be a panic() * for normal use. */ - if (error) - printf("%s: failed to unregister sysctl\n", __func__); + if (error) { + printf("%s: failed(%d) to unregister sysctl(%s)\n", + __func__, error, oidp->oid_name); + } } /* Initialize a new context to keep track of dynamically added sysctls. */ From owner-svn-src-stable@freebsd.org Mon Nov 26 11:13:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 258F611555C2; Mon, 26 Nov 2018 11:13:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C12F86D34E; Mon, 26 Nov 2018 11:13:11 +0000 (UTC) (envelope-from hselasky@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 A39212E71; Mon, 26 Nov 2018 11:13:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBDB3D021024; Mon, 26 Nov 2018 11:13:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBDBiE021023; Mon, 26 Nov 2018 11:13:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261113.wAQBDBiE021023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340948 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C12F86D34E X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:13:12 -0000 Author: hselasky Date: Mon Nov 26 11:13:11 2018 New Revision: 340948 URL: https://svnweb.freebsd.org/changeset/base/340948 Log: MFC r340622: Minor code factoring. No functional change. Sponsored by: Mellanox Technologies Modified: stable/12/sys/kern/kern_sysctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sysctl.c ============================================================================== --- stable/12/sys/kern/kern_sysctl.c Mon Nov 26 11:11:53 2018 (r340947) +++ stable/12/sys/kern/kern_sysctl.c Mon Nov 26 11:13:11 2018 (r340948) @@ -546,10 +546,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) int error; SYSCTL_ASSERT_WLOCKED(); - error = ENOENT; if (oidp->oid_number == OID_AUTO) { error = EINVAL; } else { + error = ENOENT; SLIST_FOREACH(p, oidp->oid_parent, oid_link) { if (p == oidp) { SLIST_REMOVE(oidp->oid_parent, oidp, From owner-svn-src-stable@freebsd.org Mon Nov 26 11:14:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E65B2115565E; Mon, 26 Nov 2018 11:14:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83EED6D57A; Mon, 26 Nov 2018 11:14:07 +0000 (UTC) (envelope-from hselasky@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 AABB12E74; Mon, 26 Nov 2018 11:14:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBE6tN021257; Mon, 26 Nov 2018 11:14:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBE68A021256; Mon, 26 Nov 2018 11:14:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811261114.wAQBE68A021256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Nov 2018 11:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340949 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83EED6D57A X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:14:08 -0000 Author: hselasky Date: Mon Nov 26 11:14:06 2018 New Revision: 340949 URL: https://svnweb.freebsd.org/changeset/base/340949 Log: MFC r340622: Minor code factoring. No functional change. Sponsored by: Mellanox Technologies Modified: stable/11/sys/kern/kern_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sysctl.c ============================================================================== --- stable/11/sys/kern/kern_sysctl.c Mon Nov 26 11:13:11 2018 (r340948) +++ stable/11/sys/kern/kern_sysctl.c Mon Nov 26 11:14:06 2018 (r340949) @@ -460,10 +460,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) int error; SYSCTL_ASSERT_WLOCKED(); - error = ENOENT; if (oidp->oid_number == OID_AUTO) { error = EINVAL; } else { + error = ENOENT; SLIST_FOREACH(p, oidp->oid_parent, oid_link) { if (p == oidp) { SLIST_REMOVE(oidp->oid_parent, oidp, From owner-svn-src-stable@freebsd.org Mon Nov 26 11:16:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563F41155745; Mon, 26 Nov 2018 11:16:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECC716D749; Mon, 26 Nov 2018 11:15:59 +0000 (UTC) (envelope-from eugen@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 CDA732E77; Mon, 26 Nov 2018 11:15:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBFxH2021396; Mon, 26 Nov 2018 11:15:59 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBFx7Q021395; Mon, 26 Nov 2018 11:15:59 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261115.wAQBFx7Q021395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:15: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: r340950 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECC716D749 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:16:00 -0000 Author: eugen Date: Mon Nov 26 11:15:59 2018 New Revision: 340950 URL: https://svnweb.freebsd.org/changeset/base/340950 Log: MFC r339806: Prevent stf(4) from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/12/sys/net/if_stf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_stf.c ============================================================================== --- stable/12/sys/net/if_stf.c Mon Nov 26 11:14:06 2018 (r340949) +++ stable/12/sys/net/if_stf.c Mon Nov 26 11:15:59 2018 (r340950) @@ -367,6 +367,7 @@ stf_encapcheck(const struct mbuf *m, int off, int prot static int stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) { + struct rm_priotracker in_ifa_tracker; struct ifaddr *ia; struct in_ifaddr *ia4; struct in6_ifaddr *ia6; @@ -382,9 +383,11 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *add continue; bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) break; + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ia4 == NULL) continue; From owner-svn-src-stable@freebsd.org Mon Nov 26 11:17:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F1F11557C3; Mon, 26 Nov 2018 11:17:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 125CF6D8AE; Mon, 26 Nov 2018 11:17:13 +0000 (UTC) (envelope-from eugen@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 E732D2E79; Mon, 26 Nov 2018 11:17:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBHClO021514; Mon, 26 Nov 2018 11:17:12 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBHCsK021513; Mon, 26 Nov 2018 11:17:12 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261117.wAQBHCsK021513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340951 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 340951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 125CF6D8AE X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:17:13 -0000 Author: eugen Date: Mon Nov 26 11:17:12 2018 New Revision: 340951 URL: https://svnweb.freebsd.org/changeset/base/340951 Log: MFC r339806: Prevent stf(4) from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/11/sys/net/if_stf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_stf.c ============================================================================== --- stable/11/sys/net/if_stf.c Mon Nov 26 11:15:59 2018 (r340950) +++ stable/11/sys/net/if_stf.c Mon Nov 26 11:17:12 2018 (r340951) @@ -372,6 +372,7 @@ stf_encapcheck(const struct mbuf *m, int off, int prot static int stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) { + struct rm_priotracker in_ifa_tracker; struct ifaddr *ia; struct in_ifaddr *ia4; struct in6_ifaddr *ia6; @@ -387,9 +388,11 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *add continue; bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) break; + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ia4 == NULL) continue; From owner-svn-src-stable@freebsd.org Mon Nov 26 11:20:26 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3EE115590E; Mon, 26 Nov 2018 11:20:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2FE26DAF6; Mon, 26 Nov 2018 11:20:25 +0000 (UTC) (envelope-from eugen@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 9451A2E81; Mon, 26 Nov 2018 11:20:25 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBKPxW021732; Mon, 26 Nov 2018 11:20:25 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBKPlE021731; Mon, 26 Nov 2018 11:20:25 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261120.wAQBKPlE021731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:20: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: r340952 - stable/12/sbin/mount_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/mount_msdosfs X-SVN-Commit-Revision: 340952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2FE26DAF6 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:20:26 -0000 Author: eugen Date: Mon Nov 26 11:20:25 2018 New Revision: 340952 URL: https://svnweb.freebsd.org/changeset/base/340952 Log: MFC r339816: mount_msdosfs mount_msdosfs: do not fail mounts requiring locale name conversion table that is already present in a kernel statically. For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16951 Modified: stable/12/sbin/mount_msdosfs/mount_msdosfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- stable/12/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:17:12 2018 (r340951) +++ stable/12/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:20:25 2018 (r340952) @@ -46,6 +46,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -308,17 +309,17 @@ set_charset(struct iovec **iov, int *iovlen, const cha build_iovec_argf(iov, iovlen, "cs_win", ENCODING_UNICODE); error = kiconv_add_xlat16_cspairs(ENCODING_UNICODE, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); if (cs_dos != NULL) { error = kiconv_add_xlat16_cspairs(cs_dos, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); } else { build_iovec_argf(iov, iovlen, "cs_dos", cs_local); error = kiconv_add_xlat16_cspair(cs_local, cs_local, KICONV_FROM_UPPER | KICONV_LOWER); - if (error) + if (error && errno != EEXIST) return (-1); } From owner-svn-src-stable@freebsd.org Mon Nov 26 11:22:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95E311559F2; Mon, 26 Nov 2018 11:22:05 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB4B6DEEE; Mon, 26 Nov 2018 11:22:05 +0000 (UTC) (envelope-from eugen@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 30ADE2FE5; Mon, 26 Nov 2018 11:22:05 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBM5Yc026283; Mon, 26 Nov 2018 11:22:05 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBM5bA026282; Mon, 26 Nov 2018 11:22:05 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261122.wAQBM5bA026282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340953 - stable/11/sbin/mount_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/mount_msdosfs X-SVN-Commit-Revision: 340953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FB4B6DEEE X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:22:05 -0000 Author: eugen Date: Mon Nov 26 11:22:04 2018 New Revision: 340953 URL: https://svnweb.freebsd.org/changeset/base/340953 Log: MFC r339816: mount_msdosfs mount_msdosfs: do not fail mounts requiring locale name conversion table that is already present in a kernel statically. For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16951 Modified: stable/11/sbin/mount_msdosfs/mount_msdosfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- stable/11/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:20:25 2018 (r340952) +++ stable/11/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:22:04 2018 (r340953) @@ -46,6 +46,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -308,17 +309,17 @@ set_charset(struct iovec **iov, int *iovlen, const cha build_iovec_argf(iov, iovlen, "cs_win", ENCODING_UNICODE); error = kiconv_add_xlat16_cspairs(ENCODING_UNICODE, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); if (cs_dos != NULL) { error = kiconv_add_xlat16_cspairs(cs_dos, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); } else { build_iovec_argf(iov, iovlen, "cs_dos", cs_local); error = kiconv_add_xlat16_cspair(cs_local, cs_local, KICONV_FROM_UPPER | KICONV_LOWER); - if (error) + if (error && errno != EEXIST) return (-1); } From owner-svn-src-stable@freebsd.org Mon Nov 26 11:23:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB051155BD1; Mon, 26 Nov 2018 11:23:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1744C6E0BC; Mon, 26 Nov 2018 11:23:02 +0000 (UTC) (envelope-from eugen@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 EDDD1300D; Mon, 26 Nov 2018 11:23:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBN1R9026370; Mon, 26 Nov 2018 11:23:01 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBN1KK026368; Mon, 26 Nov 2018 11:23:01 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261123.wAQBN1KK026368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340954 - stable/10/sbin/mount_msdosfs X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sbin/mount_msdosfs X-SVN-Commit-Revision: 340954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1744C6E0BC X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_HAM_SHORT(-0.29)[-0.294,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:23:02 -0000 Author: eugen Date: Mon Nov 26 11:23:01 2018 New Revision: 340954 URL: https://svnweb.freebsd.org/changeset/base/340954 Log: MFC r339816: mount_msdosfs mount_msdosfs: do not fail mounts requiring locale name conversion table that is already present in a kernel statically. For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16951 Modified: stable/10/sbin/mount_msdosfs/mount_msdosfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- stable/10/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:22:04 2018 (r340953) +++ stable/10/sbin/mount_msdosfs/mount_msdosfs.c Mon Nov 26 11:23:01 2018 (r340954) @@ -44,6 +44,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -306,17 +307,17 @@ set_charset(struct iovec **iov, int *iovlen, const cha build_iovec_argf(iov, iovlen, "cs_win", ENCODING_UNICODE); error = kiconv_add_xlat16_cspairs(ENCODING_UNICODE, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); if (cs_dos != NULL) { error = kiconv_add_xlat16_cspairs(cs_dos, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); } else { build_iovec_argf(iov, iovlen, "cs_dos", cs_local); error = kiconv_add_xlat16_cspair(cs_local, cs_local, KICONV_FROM_UPPER | KICONV_LOWER); - if (error) + if (error && errno != EEXIST) return (-1); } From owner-svn-src-stable@freebsd.org Mon Nov 26 11:28:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA7EA1155D2F; Mon, 26 Nov 2018 11:28:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6716E4BC; Mon, 26 Nov 2018 11:28:35 +0000 (UTC) (envelope-from eugen@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 48A6C3012; Mon, 26 Nov 2018 11:28:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBSZAH026637; Mon, 26 Nov 2018 11:28:35 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBSZRP026636; Mon, 26 Nov 2018 11:28:35 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261128.wAQBSZRP026636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340955 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 340955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C6716E4BC X-Spamd-Result: default: False [1.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.053,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:28:36 -0000 Author: eugen Date: Mon Nov 26 11:28:34 2018 New Revision: 340955 URL: https://svnweb.freebsd.org/changeset/base/340955 Log: MFC r339810: ipfw: implement ngtee/netgraph actions for layer-2 frames. Kernel part of ipfw does not support and ignores rules other than "pass", "deny" and dummynet-related for layer-2 (ethernet frames). Others are processed as "pass". Make it support ngtee/netgraph rules just like they are supported for IP packets. For example, this allows us to mirror some frames selectively to another interface for delivery to remote network analyzer over RSPAN vlan. Assuming ng_ipfw(4) netgraph node has a hook named "900" attached to "lower" hook of vlan900's ng_ether(4) node, that would be as simple as: ipfw add ngtee 900 ip from any to 8.8.8.8 layer2 out xmit igb0 PR: 213452 Tested-by: Fyodor Ustinov Modified: stable/12/sys/netpfil/ipfw/ip_fw_pfil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_pfil.c Mon Nov 26 11:23:01 2018 (r340954) +++ stable/12/sys/netpfil/ipfw/ip_fw_pfil.c Mon Nov 26 11:28:34 2018 (r340955) @@ -317,11 +317,12 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i struct ip_fw_args args; struct m_tag *mtag; + bzero(&args, sizeof(args)); + +again: /* fetch start point from rule, if any. remove the tag if present. */ mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); - if (mtag == NULL) { - args.rule.slot = 0; - } else { + if (mtag != NULL) { args.rule = *((struct ipfw_rule_ref *)(mtag+1)); m_tag_delete(*m0, mtag); if (args.rule.info & IPFW_ONEPASS) @@ -378,14 +379,27 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i case IP_FW_DUMMYNET: ret = EACCES; + int dir2; if (ip_dn_io_ptr == NULL) break; /* i.e. drop */ *m0 = NULL; - dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; - ip_dn_io_ptr(&m, dir | PROTO_LAYER2, &args); + dir2 = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; + ip_dn_io_ptr(&m, dir2 | PROTO_LAYER2, &args); return 0; + + case IP_FW_NGTEE: + case IP_FW_NETGRAPH: + if (ng_ipfw_input_p == NULL) { + ret = EACCES; + break; /* i.e. drop */ + } + ret = ng_ipfw_input_p(m0, (dir == PFIL_IN) ? DIR_IN : DIR_OUT, + &args, (i == IP_FW_NGTEE) ? 1 : 0); + if (i == IP_FW_NGTEE) /* ignore errors for NGTEE */ + goto again; /* continue with packet */ + break; default: KASSERT(0, ("%s: unknown retval", __func__)); From owner-svn-src-stable@freebsd.org Mon Nov 26 11:32:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F64115627D; Mon, 26 Nov 2018 11:32:23 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1EAA6EA77; Mon, 26 Nov 2018 11:32:22 +0000 (UTC) (envelope-from eugen@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 BA5D731A6; Mon, 26 Nov 2018 11:32:22 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBWM0L030036; Mon, 26 Nov 2018 11:32:22 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBWMYG030035; Mon, 26 Nov 2018 11:32:22 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261132.wAQBWMYG030035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340956 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 340956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1EAA6EA77 X-Spamd-Result: default: False [1.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.053,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:32:23 -0000 Author: eugen Date: Mon Nov 26 11:32:22 2018 New Revision: 340956 URL: https://svnweb.freebsd.org/changeset/base/340956 Log: MFC r339810: ipfw: implement ngtee/netgraph actions for layer-2 frames. Kernel part of ipfw does not support and ignores rules other than "pass", "deny" and dummynet-related for layer-2 (ethernet frames). Others are processed as "pass". Make it support ngtee/netgraph rules just like they are supported for IP packets. For example, this allows us to mirror some frames selectively to another interface for delivery to remote network analyzer over RSPAN vlan. Assuming ng_ipfw(4) netgraph node has a hook named "900" attached to "lower" hook of vlan900's ng_ether(4) node, that would be as simple as: ipfw add ngtee 900 ip from any to 8.8.8.8 layer2 out xmit igb0 PR: 213452 Tested-by: Fyodor Ustinov Modified: stable/11/sys/netpfil/ipfw/ip_fw_pfil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_pfil.c Mon Nov 26 11:28:34 2018 (r340955) +++ stable/11/sys/netpfil/ipfw/ip_fw_pfil.c Mon Nov 26 11:32:22 2018 (r340956) @@ -315,11 +315,12 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i struct ip_fw_args args; struct m_tag *mtag; + bzero(&args, sizeof(args)); + +again: /* fetch start point from rule, if any. remove the tag if present. */ mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); - if (mtag == NULL) { - args.rule.slot = 0; - } else { + if (mtag != NULL) { args.rule = *((struct ipfw_rule_ref *)(mtag+1)); m_tag_delete(*m0, mtag); if (args.rule.info & IPFW_ONEPASS) @@ -376,14 +377,27 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i case IP_FW_DUMMYNET: ret = EACCES; + int dir2; if (ip_dn_io_ptr == NULL) break; /* i.e. drop */ *m0 = NULL; - dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; - ip_dn_io_ptr(&m, dir | PROTO_LAYER2, &args); + dir2 = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; + ip_dn_io_ptr(&m, dir2 | PROTO_LAYER2, &args); return 0; + + case IP_FW_NGTEE: + case IP_FW_NETGRAPH: + if (ng_ipfw_input_p == NULL) { + ret = EACCES; + break; /* i.e. drop */ + } + ret = ng_ipfw_input_p(m0, (dir == PFIL_IN) ? DIR_IN : DIR_OUT, + &args, (i == IP_FW_NGTEE) ? 1 : 0); + if (i == IP_FW_NGTEE) /* ignore errors for NGTEE */ + goto again; /* continue with packet */ + break; default: KASSERT(0, ("%s: unknown retval", __func__)); From owner-svn-src-stable@freebsd.org Mon Nov 26 11:51:45 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C2D115678A; Mon, 26 Nov 2018 11:51:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16AAF6F43B; Mon, 26 Nov 2018 11:51:45 +0000 (UTC) (envelope-from eugen@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 EBD733407; Mon, 26 Nov 2018 11:51:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQBpi0A041073; Mon, 26 Nov 2018 11:51:44 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQBpi3v041072; Mon, 26 Nov 2018 11:51:44 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261151.wAQBpi3v041072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 11:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340957 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 340957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16AAF6F43B X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.068,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:51:45 -0000 Author: eugen Date: Mon Nov 26 11:51:44 2018 New Revision: 340957 URL: https://svnweb.freebsd.org/changeset/base/340957 Log: Prevent multicast code from panicing due to unprotected access to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339807 due to significant difference in code base. PR: 220078 Tested-by: Cassiano Peixoto and others Modified: stable/10/sys/netinet/in_mcast.c Modified: stable/10/sys/netinet/in_mcast.c ============================================================================== --- stable/10/sys/netinet/in_mcast.c Mon Nov 26 11:32:22 2018 (r340956) +++ stable/10/sys/netinet/in_mcast.c Mon Nov 26 11:51:44 2018 (r340957) @@ -1339,9 +1339,11 @@ inp_block_unblock_source(struct inpcb *inp, struct soc ssa->sin.sin_len = sizeof(struct sockaddr_in); ssa->sin.sin_addr = mreqs.imr_sourceaddr; - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(); + } if (sopt->sopt_name == IP_BLOCK_SOURCE) doblock = 1; @@ -1836,7 +1838,6 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop * * Returns NULL if no ifp could be found. * - * SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP. * FUTURE: Implement IPv4 source-address selection. */ static struct ifnet * @@ -1851,7 +1852,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, ifp = NULL; if (!in_nullhost(ina)) { + IN_IFADDR_RLOCK(); INADDR_TO_IFP(ina, ifp); + IN_IFADDR_RUNLOCK(); } else { struct route ro; @@ -2247,9 +2250,11 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * XXX NOTE WELL: The RFC 3678 API is preferred because * using an IPv4 address as a key is racy. */ - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(); + } CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", __func__, inet_ntoa(mreqs.imr_interface), ifp); @@ -2447,7 +2452,9 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt if (in_nullhost(addr)) { ifp = NULL; } else { + IN_IFADDR_RLOCK(); INADDR_TO_IFP(addr, ifp); + IN_IFADDR_RUNLOCK(); if (ifp == NULL) return (EADDRNOTAVAIL); } From owner-svn-src-stable@freebsd.org Mon Nov 26 12:19:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC140110403F; Mon, 26 Nov 2018 12:19:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F14A707C3; Mon, 26 Nov 2018 12:19:31 +0000 (UTC) (envelope-from eugen@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 702673CA2; Mon, 26 Nov 2018 12:19:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQCJVkj052702; Mon, 26 Nov 2018 12:19:31 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQCJVQt052701; Mon, 26 Nov 2018 12:19:31 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261219.wAQCJVQt052701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 12:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340958 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 340958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F14A707C3 X-Spamd-Result: default: False [1.22 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 12:19:32 -0000 Author: eugen Date: Mon Nov 26 12:19:30 2018 New Revision: 340958 URL: https://svnweb.freebsd.org/changeset/base/340958 Log: Prevent stf(4) from panicing due to unprotected access to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339806 due to significant differences in code base. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/10/sys/net/if_stf.c Modified: stable/10/sys/net/if_stf.c ============================================================================== --- stable/10/sys/net/if_stf.c Mon Nov 26 11:51:44 2018 (r340957) +++ stable/10/sys/net/if_stf.c Mon Nov 26 12:19:30 2018 (r340958) @@ -384,7 +384,6 @@ stf_getsrcifa6(ifp) struct ifnet *ifp; { struct ifaddr *ia; - struct in_ifaddr *ia4; struct sockaddr_in6 *sin6; struct in_addr in; @@ -397,10 +396,7 @@ stf_getsrcifa6(ifp) continue; bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); - LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) - if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) - break; - if (ia4 == NULL) + if (!in_localip(in)) continue; ifa_ref(ia); From owner-svn-src-stable@freebsd.org Mon Nov 26 12:39:58 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21A5B1104983; Mon, 26 Nov 2018 12:39:58 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCCDD712B8; Mon, 26 Nov 2018 12:39:57 +0000 (UTC) (envelope-from eugen@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 9EC6B4032; Mon, 26 Nov 2018 12:39:57 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQCdvnb062639; Mon, 26 Nov 2018 12:39:57 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQCdvoE062638; Mon, 26 Nov 2018 12:39:57 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261239.wAQCdvoE062638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 12:39: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: r340959 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCCDD712B8 X-Spamd-Result: default: False [1.22 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 12:39:58 -0000 Author: eugen Date: Mon Nov 26 12:39:57 2018 New Revision: 340959 URL: https://svnweb.freebsd.org/changeset/base/340959 Log: MFC r339808: Prevent ip_input() from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/12/sys/netinet/ip_input.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_input.c ============================================================================== --- stable/12/sys/netinet/ip_input.c Mon Nov 26 12:19:30 2018 (r340958) +++ stable/12/sys/netinet/ip_input.c Mon Nov 26 12:39:57 2018 (r340959) @@ -448,6 +448,7 @@ ip_direct_input(struct mbuf *m) void ip_input(struct mbuf *m) { + struct rm_priotracker in_ifa_tracker; struct ip *ip = NULL; struct in_ifaddr *ia = NULL; struct ifaddr *ifa; @@ -681,7 +682,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - /* IN_IFADDR_RLOCK(); */ + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet @@ -693,11 +694,11 @@ passin: counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto ours; } } - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * Check for broadcast addresses. From owner-svn-src-stable@freebsd.org Mon Nov 26 12:41:50 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB201104E73; Mon, 26 Nov 2018 12:41:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F1EF717BE; Mon, 26 Nov 2018 12:41:50 +0000 (UTC) (envelope-from eugen@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 3101E4191; Mon, 26 Nov 2018 12:41:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQCfocg067541; Mon, 26 Nov 2018 12:41:50 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQCfoZD067540; Mon, 26 Nov 2018 12:41:50 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261241.wAQCfoZD067540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 12:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340960 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 340960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F1EF717BE X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 12:41:50 -0000 Author: eugen Date: Mon Nov 26 12:41:49 2018 New Revision: 340960 URL: https://svnweb.freebsd.org/changeset/base/340960 Log: MFC r339808: Prevent ip_input() from panicing due to unprotected access to INADDR_HASH. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/11/sys/netinet/ip_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_input.c ============================================================================== --- stable/11/sys/netinet/ip_input.c Mon Nov 26 12:39:57 2018 (r340959) +++ stable/11/sys/netinet/ip_input.c Mon Nov 26 12:41:49 2018 (r340960) @@ -446,6 +446,7 @@ ip_direct_input(struct mbuf *m) void ip_input(struct mbuf *m) { + struct rm_priotracker in_ifa_tracker; struct ip *ip = NULL; struct in_ifaddr *ia = NULL; struct ifaddr *ifa; @@ -679,7 +680,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - /* IN_IFADDR_RLOCK(); */ + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet @@ -691,11 +692,11 @@ passin: counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto ours; } } - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * Check for broadcast addresses. From owner-svn-src-stable@freebsd.org Mon Nov 26 12:47:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEEA2113328D; Mon, 26 Nov 2018 12:47:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C06F71B39; Mon, 26 Nov 2018 12:47:13 +0000 (UTC) (envelope-from eugen@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 387CE41D9; Mon, 26 Nov 2018 12:47:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQClDbP067827; Mon, 26 Nov 2018 12:47:13 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQClD7h067826; Mon, 26 Nov 2018 12:47:13 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261247.wAQClD7h067826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 12:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340961 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 340961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C06F71B39 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 12:47:13 -0000 Author: eugen Date: Mon Nov 26 12:47:12 2018 New Revision: 340961 URL: https://svnweb.freebsd.org/changeset/base/340961 Log: Prevent ip_input() from panicing due to unprotected access to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339808 due to significant differences in code base. PR: 220078 Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: stable/10/sys/netinet/ip_input.c Modified: stable/10/sys/netinet/ip_input.c ============================================================================== --- stable/10/sys/netinet/ip_input.c Mon Nov 26 12:41:49 2018 (r340960) +++ stable/10/sys/netinet/ip_input.c Mon Nov 26 12:47:12 2018 (r340961) @@ -564,7 +564,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - /* IN_IFADDR_RLOCK(); */ + IN_IFADDR_RLOCK(); LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet @@ -574,11 +574,11 @@ passin: if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr && (!checkif || ia->ia_ifp == ifp)) { ifa_ref(&ia->ia_ifa); - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(); goto ours; } } - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(); /* * Check for broadcast addresses. From owner-svn-src-stable@freebsd.org Mon Nov 26 13:01:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB2491133B41; Mon, 26 Nov 2018 13:01:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5C672696; Mon, 26 Nov 2018 13:01:52 +0000 (UTC) (envelope-from eugen@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 4C8C943EA; Mon, 26 Nov 2018 13:01:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQD1q2x074268; Mon, 26 Nov 2018 13:01:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQD1qWU074259; Mon, 26 Nov 2018 13:01:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261301.wAQD1qWU074259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340962 - stable/12/libexec/makewhatis.local X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/libexec/makewhatis.local X-SVN-Commit-Revision: 340962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B5C672696 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:01:53 -0000 Author: eugen Date: Mon Nov 26 13:01:51 2018 New Revision: 340962 URL: https://svnweb.freebsd.org/changeset/base/340962 Log: MFC r339817: makewhatis: do not try to operate on read-only mounted directories just to fail later. Modified: stable/12/libexec/makewhatis.local/makewhatis.local.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/makewhatis.local/makewhatis.local.sh ============================================================================== --- stable/12/libexec/makewhatis.local/makewhatis.local.sh Mon Nov 26 12:47:12 2018 (r340961) +++ stable/12/libexec/makewhatis.local/makewhatis.local.sh Mon Nov 26 13:01:51 2018 (r340962) @@ -47,10 +47,10 @@ done dirs=`echo $dirs | sed 's/:/ /g'` case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac -localdirs=`find -H $dirs -fstype local -type d -prune -print` +localdirs=`find -H $dirs -fstype local \! -fstype rdonly -type d -prune -print` case X"$localdirs" in - X) echo "$0: no local-mounted manual directories found: $dirs" + X) echo "$0: no local rw-mounted manual directories found: $dirs" exit 1;; *) exec `basename $0 .local` $opt $localdirs;; esac From owner-svn-src-stable@freebsd.org Mon Nov 26 13:03:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36AF81133DC9; Mon, 26 Nov 2018 13:03:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0BE6729A1; Mon, 26 Nov 2018 13:03:34 +0000 (UTC) (envelope-from eugen@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 8CF714529; Mon, 26 Nov 2018 13:03:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQD3Y02078184; Mon, 26 Nov 2018 13:03:34 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQD3YRp078183; Mon, 26 Nov 2018 13:03:34 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261303.wAQD3YRp078183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340963 - stable/11/libexec/makewhatis.local X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/libexec/makewhatis.local X-SVN-Commit-Revision: 340963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0BE6729A1 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.61)[0.611,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:03:35 -0000 Author: eugen Date: Mon Nov 26 13:03:34 2018 New Revision: 340963 URL: https://svnweb.freebsd.org/changeset/base/340963 Log: MFC r339817: makewhatis: do not try to operate on read-only mounted directories just to fail later. Modified: stable/11/libexec/makewhatis.local/makewhatis.local.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/makewhatis.local/makewhatis.local.sh ============================================================================== --- stable/11/libexec/makewhatis.local/makewhatis.local.sh Mon Nov 26 13:01:51 2018 (r340962) +++ stable/11/libexec/makewhatis.local/makewhatis.local.sh Mon Nov 26 13:03:34 2018 (r340963) @@ -49,10 +49,10 @@ done dirs=`echo $dirs | sed 's/:/ /g'` case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac -localdirs=`find -H $dirs -fstype local -type d -prune -print` +localdirs=`find -H $dirs -fstype local \! -fstype rdonly -type d -prune -print` case X"$localdirs" in - X) echo "$0: no local-mounted manual directories found: $dirs" + X) echo "$0: no local rw-mounted manual directories found: $dirs" exit 1;; *) exec `basename $0 .local` $opt $localdirs;; esac From owner-svn-src-stable@freebsd.org Mon Nov 26 13:08:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF5411133EE7; Mon, 26 Nov 2018 13:08:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5957E72BF2; Mon, 26 Nov 2018 13:08:35 +0000 (UTC) (envelope-from eugen@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 3A5244537; Mon, 26 Nov 2018 13:08:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQD8ZG9078440; Mon, 26 Nov 2018 13:08:35 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQD8Zxn078439; Mon, 26 Nov 2018 13:08:35 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261308.wAQD8Zxn078439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340964 - stable/10/usr.bin/makewhatis X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/usr.bin/makewhatis X-SVN-Commit-Revision: 340964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5957E72BF2 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.61)[0.611,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:08:35 -0000 Author: eugen Date: Mon Nov 26 13:08:34 2018 New Revision: 340964 URL: https://svnweb.freebsd.org/changeset/base/340964 Log: makewhatis: do not try to operate on read-only mounted directories just to fail later. This is direct commit to stable/10 instead of MFC r339817 due to makewhatis.local being moved in recent branches. Modified: stable/10/usr.bin/makewhatis/makewhatis.local.sh Modified: stable/10/usr.bin/makewhatis/makewhatis.local.sh ============================================================================== --- stable/10/usr.bin/makewhatis/makewhatis.local.sh Mon Nov 26 13:03:34 2018 (r340963) +++ stable/10/usr.bin/makewhatis/makewhatis.local.sh Mon Nov 26 13:08:34 2018 (r340964) @@ -49,10 +49,10 @@ done dirs=`echo $dirs | sed 's/:/ /g'` case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac -localdirs=`find -H $dirs -fstype local -type d -prune -print` +localdirs=`find -H $dirs -fstype local \! -fstype rdonly -type d -prune -print` case X"$localdirs" in - X) echo "$0: no local-mounted manual directories found: $dirs" + X) echo "$0: no local rw-mounted manual directories found: $dirs" exit 1;; *) exec `basename $0 .local` $opt $localdirs;; esac From owner-svn-src-stable@freebsd.org Mon Nov 26 13:23:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0637011355A0; Mon, 26 Nov 2018 13:23:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B076D73487; Mon, 26 Nov 2018 13:23:11 +0000 (UTC) (envelope-from eugen@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 775F5485E; Mon, 26 Nov 2018 13:23:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDNBhc088526; Mon, 26 Nov 2018 13:23:11 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDNAvW088523; Mon, 26 Nov 2018 13:23:10 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261323.wAQDNAvW088523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:23: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: r340965 - in stable/12: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/12: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 340965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B076D73487 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.215,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:23:13 -0000 Author: eugen Date: Mon Nov 26 13:23:10 2018 New Revision: 340965 URL: https://svnweb.freebsd.org/changeset/base/340965 Log: MFC r339818: rcorder(8) Add support for /etc/rc.resume, so it calls "rcorder -k resume" and runs scripts containing "KEYWORD: resume" with single "resume" argument. Working example is the port sysutils/cpupdate that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence. This change does nothing for a system having no scripts with KEYWORD: resume. PR: 227866 Differential Revision: https://reviews.freebsd.org/D15247 Modified: stable/12/libexec/rc/rc.resume stable/12/sbin/rcorder/rcorder.8 stable/12/share/man/man8/rc.8 stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.resume ============================================================================== --- stable/12/libexec/rc/rc.resume Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/libexec/rc/rc.resume Mon Nov 26 13:23:10 2018 (r340965) @@ -55,4 +55,22 @@ fi /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k resume" + +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` + +for _rc_elem in $files; do + debug "run_rc_script $_rc_elem resume" + run_rc_script $_rc_elem resume +done + exit 0 Modified: stable/12/sbin/rcorder/rcorder.8 ============================================================================== --- stable/12/sbin/rcorder/rcorder.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/sbin/rcorder/rcorder.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd October 27, 2018 .Dt RCORDER 8 .Os .Sh NAME @@ -136,6 +136,23 @@ There must be at least one file with no dependencies i arguments passed to .Nm in order for it to find a starting place in the dependency ordering. +.Sh KEYWORDS +There are several +.Em KEYWORDs +in use: +.Bl -tag -width ".Cm shutdown" -offset indent +.It Cm firstboot, nojail, nojailvnet, nostart +Used by +.Xr rc 8 . +.It Cm resume +Used by +.Nm /etc/rc.resume +(see +.Xr acpiconf 8 ) +.It Cm shutdown +Used by +.Xr rc.shutdown 8 . +.El .Sh DIAGNOSTICS The .Nm @@ -156,7 +173,9 @@ A set of files has a circular dependency which was det processing the stated file. .El .Sh SEE ALSO -.Xr rc 8 +.Xr acpiconf 8 , +.Xr rc 8 , +.Xr rc.shutdown 8 .Sh HISTORY The .Nm Modified: stable/12/share/man/man8/rc.8 ============================================================================== --- stable/12/share/man/man8/rc.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/share/man/man8/rc.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -44,6 +44,7 @@ .Nm rc.d/ .Nm rc.firewall .Nm rc.local +.Nm rc.resume .Nm rc.shutdown .Nm rc.subr .Sh DESCRIPTION @@ -563,6 +564,7 @@ is unnecessary, but is often included. .Xr kill 1 , .Xr rc.conf 5 , .Xr init 8 , +.Xr rc.resume 8 , .Xr rc.subr 8 , .Xr rcorder 8 , .Xr reboot 8 , Modified: stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2015 +.Dd October 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -72,13 +72,35 @@ If the .Pa /etc/rc.suspend and .Pa /etc/rc.resume -scripts are executable, they will be run before and after entering -the given sleep state. +scripts are executable, they will be run by +.Xr devd 8 +or +.Xr apmd 8 +before and after entering the given sleep state. +.Pp +The +.Pa /etc/rc.resume +script uses the +.Xr rcorder 8 +utility to call scripts in +.Pa /etc/rc.d/ +and the +.Va $local_startup +directories that have a "resume" KEYWORD. +Called scripts are supplied with single "resume" +command line argument. See +.Xr rc.conf 5 +for more information about +.Va $local_startup . .El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr apmd 8 , +.Xr devd 8 , +.Xr rc.conf 5 , +.Xr rcorder 8 .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Mon Nov 26 13:30:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C23811358F9; Mon, 26 Nov 2018 13:30:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3D3E73751; Mon, 26 Nov 2018 13:30:01 +0000 (UTC) (envelope-from eugen@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 D4CEE487A; Mon, 26 Nov 2018 13:30:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDU18D088901; Mon, 26 Nov 2018 13:30:01 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDU1HA088898; Mon, 26 Nov 2018 13:30:01 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261330.wAQDU1HA088898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340966 - in stable/11: etc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/11: etc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 340966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3D3E73751 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.215,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:30:02 -0000 Author: eugen Date: Mon Nov 26 13:30:00 2018 New Revision: 340966 URL: https://svnweb.freebsd.org/changeset/base/340966 Log: MFC r339818: rcorder(8): Add support for /etc/rc.resume, so it calls "rcorder -k resume" and runs scripts containing "KEYWORD: resume" with single "resume" argument. Working example is the port sysutils/cpupdate that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence. This change does nothing for a system having no scripts with KEYWORD: resume. PR: 227866 Differential Revision: https://reviews.freebsd.org/D15247 Modified: stable/11/etc/rc.resume stable/11/sbin/rcorder/rcorder.8 stable/11/share/man/man8/rc.8 stable/11/usr.sbin/acpi/acpiconf/acpiconf.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.resume ============================================================================== --- stable/11/etc/rc.resume Mon Nov 26 13:23:10 2018 (r340965) +++ stable/11/etc/rc.resume Mon Nov 26 13:30:00 2018 (r340966) @@ -55,4 +55,22 @@ fi /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k resume" + +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` + +for _rc_elem in $files; do + debug "run_rc_script $_rc_elem resume" + run_rc_script $_rc_elem resume +done + exit 0 Modified: stable/11/sbin/rcorder/rcorder.8 ============================================================================== --- stable/11/sbin/rcorder/rcorder.8 Mon Nov 26 13:23:10 2018 (r340965) +++ stable/11/sbin/rcorder/rcorder.8 Mon Nov 26 13:30:00 2018 (r340966) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd October 27, 2018 .Dt RCORDER 8 .Os .Sh NAME @@ -136,6 +136,23 @@ There must be at least one file with no dependencies i arguments passed to .Nm in order for it to find a starting place in the dependency ordering. +.Sh KEYWORDS +There are several +.Em KEYWORDs +in use: +.Bl -tag -width ".Cm shutdown" -offset indent +.It Cm firstboot, nojail, nojailvnet, nostart +Used by +.Xr rc 8 . +.It Cm resume +Used by +.Nm /etc/rc.resume +(see +.Xr acpiconf 8 ) +.It Cm shutdown +Used by +.Xr rc.shutdown 8 . +.El .Sh DIAGNOSTICS The .Nm @@ -156,7 +173,9 @@ A set of files has a circular dependency which was det processing the stated file. .El .Sh SEE ALSO -.Xr rc 8 +.Xr acpiconf 8 , +.Xr rc 8 , +.Xr rc.shutdown 8 .Sh HISTORY The .Nm Modified: stable/11/share/man/man8/rc.8 ============================================================================== --- stable/11/share/man/man8/rc.8 Mon Nov 26 13:23:10 2018 (r340965) +++ stable/11/share/man/man8/rc.8 Mon Nov 26 13:30:00 2018 (r340966) @@ -44,6 +44,7 @@ .Nm rc.d/ .Nm rc.firewall .Nm rc.local +.Nm rc.resume .Nm rc.shutdown .Nm rc.subr .Sh DESCRIPTION @@ -557,6 +558,7 @@ is unnecessary, but is often included. .Xr kill 1 , .Xr rc.conf 5 , .Xr init 8 , +.Xr rc.resume 8 , .Xr rc.subr 8 , .Xr rcorder 8 , .Xr reboot 8 , Modified: stable/11/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- stable/11/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:23:10 2018 (r340965) +++ stable/11/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:30:00 2018 (r340966) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2015 +.Dd October 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -72,13 +72,35 @@ If the .Pa /etc/rc.suspend and .Pa /etc/rc.resume -scripts are executable, they will be run before and after entering -the given sleep state. +scripts are executable, they will be run by +.Xr devd 8 +or +.Xr apmd 8 +before and after entering the given sleep state. +.Pp +The +.Pa /etc/rc.resume +script uses the +.Xr rcorder 8 +utility to call scripts in +.Pa /etc/rc.d/ +and the +.Va $local_startup +directories that have a "resume" KEYWORD. +Called scripts are supplied with single "resume" +command line argument. See +.Xr rc.conf 5 +for more information about +.Va $local_startup . .El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr apmd 8 , +.Xr devd 8 , +.Xr rc.conf 5 , +.Xr rcorder 8 .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Mon Nov 26 13:36:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D282F1135DF9; Mon, 26 Nov 2018 13:36:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7838573C97; Mon, 26 Nov 2018 13:36:31 +0000 (UTC) (envelope-from eugen@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 58F284A35; Mon, 26 Nov 2018 13:36:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDaV1s093844; Mon, 26 Nov 2018 13:36:31 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDaUVK093840; Mon, 26 Nov 2018 13:36:30 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261336.wAQDaUVK093840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340967 - in stable/10: etc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/10: etc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 340967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7838573C97 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.630,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.215,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:36:32 -0000 Author: eugen Date: Mon Nov 26 13:36:30 2018 New Revision: 340967 URL: https://svnweb.freebsd.org/changeset/base/340967 Log: MFC r339818: rcorder(8): Add support for /etc/rc.resume, so it calls "rcorder -k resume" and runs scripts containing "KEYWORD: resume" with single "resume" argument. Working example is the port sysutils/cpupdate that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence. This change does nothing for a system having no scripts with KEYWORD: resume. PR: 227866 Differential Revision: https://reviews.freebsd.org/D15247 Modified: stable/10/etc/rc.resume stable/10/sbin/rcorder/rcorder.8 stable/10/share/man/man8/rc.8 stable/10/usr.sbin/acpi/acpiconf/acpiconf.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.resume ============================================================================== --- stable/10/etc/rc.resume Mon Nov 26 13:30:00 2018 (r340966) +++ stable/10/etc/rc.resume Mon Nov 26 13:36:30 2018 (r340967) @@ -55,4 +55,22 @@ fi /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k resume" + +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` + +for _rc_elem in $files; do + debug "run_rc_script $_rc_elem resume" + run_rc_script $_rc_elem resume +done + exit 0 Modified: stable/10/sbin/rcorder/rcorder.8 ============================================================================== --- stable/10/sbin/rcorder/rcorder.8 Mon Nov 26 13:30:00 2018 (r340966) +++ stable/10/sbin/rcorder/rcorder.8 Mon Nov 26 13:36:30 2018 (r340967) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2011 +.Dd October 27, 2018 .Dt RCORDER 8 .Os .Sh NAME @@ -136,6 +136,23 @@ There must be at least one file with no dependencies i arguments passed to .Nm in order for it to find a starting place in the dependency ordering. +.Sh KEYWORDS +There are several +.Em KEYWORDs +in use: +.Bl -tag -width ".Cm shutdown" -offset indent +.It Cm firstboot, nojail, nojailvnet, nostart +Used by +.Xr rc 8 . +.It Cm resume +Used by +.Nm /etc/rc.resume +(see +.Xr acpiconf 8 ) +.It Cm shutdown +Used by +.Xr rc.shutdown 8 . +.El .Sh DIAGNOSTICS The .Nm @@ -156,7 +173,9 @@ A set of files has a circular dependency which was det processing the stated file. .El .Sh SEE ALSO -.Xr rc 8 +.Xr acpiconf 8 , +.Xr rc 8 , +.Xr rc.shutdown 8 .Sh HISTORY The .Nm Modified: stable/10/share/man/man8/rc.8 ============================================================================== --- stable/10/share/man/man8/rc.8 Mon Nov 26 13:30:00 2018 (r340966) +++ stable/10/share/man/man8/rc.8 Mon Nov 26 13:36:30 2018 (r340967) @@ -48,6 +48,7 @@ .Nm rc.d/ .Nm rc.firewall .Nm rc.local +.Nm rc.resume .Nm rc.shutdown .Nm rc.subr .Sh DESCRIPTION @@ -557,7 +558,7 @@ is unnecessary, but is often included. .Xr kill 1 , .Xr rc.conf 5 , .Xr init 8 , -.Xr rcorder 8 , +.Xr rc.resume 8 , .Xr rc.subr 8 , .Xr reboot 8 , .Xr savecore 8 , Modified: stable/10/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- stable/10/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:30:00 2018 (r340966) +++ stable/10/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:36:30 2018 (r340967) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2015 +.Dd October 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -72,13 +72,35 @@ If the .Pa /etc/rc.suspend and .Pa /etc/rc.resume -scripts are executable, they will be run before and after entering -the given sleep state. +scripts are executable, they will be run by +.Xr devd 8 +or +.Xr apmd 8 +before and after entering the given sleep state. +.Pp +The +.Pa /etc/rc.resume +script uses the +.Xr rcorder 8 +utility to call scripts in +.Pa /etc/rc.d/ +and the +.Va $local_startup +directories that have a "resume" KEYWORD. +Called scripts are supplied with single "resume" +command line argument. See +.Xr rc.conf 5 +for more information about +.Va $local_startup . .El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr apmd 8 , +.Xr devd 8 , +.Xr rc.conf 5 , +.Xr rcorder 8 .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Mon Nov 26 14:01:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8001136C81; Mon, 26 Nov 2018 14:01:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 696E974DDA; Mon, 26 Nov 2018 14:01:10 +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 4BB0C4EC9; Mon, 26 Nov 2018 14:01:10 +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 wAQE1ACI004740; Mon, 26 Nov 2018 14:01:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQE15tF004718; Mon, 26 Nov 2018 14:01:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811261401.wAQE15tF004718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 26 Nov 2018 14:01:05 +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: r340970 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/pseudofs fs/smbfs f... X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys u... X-SVN-Commit-Revision: 340970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 696E974DDA X-Spamd-Result: default: False [1.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.67)[0.667,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.280,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 14:01:11 -0000 Author: markj Date: Mon Nov 26 14:01:05 2018 New Revision: 340970 URL: https://svnweb.freebsd.org/changeset/base/340970 Log: MFC r340787 (by rmacklem), r340856, r340859: Ensure that directory entry padding bytes are zeroed. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/fs/autofs/autofs_vnops.c stable/12/sys/fs/cd9660/cd9660_vnops.c stable/12/sys/fs/devfs/devfs_devs.c stable/12/sys/fs/ext2fs/ext2_lookup.c stable/12/sys/fs/fdescfs/fdesc_vnops.c stable/12/sys/fs/fuse/fuse_internal.c stable/12/sys/fs/msdosfs/msdosfs_vnops.c stable/12/sys/fs/nandfs/nandfs_vnops.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/pseudofs/pseudofs_vnops.c stable/12/sys/fs/smbfs/smbfs_io.c stable/12/sys/fs/tmpfs/tmpfs_subr.c stable/12/sys/fs/tmpfs/tmpfs_vfsops.c stable/12/sys/fs/tmpfs/tmpfs_vnops.c stable/12/sys/fs/udf/udf_vnops.c stable/12/sys/kern/uipc_mqueue.c stable/12/sys/kern/vfs_export.c stable/12/sys/sys/dirent.h stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Nov 26 14:01:05 2018 (r340970) @@ -262,9 +262,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_fileno = id; entry.d_type = DT_DIR; entry.d_name[0] = '.'; - entry.d_name[1] = '\0'; entry.d_namlen = 1; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -277,9 +277,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_type = DT_DIR; entry.d_name[0] = '.'; entry.d_name[1] = '.'; - entry.d_name[2] = '\0'; entry.d_namlen = 2; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -694,6 +694,7 @@ zfsctl_root_readdir(ap) strcpy(entry.d_name, node->snapdir->sn_name); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) @@ -1099,6 +1100,7 @@ zfsctl_snapdir_readdir(ap) entry.d_reclen = sizeof(entry); /* NOTE: d_off is the offset for the *next* entry. */ entry.d_off = cookie + dots_offset; + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -2547,6 +2547,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; + dirent_terminate(odp); odp = (dirent64_t *)((intptr_t)odp + reclen); } outcount += reclen; Modified: stable/12/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/12/sys/fs/autofs/autofs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/autofs/autofs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -354,14 +354,11 @@ autofs_readdir_one(struct uio *uio, const char *name, size_t *reclenp) { struct dirent dirent; - size_t namlen, padded_namlen, reclen; + size_t namlen, reclen; int error; namlen = strlen(name); - padded_namlen = roundup2(namlen + 1, __alignof(struct dirent)); - KASSERT(padded_namlen <= MAXNAMLEN, ("%zd > MAXNAMLEN", padded_namlen)); - reclen = offsetof(struct dirent, d_name) + padded_namlen; - + reclen = _GENERIC_DIRLEN(namlen); if (reclenp != NULL) *reclenp = reclen; @@ -376,7 +373,7 @@ autofs_readdir_one(struct uio *uio, const char *name, dirent.d_type = DT_DIR; dirent.d_namlen = namlen; memcpy(dirent.d_name, name, namlen); - memset(dirent.d_name + namlen, 0, padded_namlen - namlen); + dirent_terminate(&dirent); error = uiomove(&dirent, reclen, uio); return (error); Modified: stable/12/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/12/sys/fs/cd9660/cd9660_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/cd9660/cd9660_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -380,8 +380,8 @@ iso_uiodir(idp,dp,off) { int error; - dp->d_name[dp->d_namlen] = 0; dp->d_reclen = GENERIC_DIRSIZ(dp); + dirent_terminate(dp); if (idp->uio->uio_resid < dp->d_reclen) { idp->eofflag = 0; Modified: stable/12/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_devs.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/devfs/devfs_devs.c Mon Nov 26 14:01:05 2018 (r340970) @@ -226,7 +226,7 @@ devfs_newdirent(char *name, int namelen) de->de_dirent->d_namlen = namelen; de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d); bcopy(name, de->de_dirent->d_name, namelen); - de->de_dirent->d_name[namelen] = '\0'; + dirent_terminate(de->de_dirent); vfs_timestamp(&de->de_ctime); de->de_mtime = de->de_atime = de->de_ctime; de->de_links = 1; Modified: stable/12/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_lookup.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/ext2fs/ext2_lookup.c Mon Nov 26 14:01:05 2018 (r340970) @@ -223,9 +223,9 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->e2d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: stable/12/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/12/sys/fs/fdescfs/fdesc_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/fdescfs/fdesc_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -561,8 +561,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_namlen = i + 1; dp->d_reclen = UIO_MX; bcopy("..", dp->d_name, dp->d_namlen); - dp->d_name[i + 1] = '\0'; dp->d_type = DT_DIR; + dirent_terminate(dp); break; default: if (fdp->fd_ofiles[fcnt].fde_file == NULL) @@ -572,6 +572,7 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; + dirent_terminate(dp); break; } /* NOTE: d_off is the offset of the *next* entry. */ Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/fuse/fuse_internal.c Mon Nov 26 14:01:05 2018 (r340970) @@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail - 1] = '\0'; + dirent_terminate(de); err = uiomove(cookediov->base, cookediov->len, uio); if (err) { Modified: stable/12/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -1550,16 +1550,18 @@ msdosfs_readdir(struct vop_readdir_args *ap) switch (n) { case 0: dirbuf.d_namlen = 1; - strcpy(dirbuf.d_name, "."); + dirbuf.d_name[0] = '.'; break; case 1: dirbuf.d_namlen = 2; - strcpy(dirbuf.d_name, ".."); + dirbuf.d_name[0] = '.'; + dirbuf.d_name[1] = '.'; break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); /* NOTE: d_off is the offset of the *next* entry. */ dirbuf.d_off = offset + sizeof(struct direntry); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); Modified: stable/12/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/12/sys/fs/nandfs/nandfs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/nandfs/nandfs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -1226,7 +1226,7 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; - memset(&dirent, 0, sizeof(struct dirent)); + memset(&dirent, 0, sizeof(dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; @@ -1235,6 +1235,7 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_reclen = GENERIC_DIRSIZ(&dirent); /* NOTE: d_off is the offset of the *next* entry. */ dirent.d_off = diroffset + ndirent->rec_len; + dirent_terminate(&dirent); DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } @@ -1248,7 +1249,7 @@ nandfs_readdir(struct vop_readdir_args *ap) /* Transfer */ if (dirent.d_fileno) - uiomove(&dirent, GENERIC_DIRSIZ(&dirent), uio); + uiomove(&dirent, dirent.d_reclen, uio); /* Advance */ diroffset += ndirent->rec_len; Modified: stable/12/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clrpcops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/nfsclient/nfs_clrpcops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -2959,6 +2959,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -2978,6 +2979,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3091,6 +3093,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3103,6 +3106,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3120,7 +3124,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; /* null terminate */ + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; uio_iov_base_add(uiop, (tlen + NFSX_HYPER)); @@ -3208,6 +3212,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3235,10 +3240,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; @@ -3393,6 +3396,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -3412,6 +3416,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3506,6 +3511,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3518,6 +3524,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3538,7 +3545,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; if (len == 2 && cnp->cn_nameptr[0] == '.' && @@ -3708,6 +3715,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3735,10 +3743,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/pseudofs/pseudofs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -828,7 +828,6 @@ pfs_readdir(struct vop_readdir_args *va) /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) pfsent->entry.d_name[i] = pn->pn_name[i]; - pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; /* NOTE: d_off is the offset of the *next* entry. */ pfsent->entry.d_off = offset + PFS_DELEN; @@ -855,6 +854,7 @@ pfs_readdir(struct vop_readdir_args *va) panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } PFS_TRACE(("%s", pfsent->entry.d_name)); + dirent_terminate(&pfsent->entry); STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; Modified: stable/12/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/12/sys/fs/smbfs/smbfs_io.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/smbfs/smbfs_io.c Mon Nov 26 14:01:05 2018 (r340970) @@ -106,8 +106,8 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_namlen = offset + 1; de.d_name[0] = '.'; de.d_name[1] = '.'; - de.d_name[offset + 1] = '\0'; de.d_type = DT_DIR; + dirent_terminate(&de); error = uiomove(&de, DE_SIZE, uio); if (error) goto out; @@ -156,7 +156,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; de.d_namlen = ctx->f_nmlen; bcopy(ctx->f_name, de.d_name, de.d_namlen); - de.d_name[de.d_namlen] = '\0'; + dirent_terminate(&de); if (smbfs_fastlookup) { error = smbfs_nget(vp->v_mount, vp, ctx->f_name, ctx->f_nmlen, &ctx->f_attr, &newvp); Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_subr.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/tmpfs/tmpfs_subr.c Mon Nov 26 14:01:05 2018 (r340970) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1127,8 +1127,8 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u dent.d_type = DT_DIR; dent.d_namlen = 1; dent.d_name[0] = '.'; - dent.d_name[1] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1171,8 +1171,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc dent.d_namlen = 2; dent.d_name[0] = '.'; dent.d_name[1] = '.'; - dent.d_name[2] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1292,8 +1292,8 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); - d.d_name[de->td_namelen] = '\0'; d.d_reclen = GENERIC_DIRSIZ(&d); + dirent_terminate(&d); /* Stop reading if the directory entry we are treating is * bigger than the amount of data that can be returned. */ Modified: stable/12/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/12/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/12/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/12/sys/fs/udf/udf_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/fs/udf/udf_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -843,10 +843,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_fileno = node->hash_id; dir.d_type = DT_DIR; dir.d_name[0] = '.'; - dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 1; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -856,10 +856,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = DT_DIR; dir.d_name[0] = '.'; dir.d_name[1] = '.'; - dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 2; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -870,6 +870,7 @@ udf_readdir(struct vop_readdir_args *a) DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = ds->this_off; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: stable/12/sys/kern/uipc_mqueue.c ============================================================================== --- stable/12/sys/kern/uipc_mqueue.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/kern/uipc_mqueue.c Mon Nov 26 14:01:05 2018 (r340970) @@ -1428,7 +1428,6 @@ mqfs_readdir(struct vop_readdir_args *ap) entry.d_fileno = pn->mn_fileno; for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i) entry.d_name[i] = pn->mn_name[i]; - entry.d_name[i] = 0; entry.d_namlen = i; switch (pn->mn_type) { case mqfstype_root: @@ -1447,6 +1446,7 @@ mqfs_readdir(struct vop_readdir_args *ap) panic("%s has unexpected node type: %d", pn->mn_name, pn->mn_type); } + dirent_terminate(&entry); if (entry.d_reclen > uio->uio_resid) break; if (offset >= uio->uio_offset) { Modified: stable/12/sys/kern/vfs_export.c ============================================================================== --- stable/12/sys/kern/vfs_export.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/kern/vfs_export.c Mon Nov 26 14:01:05 2018 (r340970) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include @@ -55,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/12/sys/sys/dirent.h ============================================================================== --- stable/12/sys/sys/dirent.h Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/sys/dirent.h Mon Nov 26 14:01:05 2018 (r340970) @@ -126,6 +126,19 @@ struct freebsd11_dirent { #ifdef _KERNEL #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) + +/* + * Ensure that padding bytes are zeroed and that the name is NUL-terminated. + */ +static inline void +dirent_terminate(struct dirent *dp) +{ + + dp->d_pad0 = 0; + dp->d_pad1 = 0; + memset(dp->d_name + dp->d_namlen, 0, + dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); +} #endif #endif /* !_SYS_DIRENT_H_ */ Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Mon Nov 26 13:56:19 2018 (r340969) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Mon Nov 26 14:01:05 2018 (r340970) @@ -2217,9 +2217,9 @@ ufs_readdir(ap) dstdp.d_fileno = dp->d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-stable@freebsd.org Mon Nov 26 16:54:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919B5113C5E7; Mon, 26 Nov 2018 16:54:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7827C9A5; Mon, 26 Nov 2018 16:54:17 +0000 (UTC) (envelope-from royger@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 09F0C6B8B; Mon, 26 Nov 2018 16:54:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQGsGZ6096936; Mon, 26 Nov 2018 16:54:16 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQGsGiK096935; Mon, 26 Nov 2018 16:54:16 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201811261654.wAQGsGiK096935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 26 Nov 2018 16:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340982 - stable/11/sys/x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: royger X-SVN-Commit-Paths: stable/11/sys/x86/xen X-SVN-Commit-Revision: 340982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D7827C9A5 X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.49)[0.489,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 16:54:17 -0000 Author: royger Date: Mon Nov 26 16:54:16 2018 New Revision: 340982 URL: https://svnweb.freebsd.org/changeset/base/340982 Log: MFC r338628: xen: limit the usage of PIRQs to a legacy PVH Dom0 Sponsored by: Citrix Systems R&D Modified: stable/11/sys/x86/xen/xen_intr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/xen/xen_intr.c ============================================================================== --- stable/11/sys/x86/xen/xen_intr.c Mon Nov 26 16:38:39 2018 (r340981) +++ stable/11/sys/x86/xen/xen_intr.c Mon Nov 26 16:54:16 2018 (r340982) @@ -658,7 +658,8 @@ xen_intr_init(void *dummy __unused) xen_intr_pirq_eoi_map_enabled = true; intr_register_pic(&xen_intr_pic); - intr_register_pic(&xen_intr_pirq_pic); + if (xen_pv_domain() && xen_initial_domain()) + intr_register_pic(&xen_intr_pirq_pic); if (bootverbose) printf("Xen interrupt system initialized\n"); From owner-svn-src-stable@freebsd.org Mon Nov 26 22:00:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D85C31145D01; Mon, 26 Nov 2018 22:00:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A23076D2BF; Mon, 26 Nov 2018 22:00:30 +0000 (UTC) (envelope-from gonzo@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 7E47411D02; Mon, 26 Nov 2018 22:00:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQM0UvS053652; Mon, 26 Nov 2018 22:00:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQM0UTJ053651; Mon, 26 Nov 2018 22:00:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201811262200.wAQM0UTJ053651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 26 Nov 2018 22:00:30 +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: r340998 - in stable/12/sys: conf dev/amdgpio modules modules/amdgpio X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: conf dev/amdgpio modules modules/amdgpio X-SVN-Commit-Revision: 340998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A23076D2BF X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.44)[0.444,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.61)[0.611,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 22:00:31 -0000 Author: gonzo Date: Mon Nov 26 22:00:29 2018 New Revision: 340998 URL: https://svnweb.freebsd.org/changeset/base/340998 Log: MFC r339523: Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms Submitted by: Rajesh Kumar Differential Revision: https://reviews.freebsd.org/D16865 Added: stable/12/sys/dev/amdgpio/ - copied from r339523, head/sys/dev/amdgpio/ stable/12/sys/modules/amdgpio/ - copied from r339523, head/sys/modules/amdgpio/ Modified: stable/12/sys/conf/files.amd64 stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Mon Nov 26 21:45:27 2018 (r340997) +++ stable/12/sys/conf/files.amd64 Mon Nov 26 22:00:29 2018 (r340998) @@ -208,6 +208,7 @@ dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp +dev/amdgpio/amdgpio.c optional amdgpio dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdsmn/amdsmn.c optional amdsmn | amdtemp dev/amdtemp/amdtemp.c optional amdtemp Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Mon Nov 26 21:45:27 2018 (r340997) +++ stable/12/sys/modules/Makefile Mon Nov 26 22:00:29 2018 (r340998) @@ -34,6 +34,7 @@ SUBDIR= \ ale \ alq \ ${_amd_ecc_inject} \ + ${_amdgpio} \ ${_amdsbwd} \ ${_amdsmn} \ ${_amdtemp} \ @@ -717,6 +718,7 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" +_amdgpio= amdgpio _ccp= ccp _efirt= efirt _iavf= iavf From owner-svn-src-stable@freebsd.org Mon Nov 26 22:21:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9690E1146BD8; Mon, 26 Nov 2018 22:21:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF4D6E50E; Mon, 26 Nov 2018 22:21:41 +0000 (UTC) (envelope-from brooks@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 03A0912199; Mon, 26 Nov 2018 22:21:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQMLe6j067188; Mon, 26 Nov 2018 22:21:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQMLe8F067187; Mon, 26 Nov 2018 22:21:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811262221.wAQMLe8F067187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 26 Nov 2018 22:21: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: r341000 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 341000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CF4D6E50E X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.59)[0.591,0]; NEURAL_SPAM_SHORT(0.14)[0.136,0]; NEURAL_SPAM_MEDIUM(0.51)[0.513,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 22:21:41 -0000 Author: brooks Date: Mon Nov 26 22:21:40 2018 New Revision: 341000 URL: https://svnweb.freebsd.org/changeset/base/341000 Log: Record r340273, r340275, r340295, r340303 as merged. These commits where the result of running "make sysent" and their counterparts in this branch were direct commits. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-stable@freebsd.org Tue Nov 27 13:06:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF8A114B2C9; Tue, 27 Nov 2018 13:06:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F075C79919; Tue, 27 Nov 2018 13:06:54 +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 D28571BA41; Tue, 27 Nov 2018 13:06:54 +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 wARD6ssh024477; Tue, 27 Nov 2018 13:06:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD6sCV024476; Tue, 27 Nov 2018 13:06:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811271306.wARD6sCV024476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Nov 2018 13:06: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: r341053 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 341053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F075C79919 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.447,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_SPAM_LONG(0.44)[0.441,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:06:55 -0000 Author: kib Date: Tue Nov 27 13:06:54 2018 New Revision: 341053 URL: https://svnweb.freebsd.org/changeset/base/341053 Log: MFC r340675: rtld: when immediate bind mode is requested, process irelocs in PLT immediately after other PLT relocs. Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Tue Nov 27 13:00:51 2018 (r341052) +++ stable/12/libexec/rtld-elf/rtld.c Tue Nov 27 13:06:54 2018 (r341053) @@ -134,6 +134,7 @@ static int relocate_object(Obj_Entry *obj, bool bind_n int flags, RtldLockState *lockstate); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, RtldLockState *); +static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags, RtldLockState *lockstate); static int rtld_dirname(const char *, char *); @@ -2859,9 +2860,11 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent if (reloc_plt(obj) == -1) return (-1); /* Relocate the jump slots if we are doing immediate binding. */ - if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, flags, lockstate) == -1) + if (obj->bind_now || bind_now) { + if (reloc_jmpslots(obj, flags, lockstate) == -1 || + resolve_object_ifunc(obj, true, flags, lockstate) == -1) return (-1); + } /* * Process the non-PLT IFUNC relocations. The relocations are From owner-svn-src-stable@freebsd.org Tue Nov 27 13:14:14 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72747114B61D; Tue, 27 Nov 2018 13:14:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16C0B79E68; Tue, 27 Nov 2018 13:14:14 +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 AD5861BBDA; Tue, 27 Nov 2018 13:14:13 +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 wARDEDaR029410; Tue, 27 Nov 2018 13:14:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARDEDke029409; Tue, 27 Nov 2018 13:14:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811271314.wARDEDke029409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Nov 2018 13:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341054 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 341054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16C0B79E68 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_SPAM_SHORT(0.45)[0.447,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:14:14 -0000 Author: kib Date: Tue Nov 27 13:14:13 2018 New Revision: 341054 URL: https://svnweb.freebsd.org/changeset/base/341054 Log: MFC r340675: rtld: when immediate bind mode is requested, process irelocs in PLT immediately after other PLT relocs. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Tue Nov 27 13:06:54 2018 (r341053) +++ stable/11/libexec/rtld-elf/rtld.c Tue Nov 27 13:14:13 2018 (r341054) @@ -132,6 +132,7 @@ static int relocate_object(Obj_Entry *obj, bool bind_n int flags, RtldLockState *lockstate); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, RtldLockState *); +static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags, RtldLockState *lockstate); static int rtld_dirname(const char *, char *); @@ -2873,9 +2874,11 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent if (reloc_plt(obj) == -1) return (-1); /* Relocate the jump slots if we are doing immediate binding. */ - if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, flags, lockstate) == -1) + if (obj->bind_now || bind_now) { + if (reloc_jmpslots(obj, flags, lockstate) == -1 || + resolve_object_ifunc(obj, true, flags, lockstate) == -1) return (-1); + } /* * Process the non-PLT IFUNC relocations. The relocations are From owner-svn-src-stable@freebsd.org Tue Nov 27 14:02:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91843114D1A8; Tue, 27 Nov 2018 14:02:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59BD87C1CD; Tue, 27 Nov 2018 14:02:00 +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 33AF11C43A; Tue, 27 Nov 2018 14:02:00 +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 wARE1xBV055600; Tue, 27 Nov 2018 14:01:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARE1x1h055599; Tue, 27 Nov 2018 14:01:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811271401.wARE1x1h055599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2018 14:01: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: r341056 - in stable/12: sbin/ipfw sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 341056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59BD87C1CD X-Spamd-Result: default: False [1.60 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_SPAM_SHORT(0.53)[0.526,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:02:00 -0000 Author: ae Date: Tue Nov 27 14:01:59 2018 New Revision: 341056 URL: https://svnweb.freebsd.org/changeset/base/341056 Log: MFC r340689: Make multiline APPLY_MASK() macro to be function-like. Reported by: cem Modified: stable/12/sbin/ipfw/ipv6.c stable/12/sys/netinet/ip_fw.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipv6.c ============================================================================== --- stable/12/sbin/ipfw/ipv6.c Tue Nov 27 13:52:51 2018 (r341055) +++ stable/12/sbin/ipfw/ipv6.c Tue Nov 27 14:01:59 2018 (r341056) @@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru n2mask(&d[1], masklen); } - APPLY_MASK(d, &d[1]) /* mask base address with mask */ + APPLY_MASK(d, &d[1]); /* mask base address with mask */ av = q; Modified: stable/12/sys/netinet/ip_fw.h ============================================================================== --- stable/12/sys/netinet/ip_fw.h Tue Nov 27 13:52:51 2018 (r341055) +++ stable/12/sys/netinet/ip_fw.h Tue Nov 27 14:01:59 2018 (r341056) @@ -551,11 +551,12 @@ typedef struct _ipfw_insn_nat { } ipfw_insn_nat; /* Apply ipv6 mask on ipv6 addr */ -#define APPLY_MASK(addr,mask) \ +#define APPLY_MASK(addr,mask) do { \ (addr)->__u6_addr.__u6_addr32[0] &= (mask)->__u6_addr.__u6_addr32[0]; \ (addr)->__u6_addr.__u6_addr32[1] &= (mask)->__u6_addr.__u6_addr32[1]; \ (addr)->__u6_addr.__u6_addr32[2] &= (mask)->__u6_addr.__u6_addr32[2]; \ - (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; + (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; \ +} while (0) /* Structure for ipv6 */ typedef struct _ipfw_insn_ip6 { From owner-svn-src-stable@freebsd.org Tue Nov 27 14:03:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336B4114D4C0; Tue, 27 Nov 2018 14:03:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C68FD7C556; Tue, 27 Nov 2018 14:03:40 +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 A17231C460; Tue, 27 Nov 2018 14:03:40 +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 wARE3et2055839; Tue, 27 Nov 2018 14:03:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARE3ekS055838; Tue, 27 Nov 2018 14:03:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811271403.wARE3ekS055838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2018 14:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341057 - in stable/11: sbin/ipfw sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 341057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C68FD7C556 X-Spamd-Result: default: False [1.60 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_SPAM_SHORT(0.53)[0.526,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:03:41 -0000 Author: ae Date: Tue Nov 27 14:03:40 2018 New Revision: 341057 URL: https://svnweb.freebsd.org/changeset/base/341057 Log: MFC r340689: Make multiline APPLY_MASK() macro to be function-like. Reported by: cem Modified: stable/11/sbin/ipfw/ipv6.c stable/11/sys/netinet/ip_fw.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipv6.c ============================================================================== --- stable/11/sbin/ipfw/ipv6.c Tue Nov 27 14:01:59 2018 (r341056) +++ stable/11/sbin/ipfw/ipv6.c Tue Nov 27 14:03:40 2018 (r341057) @@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru n2mask(&d[1], masklen); } - APPLY_MASK(d, &d[1]) /* mask base address with mask */ + APPLY_MASK(d, &d[1]); /* mask base address with mask */ av = q; Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Tue Nov 27 14:01:59 2018 (r341056) +++ stable/11/sys/netinet/ip_fw.h Tue Nov 27 14:03:40 2018 (r341057) @@ -549,11 +549,12 @@ typedef struct _ipfw_insn_nat { } ipfw_insn_nat; /* Apply ipv6 mask on ipv6 addr */ -#define APPLY_MASK(addr,mask) \ +#define APPLY_MASK(addr,mask) do { \ (addr)->__u6_addr.__u6_addr32[0] &= (mask)->__u6_addr.__u6_addr32[0]; \ (addr)->__u6_addr.__u6_addr32[1] &= (mask)->__u6_addr.__u6_addr32[1]; \ (addr)->__u6_addr.__u6_addr32[2] &= (mask)->__u6_addr.__u6_addr32[2]; \ - (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; + (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; \ +} while (0) /* Structure for ipv6 */ typedef struct _ipfw_insn_ip6 { From owner-svn-src-stable@freebsd.org Tue Nov 27 16:09:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 634D11152071; Tue, 27 Nov 2018 16:09:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A54883064; Tue, 27 Nov 2018 16:09:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF1FC1D91B; Tue, 27 Nov 2018 16:09:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARG9GUj018222; Tue, 27 Nov 2018 16:09:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARG9GM0018221; Tue, 27 Nov 2018 16:09:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201811271609.wARG9GM0018221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 27 Nov 2018 16:09: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: r341069 - stable/12/stand/i386/gptboot X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/stand/i386/gptboot X-SVN-Commit-Revision: 341069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A54883064 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:09:17 -0000 Author: ian Date: Tue Nov 27 16:09:16 2018 New Revision: 341069 URL: https://svnweb.freebsd.org/changeset/base/341069 Log: Restore the ability to override the disk unit/partition at the boot: prompt in gptboot. When arch-independent geli support was added, a new static 'gdsk' struct was added, but there was still a static 'dsk' struct, and when you typed in an alternate disk/partition, the string was parsed into that struct, which was then never used for anything. Now the string gets parsed into gdsk.dsk, the struct that's actually used. X-MFC after: 3 days Modified: stable/12/stand/i386/gptboot/gptboot.c Modified: stable/12/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/12/stand/i386/gptboot/gptboot.c Tue Nov 27 15:12:34 2018 (r341068) +++ stable/12/stand/i386/gptboot/gptboot.c Tue Nov 27 16:09:16 2018 (r341069) @@ -81,7 +81,6 @@ uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; -static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; @@ -569,22 +568,22 @@ parse_cmds(char *cmdstr, int *dskupdated) arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) return (-1); - dsk.type = i; + gdsk.dsk.type = i; arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != 'p' || dsk.unit > 9) + gdsk.dsk.unit = *arg - '0'; + if (arg[1] != 'p' || gdsk.dsk.unit > 9) return (-1); arg += 2; - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) + gdsk.dsk.part = *arg - '0'; + if (gdsk.dsk.part < 1 || gdsk.dsk.part > 9) return (-1); arg++; if (arg[0] != ')') return (-1); arg++; if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD + drv = gdsk.dsk.unit; + gdsk.dsk.drive = (gdsk.dsk.type <= TYPE_MAXHARD ? DRV_HARD : 0) + drv; *dskupdated = 1; } From owner-svn-src-stable@freebsd.org Tue Nov 27 16:13:57 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1DD115237B; Tue, 27 Nov 2018 16:13:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D41EF8363A; Tue, 27 Nov 2018 16:13:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2CB01DAAE; Tue, 27 Nov 2018 16:13:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARGDu1w023007; Tue, 27 Nov 2018 16:13:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGDuDM023006; Tue, 27 Nov 2018 16:13:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201811271613.wARGDuDM023006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 27 Nov 2018 16:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341070 - stable/12/stand/i386/gptboot X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/stand/i386/gptboot X-SVN-Commit-Revision: 341070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D41EF8363A X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:13:57 -0000 Author: ian Date: Tue Nov 27 16:13:56 2018 New Revision: 341070 URL: https://svnweb.freebsd.org/changeset/base/341070 Log: Revert r341069, I committed it to the wrong branch. Modified: stable/12/stand/i386/gptboot/gptboot.c Modified: stable/12/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/12/stand/i386/gptboot/gptboot.c Tue Nov 27 16:09:16 2018 (r341069) +++ stable/12/stand/i386/gptboot/gptboot.c Tue Nov 27 16:13:56 2018 (r341070) @@ -81,6 +81,7 @@ uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; @@ -568,22 +569,22 @@ parse_cmds(char *cmdstr, int *dskupdated) arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) return (-1); - gdsk.dsk.type = i; + dsk.type = i; arg += 3; - gdsk.dsk.unit = *arg - '0'; - if (arg[1] != 'p' || gdsk.dsk.unit > 9) + dsk.unit = *arg - '0'; + if (arg[1] != 'p' || dsk.unit > 9) return (-1); arg += 2; - gdsk.dsk.part = *arg - '0'; - if (gdsk.dsk.part < 1 || gdsk.dsk.part > 9) + dsk.part = *arg - '0'; + if (dsk.part < 1 || dsk.part > 9) return (-1); arg++; if (arg[0] != ')') return (-1); arg++; if (drv == -1) - drv = gdsk.dsk.unit; - gdsk.dsk.drive = (gdsk.dsk.type <= TYPE_MAXHARD + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD ? DRV_HARD : 0) + drv; *dskupdated = 1; } From owner-svn-src-stable@freebsd.org Tue Nov 27 16:51:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 297CC1153B45; Tue, 27 Nov 2018 16:51: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE8F785CD4; Tue, 27 Nov 2018 16:51:22 +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 B00331E04A; Tue, 27 Nov 2018 16:51:22 +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 wARGpM57044764; Tue, 27 Nov 2018 16:51:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGpIt5042522; Tue, 27 Nov 2018 16:51:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271651.wARGpIt5042522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 16:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341074 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/pseudofs fs/smbfs f... X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys u... X-SVN-Commit-Revision: 341074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE8F785CD4 X-Spamd-Result: default: False [1.30 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.025,0]; NEURAL_SPAM_LONG(0.57)[0.574,0]; NEURAL_SPAM_MEDIUM(0.75)[0.750,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:51:23 -0000 Author: markj Date: Tue Nov 27 16:51:18 2018 New Revision: 341074 URL: https://svnweb.freebsd.org/changeset/base/341074 Log: MFC r340856: Ensure that directory entry padding bytes are zeroed. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/11/sys/fs/autofs/autofs_vnops.c stable/11/sys/fs/cd9660/cd9660_vnops.c stable/11/sys/fs/devfs/devfs_devs.c stable/11/sys/fs/ext2fs/ext2_lookup.c stable/11/sys/fs/fdescfs/fdesc_vnops.c stable/11/sys/fs/fuse/fuse_internal.c stable/11/sys/fs/msdosfs/msdosfs_vnops.c stable/11/sys/fs/nandfs/nandfs_vnops.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/pseudofs/pseudofs_vnops.c stable/11/sys/fs/smbfs/smbfs_io.c stable/11/sys/fs/tmpfs/tmpfs_subr.c stable/11/sys/fs/tmpfs/tmpfs_vfsops.c stable/11/sys/fs/tmpfs/tmpfs_vnops.c stable/11/sys/fs/udf/udf_vnops.c stable/11/sys/kern/uipc_mqueue.c stable/11/sys/kern/vfs_export.c stable/11/sys/sys/dirent.h stable/11/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Nov 27 16:51:18 2018 (r341074) @@ -262,9 +262,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_fileno = id; entry.d_type = DT_DIR; entry.d_name[0] = '.'; - entry.d_name[1] = '\0'; entry.d_namlen = 1; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -277,9 +277,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_type = DT_DIR; entry.d_name[0] = '.'; entry.d_name[1] = '.'; - entry.d_name[2] = '\0'; entry.d_namlen = 2; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -694,6 +694,7 @@ zfsctl_root_readdir(ap) strcpy(entry.d_name, node->snapdir->sn_name); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) @@ -1097,6 +1098,7 @@ zfsctl_snapdir_readdir(ap) strcpy(entry.d_name, snapname); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -2545,6 +2545,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * odp->d_namlen = strlen(zap.za_name); (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; + dirent_terminate(odp); odp = (dirent64_t *)((intptr_t)odp + reclen); } outcount += reclen; Modified: stable/11/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/11/sys/fs/autofs/autofs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/autofs/autofs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -361,7 +361,6 @@ autofs_readdir_one(struct uio *uio, const char *name, padded_namlen = roundup2(namlen + 1, __alignof(struct dirent)); KASSERT(padded_namlen <= MAXNAMLEN, ("%zd > MAXNAMLEN", padded_namlen)); reclen = offsetof(struct dirent, d_name) + padded_namlen; - if (reclenp != NULL) *reclenp = reclen; @@ -376,7 +375,7 @@ autofs_readdir_one(struct uio *uio, const char *name, dirent.d_type = DT_DIR; dirent.d_namlen = namlen; memcpy(dirent.d_name, name, namlen); - memset(dirent.d_name + namlen, 0, padded_namlen - namlen); + dirent_terminate(&dirent); error = uiomove(&dirent, reclen, uio); return (error); Modified: stable/11/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/11/sys/fs/cd9660/cd9660_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/cd9660/cd9660_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -378,8 +378,8 @@ iso_uiodir(idp,dp,off) { int error; - dp->d_name[dp->d_namlen] = 0; dp->d_reclen = GENERIC_DIRSIZ(dp); + dirent_terminate(dp); if (idp->uio->uio_resid < dp->d_reclen) { idp->eofflag = 0; Modified: stable/11/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_devs.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/devfs/devfs_devs.c Tue Nov 27 16:51:18 2018 (r341074) @@ -214,7 +214,7 @@ devfs_newdirent(char *name, int namelen) de->de_dirent->d_namlen = namelen; de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d); bcopy(name, de->de_dirent->d_name, namelen); - de->de_dirent->d_name[namelen] = '\0'; + dirent_terminate(de->de_dirent); vfs_timestamp(&de->de_ctime); de->de_mtime = de->de_atime = de->de_ctime; de->de_links = 1; Modified: stable/11/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_lookup.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/ext2fs/ext2_lookup.c Tue Nov 27 16:51:18 2018 (r341074) @@ -219,7 +219,7 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/11/sys/fs/fdescfs/fdesc_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/fdescfs/fdesc_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -560,8 +560,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_namlen = i + 1; dp->d_reclen = UIO_MX; bcopy("..", dp->d_name, dp->d_namlen); - dp->d_name[i + 1] = '\0'; dp->d_type = DT_DIR; + dirent_terminate(dp); break; default: if (fdp->fd_ofiles[fcnt].fde_file == NULL) @@ -571,6 +571,7 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; + dirent_terminate(dp); break; } if (dp->d_namlen != 0) { Modified: stable/11/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_internal.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/fuse/fuse_internal.c Tue Nov 27 16:51:18 2018 (r341074) @@ -355,7 +355,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail - 1] = '\0'; + dirent_terminate(de); err = uiomove(cookediov->base, cookediov->len, uio); if (err) { Modified: stable/11/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/msdosfs/msdosfs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -1561,14 +1561,16 @@ msdosfs_readdir(struct vop_readdir_args *ap) switch (n) { case 0: dirbuf.d_namlen = 1; - strcpy(dirbuf.d_name, "."); + dirbuf.d_name[0] = '.'; break; case 1: dirbuf.d_namlen = 2; - strcpy(dirbuf.d_name, ".."); + dirbuf.d_name[0] = '.'; + dirbuf.d_name[1] = '.'; break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); Modified: stable/11/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/11/sys/fs/nandfs/nandfs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/nandfs/nandfs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -1225,13 +1225,14 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; - memset(&dirent, 0, sizeof(struct dirent)); + memset(&dirent, 0, sizeof(dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; dirent.d_namlen = name_len; strncpy(dirent.d_name, ndirent->name, name_len); dirent.d_reclen = GENERIC_DIRSIZ(&dirent); + dirent_terminate(&dirent); DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } @@ -1245,7 +1246,7 @@ nandfs_readdir(struct vop_readdir_args *ap) /* Transfer */ if (dirent.d_fileno) - uiomove(&dirent, GENERIC_DIRSIZ(&dirent), uio); + uiomove(&dirent, dirent.d_reclen, uio); /* Advance */ diroffset += ndirent->rec_len; Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -3036,6 +3036,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 tlen += 4; /* To ensure null termination */ left = DIRBLKSIZ - blksiz; if ((int)(tlen + DIRHDSIZ + NFSX_HYPER) > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3062,7 +3063,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 goto nfsmout; cp = CAST_DOWN(caddr_t, uio_iov_base(uiop)); tlen -= len; - *cp = '\0'; /* null terminate */ + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; uio_iov_base_add(uiop, (tlen + NFSX_HYPER)); @@ -3150,6 +3151,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3177,10 +3179,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ while (uio_uio_resid(uiop) > 0 && ((size_t)(uio_uio_resid(uiop))) != tresid) { dp = (struct dirent *) CAST_DOWN(caddr_t, uio_iov_base(uiop)); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; @@ -3444,6 +3444,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui tlen += 4; /* To ensure null termination */ left = DIRBLKSIZ - blksiz; if ((tlen + DIRHDSIZ + NFSX_HYPER) > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3473,7 +3474,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; if (len == 2 && cnp->cn_nameptr[0] == '.' && @@ -3643,6 +3644,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3670,10 +3672,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; Modified: stable/11/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/pseudofs/pseudofs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -826,7 +826,6 @@ pfs_readdir(struct vop_readdir_args *va) /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) pfsent->entry.d_name[i] = pn->pn_name[i]; - pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; switch (pn->pn_type) { case pfstype_procdir: @@ -851,6 +850,7 @@ pfs_readdir(struct vop_readdir_args *va) panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } PFS_TRACE(("%s", pfsent->entry.d_name)); + dirent_terminate(&pfsent->entry); STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; Modified: stable/11/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/11/sys/fs/smbfs/smbfs_io.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/smbfs/smbfs_io.c Tue Nov 27 16:51:18 2018 (r341074) @@ -104,8 +104,8 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_namlen = offset + 1; de.d_name[0] = '.'; de.d_name[1] = '.'; - de.d_name[offset + 1] = '\0'; de.d_type = DT_DIR; + dirent_terminate(&de); error = uiomove(&de, DE_SIZE, uio); if (error) goto out; @@ -154,7 +154,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; de.d_namlen = ctx->f_nmlen; bcopy(ctx->f_name, de.d_name, de.d_namlen); - de.d_name[de.d_namlen] = '\0'; + dirent_terminate(&de); if (smbfs_fastlookup) { error = smbfs_nget(vp->v_mount, vp, ctx->f_name, ctx->f_nmlen, &ctx->f_attr, &newvp); Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 27 16:51:18 2018 (r341074) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -45,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1115,8 +1116,8 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u dent.d_type = DT_DIR; dent.d_namlen = 1; dent.d_name[0] = '.'; - dent.d_name[1] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1159,8 +1160,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc dent.d_namlen = 2; dent.d_name[0] = '.'; dent.d_name[1] = '.'; - dent.d_name[2] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1280,8 +1281,8 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); - d.d_name[de->td_namelen] = '\0'; d.d_reclen = GENERIC_DIRSIZ(&d); + dirent_terminate(&d); /* Stop reading if the directory entry we are treating is * bigger than the amount of data that can be returned. */ Modified: stable/11/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/11/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/tmpfs/tmpfs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/11/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/11/sys/fs/udf/udf_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/fs/udf/udf_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -841,9 +841,9 @@ udf_readdir(struct vop_readdir_args *a) dir.d_fileno = node->hash_id; dir.d_type = DT_DIR; dir.d_name[0] = '.'; - dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -853,9 +853,9 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = DT_DIR; dir.d_name[0] = '.'; dir.d_name[1] = '.'; - dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -865,6 +865,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = (fid->file_char & UDF_FILE_CHAR_DIR) ? DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: stable/11/sys/kern/uipc_mqueue.c ============================================================================== --- stable/11/sys/kern/uipc_mqueue.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/kern/uipc_mqueue.c Tue Nov 27 16:51:18 2018 (r341074) @@ -1421,7 +1421,6 @@ mqfs_readdir(struct vop_readdir_args *ap) entry.d_fileno = pn->mn_fileno; for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i) entry.d_name[i] = pn->mn_name[i]; - entry.d_name[i] = 0; entry.d_namlen = i; switch (pn->mn_type) { case mqfstype_root: @@ -1440,6 +1439,7 @@ mqfs_readdir(struct vop_readdir_args *ap) panic("%s has unexpected node type: %d", pn->mn_name, pn->mn_type); } + dirent_terminate(&entry); if (entry.d_reclen > uio->uio_resid) break; if (offset >= uio->uio_offset) { Modified: stable/11/sys/kern/vfs_export.c ============================================================================== --- stable/11/sys/kern/vfs_export.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/kern/vfs_export.c Tue Nov 27 16:51:18 2018 (r341074) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include @@ -53,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/11/sys/sys/dirent.h ============================================================================== --- stable/11/sys/sys/dirent.h Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/sys/dirent.h Tue Nov 27 16:51:18 2018 (r341074) @@ -95,6 +95,17 @@ struct dirent { #ifdef _KERNEL #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) + +/* + * Ensure that padding bytes are zeroed and that the name is NUL-terminated. + */ +static inline void +dirent_terminate(struct dirent *dp) +{ + + memset(dp->d_name + dp->d_namlen, 0, + dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); +} #endif #endif /* !_SYS_DIRENT_H_ */ Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Tue Nov 27 16:51:01 2018 (r341073) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Tue Nov 27 16:51:18 2018 (r341074) @@ -2216,7 +2216,7 @@ ufs_readdir(ap) dstdp.d_fileno = dp->d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-stable@freebsd.org Tue Nov 27 16:54:24 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D28C31153E6A; Tue, 27 Nov 2018 16:54:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 788198605C; Tue, 27 Nov 2018 16:54:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A3B11E1B6; Tue, 27 Nov 2018 16:54:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARGsO7O045148; Tue, 27 Nov 2018 16:54:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGsOhd045146; Tue, 27 Nov 2018 16:54:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271654.wARGsOhd045146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 16:54: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: r341075 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 341075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 788198605C X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:54:25 -0000 Author: markj Date: Tue Nov 27 16:54:23 2018 New Revision: 341075 URL: https://svnweb.freebsd.org/changeset/base/341075 Log: MFC r340899: Plug some kernel memory disclosures via kevent(2). Modified: stable/12/sys/kern/kern_event.c stable/12/sys/kern/vfs_aio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Tue Nov 27 16:51:18 2018 (r341074) +++ stable/12/sys/kern/kern_event.c Tue Nov 27 16:54:23 2018 (r341075) @@ -535,8 +535,9 @@ knote_fork(struct knlist *list, int pid) if (list == NULL) return; - list->kl_lock(list->kl_lockarg); + memset(&kev, 0, sizeof(kev)); + list->kl_lock(list->kl_lockarg); SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; KQ_LOCK(kq); Modified: stable/12/sys/kern/vfs_aio.c ============================================================================== --- stable/12/sys/kern/vfs_aio.c Tue Nov 27 16:51:18 2018 (r341074) +++ stable/12/sys/kern/vfs_aio.c Tue Nov 27 16:54:23 2018 (r341075) @@ -1589,6 +1589,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru goto aqueue_fail; } kqfd = job->uaiocb.aio_sigevent.sigev_notify_kqueue; + memset(&kev, 0, sizeof(kev)); kev.ident = (uintptr_t)job->ujob; kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; @@ -2155,6 +2156,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { /* Assume only new style KEVENT */ + memset(&kev, 0, sizeof(kev)); kev.filter = EVFILT_LIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; kev.ident = (uintptr_t)uacb_list; /* something unique */ From owner-svn-src-stable@freebsd.org Tue Nov 27 16:55:26 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDDF31153F5A; Tue, 27 Nov 2018 16:55:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9407B86282; Tue, 27 Nov 2018 16:55:25 +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 74FC21E1BB; Tue, 27 Nov 2018 16:55:25 +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 wARGtPJX045338; Tue, 27 Nov 2018 16:55:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGtP0s045336; Tue, 27 Nov 2018 16:55:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271655.wARGtP0s045336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 16:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341076 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 341076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9407B86282 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:55:26 -0000 Author: markj Date: Tue Nov 27 16:55:24 2018 New Revision: 341076 URL: https://svnweb.freebsd.org/changeset/base/341076 Log: MFC r340899: Plug some kernel memory disclosures via kevent(2). Modified: stable/11/sys/kern/kern_event.c stable/11/sys/kern/vfs_aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Tue Nov 27 16:54:23 2018 (r341075) +++ stable/11/sys/kern/kern_event.c Tue Nov 27 16:55:24 2018 (r341076) @@ -498,8 +498,9 @@ knote_fork(struct knlist *list, int pid) if (list == NULL) return; - list->kl_lock(list->kl_lockarg); + memset(&kev, 0, sizeof(kev)); + list->kl_lock(list->kl_lockarg); SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; KQ_LOCK(kq); Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Tue Nov 27 16:54:23 2018 (r341075) +++ stable/11/sys/kern/vfs_aio.c Tue Nov 27 16:55:24 2018 (r341076) @@ -1594,6 +1594,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru goto aqueue_fail; } kqfd = job->uaiocb.aio_sigevent.sigev_notify_kqueue; + memset(&kev, 0, sizeof(kev)); kev.ident = (uintptr_t)job->ujob; kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; @@ -2163,6 +2164,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { /* Assume only new style KEVENT */ + memset(&kev, 0, sizeof(kev)); kev.filter = EVFILT_LIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; kev.ident = (uintptr_t)uacb_list; /* something unique */ From owner-svn-src-stable@freebsd.org Tue Nov 27 16:58:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F07711540C4; Tue, 27 Nov 2018 16:58:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8E4186505; Tue, 27 Nov 2018 16:57:59 +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 A91241E1BF; Tue, 27 Nov 2018 16:57:59 +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 wARGvxQw045494; Tue, 27 Nov 2018 16:57:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGvx6p045493; Tue, 27 Nov 2018 16:57:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271657.wARGvx6p045493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 16:57: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: r341077 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 341077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8E4186505 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:58:00 -0000 Author: markj Date: Tue Nov 27 16:57:59 2018 New Revision: 341077 URL: https://svnweb.freebsd.org/changeset/base/341077 Log: MFC r340897: Lock the knlist before releasing the in-flux state in knote_fork(). PR: 228858 Modified: stable/12/sys/kern/kern_event.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Tue Nov 27 16:55:24 2018 (r341076) +++ stable/12/sys/kern/kern_event.c Tue Nov 27 16:57:59 2018 (r341077) @@ -603,10 +603,10 @@ knote_fork(struct knlist *list, int pid) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 0); + list->kl_lock(list->kl_lockarg); KQ_LOCK(kq); kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); - list->kl_lock(list->kl_lockarg); } list->kl_unlock(list->kl_lockarg); } From owner-svn-src-stable@freebsd.org Tue Nov 27 16:59:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C94D411541C1; Tue, 27 Nov 2018 16:59:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51E9386704; Tue, 27 Nov 2018 16:59:13 +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 32FA41E1C4; Tue, 27 Nov 2018 16:59:13 +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 wARGxDv4045614; Tue, 27 Nov 2018 16:59:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGxD64045613; Tue, 27 Nov 2018 16:59:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271659.wARGxD64045613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 16:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341078 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 341078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51E9386704 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.01)[-0.007,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:59:14 -0000 Author: markj Date: Tue Nov 27 16:59:12 2018 New Revision: 341078 URL: https://svnweb.freebsd.org/changeset/base/341078 Log: MFC r340897: Lock the knlist before releasing the in-flux state in knote_fork(). PR: 228858 Modified: stable/11/sys/kern/kern_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Tue Nov 27 16:57:59 2018 (r341077) +++ stable/11/sys/kern/kern_event.c Tue Nov 27 16:59:12 2018 (r341078) @@ -566,10 +566,10 @@ knote_fork(struct knlist *list, int pid) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 0); + list->kl_lock(list->kl_lockarg); KQ_LOCK(kq); kn->kn_status &= ~KN_INFLUX; KQ_UNLOCK_FLUX(kq); - list->kl_lock(list->kl_lockarg); } list->kl_unlock(list->kl_lockarg); } From owner-svn-src-stable@freebsd.org Tue Nov 27 17:00:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9D0D11543CB; Tue, 27 Nov 2018 17:00:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FA186B50; Tue, 27 Nov 2018 17:00:48 +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 2B1051E1D9; Tue, 27 Nov 2018 17:00:48 +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 wARH0mXC045812; Tue, 27 Nov 2018 17:00:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARH0lY5045808; Tue, 27 Nov 2018 17:00:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271700.wARH0lY5045808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 17:00:47 +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: r341079 - in stable/12: lib/libnv lib/libnv/tests sys/contrib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: lib/libnv lib/libnv/tests sys/contrib/libnv X-SVN-Commit-Revision: 341079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49FA186B50 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_SHORT(0.02)[0.019,0]; NEURAL_SPAM_MEDIUM(0.68)[0.676,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:00:49 -0000 Author: markj Date: Tue Nov 27 17:00:47 2018 New Revision: 341079 URL: https://svnweb.freebsd.org/changeset/base/341079 Log: MFC r340408: Ensure that libnv can be used when kern.trap_enotcap=1. Modified: stable/12/lib/libnv/common_impl.h stable/12/lib/libnv/msgio.c stable/12/lib/libnv/tests/nvlist_send_recv_test.c stable/12/sys/contrib/libnv/nvpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libnv/common_impl.h ============================================================================== --- stable/12/lib/libnv/common_impl.h Tue Nov 27 16:59:12 2018 (r341078) +++ stable/12/lib/libnv/common_impl.h Tue Nov 27 17:00:47 2018 (r341079) @@ -34,6 +34,15 @@ #ifndef _COMMON_IMPL_H_ #define _COMMON_IMPL_H_ -#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) +#include +#include +#include + +static inline bool +fd_is_valid(int fd) +{ + + return (fcntl(fd, F_GETFD) != -1 || errno != EBADF); +} #endif /* !_COMMON_IMPL_H_ */ Modified: stable/12/lib/libnv/msgio.c ============================================================================== --- stable/12/lib/libnv/msgio.c Tue Nov 27 16:59:12 2018 (r341078) +++ stable/12/lib/libnv/msgio.c Tue Nov 27 17:00:47 2018 (r341079) @@ -66,11 +66,6 @@ msghdr_add_fd(struct cmsghdr *cmsg, int fd) PJDLOG_ASSERT(fd >= 0); - if (!fd_is_valid(fd)) { - errno = EBADF; - return (-1); - } - cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); Modified: stable/12/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- stable/12/lib/libnv/tests/nvlist_send_recv_test.c Tue Nov 27 16:59:12 2018 (r341078) +++ stable/12/lib/libnv/tests/nvlist_send_recv_test.c Tue Nov 27 17:00:47 2018 (r341079) @@ -306,15 +306,12 @@ parent(int sock) CHECK(name == NULL); } -int -main(void) +static void +send_nvlist(void) { int status, socks[2]; pid_t pid; - printf("1..134\n"); - fflush(stdout); - if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) err(1, "socketpair() failed"); pid = fork(); @@ -326,7 +323,7 @@ main(void) /* Child. */ close(socks[0]); child(socks[1]); - return (0); + _exit(0); default: /* Parent. */ close(socks[1]); @@ -336,6 +333,35 @@ main(void) if (waitpid(pid, &status, 0) < 0) err(1, "waitpid() failed"); +} + +static void +send_closed_fd(void) +{ + nvlist_t *nvl; + int error, socks[2]; + + if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) + err(1, "socketpair() failed"); + + nvl = nvlist_create(0); + nvlist_add_descriptor(nvl, "fd", 12345); + error = nvlist_error(nvl); + CHECK(error == EBADF); + + error = nvlist_send(socks[1], nvl); + CHECK(error != 0 && errno == EBADF); +} + +int +main(void) +{ + + printf("1..136\n"); + fflush(stdout); + + send_nvlist(); + send_closed_fd(); return (0); } Modified: stable/12/sys/contrib/libnv/nvpair.c ============================================================================== --- stable/12/sys/contrib/libnv/nvpair.c Tue Nov 27 16:59:12 2018 (r341078) +++ stable/12/sys/contrib/libnv/nvpair.c Tue Nov 27 17:00:47 2018 (r341079) @@ -1276,11 +1276,6 @@ nvpair_create_descriptor(const char *name, int value) { nvpair_t *nvp; - if (value < 0 || !fd_is_valid(value)) { - ERRNO_SET(EBADF); - return (NULL); - } - value = fcntl(value, F_DUPFD_CLOEXEC, 0); if (value < 0) return (NULL); @@ -1517,11 +1512,6 @@ nvpair_create_descriptor_array(const char *name, const if (value[ii] == -1) { fds[ii] = -1; } else { - if (!fd_is_valid(value[ii])) { - ERRNO_SET(EBADF); - goto fail; - } - fds[ii] = fcntl(value[ii], F_DUPFD_CLOEXEC, 0); if (fds[ii] == -1) goto fail; @@ -2035,10 +2025,6 @@ nvpair_append_descriptor_array(nvpair_t *nvp, const in NVPAIR_ASSERT(nvp); PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR_ARRAY); - if (value < 0 || !fd_is_valid(value)) { - ERRNO_SET(EBADF); - return -1; - } fd = fcntl(value, F_DUPFD_CLOEXEC, 0); if (fd == -1) { return (-1); From owner-svn-src-stable@freebsd.org Tue Nov 27 17:02:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FCF5115469C; Tue, 27 Nov 2018 17:02:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB0686F5C; Tue, 27 Nov 2018 17:02:16 +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 DE7571E343; Tue, 27 Nov 2018 17:02:15 +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 wARH2F6m050886; Tue, 27 Nov 2018 17:02:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARH2Flk050884; Tue, 27 Nov 2018 17:02:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271702.wARH2Flk050884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 17:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341080 - stable/12/sys/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/include X-SVN-Commit-Revision: 341080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BB0686F5C X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.001,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:02:16 -0000 Author: markj Date: Tue Nov 27 17:02:15 2018 New Revision: 341080 URL: https://svnweb.freebsd.org/changeset/base/341080 Log: MFC r340399: RISC-V: Add macros for reading performance counter CSRs. Modified: stable/12/sys/riscv/include/cpufunc.h stable/12/sys/riscv/include/riscvreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/cpufunc.h ============================================================================== --- stable/12/sys/riscv/include/cpufunc.h Tue Nov 27 17:00:47 2018 (r341079) +++ stable/12/sys/riscv/include/cpufunc.h Tue Nov 27 17:02:15 2018 (r341080) @@ -104,6 +104,11 @@ sfence_vma_page(uintptr_t addr) __asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); } +#define rdcycle() csr_read64(cycle) +#define rdtime() csr_read64(time) +#define rdinstret() csr_read64(instret) +#define rdhpmcounter(n) csr_read64(hpmcounter##n) + #define cpufunc_nullop() riscv_nullop() void riscv_nullop(void); Modified: stable/12/sys/riscv/include/riscvreg.h ============================================================================== --- stable/12/sys/riscv/include/riscvreg.h Tue Nov 27 17:00:47 2018 (r341079) +++ stable/12/sys/riscv/include/riscvreg.h Tue Nov 27 17:02:15 2018 (r341080) @@ -223,4 +223,23 @@ val; \ }) +#if __riscv_xlen == 32 +#define csr_read64(csr) \ +({ uint64_t val; \ + uint32_t high, low; \ + __asm __volatile("1: " \ + "csrr t0, " #csr "h\n" \ + "csrr %0, " #csr "\n" \ + "csrr %1, " #csr "h\n" \ + "bne t0, %1, 1b" \ + : "=r" (low), "=r" (high) \ + : \ + : "t0"); \ + val = (low | ((uint64_t)high << 32)); \ + val; \ +}) +#else +#define csr_read64(csr) ((uint64_t)csr_read(csr)) +#endif + #endif /* !_MACHINE_RISCVREG_H_ */ From owner-svn-src-stable@freebsd.org Tue Nov 27 17:03:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B971154776; Tue, 27 Nov 2018 17:03:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C84E587112; Tue, 27 Nov 2018 17:03:15 +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 A07341E35C; Tue, 27 Nov 2018 17:03:15 +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 wARH3Fxi050985; Tue, 27 Nov 2018 17:03:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARH3FQ8050984; Tue, 27 Nov 2018 17:03:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271703.wARH3FQ8050984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 17:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341081 - stable/12/sys/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/include X-SVN-Commit-Revision: 341081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C84E587112 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.001,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:03:16 -0000 Author: markj Date: Tue Nov 27 17:03:15 2018 New Revision: 341081 URL: https://svnweb.freebsd.org/changeset/base/341081 Log: MFC r340400: RISC-V: Implement get_cyclecount(9). Modified: stable/12/sys/riscv/include/cpu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/cpu.h ============================================================================== --- stable/12/sys/riscv/include/cpu.h Tue Nov 27 17:02:15 2018 (r341080) +++ stable/12/sys/riscv/include/cpu.h Tue Nov 27 17:03:15 2018 (r341081) @@ -38,6 +38,7 @@ #define _MACHINE_CPU_H_ #include +#include #include #define TRAPF_PC(tfp) ((tfp)->tf_ra) @@ -86,8 +87,7 @@ static __inline uint64_t get_cyclecount(void) { - /* TODO: This is bogus */ - return (1); + return (rdcycle()); } #endif From owner-svn-src-stable@freebsd.org Tue Nov 27 17:08:09 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5487911549D1; Tue, 27 Nov 2018 17:08:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFE1587439; Tue, 27 Nov 2018 17:08:08 +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 784D71E37D; Tue, 27 Nov 2018 17:08:08 +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 wARH884x051402; Tue, 27 Nov 2018 17:08:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARH88UE051401; Tue, 27 Nov 2018 17:08:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271708.wARH88UE051401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 17:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341082 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 341082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFE1587439 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.68)[0.676,0]; NEURAL_SPAM_SHORT(0.02)[0.019,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:08:09 -0000 Author: markj Date: Tue Nov 27 17:08:07 2018 New Revision: 341082 URL: https://svnweb.freebsd.org/changeset/base/341082 Log: MFC r340898: Ensure that knotes do not get registered when KQ_CLOSING is set. PR: 228858 Modified: stable/12/sys/kern/kern_event.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Tue Nov 27 17:03:15 2018 (r341081) +++ stable/12/sys/kern/kern_event.c Tue Nov 27 17:08:07 2018 (r341082) @@ -1463,8 +1463,11 @@ findkn: break; } } else { - if ((kev->flags & EV_ADD) == EV_ADD) - kqueue_expand(kq, fops, kev->ident, waitok); + if ((kev->flags & EV_ADD) == EV_ADD) { + error = kqueue_expand(kq, fops, kev->ident, waitok); + if (error != 0) + goto done; + } KQ_LOCK(kq); @@ -1700,12 +1703,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; - int size; - int fd; + int error, fd, size; int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); + error = 0; to_free = NULL; if (fops->f_isfd) { fd = ident; @@ -1717,9 +1720,11 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop if (list == NULL) return ENOMEM; KQ_LOCK(kq); - if (kq->kq_knlistsize > fd) { + if ((kq->kq_state & KQ_CLOSING) != 0) { to_free = list; - list = NULL; + error = EBADF; + } else if (kq->kq_knlistsize > fd) { + to_free = list; } else { if (kq->kq_knlist != NULL) { bcopy(kq->kq_knlist, list, @@ -1740,9 +1745,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, &tmp_knhashmask); if (tmp_knhash == NULL) - return ENOMEM; + return (ENOMEM); KQ_LOCK(kq); - if (kq->kq_knhashmask == 0) { + if ((kq->kq_state & KQ_CLOSING) != 0) { + to_free = tmp_knhash; + error = EBADF; + } else if (kq->kq_knhashmask == 0) { kq->kq_knhash = tmp_knhash; kq->kq_knhashmask = tmp_knhashmask; } else { @@ -1754,7 +1762,7 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop free(to_free, M_KQUEUE); KQ_NOTOWNED(kq); - return 0; + return (error); } static void @@ -2605,6 +2613,8 @@ knote_attach(struct knote *kn, struct kqueue *kq) KASSERT(kn_in_flux(kn), ("knote %p not marked influx", kn)); KQ_OWNED(kq); + if ((kq->kq_state & KQ_CLOSING) != 0) + return (EBADF); if (kn->kn_fop->f_isfd) { if (kn->kn_id >= kq->kq_knlistsize) return (ENOMEM); From owner-svn-src-stable@freebsd.org Tue Nov 27 17:10:04 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B6591154CA5; Tue, 27 Nov 2018 17:10:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF268867D; Tue, 27 Nov 2018 17:10:04 +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 775B51E392; Tue, 27 Nov 2018 17:10:01 +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 wARHA1LJ052834; Tue, 27 Nov 2018 17:10:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARHA17f052833; Tue, 27 Nov 2018 17:10:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811271710.wARHA17f052833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Nov 2018 17:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341083 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 341083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DF268867D X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.68)[0.676,0]; NEURAL_SPAM_SHORT(0.02)[0.019,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:10:04 -0000 Author: markj Date: Tue Nov 27 17:10:00 2018 New Revision: 341083 URL: https://svnweb.freebsd.org/changeset/base/341083 Log: MFC r340898: Ensure that knotes do not get registered when KQ_CLOSING is set. PR: 228858 Modified: stable/11/sys/kern/kern_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Tue Nov 27 17:08:07 2018 (r341082) +++ stable/11/sys/kern/kern_event.c Tue Nov 27 17:10:00 2018 (r341083) @@ -1319,8 +1319,11 @@ findkn: break; } } else { - if ((kev->flags & EV_ADD) == EV_ADD) - kqueue_expand(kq, fops, kev->ident, waitok); + if ((kev->flags & EV_ADD) == EV_ADD) { + error = kqueue_expand(kq, fops, kev->ident, waitok); + if (error != 0) + goto done; + } KQ_LOCK(kq); @@ -1555,12 +1558,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; - int size; - int fd; + int error, fd, size; int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); + error = 0; to_free = NULL; if (fops->f_isfd) { fd = ident; @@ -1572,9 +1575,11 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop if (list == NULL) return ENOMEM; KQ_LOCK(kq); - if (kq->kq_knlistsize > fd) { + if ((kq->kq_state & KQ_CLOSING) != 0) { to_free = list; - list = NULL; + error = EBADF; + } else if (kq->kq_knlistsize > fd) { + to_free = list; } else { if (kq->kq_knlist != NULL) { bcopy(kq->kq_knlist, list, @@ -1595,9 +1600,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, &tmp_knhashmask); if (tmp_knhash == NULL) - return ENOMEM; + return (ENOMEM); KQ_LOCK(kq); - if (kq->kq_knhashmask == 0) { + if ((kq->kq_state & KQ_CLOSING) != 0) { + to_free = tmp_knhash; + error = EBADF; + } else if (kq->kq_knhashmask == 0) { kq->kq_knhash = tmp_knhash; kq->kq_knhashmask = tmp_knhashmask; } else { @@ -1609,7 +1617,7 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop free(to_free, M_KQUEUE); KQ_NOTOWNED(kq); - return 0; + return (error); } static void @@ -2470,6 +2478,8 @@ knote_attach(struct knote *kn, struct kqueue *kq) KASSERT(kn->kn_status & KN_INFLUX, ("knote not marked INFLUX")); KQ_OWNED(kq); + if ((kq->kq_state & KQ_CLOSING) != 0) + return (EBADF); if (kn->kn_fop->f_isfd) { if (kn->kn_id >= kq->kq_knlistsize) return (ENOMEM); From owner-svn-src-stable@freebsd.org Tue Nov 27 19:40:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19D6E11595DE; Tue, 27 Nov 2018 19:40:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B56138F3AE; Tue, 27 Nov 2018 19:40:07 +0000 (UTC) (envelope-from vangyzen@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 9740C1FCD4; Tue, 27 Nov 2018 19:40:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARJe7tv032488; Tue, 27 Nov 2018 19:40:07 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARJe7i2032487; Tue, 27 Nov 2018 19:40:07 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811271940.wARJe7i2032487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 19:40: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: r341086 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 341086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B56138F3AE X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.16)[0.157,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:40:08 -0000 Author: vangyzen Date: Tue Nov 27 19:40:07 2018 New Revision: 341086 URL: https://svnweb.freebsd.org/changeset/base/341086 Log: MFC r340257 in6_ifattach_linklocal: handle immediate removal of the new LLA If another thread immediately removes the link-local address added by in6_update_ifa(), in6ifa_ifpforlinklocal() can return NULL, so the following assertion (or dereference) is wrong. Remove the assertion, and handle NULL somewhat better than panicking. This matches all of the other callers of in6_update_ifa(). PR: 219250 Reviewed by: bz, dab (both an earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17898 Modified: stable/12/sys/netinet6/in6_ifattach.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/12/sys/netinet6/in6_ifattach.c Tue Nov 27 17:58:25 2018 (r341085) +++ stable/12/sys/netinet6/in6_ifattach.c Tue Nov 27 19:40:07 2018 (r341086) @@ -481,9 +481,16 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet return (-1); } - ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ - KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); - + ia = in6ifa_ifpforlinklocal(ifp, 0); + if (ia == NULL) { + /* + * Another thread removed the address that we just added. + * This should be rare, but it happens. + */ + nd6log((LOG_NOTICE, "%s: %s: new link-local address " + "disappeared\n", __func__, if_name(ifp))); + return (-1); + } ifa_free(&ia->ia_ifa); /* From owner-svn-src-stable@freebsd.org Tue Nov 27 19:40:20 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D2CD1159628; Tue, 27 Nov 2018 19:40:20 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3598F492; Tue, 27 Nov 2018 19:40:20 +0000 (UTC) (envelope-from vangyzen@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 E61521FCD7; Tue, 27 Nov 2018 19:40:18 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARJeIUF032558; Tue, 27 Nov 2018 19:40:18 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARJeIdm032557; Tue, 27 Nov 2018 19:40:18 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811271940.wARJeIdm032557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 19:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341087 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 341087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D3598F492 X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.16)[0.157,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:40:20 -0000 Author: vangyzen Date: Tue Nov 27 19:40:18 2018 New Revision: 341087 URL: https://svnweb.freebsd.org/changeset/base/341087 Log: MFC r340257 in6_ifattach_linklocal: handle immediate removal of the new LLA If another thread immediately removes the link-local address added by in6_update_ifa(), in6ifa_ifpforlinklocal() can return NULL, so the following assertion (or dereference) is wrong. Remove the assertion, and handle NULL somewhat better than panicking. This matches all of the other callers of in6_update_ifa(). PR: 219250 Reviewed by: bz, dab (both an earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17898 Modified: stable/11/sys/netinet6/in6_ifattach.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/11/sys/netinet6/in6_ifattach.c Tue Nov 27 19:40:07 2018 (r341086) +++ stable/11/sys/netinet6/in6_ifattach.c Tue Nov 27 19:40:18 2018 (r341087) @@ -502,9 +502,16 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet return (-1); } - ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ - KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); - + ia = in6ifa_ifpforlinklocal(ifp, 0); + if (ia == NULL) { + /* + * Another thread removed the address that we just added. + * This should be rare, but it happens. + */ + nd6log((LOG_NOTICE, "%s: %s: new link-local address " + "disappeared\n", __func__, if_name(ifp))); + return (-1); + } ifa_free(&ia->ia_ifa); /* From owner-svn-src-stable@freebsd.org Tue Nov 27 19:44:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618091159A43; Tue, 27 Nov 2018 19:44:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A01DF8FCC6; Tue, 27 Nov 2018 19:44:04 +0000 (UTC) (envelope-from vangyzen@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 81AE51FE6A; Tue, 27 Nov 2018 19:44:04 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARJi4Kd037748; Tue, 27 Nov 2018 19:44:04 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARJi4x9037747; Tue, 27 Nov 2018 19:44:04 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811271944.wARJi4x9037747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 19:44: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: r341090 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 341090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A01DF8FCC6 X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_SHORT(0.16)[0.157,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:44:05 -0000 Author: vangyzen Date: Tue Nov 27 19:44:04 2018 New Revision: 341090 URL: https://svnweb.freebsd.org/changeset/base/341090 Log: MFC r340328 Update comment about 'universe' disk usage It's 167 GB now (or 81 GB with ZFS lz4). Sponsored by: Dell EMC Isilon Modified: stable/12/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile ============================================================================== --- stable/12/Makefile Tue Nov 27 19:43:16 2018 (r341089) +++ stable/12/Makefile Tue Nov 27 19:44:04 2018 (r341090) @@ -61,9 +61,10 @@ # Most of the user-driven targets (as listed above) are implemented in # Makefile.inc1. The exceptions are universe, tinderbox and targets. # -# If you want to build your system from source be sure that /usr/obj has -# at least 6GB of diskspace available. A complete 'universe' build requires -# about 100GB of space. +# If you want to build your system from source, be sure that /usr/obj has +# at least 6 GB of disk space available. A complete 'universe' build of +# r340283 (2018-11) required 167 GB of space. ZFS lz4 compression +# achieved a 2.18x ratio, reducing actual space to 81 GB. # # For individuals wanting to build from the sources currently on their # system, the simple instructions are: From owner-svn-src-stable@freebsd.org Tue Nov 27 19:45:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6BA1159BEA; Tue, 27 Nov 2018 19:45:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3438D699A7; Tue, 27 Nov 2018 19:45:25 +0000 (UTC) (envelope-from vangyzen@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 1642C1FE76; Tue, 27 Nov 2018 19:45:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARJjOEB037941; Tue, 27 Nov 2018 19:45:24 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARJjOOX037940; Tue, 27 Nov 2018 19:45:24 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811271945.wARJjOOX037940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 19:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341092 - stable/12/usr.sbin/periodic/etc/daily X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/usr.sbin/periodic/etc/daily X-SVN-Commit-Revision: 341092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3438D699A7 X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_SHORT(0.16)[0.157,0]; NEURAL_SPAM_MEDIUM(0.63)[0.632,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:45:25 -0000 Author: vangyzen Date: Tue Nov 27 19:45:24 2018 New Revision: 341092 URL: https://svnweb.freebsd.org/changeset/base/341092 Log: MFC r340345 Fix daily mailq script for Postfix and daily_show_success="NO" Exit with a zero status when Postfix reports "Mail queue is empty" so this section won't appear in the report at all when daily_show_success="NO". Sponsored by: Dell EMC Isilon Modified: stable/12/usr.sbin/periodic/etc/daily/440.status-mailq Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/periodic/etc/daily/440.status-mailq ============================================================================== --- stable/12/usr.sbin/periodic/etc/daily/440.status-mailq Tue Nov 27 19:44:39 2018 (r341091) +++ stable/12/usr.sbin/periodic/etc/daily/440.status-mailq Tue Nov 27 19:45:24 2018 (r341092) @@ -33,7 +33,7 @@ case "$daily_status_mailq_enable" in *) mailq;; esac | tee /dev/stderr | - egrep -v '(mqueue is empty|Total requests)' | wc -l) + egrep -v '((Mail |m)queue is empty|Total requests)' | wc -l) [ $rc -gt 0 ] && rc=1 || rc=0 case "$daily_status_include_submit_mailq" in From owner-svn-src-stable@freebsd.org Tue Nov 27 22:32:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9D3F113DE6B; Tue, 27 Nov 2018 22:32:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7EA72BE1; Tue, 27 Nov 2018 22:32:35 +0000 (UTC) (envelope-from vangyzen@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 705F021A6D; Tue, 27 Nov 2018 22:32:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARMWZH8026440; Tue, 27 Nov 2018 22:32:35 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARMWYV8026438; Tue, 27 Nov 2018 22:32:34 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811272232.wARMWYV8026438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 22:32: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: r341099 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 341099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F7EA72BE1 X-Spamd-Result: default: False [0.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.064,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.25)[0.252,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 22:32:36 -0000 Author: vangyzen Date: Tue Nov 27 22:32:34 2018 New Revision: 341099 URL: https://svnweb.freebsd.org/changeset/base/341099 Log: MFC r340409 Make no assertions about lock state when the scheduler is stopped. Change the assert paths in rm, rw, and sx locks to match the lock and unlock paths. I did this for mutexes in r306346. Reported by: Travis Lane Sponsored by: Dell EMC Isilon Modified: stable/12/sys/kern/kern_rmlock.c stable/12/sys/kern/kern_rwlock.c stable/12/sys/kern/kern_sx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_rmlock.c ============================================================================== --- stable/12/sys/kern/kern_rmlock.c Tue Nov 27 22:02:54 2018 (r341098) +++ stable/12/sys/kern/kern_rmlock.c Tue Nov 27 22:32:34 2018 (r341099) @@ -742,7 +742,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch { int count; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case RA_LOCKED: Modified: stable/12/sys/kern/kern_rwlock.c ============================================================================== --- stable/12/sys/kern/kern_rwlock.c Tue Nov 27 22:02:54 2018 (r341098) +++ stable/12/sys/kern/kern_rwlock.c Tue Nov 27 22:32:34 2018 (r341099) @@ -1439,7 +1439,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con { const struct rwlock *rw; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; rw = rwlock2rw(c); Modified: stable/12/sys/kern/kern_sx.c ============================================================================== --- stable/12/sys/kern/kern_sx.c Tue Nov 27 22:02:54 2018 (r341098) +++ stable/12/sys/kern/kern_sx.c Tue Nov 27 22:32:34 2018 (r341099) @@ -1416,7 +1416,7 @@ _sx_assert(const struct sx *sx, int what, const char * int slocked = 0; #endif - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case SA_SLOCKED: From owner-svn-src-stable@freebsd.org Tue Nov 27 22:34:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EA49113DF51; Tue, 27 Nov 2018 22:34:00 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8F0972D5D; Tue, 27 Nov 2018 22:33:59 +0000 (UTC) (envelope-from vangyzen@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 A883521A72; Tue, 27 Nov 2018 22:33:59 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARMXxx2026580; Tue, 27 Nov 2018 22:33:59 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARMXxch026578; Tue, 27 Nov 2018 22:33:59 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811272233.wARMXxch026578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 27 Nov 2018 22:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341100 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 341100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8F0972D5D X-Spamd-Result: default: False [0.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.064,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.25)[0.252,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 22:34:00 -0000 Author: vangyzen Date: Tue Nov 27 22:33:58 2018 New Revision: 341100 URL: https://svnweb.freebsd.org/changeset/base/341100 Log: MFC r340409 Make no assertions about lock state when the scheduler is stopped. Change the assert paths in rm, rw, and sx locks to match the lock and unlock paths. I did this for mutexes in r306346. Reported by: Travis Lane Sponsored by: Dell EMC Isilon Modified: stable/11/sys/kern/kern_rmlock.c stable/11/sys/kern/kern_rwlock.c stable/11/sys/kern/kern_sx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_rmlock.c ============================================================================== --- stable/11/sys/kern/kern_rmlock.c Tue Nov 27 22:32:34 2018 (r341099) +++ stable/11/sys/kern/kern_rmlock.c Tue Nov 27 22:33:58 2018 (r341100) @@ -740,7 +740,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch { int count; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case RA_LOCKED: Modified: stable/11/sys/kern/kern_rwlock.c ============================================================================== --- stable/11/sys/kern/kern_rwlock.c Tue Nov 27 22:32:34 2018 (r341099) +++ stable/11/sys/kern/kern_rwlock.c Tue Nov 27 22:33:58 2018 (r341100) @@ -1378,7 +1378,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con { const struct rwlock *rw; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; rw = rwlock2rw(c); Modified: stable/11/sys/kern/kern_sx.c ============================================================================== --- stable/11/sys/kern/kern_sx.c Tue Nov 27 22:32:34 2018 (r341099) +++ stable/11/sys/kern/kern_sx.c Tue Nov 27 22:33:58 2018 (r341100) @@ -1312,7 +1312,7 @@ _sx_assert(const struct sx *sx, int what, const char * int slocked = 0; #endif - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case SA_SLOCKED: From owner-svn-src-stable@freebsd.org Wed Nov 28 09:10:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B00114D38A; Wed, 28 Nov 2018 09:10:29 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DB776A12F; Wed, 28 Nov 2018 09:10:29 +0000 (UTC) (envelope-from ygy@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 657FD1C9; Wed, 28 Nov 2018 09:10:29 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9ATMa051105; Wed, 28 Nov 2018 09:10:29 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9ATZw051104; Wed, 28 Nov 2018 09:10:29 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811280910.wAS9ATZw051104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Wed, 28 Nov 2018 09:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341121 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 341121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DB776A12F X-Spamd-Result: default: False [1.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.51)[0.507,0]; NEURAL_SPAM_MEDIUM(0.25)[0.252,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:10:30 -0000 Author: ygy (doc committer) Date: Wed Nov 28 09:10:28 2018 New Revision: 341121 URL: https://svnweb.freebsd.org/changeset/base/341121 Log: MFC r340717: Fix incorrect DSCP value range from 0..64 to 0..63. PR: 232786 Submitted by: Sergey Akhmatov Reviewed by: AllanJude Modified: stable/12/sbin/ipfw/ipfw.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Wed Nov 28 06:56:34 2018 (r341120) +++ stable/12/sbin/ipfw/ipfw.8 Wed Nov 28 09:10:28 2018 (r341121) @@ -1138,11 +1138,11 @@ Supported values are: .Pq Dv 101110 , .Cm be .Pq Dv 000000 . -Additionally, DSCP value can be specified by number (0..64). +Additionally, DSCP value can be specified by number (0..63). It is also possible to use the .Cm tablearg keyword with setdscp. -If the tablearg value is not within the 0..64 range, lower 6 bits of supplied +If the tablearg value is not within the 0..63 range, lower 6 bits of supplied value are used. .It Cm tcp-setmss Ar mss Set the Maximum Segment Size (MSS) in the TCP segment to value From owner-svn-src-stable@freebsd.org Wed Nov 28 11:58:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D7F71151AD8; Wed, 28 Nov 2018 11:58:41 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F27471089; Wed, 28 Nov 2018 11:58:41 +0000 (UTC) (envelope-from oleg@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 D78461E3B; Wed, 28 Nov 2018 11:58:40 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASBweZM039030; Wed, 28 Nov 2018 11:58:40 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASBwewv039029; Wed, 28 Nov 2018 11:58:40 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201811281158.wASBwewv039029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Wed, 28 Nov 2018 11:58: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: r341139 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: oleg X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 341139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F27471089 X-Spamd-Result: default: False [1.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.25)[0.252,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 11:58:41 -0000 Author: oleg Date: Wed Nov 28 11:58:40 2018 New Revision: 341139 URL: https://svnweb.freebsd.org/changeset/base/341139 Log: MFC r340724: Unbreak kernel build with VLAN_ARRAY defined. Modified: stable/12/sys/net/if_vlan.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_vlan.c ============================================================================== --- stable/12/sys/net/if_vlan.c Wed Nov 28 09:25:43 2018 (r341138) +++ stable/12/sys/net/if_vlan.c Wed Nov 28 11:58:40 2018 (r341139) @@ -314,15 +314,15 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #define V_vlan_cloner VNET(vlan_cloner) #endif -#ifndef VLAN_ARRAY -#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) - static void vlan_mc_free(struct epoch_context *ctx) { struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); free(mc, M_VLAN); } + +#ifndef VLAN_ARRAY +#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) static void vlan_inithash(struct ifvlantrunk *trunk) From owner-svn-src-stable@freebsd.org Wed Nov 28 15:31:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 019C211577BA; Wed, 28 Nov 2018 15:31:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9851778923; Wed, 28 Nov 2018 15:31:06 +0000 (UTC) (envelope-from vangyzen@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 7AF8745CA; Wed, 28 Nov 2018 15:31:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASFV6kt050944; Wed, 28 Nov 2018 15:31:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASFV56Y050942; Wed, 28 Nov 2018 15:31:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811281531.wASFV56Y050942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 28 Nov 2018 15:31:05 +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: r341146 - in stable/12/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in stable/12/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Commit-Revision: 341146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9851778923 X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.32)[0.317,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.433,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 15:31:07 -0000 Author: vangyzen Date: Wed Nov 28 15:31:05 2018 New Revision: 341146 URL: https://svnweb.freebsd.org/changeset/base/341146 Log: MFC r340994 Prevent kernel stack disclosure in getcontext/swapcontext Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc. Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: stable/12/sys/amd64/ia32/ia32_signal.c stable/12/sys/mips/mips/freebsd32_machdep.c stable/12/sys/powerpc/powerpc/exec_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/12/sys/amd64/ia32/ia32_signal.c Wed Nov 28 15:29:58 2018 (r341145) +++ stable/12/sys/amd64/ia32/ia32_signal.c Wed Nov 28 15:31:05 2018 (r341146) @@ -261,6 +261,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -301,6 +302,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: stable/12/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- stable/12/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 15:29:58 2018 (r341145) +++ stable/12/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 15:31:05 2018 (r341146) @@ -294,6 +294,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -333,6 +334,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: stable/12/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/exec_machdep.c Wed Nov 28 15:29:58 2018 (r341145) +++ stable/12/sys/powerpc/powerpc/exec_machdep.c Wed Nov 28 15:31:05 2018 (r341146) @@ -783,6 +783,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -822,6 +823,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; From owner-svn-src-stable@freebsd.org Wed Nov 28 15:34:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68EFF1157A3D; Wed, 28 Nov 2018 15:34:48 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD0C79177; Wed, 28 Nov 2018 15:34:48 +0000 (UTC) (envelope-from vangyzen@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 C3F8A4638; Wed, 28 Nov 2018 15:34:47 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASFYlLH052674; Wed, 28 Nov 2018 15:34:47 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASFYljp052671; Wed, 28 Nov 2018 15:34:47 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811281534.wASFYljp052671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 28 Nov 2018 15:34:47 +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: r341147 - in stable/12/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in stable/12/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 341147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AD0C79177 X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_SHORT(0.43)[0.433,0]; NEURAL_SPAM_MEDIUM(0.32)[0.317,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 15:34:48 -0000 Author: vangyzen Date: Wed Nov 28 15:34:46 2018 New Revision: 341147 URL: https://svnweb.freebsd.org/changeset/base/341147 Log: MFC r340995 Prevent kernel stack disclosure in signal delivery On arm64 and riscv platforms, sendsig() failed to zero the signal frame before copying it out to userspace. Zero it. On arm, I believe all the contents of the frame were initialized, so there was no disclosure. However, explicitly zero the whole frame because that fact could inadvertently change in the future, it's more clear to the reader, and I could be wrong in the first place. Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: stable/12/sys/arm/arm/machdep.c stable/12/sys/arm64/arm64/machdep.c stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/machdep.c ============================================================================== --- stable/12/sys/arm/arm/machdep.c Wed Nov 28 15:31:05 2018 (r341146) +++ stable/12/sys/arm/arm/machdep.c Wed Nov 28 15:34:46 2018 (r341147) @@ -641,6 +641,7 @@ sendsig(catcher, ksi, mask) /* make the stack aligned */ fp = (struct sigframe *)STACKALIGN(fp); /* Populate the siginfo frame. */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); #ifdef VFP get_vfpcontext(td, &frame.sf_vfp); Modified: stable/12/sys/arm64/arm64/machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/machdep.c Wed Nov 28 15:31:05 2018 (r341146) +++ stable/12/sys/arm64/arm64/machdep.c Wed Nov 28 15:34:46 2018 (r341147) @@ -656,6 +656,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Wed Nov 28 15:31:05 2018 (r341146) +++ stable/12/sys/riscv/riscv/machdep.c Wed Nov 28 15:34:46 2018 (r341147) @@ -583,6 +583,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; From owner-svn-src-stable@freebsd.org Wed Nov 28 16:48:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0AE7115ADE8; Wed, 28 Nov 2018 16:48: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96AA67C4FD; Wed, 28 Nov 2018 16:48: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 77A0B519C; Wed, 28 Nov 2018 16:48:41 +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 wASGmfEb089028; Wed, 28 Nov 2018 16:48:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASGmfLc089027; Wed, 28 Nov 2018 16:48:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811281648.wASGmfLc089027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Nov 2018 16:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341150 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 341150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96AA67C4FD X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.49)[0.489,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; NEURAL_SPAM_LONG(0.44)[0.441,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 16:48:42 -0000 Author: markj Date: Wed Nov 28 16:48:40 2018 New Revision: 341150 URL: https://svnweb.freebsd.org/changeset/base/341150 Log: MFC r339497 (by cem): ZSTDIO: Correctly initialize zstd context with provided 'level' Modified: stable/12/sys/kern/subr_compressor.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_compressor.c ============================================================================== --- stable/12/sys/kern/subr_compressor.c Wed Nov 28 16:20:04 2018 (r341149) +++ stable/12/sys/kern/subr_compressor.c Wed Nov 28 16:48:40 2018 (r341150) @@ -275,8 +275,9 @@ zstdio_init(size_t maxiosize, int level) ZSTD_CCtx *dump_compressor; struct zstdio_stream *s; void *wkspc, *owkspc, *buffer; - size_t wkspc_size, buf_size; + size_t wkspc_size, buf_size, rc; + s = NULL; wkspc_size = ZSTD_estimateCStreamSize(level); owkspc = wkspc = malloc(wkspc_size + 8, M_COMPRESS, M_WAITOK | M_NODUMP); @@ -286,12 +287,23 @@ zstdio_init(size_t maxiosize, int level) dump_compressor = ZSTD_initStaticCCtx(wkspc, wkspc_size); if (dump_compressor == NULL) { - free(owkspc, M_COMPRESS); printf("%s: workspace too small.\n", __func__); - return (NULL); + goto out; } - (void)ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + rc = ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + if (ZSTD_isError(rc)) { + printf("%s: error setting checksumFlag: %s\n", __func__, + ZSTD_getErrorName(rc)); + goto out; + } + rc = ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_compressionLevel, + level); + if (ZSTD_isError(rc)) { + printf("%s: error setting compressLevel: %s\n", __func__, + ZSTD_getErrorName(rc)); + goto out; + } buf_size = ZSTD_CStreamOutSize() * 2; buffer = malloc(buf_size, M_COMPRESS, M_WAITOK | M_NODUMP); @@ -306,6 +318,9 @@ zstdio_init(size_t maxiosize, int level) zstdio_reset(s); +out: + if (s == NULL) + free(owkspc, M_COMPRESS); return (s); } From owner-svn-src-stable@freebsd.org Wed Nov 28 16:51:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7B5115AEA1; Wed, 28 Nov 2018 16:51:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 301AA7C7D1; Wed, 28 Nov 2018 16:51:12 +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 120C251D1; Wed, 28 Nov 2018 16:51:12 +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 wASGpBjL090664; Wed, 28 Nov 2018 16:51:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASGpBrd090661; Wed, 28 Nov 2018 16:51:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811281651.wASGpBrd090661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Nov 2018 16:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341151 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 341151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 301AA7C7D1 X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.489,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 16:51:12 -0000 Author: markj Date: Wed Nov 28 16:51:11 2018 New Revision: 341151 URL: https://svnweb.freebsd.org/changeset/base/341151 Log: MFC r340733: Remove KN_HASKQLOCK. Modified: stable/12/sys/kern/kern_event.c stable/12/sys/sys/event.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Wed Nov 28 16:48:40 2018 (r341150) +++ stable/12/sys/kern/kern_event.c Wed Nov 28 16:51:11 2018 (r341151) @@ -550,10 +550,8 @@ knote_fork(struct knlist *list, int pid) * The same as knote(), activate the event. */ if ((kn->kn_sfflags & NOTE_TRACK) == 0) { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); continue; } @@ -2286,10 +2284,8 @@ knote(struct knlist *list, long hint, int lockflags) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); } else { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, hint)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); } } Modified: stable/12/sys/sys/event.h ============================================================================== --- stable/12/sys/sys/event.h Wed Nov 28 16:48:40 2018 (r341150) +++ stable/12/sys/sys/event.h Wed Nov 28 16:51:11 2018 (r341151) @@ -294,7 +294,6 @@ struct knote { #define KN_DETACHED 0x08 /* knote is detached */ #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ -#define KN_HASKQLOCK 0x80 /* for _inevent */ #define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_influx; int kn_sfflags; /* saved filter flags */ From owner-svn-src-stable@freebsd.org Wed Nov 28 16:52:43 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0EBB1136060; Wed, 28 Nov 2018 16:52:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 574037CA83; Wed, 28 Nov 2018 16:52:43 +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 38F91532E; Wed, 28 Nov 2018 16:52:43 +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 wASGqh0b093943; Wed, 28 Nov 2018 16:52:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASGqg2O093935; Wed, 28 Nov 2018 16:52:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811281652.wASGqg2O093935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Nov 2018 16:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341152 - in stable/12: share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/sys X-SVN-Commit-Revision: 341152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 574037CA83 X-Spamd-Result: default: False [1.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.504,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 16:52:43 -0000 Author: markj Date: Wed Nov 28 16:52:41 2018 New Revision: 341152 URL: https://svnweb.freebsd.org/changeset/base/341152 Log: MFC r340730, r340731: Add taskqueue_quiesce(9) and use it to implement taskq_wait(). PR: 227784 Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/taskqueue.9 stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c stable/12/sys/kern/subr_taskqueue.c stable/12/sys/sys/taskqueue.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Wed Nov 28 16:51:11 2018 (r341151) +++ stable/12/share/man/man9/Makefile Wed Nov 28 16:52:41 2018 (r341152) @@ -2053,6 +2053,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ + taskqueue.9 taskqueue_quiesce.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ Modified: stable/12/share/man/man9/taskqueue.9 ============================================================================== --- stable/12/share/man/man9/taskqueue.9 Wed Nov 28 16:51:11 2018 (r341151) +++ stable/12/share/man/man9/taskqueue.9 Wed Nov 28 16:52:41 2018 (r341152) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2017 +.Dd November 21, 2018 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -94,6 +94,8 @@ struct timeout_task; .Ft void .Fn taskqueue_drain_all "struct taskqueue *queue" .Ft void +.Fn taskqueue_quiesce "struct taskqueue *queue" +.Ft void .Fn taskqueue_block "struct taskqueue *queue" .Ft void .Fn taskqueue_unblock "struct taskqueue *queue" @@ -298,6 +300,12 @@ do not extend the wait time of and may complete after .Fn taskqueue_drain_all returns. +The +.Fn taskqueue_quiesce +function is used to wait for the queue to become empty and for all +running tasks to finish. +To avoid blocking indefinitely, the caller must ensure by some mechanism +that tasks will eventually stop being posted to the queue. .Pp The .Fn taskqueue_block Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 28 16:51:11 2018 (r341151) +++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 28 16:52:41 2018 (r341152) @@ -171,11 +171,11 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void void taskq_wait(taskq_t *tq) { - taskqueue_drain_all(tq->tq_queue); + taskqueue_quiesce(tq->tq_queue); } void taskq_wait_id(taskq_t *tq, taskqid_t id) { - taskq_wait(tq); + taskqueue_drain_all(tq->tq_queue); } Modified: stable/12/sys/kern/subr_taskqueue.c ============================================================================== --- stable/12/sys/kern/subr_taskqueue.c Wed Nov 28 16:51:11 2018 (r341151) +++ stable/12/sys/kern/subr_taskqueue.c Wed Nov 28 16:52:41 2018 (r341152) @@ -346,13 +346,13 @@ taskqueue_task_nop_fn(void *context, int pending) * have begun execution. Tasks queued during execution of * this function are ignored. */ -static void +static int taskqueue_drain_tq_queue(struct taskqueue *queue) { struct task t_barrier; if (STAILQ_EMPTY(&queue->tq_queue)) - return; + return (0); /* * Enqueue our barrier after all current tasks, but with @@ -372,6 +372,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ while (t_barrier.ta_pending != 0) TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + return (1); } /* @@ -379,13 +380,13 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * complete. Tasks that begin execution during the execution * of this function are ignored. */ -static void +static int taskqueue_drain_tq_active(struct taskqueue *queue) { struct taskqueue_busy tb_marker, *tb_first; if (TAILQ_EMPTY(&queue->tq_active)) - return; + return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; @@ -412,6 +413,7 @@ taskqueue_drain_tq_active(struct taskqueue *queue) queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) wakeup_one(queue->tq_threads); + return (1); } void @@ -582,8 +584,8 @@ taskqueue_drain_all(struct taskqueue *queue) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - taskqueue_drain_tq_queue(queue); - taskqueue_drain_tq_active(queue); + (void)taskqueue_drain_tq_queue(queue); + (void)taskqueue_drain_tq_active(queue); TQ_UNLOCK(queue); } @@ -609,6 +611,20 @@ taskqueue_drain_timeout(struct taskqueue *queue, */ TQ_LOCK(queue); timeout_task->f &= ~DT_DRAIN_IN_PROGRESS; + TQ_UNLOCK(queue); +} + +void +taskqueue_quiesce(struct taskqueue *queue) +{ + int ret; + + TQ_LOCK(queue); + do { + ret = taskqueue_drain_tq_queue(queue); + if (ret == 0) + ret = taskqueue_drain_tq_active(queue); + } while (ret != 0); TQ_UNLOCK(queue); } Modified: stable/12/sys/sys/taskqueue.h ============================================================================== --- stable/12/sys/sys/taskqueue.h Wed Nov 28 16:51:11 2018 (r341151) +++ stable/12/sys/sys/taskqueue.h Wed Nov 28 16:52:41 2018 (r341152) @@ -93,6 +93,7 @@ void taskqueue_drain(struct taskqueue *queue, struct t void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); void taskqueue_drain_all(struct taskqueue *queue); +void taskqueue_quiesce(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable@freebsd.org Wed Nov 28 17:00:20 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF6D511363ED; Wed, 28 Nov 2018 17:00: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9367F7CF02; Wed, 28 Nov 2018 17:00: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 705945339; Wed, 28 Nov 2018 17:00: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 wASH0J0B094579; Wed, 28 Nov 2018 17:00:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASH0Inl094575; Wed, 28 Nov 2018 17:00:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811281700.wASH0Inl094575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Nov 2018 17:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341154 - in stable/11: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 341154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9367F7CF02 X-Spamd-Result: default: False [1.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.504,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.49)[0.488,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 17:00:20 -0000 Author: markj Date: Wed Nov 28 17:00:18 2018 New Revision: 341154 URL: https://svnweb.freebsd.org/changeset/base/341154 Log: MFC r340730, r340731: Add taskqueue_quiesce(9) and use it to implement taskq_wait(). PR: 227784 Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/taskqueue.9 stable/11/sys/kern/subr_taskqueue.c stable/11/sys/sys/taskqueue.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Wed Nov 28 16:58:35 2018 (r341153) +++ stable/11/share/man/man9/Makefile Wed Nov 28 17:00:18 2018 (r341154) @@ -1814,6 +1814,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ + taskqueue.9 taskqueue_quiesce.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ Modified: stable/11/share/man/man9/taskqueue.9 ============================================================================== --- stable/11/share/man/man9/taskqueue.9 Wed Nov 28 16:58:35 2018 (r341153) +++ stable/11/share/man/man9/taskqueue.9 Wed Nov 28 17:00:18 2018 (r341154) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2017 +.Dd November 21, 2018 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -94,6 +94,8 @@ struct timeout_task; .Ft void .Fn taskqueue_drain_all "struct taskqueue *queue" .Ft void +.Fn taskqueue_quiesce "struct taskqueue *queue" +.Ft void .Fn taskqueue_block "struct taskqueue *queue" .Ft void .Fn taskqueue_unblock "struct taskqueue *queue" @@ -298,6 +300,12 @@ do not extend the wait time of and may complete after .Fn taskqueue_drain_all returns. +The +.Fn taskqueue_quiesce +function is used to wait for the queue to become empty and for all +running tasks to finish. +To avoid blocking indefinitely, the caller must ensure by some mechanism +that tasks will eventually stop being posted to the queue. .Pp The .Fn taskqueue_block Modified: stable/11/sys/kern/subr_taskqueue.c ============================================================================== --- stable/11/sys/kern/subr_taskqueue.c Wed Nov 28 16:58:35 2018 (r341153) +++ stable/11/sys/kern/subr_taskqueue.c Wed Nov 28 17:00:18 2018 (r341154) @@ -344,13 +344,13 @@ taskqueue_task_nop_fn(void *context, int pending) * have begun execution. Tasks queued during execution of * this function are ignored. */ -static void +static int taskqueue_drain_tq_queue(struct taskqueue *queue) { struct task t_barrier; if (STAILQ_EMPTY(&queue->tq_queue)) - return; + return (0); /* * Enqueue our barrier after all current tasks, but with @@ -370,6 +370,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ while (t_barrier.ta_pending != 0) TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + return (1); } /* @@ -377,13 +378,13 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * complete. Tasks that begin execution during the execution * of this function are ignored. */ -static void +static int taskqueue_drain_tq_active(struct taskqueue *queue) { struct taskqueue_busy tb_marker, *tb_first; if (TAILQ_EMPTY(&queue->tq_active)) - return; + return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; @@ -410,6 +411,7 @@ taskqueue_drain_tq_active(struct taskqueue *queue) queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) wakeup_one(queue->tq_threads); + return (1); } void @@ -580,8 +582,8 @@ taskqueue_drain_all(struct taskqueue *queue) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - taskqueue_drain_tq_queue(queue); - taskqueue_drain_tq_active(queue); + (void)taskqueue_drain_tq_queue(queue); + (void)taskqueue_drain_tq_active(queue); TQ_UNLOCK(queue); } @@ -607,6 +609,20 @@ taskqueue_drain_timeout(struct taskqueue *queue, */ TQ_LOCK(queue); timeout_task->f &= ~DT_DRAIN_IN_PROGRESS; + TQ_UNLOCK(queue); +} + +void +taskqueue_quiesce(struct taskqueue *queue) +{ + int ret; + + TQ_LOCK(queue); + do { + ret = taskqueue_drain_tq_queue(queue); + if (ret == 0) + ret = taskqueue_drain_tq_active(queue); + } while (ret != 0); TQ_UNLOCK(queue); } Modified: stable/11/sys/sys/taskqueue.h ============================================================================== --- stable/11/sys/sys/taskqueue.h Wed Nov 28 16:58:35 2018 (r341153) +++ stable/11/sys/sys/taskqueue.h Wed Nov 28 17:00:18 2018 (r341154) @@ -91,6 +91,7 @@ void taskqueue_drain(struct taskqueue *queue, struct t void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); void taskqueue_drain_all(struct taskqueue *queue); +void taskqueue_quiesce(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable@freebsd.org Wed Nov 28 18:03:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB42113843E; Wed, 28 Nov 2018 18:03:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6B17FDA8; Wed, 28 Nov 2018 18:03:00 +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 07A085EC9; Wed, 28 Nov 2018 18:03:00 +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 wASI2xH9030627; Wed, 28 Nov 2018 18:02:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASI2xjn030626; Wed, 28 Nov 2018 18:02:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811281802.wASI2xjn030626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Nov 2018 18:02: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: r341158 - stable/12/tests/sys/acl X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/acl X-SVN-Commit-Revision: 341158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E6B17FDA8 X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.34)[0.341,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.49)[0.488,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 18:03:00 -0000 Author: markj Date: Wed Nov 28 18:02:59 2018 New Revision: 341158 URL: https://svnweb.freebsd.org/changeset/base/341158 Log: MFC r339795: Add a very basic regression test for setfacl -R with NFSv4 ACLs. Modified: stable/12/tests/sys/acl/tools-nfs4-psarc.test stable/12/tests/sys/acl/tools-nfs4.test Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/acl/tools-nfs4-psarc.test ============================================================================== --- stable/12/tests/sys/acl/tools-nfs4-psarc.test Wed Nov 28 17:40:08 2018 (r341157) +++ stable/12/tests/sys/acl/tools-nfs4-psarc.test Wed Nov 28 18:02:59 2018 (r341158) @@ -557,6 +557,29 @@ $ rmdir yyy $ rm xxx $ cd .. $ rmdir ddd - $ rm xxx +# Test basic recursive setting of ACLs. +$ mkdir ddd +$ touch ddd/xxx +$ mkdir ddd/eee +$ touch ddd/eee/yyy +$ setfacl -R -m owner@:full_set:f:allow,group@:full_set::allow,everyone@:full_set::allow ddd +$ getfacl -q ddd +> owner@:rwxpDdaARWcCos:f------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/xxx +> owner@:rwxpDdaARWcCos:-------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee +> owner@:rwxpDdaARWcCos:f------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee/yyy +> owner@:rwxpDdaARWcCos:-------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow + +$ rm -r ddd Modified: stable/12/tests/sys/acl/tools-nfs4.test ============================================================================== --- stable/12/tests/sys/acl/tools-nfs4.test Wed Nov 28 17:40:08 2018 (r341157) +++ stable/12/tests/sys/acl/tools-nfs4.test Wed Nov 28 18:02:59 2018 (r341158) @@ -823,6 +823,41 @@ $ rmdir yyy $ rm xxx $ cd .. $ rmdir ddd - $ rm xxx +# Test basic recursive setting of ACLs. +$ mkdir ddd +$ touch ddd/xxx +$ mkdir ddd/eee +$ touch ddd/eee/yyy +$ setfacl -R -m owner@:full_set:f:allow,group@:full_set::allow,everyone@:full_set::allow ddd +$ getfacl -q ddd +> owner@:--------------:-------:deny +> owner@:rwxpDdaARWcCos:f------:allow +> group@:-w-p----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-w-p---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/xxx +> owner@:--x-----------:-------:deny +> owner@:rwxpDdaARWcCos:-------:allow +> group@:-wxp----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee +> owner@:--------------:-------:deny +> owner@:rwxpDdaARWcCos:f------:allow +> group@:-w-p----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-w-p---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee/yyy +> owner@:--x-----------:-------:deny +> owner@:rwxpDdaARWcCos:-------:allow +> group@:-wxp----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow + +$ rm -r ddd From owner-svn-src-stable@freebsd.org Wed Nov 28 18:42:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2CAB1139589; Wed, 28 Nov 2018 18:42:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4CB8169F; Wed, 28 Nov 2018 18:42:43 +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 4C64A6564; Wed, 28 Nov 2018 18:42:43 +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 wASIgh2X051216; Wed, 28 Nov 2018 18:42:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASIggAY051213; Wed, 28 Nov 2018 18:42:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811281842.wASIggAY051213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Nov 2018 18:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341161 - in stable/12/sys: kern vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: kern vm X-SVN-Commit-Revision: 341161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4CB8169F X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.53)[0.533,0]; NEURAL_SPAM_SHORT(0.39)[0.385,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 18:42:44 -0000 Author: kib Date: Wed Nov 28 18:42:42 2018 New Revision: 341161 URL: https://svnweb.freebsd.org/changeset/base/341161 Log: MFC r339506, r339508, r340064 (by markj), r340546 (by alc): Tidy up code to merge vm_entry neighbors and simplify related checks. r339506: Reduce code duplication in merging vm_entry neighbors. r339508: Unindent. r340064: Initialize the eflags field of vm_map headers. r340546: Tidy up vm_map_simplify_entry() and its recently introduced helper functions. Discussed with: markj Modified: stable/12/sys/kern/sys_process.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Wed Nov 28 18:09:42 2018 (r341160) +++ stable/12/sys/kern/sys_process.c Wed Nov 28 18:42:42 2018 (r341161) @@ -387,8 +387,9 @@ ptrace_vm_entry(struct thread *td, struct proc *p, str error = EINVAL; break; } - while (entry != &map->header && - (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { + KASSERT((map->header.eflags & MAP_ENTRY_IS_SUB_MAP) == 0, + ("Submap in map header")); + while ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { entry = entry->next; index++; } Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Nov 28 18:09:42 2018 (r341160) +++ stable/12/sys/vm/vm_map.c Wed Nov 28 18:42:42 2018 (r341161) @@ -796,6 +796,7 @@ _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t mi { map->header.next = map->header.prev = &map->header; + map->header.eflags = MAP_ENTRY_HEADER; map->needs_wakeup = FALSE; map->system_map = 0; map->pmap = pmap; @@ -1277,8 +1278,8 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } else if (prev_entry != &map->header && - (prev_entry->eflags & ~MAP_ENTRY_USER_WIRED) == protoeflags && + } else if ((prev_entry->eflags & ~MAP_ENTRY_USER_WIRED) == + protoeflags && (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && prev_entry->end == start && (prev_entry->cred == cred || (prev_entry->object.vm_object != NULL && @@ -1644,6 +1645,54 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o } /* + * A map entry with any of the following flags set must not be merged with + * another entry. + */ +#define MAP_ENTRY_NOMERGE_MASK (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | \ + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP) + +static bool +vm_map_mergeable_neighbors(vm_map_entry_t prev, vm_map_entry_t entry) +{ + + KASSERT((prev->eflags & MAP_ENTRY_NOMERGE_MASK) == 0 || + (entry->eflags & MAP_ENTRY_NOMERGE_MASK) == 0, + ("vm_map_mergeable_neighbors: neither %p nor %p are mergeable", + prev, entry)); + return (prev->end == entry->start && + prev->object.vm_object == entry->object.vm_object && + (prev->object.vm_object == NULL || + prev->offset + (prev->end - prev->start) == entry->offset) && + prev->eflags == entry->eflags && + prev->protection == entry->protection && + prev->max_protection == entry->max_protection && + prev->inheritance == entry->inheritance && + prev->wired_count == entry->wired_count && + prev->cred == entry->cred); +} + +static void +vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_entry_t entry) +{ + + /* + * If the backing object is a vnode object, vm_object_deallocate() + * calls vrele(). However, vrele() does not lock the vnode because + * the vnode has additional references. Thus, the map lock can be + * kept without causing a lock-order reversal with the vnode lock. + * + * Since we count the number of virtual page mappings in + * object->un_pager.vnp.writemappings, the writemappings value + * should not be adjusted when the entry is disposed of. + */ + if (entry->object.vm_object != NULL) + vm_object_deallocate(entry->object.vm_object); + if (entry->cred != NULL) + crfree(entry->cred); + vm_map_entry_dispose(map, entry); +} + +/* * vm_map_simplify_entry: * * Simplify the given map entry by merging with either neighbor. This @@ -1659,81 +1708,27 @@ void vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry) { vm_map_entry_t next, prev; - vm_size_t prevsize, esize; - if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | - MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) + if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) != 0) return; - prev = entry->prev; - if (prev != &map->header) { - prevsize = prev->end - prev->start; - if ( (prev->end == entry->start) && - (prev->object.vm_object == entry->object.vm_object) && - (!prev->object.vm_object || - (prev->offset + prevsize == entry->offset)) && - (prev->eflags == entry->eflags) && - (prev->protection == entry->protection) && - (prev->max_protection == entry->max_protection) && - (prev->inheritance == entry->inheritance) && - (prev->wired_count == entry->wired_count) && - (prev->cred == entry->cred)) { - vm_map_entry_unlink(map, prev); - entry->start = prev->start; - entry->offset = prev->offset; - if (entry->prev != &map->header) - vm_map_entry_resize_free(map, entry->prev); - - /* - * If the backing object is a vnode object, - * vm_object_deallocate() calls vrele(). - * However, vrele() does not lock the vnode - * because the vnode has additional - * references. Thus, the map lock can be kept - * without causing a lock-order reversal with - * the vnode lock. - * - * Since we count the number of virtual page - * mappings in object->un_pager.vnp.writemappings, - * the writemappings value should not be adjusted - * when the entry is disposed of. - */ - if (prev->object.vm_object) - vm_object_deallocate(prev->object.vm_object); - if (prev->cred != NULL) - crfree(prev->cred); - vm_map_entry_dispose(map, prev); - } + if (vm_map_mergeable_neighbors(prev, entry)) { + vm_map_entry_unlink(map, prev); + entry->start = prev->start; + entry->offset = prev->offset; + if (entry->prev != &map->header) + vm_map_entry_resize_free(map, entry->prev); + vm_map_merged_neighbor_dispose(map, prev); } - next = entry->next; - if (next != &map->header) { - esize = entry->end - entry->start; - if ((entry->end == next->start) && - (next->object.vm_object == entry->object.vm_object) && - (!entry->object.vm_object || - (entry->offset + esize == next->offset)) && - (next->eflags == entry->eflags) && - (next->protection == entry->protection) && - (next->max_protection == entry->max_protection) && - (next->inheritance == entry->inheritance) && - (next->wired_count == entry->wired_count) && - (next->cred == entry->cred)) { - vm_map_entry_unlink(map, next); - entry->end = next->end; - vm_map_entry_resize_free(map, entry); - - /* - * See comment above. - */ - if (next->object.vm_object) - vm_object_deallocate(next->object.vm_object); - if (next->cred != NULL) - crfree(next->cred); - vm_map_entry_dispose(map, next); - } + if (vm_map_mergeable_neighbors(entry, next)) { + vm_map_entry_unlink(map, next); + entry->end = next->end; + vm_map_entry_resize_free(map, entry); + vm_map_merged_neighbor_dispose(map, next); } } + /* * vm_map_clip_start: [ internal use only ] * Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Wed Nov 28 18:09:42 2018 (r341160) +++ stable/12/sys/vm/vm_map.h Wed Nov 28 18:42:42 2018 (r341161) @@ -146,6 +146,7 @@ struct vm_map_entry { #define MAP_ENTRY_GUARD 0x10000 #define MAP_ENTRY_STACK_GAP_DN 0x20000 #define MAP_ENTRY_STACK_GAP_UP 0x40000 +#define MAP_ENTRY_HEADER 0x80000 #ifdef _KERNEL static __inline u_char @@ -175,24 +176,22 @@ vm_map_entry_system_wired_count(vm_map_entry_t entry) * list. Both structures are ordered based upon the start and * end addresses contained within each map entry. * - * Counterintuitively, the map's min offset value is stored in - * map->header.end, and its max offset value is stored in - * map->header.start. - * - * The list header has max start value and min end value to act - * as sentinels for sequential search of the doubly-linked list. * Sleator and Tarjan's top-down splay algorithm is employed to * control height imbalance in the binary search tree. * + * The map's min offset value is stored in map->header.end, and + * its max offset value is stored in map->header.start. These + * values act as sentinels for any forward or backward address + * scan of the list. The map header has a special value for the + * eflags field, MAP_ENTRY_HEADER, that is set initially, is + * never changed, and prevents an eflags match of the header + * with any other map entry. + * * List of locks * (c) const until freed */ struct vm_map { struct vm_map_entry header; /* List of entries */ -/* - map min_offset header.end (c) - map max_offset header.start (c) -*/ struct sx lock; /* Lock for map data */ struct mtx system_mtx; int nentries; /* Number of entries */ From owner-svn-src-stable@freebsd.org Wed Nov 28 21:20:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 566CA113D9D1; Wed, 28 Nov 2018 21:20:00 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D1B8970B; Wed, 28 Nov 2018 21:19:59 +0000 (UTC) (envelope-from vangyzen@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 C4EBD7DE2; Wed, 28 Nov 2018 21:19:59 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASLJx5v033507; Wed, 28 Nov 2018 21:19:59 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASLJxuY033505; Wed, 28 Nov 2018 21:19:59 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811282119.wASLJxuY033505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 28 Nov 2018 21:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341165 - in stable/11/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in stable/11/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Commit-Revision: 341165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9D1B8970B X-Spamd-Result: default: False [0.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.236,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 21:20:00 -0000 Author: vangyzen Date: Wed Nov 28 21:19:58 2018 New Revision: 341165 URL: https://svnweb.freebsd.org/changeset/base/341165 Log: MFC r340994 Prevent kernel stack disclosure in getcontext/swapcontext Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc. Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: stable/11/sys/amd64/ia32/ia32_signal.c stable/11/sys/mips/mips/freebsd32_machdep.c stable/11/sys/powerpc/powerpc/exec_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/11/sys/amd64/ia32/ia32_signal.c Wed Nov 28 20:03:53 2018 (r341164) +++ stable/11/sys/amd64/ia32/ia32_signal.c Wed Nov 28 21:19:58 2018 (r341165) @@ -260,6 +260,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -300,6 +301,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: stable/11/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- stable/11/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 20:03:53 2018 (r341164) +++ stable/11/sys/mips/mips/freebsd32_machdep.c Wed Nov 28 21:19:58 2018 (r341165) @@ -290,6 +290,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -329,6 +330,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: stable/11/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/11/sys/powerpc/powerpc/exec_machdep.c Wed Nov 28 20:03:53 2018 (r341164) +++ stable/11/sys/powerpc/powerpc/exec_machdep.c Wed Nov 28 21:19:58 2018 (r341165) @@ -801,6 +801,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -840,6 +841,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; From owner-svn-src-stable@freebsd.org Wed Nov 28 21:20:53 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA573113DA48; Wed, 28 Nov 2018 21:20:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E33D89889; Wed, 28 Nov 2018 21:20:52 +0000 (UTC) (envelope-from vangyzen@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 704F57E00; Wed, 28 Nov 2018 21:20:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASLKqZZ033631; Wed, 28 Nov 2018 21:20:52 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASLKpYK033628; Wed, 28 Nov 2018 21:20:51 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811282120.wASLKpYK033628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 28 Nov 2018 21:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341166 - in stable/11/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in stable/11/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 341166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E33D89889 X-Spamd-Result: default: False [0.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_SHORT(0.24)[0.236,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 21:20:53 -0000 Author: vangyzen Date: Wed Nov 28 21:20:51 2018 New Revision: 341166 URL: https://svnweb.freebsd.org/changeset/base/341166 Log: MFC r340995 Prevent kernel stack disclosure in signal delivery On arm64 and riscv platforms, sendsig() failed to zero the signal frame before copying it out to userspace. Zero it. On arm, I believe all the contents of the frame were initialized, so there was no disclosure. However, explicitly zero the whole frame because that fact could inadvertently change in the future, it's more clear to the reader, and I could be wrong in the first place. Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: stable/11/sys/arm/arm/machdep.c stable/11/sys/arm64/arm64/machdep.c stable/11/sys/riscv/riscv/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/machdep.c ============================================================================== --- stable/11/sys/arm/arm/machdep.c Wed Nov 28 21:19:58 2018 (r341165) +++ stable/11/sys/arm/arm/machdep.c Wed Nov 28 21:20:51 2018 (r341166) @@ -609,6 +609,7 @@ sendsig(catcher, ksi, mask) /* make the stack aligned */ fp = (struct sigframe *)STACKALIGN(fp); /* Populate the siginfo frame. */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); #ifdef VFP get_vfpcontext(td, &frame.sf_vfp); Modified: stable/11/sys/arm64/arm64/machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/machdep.c Wed Nov 28 21:19:58 2018 (r341165) +++ stable/11/sys/arm64/arm64/machdep.c Wed Nov 28 21:20:51 2018 (r341166) @@ -590,6 +590,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; Modified: stable/11/sys/riscv/riscv/machdep.c ============================================================================== --- stable/11/sys/riscv/riscv/machdep.c Wed Nov 28 21:19:58 2018 (r341165) +++ stable/11/sys/riscv/riscv/machdep.c Wed Nov 28 21:20:51 2018 (r341166) @@ -522,6 +522,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; From owner-svn-src-stable@freebsd.org Thu Nov 29 00:28:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB52111424CF; Thu, 29 Nov 2018 00:28:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91CB38E3C0; Thu, 29 Nov 2018 00:28:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ED1F11D3A; Thu, 29 Nov 2018 00:28:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT0S9Bd029693; Thu, 29 Nov 2018 00:28:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT0S9hQ029692; Thu, 29 Nov 2018 00:28:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811290028.wAT0S9hQ029692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 29 Nov 2018 00:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341167 - in stable: 11/release/tools 12/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release/tools 12/release/tools X-SVN-Commit-Revision: 341167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91CB38E3C0 X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_SHORT(0.60)[0.600,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 00:28:10 -0000 Author: gjb Date: Thu Nov 29 00:28:08 2018 New Revision: 341167 URL: https://svnweb.freebsd.org/changeset/base/341167 Log: MFC r340983: Fix NTP query on GCE due to unresolved hostname. PR: 232456 Submitted by: Lucas Kanashiro Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/release/tools/gce.conf Directory Properties: stable/12/ (props changed) Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Wed Nov 28 21:20:51 2018 (r341166) +++ stable/11/release/tools/gce.conf Thu Nov 29 00:28:08 2018 (r341167) @@ -49,7 +49,7 @@ aesni_load="YES" nvme_load="YES" EOF - echo '169.254.169.254 metadata.google.internal metadata' > \ + echo '169.254.169.254 metadata.google.internal metadata' >> \ ${DESTDIR}/etc/hosts # overwrite ntp.conf From owner-svn-src-stable@freebsd.org Thu Nov 29 00:28:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C3E111424DD; Thu, 29 Nov 2018 00:28:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E884C8E3C7; Thu, 29 Nov 2018 00:28:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B74EA11D3B; Thu, 29 Nov 2018 00:28:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT0S9k2029699; Thu, 29 Nov 2018 00:28:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT0S9Gm029698; Thu, 29 Nov 2018 00:28:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811290028.wAT0S9Gm029698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 29 Nov 2018 00:28: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: r341167 - in stable: 11/release/tools 12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release/tools 12/release/tools X-SVN-Commit-Revision: 341167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E884C8E3C7 X-Spamd-Result: default: False [1.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_SHORT(0.60)[0.600,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 00:28:10 -0000 Author: gjb Date: Thu Nov 29 00:28:08 2018 New Revision: 341167 URL: https://svnweb.freebsd.org/changeset/base/341167 Log: MFC r340983: Fix NTP query on GCE due to unresolved hostname. PR: 232456 Submitted by: Lucas Kanashiro Sponsored by: The FreeBSD Foundation Modified: stable/12/release/tools/gce.conf Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Modified: stable/12/release/tools/gce.conf ============================================================================== --- stable/12/release/tools/gce.conf Wed Nov 28 21:20:51 2018 (r341166) +++ stable/12/release/tools/gce.conf Thu Nov 29 00:28:08 2018 (r341167) @@ -49,7 +49,7 @@ aesni_load="YES" nvme_load="YES" EOF - echo '169.254.169.254 metadata.google.internal metadata' > \ + echo '169.254.169.254 metadata.google.internal metadata' >> \ ${DESTDIR}/etc/hosts # overwrite ntp.conf From owner-svn-src-stable@freebsd.org Thu Nov 29 00:34:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F7C1142B51; Thu, 29 Nov 2018 00:34:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 079F98EBE8; Thu, 29 Nov 2018 00:34:56 +0000 (UTC) (envelope-from yuripv@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 DCEFE11EE7; Thu, 29 Nov 2018 00:34:55 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT0YtjU034704; Thu, 29 Nov 2018 00:34:55 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT0YtOS034703; Thu, 29 Nov 2018 00:34:55 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811290034.wAT0YtOS034703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 29 Nov 2018 00:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341168 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 341168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 079F98EBE8 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.72)[0.720,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 00:34:56 -0000 Author: yuripv Date: Thu Nov 29 00:34:55 2018 New Revision: 341168 URL: https://svnweb.freebsd.org/changeset/base/341168 Log: MFC r340974: bectl: sync usage with man page, removing stray multibyte characters in the process. PR: 233526 Submitted by: tigersharke@gmail.com (original version) Reviewed by: kevans Differential revision: https://reviews.freebsd.org/D18335 Modified: stable/12/sbin/bectl/bectl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Thu Nov 29 00:28:08 2018 (r341167) +++ stable/12/sbin/bectl/bectl.c Thu Nov 29 00:34:55 2018 (r341168) @@ -66,22 +66,24 @@ usage(bool explicit) FILE *fp; fp = explicit ? stdout : stderr; - fprintf(fp, + fprintf(fp, "%s", "usage:\tbectl {-h | -? | subcommand [args...]}\n" +#if SOON + "\tbectl add (path)*\n" +#endif "\tbectl activate [-t] beName\n" - "\tbectl create [-e {nonActiveBe | -e beName@snapshot}] beName\n" - "\tbectl create beName@snapshot\n" + "\tbectl create [-r] [-e {nonActiveBe | beName@snapshot}] beName\n" + "\tbectl create [-r] beName@snapshot\n" "\tbectl destroy [-F] {beName | beName@snapshot}\n" "\tbectl export sourceBe\n" "\tbectl import targetBe\n" -#if SOON - "\tbectl add (path)*\n" -#endif - "\tbectl jail [{-b | -U}] [{-o key=value | -u key}]... bootenv [utility [argument ...]]\n" - "\tbectl list [-a] [-D] [-H] [-s]\n" + "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " + "{jailID | jailName}\n" + "\t bootenv [utility [argument ...]]\n" + "\tbectl list [-DHas]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" - "\tbectl {ujail | unjail} ⟨jailID | jailName | bootenv)\n" + "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" "\tbectl {umount | unmount} [-f] beName\n"); return (explicit ? 0 : EX_USAGE); From owner-svn-src-stable@freebsd.org Thu Nov 29 01:04:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900691143853; Thu, 29 Nov 2018 01:04:25 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 368D98FFB5; Thu, 29 Nov 2018 01:04:25 +0000 (UTC) (envelope-from sef@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 17794123B6; Thu, 29 Nov 2018 01:04:25 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT14OBS050514; Thu, 29 Nov 2018 01:04:24 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT14O0O050513; Thu, 29 Nov 2018 01:04:24 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201811290104.wAT14O0O050513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 29 Nov 2018 01:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341170 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: sef X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 341170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 368D98FFB5 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.72)[0.720,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:04:25 -0000 Author: sef Date: Thu Nov 29 01:04:24 2018 New Revision: 341170 URL: https://svnweb.freebsd.org/changeset/base/341170 Log: MFC r340442 mountd has no way to configure the listen queue depth; rather than add a new option, we pass -1 down to listen, which causes it to use the kern.ipc.soacceptqueue sysctl. Approved by: mav Sponsored by: iXsystems Inc Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Thu Nov 29 01:02:52 2018 (r341169) +++ stable/12/usr.sbin/mountd/mountd.c Thu Nov 29 01:04:24 2018 (r341170) @@ -908,8 +908,12 @@ complete_service(struct netconfig *nconf, char *port_s if (fd < 0) continue; + /* + * Using -1 tells listen(2) to use + * kern.ipc.soacceptqueue for the backlog. + */ if (nconf->nc_semantics != NC_TPI_CLTS) - listen(fd, SOMAXCONN); + listen(fd, -1); if (nconf->nc_semantics == NC_TPI_CLTS ) transp = svc_dg_create(fd, 0, 0); From owner-svn-src-stable@freebsd.org Thu Nov 29 01:05:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3B6114392A; Thu, 29 Nov 2018 01:05:22 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8543069AA9; Thu, 29 Nov 2018 01:05:22 +0000 (UTC) (envelope-from sef@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 67C03123BA; Thu, 29 Nov 2018 01:05:22 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT15MK4050611; Thu, 29 Nov 2018 01:05:22 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT15MR6050610; Thu, 29 Nov 2018 01:05:22 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201811290105.wAT15MR6050610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 29 Nov 2018 01:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341171 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: sef X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 341171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8543069AA9 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.441,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.72)[0.720,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:05:23 -0000 Author: sef Date: Thu Nov 29 01:05:21 2018 New Revision: 341171 URL: https://svnweb.freebsd.org/changeset/base/341171 Log: MFC r340442 mountd has no way to configure the listen queue depth; rather than add a new option, we pass -1 down to listen, which causes it to use the kern.ipc.soacceptqueue sysctl. Approved by: mav Sponsored by: iXsystems Inc Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Thu Nov 29 01:04:24 2018 (r341170) +++ stable/11/usr.sbin/mountd/mountd.c Thu Nov 29 01:05:21 2018 (r341171) @@ -906,8 +906,12 @@ complete_service(struct netconfig *nconf, char *port_s if (fd < 0) continue; + /* + * Using -1 tells listen(2) to use + * kern.ipc.soacceptqueue for the backlog. + */ if (nconf->nc_semantics != NC_TPI_CLTS) - listen(fd, SOMAXCONN); + listen(fd, -1); if (nconf->nc_semantics == NC_TPI_CLTS ) transp = svc_dg_create(fd, 0, 0); From owner-svn-src-stable@freebsd.org Thu Nov 29 01:24:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C3471144940; Thu, 29 Nov 2018 01:24:21 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E87646ABD8; Thu, 29 Nov 2018 01:24:20 +0000 (UTC) (envelope-from eugen@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 AF3AD1277C; Thu, 29 Nov 2018 01:24:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT1OKVI060593; Thu, 29 Nov 2018 01:24:20 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT1OKq0060592; Thu, 29 Nov 2018 01:24:20 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811290124.wAT1OKq0060592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 01:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341173 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 341173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E87646ABD8 X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.73)[0.734,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:24:21 -0000 Author: eugen Date: Thu Nov 29 01:24:20 2018 New Revision: 341173 URL: https://svnweb.freebsd.org/changeset/base/341173 Log: MFC r340978-340979: ipfw.8: new section to EXAMPLES: SELECTIVE MIRRORING Modified: stable/12/sbin/ipfw/ipfw.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Thu Nov 29 01:15:53 2018 (r341172) +++ stable/12/sbin/ipfw/ipfw.8 Thu Nov 29 01:24:20 2018 (r341173) @@ -4056,6 +4056,55 @@ option could be used to (re)mark user traffic, by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" +.Ss SELECTIVE MIRRORING +If your network has network traffic analyzer +connected to your host directly via dedicated interface +or remotely via RSPAN vlan, you can selectively mirror +some ethernet layer2 frames to the analyzer. +.Pp +First, make sure your firewall is already configured and runs. +Then, enable layer2 processing if not already enabled: +.Pp +.Dl "sysctl net.link.ether.ipfw=1" +.Pp +Next, load needed additional kernel modules: +.Pp +.Dl "kldload ng_ether ng_ipfw" +.Pp +Optionally, make system load these modules automatically +at startup: +.Pp +.Dl sysrc kld_list+="ng_ether ng_ipfw" +.Pp +Next, configure +.Xr ng_ipfw 4 +kernel module to transmit mirrored copies of layer2 frames +out via vlan900 interface: +.Pp +.Dl "ngctl connect ipfw: vlan900: 1 lower" +.Pp +Think of "1" here as of "mirroring instance index" and vlan900 is its +destination. +You can have arbitrary number of instances. +Refer to +.Xr ng_ipfw 4 +for details. +.Pp +At last, actually start mirroring of selected frames using "instance 1". +For frames incoming from em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 in recv em0" +.Pp +For frames outgoing to em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 out xmit em0" +.Pp +For both incoming and outgoing frames while flowing through em0: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 via em0" +.Pp +Make sure you do not perform mirroring for already duplicated frames +or kernel may hang as there is no safety net. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: @@ -4494,6 +4543,7 @@ can be changed in a similar way as for .Xr if_bridge 4 , .Xr ip 4 , .Xr ipfirewall 4 , +.Xr ng_ether 4 , .Xr ng_ipfw 4 , .Xr protocols 5 , .Xr services 5 , @@ -4501,6 +4551,7 @@ can be changed in a similar way as for .Xr kldload 8 , .Xr reboot 8 , .Xr sysctl 8 , +.Xr sysrc 8 , .Xr syslogd 8 .Sh HISTORY The From owner-svn-src-stable@freebsd.org Thu Nov 29 01:28:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A2A1144EA0; Thu, 29 Nov 2018 01:28:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713146AFB5; Thu, 29 Nov 2018 01:28:14 +0000 (UTC) (envelope-from eugen@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 52551127BD; Thu, 29 Nov 2018 01:28:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT1SEM9060795; Thu, 29 Nov 2018 01:28:14 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT1SEto060794; Thu, 29 Nov 2018 01:28:14 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811290128.wAT1SEto060794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 01:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341174 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 341174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 713146AFB5 X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.49)[0.488,0]; NEURAL_SPAM_SHORT(0.73)[0.734,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:28:15 -0000 Author: eugen Date: Thu Nov 29 01:28:13 2018 New Revision: 341174 URL: https://svnweb.freebsd.org/changeset/base/341174 Log: MFC r340978-340979: ipfw.8: new section to EXAMPLES: SELECTIVE MIRRORING Modified: stable/11/sbin/ipfw/ipfw.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Thu Nov 29 01:24:20 2018 (r341173) +++ stable/11/sbin/ipfw/ipfw.8 Thu Nov 29 01:28:13 2018 (r341174) @@ -4011,6 +4011,55 @@ option could be used to (re)mark user traffic, by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" +.Ss SELECTIVE MIRRORING +If your network has network traffic analyzer +connected to your host directly via dedicated interface +or remotely via RSPAN vlan, you can selectively mirror +some ethernet layer2 frames to the analyzer. +.Pp +First, make sure your firewall is already configured and runs. +Then, enable layer2 processing if not already enabled: +.Pp +.Dl "sysctl net.link.ether.ipfw=1" +.Pp +Next, load needed additional kernel modules: +.Pp +.Dl "kldload ng_ether ng_ipfw" +.Pp +Optionally, make system load these modules automatically +at startup: +.Pp +.Dl sysrc kld_list+="ng_ether ng_ipfw" +.Pp +Next, configure +.Xr ng_ipfw 4 +kernel module to transmit mirrored copies of layer2 frames +out via vlan900 interface: +.Pp +.Dl "ngctl connect ipfw: vlan900: 1 lower" +.Pp +Think of "1" here as of "mirroring instance index" and vlan900 is its +destination. +You can have arbitrary number of instances. +Refer to +.Xr ng_ipfw 4 +for details. +.Pp +At last, actually start mirroring of selected frames using "instance 1". +For frames incoming from em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 in recv em0" +.Pp +For frames outgoing to em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 out xmit em0" +.Pp +For both incoming and outgoing frames while flowing through em0: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 via em0" +.Pp +Make sure you do not perform mirroring for already duplicated frames +or kernel may hang as there is no safety net. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: @@ -4449,6 +4498,7 @@ can be changed in a similar way as for .Xr if_bridge 4 , .Xr ip 4 , .Xr ipfirewall 4 , +.Xr ng_ether 4 , .Xr ng_ipfw 4 , .Xr protocols 5 , .Xr services 5 , @@ -4456,6 +4506,7 @@ can be changed in a similar way as for .Xr kldload 8 , .Xr reboot 8 , .Xr sysctl 8 , +.Xr sysrc 8 , .Xr syslogd 8 .Sh HISTORY The From owner-svn-src-stable@freebsd.org Thu Nov 29 12:12:43 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F3411394F2; Thu, 29 Nov 2018 12:12:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C3D865A3; Thu, 29 Nov 2018 12:12:43 +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 ED98019666; Thu, 29 Nov 2018 12:12:42 +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 wATCCg3v095328; Thu, 29 Nov 2018 12:12:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATCCgxc095327; Thu, 29 Nov 2018 12:12:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291212.wATCCgxc095327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 12:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341224 - stable/12/stand/libsa X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/libsa X-SVN-Commit-Revision: 341224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18C3D865A3 X-Spamd-Result: default: False [0.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.32)[0.321,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.15)[0.147,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 12:12:43 -0000 Author: tsoome Date: Thu Nov 29 12:12:42 2018 New Revision: 341224 URL: https://svnweb.freebsd.org/changeset/base/341224 Log: MFC r339651,339992-339993,340026 libsa: re-send ACK for older data packets in tftp libsa: tftp should not read past file end libsa: tftp should use calloc libsa: cstyle cleanup tftp.c Make loader pxeboot more stable over tftp transport. Modified: stable/12/stand/libsa/tftp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/tftp.c ============================================================================== --- stable/12/stand/libsa/tftp.c Thu Nov 29 09:54:27 2018 (r341223) +++ stable/12/stand/libsa/tftp.c Thu Nov 29 12:12:42 2018 (r341224) @@ -63,30 +63,29 @@ __FBSDID("$FreeBSD$"); struct tftp_handle; struct tftprecv_extra; -static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload, - time_t tleft, void *recv_extra); -static int tftp_open(const char *path, struct open_file *f); -static int tftp_close(struct open_file *f); -static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); -static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static off_t tftp_seek(struct open_file *f, off_t offset, int where); -static int tftp_set_blksize(struct tftp_handle *h, const char *str); -static int tftp_stat(struct open_file *f, struct stat *sb); +static ssize_t recvtftp(struct iodesc *, void **, void **, time_t, void *); +static int tftp_open(const char *, struct open_file *); +static int tftp_close(struct open_file *); +static int tftp_parse_oack(struct tftp_handle *, char *, size_t); +static int tftp_read(struct open_file *, void *, size_t, size_t *); +static off_t tftp_seek(struct open_file *, off_t, int); +static int tftp_set_blksize(struct tftp_handle *, const char *); +static int tftp_stat(struct open_file *, struct stat *); struct fs_ops tftp_fsops = { - "tftp", - tftp_open, - tftp_close, - tftp_read, - null_write, - tftp_seek, - tftp_stat, - null_readdir + .fs_name = "tftp", + .fo_open = tftp_open, + .fo_close = tftp_close, + .fo_read = tftp_read, + .fo_write = null_write, + .fo_seek = tftp_seek, + .fo_stat = tftp_stat, + .fo_readdir = null_readdir }; extern struct in_addr servip; -static int tftpport = 2000; +static int tftpport = 2000; static int is_open = 0; /* @@ -94,21 +93,21 @@ static int is_open = 0; * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ -#define TFTP_REQUESTED_BLKSIZE 1428 +#define TFTP_REQUESTED_BLKSIZE 1428 /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. */ -#define TFTP_MAX_BLKSIZE 9008 +#define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { struct iodesc *iodesc; - int currblock; /* contents of lastdata */ - int islastblock; /* flag */ - int validsize; - int off; - char *path; /* saved for re-requests */ + int currblock; /* contents of lastdata */ + int islastblock; /* flag */ + int validsize; + int off; + char *path; /* saved for re-requests */ unsigned int tftp_blksize; unsigned long tftp_tsize; void *pkt; @@ -117,7 +116,7 @@ struct tftp_handle { struct tftprecv_extra { struct tftp_handle *tftp_handle; - unsigned short rtype; /* Received type */ + unsigned short rtype; /* Received type */ }; #define TFTP_MAX_ERRCODE EOPTNEG @@ -141,42 +140,42 @@ tftp_senderr(struct tftp_handle *h, u_short errcode, c { struct { u_char header[HEADER_SIZE]; - struct tftphdr t; + struct tftphdr t; u_char space[63]; /* +1 from t */ } __packed __aligned(4) wbuf; - char *wtail; - int len; + char *wtail; + int len; len = strlen(msg); if (len > sizeof(wbuf.space)) len = sizeof(wbuf.space); - wbuf.t.th_opcode = htons((u_short) ERROR); - wbuf.t.th_code = htons(errcode); + wbuf.t.th_opcode = htons((u_short)ERROR); + wbuf.t.th_code = htons(errcode); wtail = wbuf.t.th_msg; bcopy(msg, wtail, len); wtail[len] = '\0'; wtail += len + 1; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static void -tftp_sendack(struct tftp_handle *h) +tftp_sendack(struct tftp_handle *h, u_short block) { struct { u_char header[HEADER_SIZE]; struct tftphdr t; } __packed __aligned(4) wbuf; - char *wtail; + char *wtail; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; + wbuf.t.th_block = htons(block); wtail += 2; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static ssize_t @@ -190,7 +189,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, ssize_t len; errno = 0; - extra = (struct tftprecv_extra *)recv_extra; + extra = recv_extra; h = extra->tftp_handle; len = readudp(d, &ptr, (void **)&t, tleft); @@ -205,28 +204,36 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, case DATA: { int got; - if (htons(t->th_block) != (u_short) d->xid) { + if (htons(t->th_block) < (u_short)d->xid) { /* - * Expected block? + * Apparently our ACK was missed, re-send. */ + tftp_sendack(h, htons(t->th_block)); free(ptr); return (-1); } + if (htons(t->th_block) != (u_short)d->xid) { + /* + * Packet from the future, drop this. + */ + free(ptr); + return (-1); + } if (d->xid == 1) { /* * First data packet from new port. */ struct udphdr *uh; - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; - } /* else check uh_sport has not changed??? */ + } got = len - (t->th_data - (char *)t); *pkt = ptr; *payload = t; return (got); } case ERROR: - if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { + if ((unsigned)ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -241,8 +248,8 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct udphdr *uh; int tftp_oack_len; - /* - * Unexpected OACK. TFTP transfer already in progress. + /* + * Unexpected OACK. TFTP transfer already in progress. * Drop the pkt. */ if (d->xid != 1) { @@ -254,9 +261,9 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, * Remember which port this OACK came from, because we need * to send the ACK or errors back to it. */ - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; - + /* Parse options ACK-ed by the server. */ tftp_oack_len = len - sizeof(t->th_opcode); if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { @@ -288,9 +295,9 @@ tftp_makereq(struct tftp_handle *h) u_char space[FNAME_SIZE + 6]; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int l; - ssize_t res; + char *wtail; + int l; + ssize_t res; void *pkt; struct tftphdr *t; char *tftp_blksize = NULL; @@ -304,7 +311,7 @@ tftp_makereq(struct tftp_handle *h) tftp_set_blksize(h, tftp_blksize); } - wbuf.t.th_opcode = htons((u_short) RRQ); + wbuf.t.th_opcode = htons((u_short)RRQ); wtail = wbuf.t.th_stuff; l = strlen(h->path); #ifdef TFTP_PREPEND_PATH @@ -329,7 +336,6 @@ tftp_makereq(struct tftp_handle *h) bcopy("0", wtail, 2); wtail += 2; - /* h->iodesc->myport = htons(--tftpport); */ h->iodesc->myport = htons(tftpport + (getsecs() & 0x3ff)); h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ @@ -340,8 +346,8 @@ tftp_makereq(struct tftp_handle *h) pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { free(pkt); return (errno); @@ -364,7 +370,7 @@ tftp_makereq(struct tftp_handle *h) h->islastblock = 0; if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ - tftp_sendack(h); + tftp_sendack(h, h->currblock); } return (0); } @@ -376,7 +382,7 @@ tftp_makereq(struct tftp_handle *h) } /* ack block, expect next */ -static int +static int tftp_getnextblock(struct tftp_handle *h) { struct { @@ -384,21 +390,22 @@ tftp_getnextblock(struct tftp_handle *h) struct tftphdr t; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int res; + char *wtail; + int res; void *pkt; struct tftphdr *t; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; + wbuf.t.th_block = htons((u_short)h->currblock); wtail += 2; h->iodesc->xid = h->currblock + 1; /* expected block */ pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { /* 0 is OK! */ free(pkt); @@ -414,8 +421,8 @@ tftp_getnextblock(struct tftp_handle *h) h->islastblock = 1; /* EOF */ if (h->islastblock == 1) { - /* Send an ACK for the last block */ - wbuf.t.th_block = htons((u_short) h->currblock); + /* Send an ACK for the last block */ + wbuf.t.th_block = htons((u_short)h->currblock); sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } @@ -426,10 +433,10 @@ static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; - struct iodesc *io; - int res; - size_t pathsize; - const char *extraslash; + struct iodesc *io; + int res; + size_t pathsize; + const char *extraslash; if (netproto != NET_TFTP) return (EINVAL); @@ -440,13 +447,12 @@ tftp_open(const char *path, struct open_file *f) if (is_open) return (EBUSY); - tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile)); + tftpfile = calloc(1, sizeof(*tftpfile)); if (!tftpfile) return (ENOMEM); - memset(tftpfile, 0, sizeof(*tftpfile)); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; - tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); + tftpfile->iodesc = io = socktodesc(*(int *)(f->f_devdata)); if (io == NULL) { free(tftpfile); return (EINVAL); @@ -458,7 +464,7 @@ tftp_open(const char *path, struct open_file *f) tftpfile->path = malloc(pathsize); if (tftpfile->path == NULL) { free(tftpfile); - return(ENOMEM); + return (ENOMEM); } if (rootpath[strlen(rootpath) - 1] == '/' || path[0] == '/') extraslash = ""; @@ -469,7 +475,7 @@ tftp_open(const char *path, struct open_file *f) if (res < 0 || res > pathsize) { free(tftpfile->path); free(tftpfile); - return(ENOMEM); + return (ENOMEM); } res = tftp_makereq(tftpfile); @@ -480,7 +486,7 @@ tftp_open(const char *path, struct open_file *f) free(tftpfile); return (res); } - f->f_fsdata = (void *) tftpfile; + f->f_fsdata = tftpfile; is_open = 1; return (0); } @@ -490,11 +496,19 @@ tftp_read(struct open_file *f, void *addr, size_t size size_t *resid /* out */) { struct tftp_handle *tftpfile; + size_t res; int rc; rc = 0; - tftpfile = (struct tftp_handle *) f->f_fsdata; + res = size; + tftpfile = f->f_fsdata; + /* Make sure we will not read past file end */ + if (tftpfile->tftp_tsize > 0 && + tftpfile->off + size > tftpfile->tftp_tsize) { + size = tftpfile->tftp_tsize - tftpfile->off; + } + while (size > 0) { int needblock, count; @@ -542,6 +556,7 @@ tftp_read(struct open_file *f, void *addr, size_t size addr = (char *)addr + count; tftpfile->off += count; size -= count; + res -= count; if ((tftpfile->islastblock) && (count == inbuffer)) break; /* EOF */ @@ -554,16 +569,16 @@ tftp_read(struct open_file *f, void *addr, size_t size } - if (resid) - *resid = size; + if (resid != NULL) + *resid = res; return (rc); } -static int +static int tftp_close(struct open_file *f) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; /* let it time out ... */ @@ -576,17 +591,17 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; sb->st_mode = 0444 | S_IFREG; sb->st_nlink = 1; sb->st_uid = 0; sb->st_gid = 0; - sb->st_size = (off_t) tftpfile->tftp_tsize; + sb->st_size = tftpfile->tftp_tsize; return (0); } @@ -594,7 +609,7 @@ static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; switch (where) { case SEEK_SET: @@ -613,7 +628,7 @@ tftp_seek(struct open_file *f, off_t offset, int where static int tftp_set_blksize(struct tftp_handle *h, const char *str) { - char *endptr; + char *endptr; int new_blksize; int ret = 0; @@ -628,8 +643,8 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * RFC2348 specifies that acceptable values are 8-65464. * Let's choose a limit less than MAXRSPACE. */ - if (*endptr == '\0' && new_blksize >= 8 - && new_blksize <= TFTP_MAX_BLKSIZE) { + if (*endptr == '\0' && new_blksize >= 8 && + new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; ret = 1; } @@ -660,10 +675,10 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * optN, valueN * The final option/value acknowledgment pair. */ -static int +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { - /* + /* * We parse the OACK strings into an array * of name-value pairs. */ @@ -673,7 +688,7 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size int option_idx = 0; int blksize_is_set = 0; int tsize = 0; - + unsigned int orig_blksize; while (option_idx < 128 && i < len) { @@ -690,26 +705,30 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size /* Save the block size we requested for sanity check later. */ orig_blksize = h->tftp_blksize; - /* + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. * * "tsize" is specified in RFC2349. - */ + */ for (i = 0; i < option_idx; i += 2) { - if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) - blksize_is_set = - tftp_set_blksize(h, tftp_options[i + 1]); - } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) - tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - if (tsize != 0) - h->tftp_tsize = tsize; - } else { - /* Do not allow any options we did not expect to be ACKed. */ - printf("unexpected tftp option '%s'\n", tftp_options[i]); - return (-1); - } + if (strcasecmp(tftp_options[i], "blksize") == 0) { + if (i + 1 < option_idx) + blksize_is_set = + tftp_set_blksize(h, tftp_options[i + 1]); + } else if (strcasecmp(tftp_options[i], "tsize") == 0) { + if (i + 1 < option_idx) + tsize = strtol(tftp_options[i + 1], NULL, 10); + if (tsize != 0) + h->tftp_tsize = tsize; + } else { + /* + * Do not allow any options we did not expect to be + * ACKed. + */ + printf("unexpected tftp option '%s'\n", + tftp_options[i]); + return (-1); + } } if (!blksize_is_set) { @@ -731,5 +750,5 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif - return 0; + return (0); } From owner-svn-src-stable@freebsd.org Thu Nov 29 13:01:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01401113AB7F; Thu, 29 Nov 2018 13:01:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C9776A06F; Thu, 29 Nov 2018 13:01:22 +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 7F37D19E1B; Thu, 29 Nov 2018 13:01:22 +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 wATD1M5D016105; Thu, 29 Nov 2018 13:01:22 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATD1MDK016104; Thu, 29 Nov 2018 13:01:22 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291301.wATD1MDK016104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:01: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: r341225 - stable/12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/common X-SVN-Commit-Revision: 341225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C9776A06F X-Spamd-Result: default: False [0.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.261,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:01:23 -0000 Author: tsoome Date: Thu Nov 29 13:01:21 2018 New Revision: 341225 URL: https://svnweb.freebsd.org/changeset/base/341225 Log: MFC: r340240: loader: ptable_open() check for ptable_cd9660read result is wrong The ptable_*read() functions return NULL on read errors (and partition table closed as an side effect). The ptable_open must check the return value and act properly. PR: 232483 Reported by: lev Reviewed by: lev,cem Differential Revision: https://reviews.freebsd.org/D17890 Modified: stable/12/stand/common/part.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/part.c ============================================================================== --- stable/12/stand/common/part.c Thu Nov 29 12:12:42 2018 (r341224) +++ stable/12/stand/common/part.c Thu Nov 29 13:01:21 2018 (r341225) @@ -676,10 +676,12 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect table->type = PTABLE_NONE; STAILQ_INIT(&table->entries); - if (ptable_iso9660read(table, dev, dread) != NULL) { - if (table->type == PTABLE_ISO9660) - goto out; - } + if (ptable_iso9660read(table, dev, dread) == NULL) { + /* Read error. */ + table = NULL; + goto out; + } else if (table->type == PTABLE_ISO9660) + goto out; #ifdef LOADER_VTOC8_SUPPORT if (be16dec(buf + offsetof(struct vtoc8, magic)) == VTOC_MAGIC) { From owner-svn-src-stable@freebsd.org Thu Nov 29 13:37:45 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B3E113C1BC; Thu, 29 Nov 2018 13:37:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 179D36B913; Thu, 29 Nov 2018 13:37:45 +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 ECEDD1A364; Thu, 29 Nov 2018 13:37:44 +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 wATDbimM036654; Thu, 29 Nov 2018 13:37:44 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATDbi0k036650; Thu, 29 Nov 2018 13:37:44 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291337.wATDbi0k036650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341226 - in stable/12/stand: common i386/libi386 X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/12/stand: common i386/libi386 X-SVN-Commit-Revision: 341226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 179D36B913 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.17)[-0.171,0]; NEURAL_SPAM_LONG(0.29)[0.292,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:37:45 -0000 Author: tsoome Date: Thu Nov 29 13:37:44 2018 New Revision: 341226 URL: https://svnweb.freebsd.org/changeset/base/341226 Log: MFC r340215: oader: always set media size from partition. The disk access is validated by using partition table definitions, therefore we have no need for if statements, just set the disk size. Of course the partition table itself may be incorrect/inconsistent, but if so, we are in trouble anyhow. Differential Revision: https://reviews.freebsd.org/D17822 Modified: stable/12/stand/common/disk.c stable/12/stand/common/part.c stable/12/stand/i386/libi386/biosdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/disk.c ============================================================================== --- stable/12/stand/common/disk.c Thu Nov 29 13:01:21 2018 (r341225) +++ stable/12/stand/common/disk.c Thu Nov 29 13:37:44 2018 (r341226) @@ -265,9 +265,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize rc = ENXIO; goto out; } - if (mediasize > od->mediasize) { - od->mediasize = mediasize; - } + od->mediasize = mediasize; if (ptable_gettype(od->table) == PTABLE_BSD && partition >= 0) { Modified: stable/12/stand/common/part.c ============================================================================== --- stable/12/stand/common/part.c Thu Nov 29 13:01:21 2018 (r341225) +++ stable/12/stand/common/part.c Thu Nov 29 13:37:44 2018 (r341226) @@ -323,8 +323,7 @@ ptable_gptread(struct ptable *table, void *dev, diskre * Note, this is still not a foolproof way to get disk's size. For * example, an image file can be truncated when copied to smaller media. */ - if (hdr.hdr_lba_alt + 1 > table->sectors) - table->sectors = hdr.hdr_lba_alt + 1; + table->sectors = hdr.hdr_lba_alt + 1; for (i = 0; i < size / hdr.hdr_entsz; i++) { ent = (struct gpt_ent *)(tbl + i * hdr.hdr_entsz); Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:01:21 2018 (r341225) +++ stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:37:44 2018 (r341226) @@ -325,6 +325,33 @@ bd_print(int verbose) } /* + * Read disk size from partition. + * This is needed to work around buggy BIOS systems returning + * wrong (truncated) disk media size. + * During bd_probe() we tested if the multiplication of bd_sectors + * would overflow so it should be safe to perform here. + */ +static uint64_t +bd_disk_get_sectors(struct disk_devdesc *dev) +{ + struct disk_devdesc disk; + uint64_t size; + + disk.dd.d_dev = dev->dd.d_dev; + disk.dd.d_unit = dev->dd.d_unit; + disk.d_slice = -1; + disk.d_partition = -1; + disk.d_offset = 0; + + size = BD(dev).bd_sectors * BD(dev).bd_sectorsize; + if (disk_open(&disk, size, BD(dev).bd_sectorsize) == 0) { + (void) disk_ioctl(&disk, DIOCGMEDIASIZE, &size); + disk_close(&disk); + } + return (size / BD(dev).bd_sectorsize); +} + +/* * Attempt to open the disk described by (dev) for use by (f). * * Note that the philosophy here is "give them exactly what @@ -338,9 +365,7 @@ static int bd_open(struct open_file *f, ...) { struct disk_devdesc *dev; - struct disk_devdesc disk; va_list ap; - uint64_t size; int rc; va_start(ap, f); @@ -349,33 +374,12 @@ bd_open(struct open_file *f, ...) if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) return (EIO); - BD(dev).bd_open++; if (BD(dev).bd_bcache == NULL) BD(dev).bd_bcache = bcache_allocate(); - /* - * Read disk size from partition. - * This is needed to work around buggy BIOS systems returning - * wrong (truncated) disk media size. - * During bd_probe() we tested if the mulitplication of bd_sectors - * would overflow so it should be safe to perform here. - */ - disk.dd.d_dev = dev->dd.d_dev; - disk.dd.d_unit = dev->dd.d_unit; - disk.d_slice = -1; - disk.d_partition = -1; - disk.d_offset = 0; - - if (disk_open(&disk, BD(dev).bd_sectors * BD(dev).bd_sectorsize, - BD(dev).bd_sectorsize) == 0) { - - if (disk_ioctl(&disk, DIOCGMEDIASIZE, &size) == 0) { - size /= BD(dev).bd_sectorsize; - if (size > BD(dev).bd_sectors) - BD(dev).bd_sectors = size; - } - disk_close(&disk); - } + if (BD(dev).bd_open == 0) + BD(dev).bd_sectors = bd_disk_get_sectors(dev); + BD(dev).bd_open++; rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize); From owner-svn-src-stable@freebsd.org Thu Nov 29 13:44:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D884113C61E; Thu, 29 Nov 2018 13:44:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8C756BEF1; Thu, 29 Nov 2018 13:44:37 +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 B8EDD1A528; Thu, 29 Nov 2018 13:44:37 +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 wATDibT1041891; Thu, 29 Nov 2018 13:44:37 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATDibK4041890; Thu, 29 Nov 2018 13:44:37 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291344.wATDibK4041890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:44: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: r341227 - stable/12/stand/i386/libi386 X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/i386/libi386 X-SVN-Commit-Revision: 341227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8C756BEF1 X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.16)[-0.161,0]; NEURAL_SPAM_LONG(0.32)[0.321,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:44:38 -0000 Author: tsoome Date: Thu Nov 29 13:44:37 2018 New Revision: 341227 URL: https://svnweb.freebsd.org/changeset/base/341227 Log: MFC r339658: loader: biosdisk interface should be able to cope with 4k sectors The 4kn support in current bios specific biosdisk.c is broken, as the code is only implementing the support for the 512B sector size. This work is building the support for custom size sectors, we still do assume the requested data to be multiple of 512B blocks and we only do address the biosdisk.c interface here. For reference, see also: https://www.illumos.org/issues/8303 https://www.illumos.org/rb/r/547 As the GELI is moved above biosdisk "layer", the GELI should just work Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D11174 Modified: stable/12/stand/i386/libi386/biosdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:37:44 2018 (r341226) +++ stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:44:37 2018 (r341227) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -255,10 +256,11 @@ bd_int13probe(struct bdinfo *bd) * Sector size must be a multiple of 512 bytes. * An alternate test would be to check power of 2, * powerof2(params.sector_size). + * 4K is largest read buffer we can use at this time. */ - if (params.sector_size % BIOSDISK_SECSIZE) - bd->bd_sectorsize = BIOSDISK_SECSIZE; - else + if (params.sector_size >= 512 && + params.sector_size <= 4096 && + (params.sector_size % BIOSDISK_SECSIZE) == 0) bd->bd_sectorsize = params.sector_size; total = bd->bd_sectorsize * params.sectors; @@ -452,16 +454,29 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks; - int blks, rc; + uint64_t disk_blocks, offset; + size_t blks, blkoff, bsize, rest; + caddr_t bbuf; + int rc; - if (size % BD(dev).bd_sectorsize) { - panic("bd_strategy: %d bytes I/O not multiple of block size", - size); + /* + * First make sure the IO size is a multiple of 512 bytes. While we do + * process partial reads below, the strategy mechanism is built + * assuming IO is a multiple of 512B blocks. If the request is not + * a multiple of 512B blocks, it has to be some sort of bug. + */ + if (size == 0 || (size % BIOSDISK_SECSIZE) != 0) { + printf("bd_strategy: %d bytes I/O not multiple of %d\n", + size, BIOSDISK_SECSIZE); + return (EIO); } DEBUG("open_disk %p", dev); + offset = dblk * BIOSDISK_SECSIZE; + dblk = offset / BD(dev).bd_sectorsize; + blkoff = offset % BD(dev).bd_sectorsize; + /* * Check the value of the size argument. We do have quite small * heap (64MB), but we do not know good upper limit, so we check against @@ -469,11 +484,14 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * while translating block count to bytes. */ if (size > INT_MAX) { - DEBUG("too large read: %zu bytes", size); + DEBUG("too large I/O: %zu bytes", size); return (EIO); } blks = size / BD(dev).bd_sectorsize; + if (blks == 0 || (size % BD(dev).bd_sectorsize) != 0) + blks++; + if (dblk > dblk + blks) return (EIO); @@ -502,36 +520,75 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (dblk + blks >= dev->d_offset + disk_blocks) { blks = dev->d_offset + disk_blocks - dblk; size = blks * BD(dev).bd_sectorsize; - DEBUG("short read %d", blks); + DEBUG("short I/O %d", blks); } - switch (rw & F_MASK) { - case F_READ: - DEBUG("read %d from %lld to %p", blks, dblk, buf); + if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) + panic("BUG: Real mode buffer is too small\n"); - if (blks && (rc = bd_io(dev, dblk, blks, buf, BD_RD))) { - /* Filter out floppy controller errors */ - if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x\n", - blks, dblk, buf, rc); + bbuf = PTOV(V86_IO_BUFFER); + rest = size; + + while (blks > 0) { + int x = min(blks, V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize); + + switch (rw & F_MASK) { + case F_READ: + DEBUG("read %d from %lld to %p", x, dblk, buf); + bsize = BD(dev).bd_sectorsize * x - blkoff; + if (rest < bsize) + bsize = rest; + + if ((rc = bd_io(dev, dblk, x, bbuf, BD_RD)) != 0) + return (EIO); + + bcopy(bbuf + blkoff, buf, bsize); + break; + case F_WRITE : + DEBUG("write %d from %lld to %p", x, dblk, buf); + if (blkoff != 0) { + /* + * We got offset to sector, read 1 sector to + * bbuf. + */ + x = 1; + bsize = BD(dev).bd_sectorsize - blkoff; + bsize = min(bsize, rest); + rc = bd_io(dev, dblk, x, bbuf, BD_RD); + } else if (rest < BD(dev).bd_sectorsize) { + /* + * The remaining block is not full + * sector. Read 1 sector to bbuf. + */ + x = 1; + bsize = rest; + rc = bd_io(dev, dblk, x, bbuf, BD_RD); + } else { + /* We can write full sector(s). */ + bsize = BD(dev).bd_sectorsize * x; } - return (EIO); - } - break; - case F_WRITE : - DEBUG("write %d from %lld to %p", blks, dblk, buf); + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + bcopy(buf, bbuf + blkoff, bsize); + if ((rc = bd_io(dev, dblk, x, bbuf, BD_WR)) != 0) + return (EIO); - if (blks && bd_io(dev, dblk, blks, buf, BD_WR)) { - DEBUG("write error"); - return (EIO); + break; + default: + /* DO NOTHING */ + return (EROFS); } - break; - default: - /* DO NOTHING */ - return (EROFS); + + blkoff = 0; + buf += bsize; + rest -= bsize; + blks -= x; + dblk += x; } - if (rsize) + if (rsize != NULL) *rsize = size; return (0); } @@ -608,21 +665,16 @@ bd_io_workaround(struct disk_devdesc *dev) bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); } - static int bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int dowrite) { - u_int x, sec, result, resid, retry, maxfer; - caddr_t p, xp, bbuf; - + int result, retry; + /* Just in case some idiot actually tries to read/write -1 blocks... */ if (blks < 0) return (-1); - resid = blks; - p = dest; - /* * Workaround for a problem with some HP ProLiant BIOS failing to work * out the boot disk after installation. hrs and kuriyama discovered @@ -631,91 +683,49 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * the bios. The problem is alleviated by doing an extra read before * the buggy read. It is not immediately known whether other models * are similarly affected. + * Loop retrying the operation a couple of times. The BIOS + * may also retry. */ if (dowrite == BD_RD && dblk >= 0x100000000) bd_io_workaround(dev); + for (retry = 0; retry < 3; retry++) { + /* if retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0; + v86.edx = BD(dev).bd_unit; + v86int(); + } - /* Decide whether we have to bounce */ - if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && - (VTOP(dest) >> 16) != - (VTOP(dest + blks * BD(dev).bd_sectorsize) >> 16))) { + if (BD(dev).bd_flags & BD_MODEEDD1) + result = bd_edd_io(dev, dblk, blks, dest, dowrite); + else + result = bd_chs_io(dev, dblk, blks, dest, dowrite); - /* - * There is a 64k physical boundary somewhere in the - * destination buffer, or the destination buffer is above - * first 1MB of physical memory so we have to arrange a - * suitable bounce buffer. Allocate a buffer twice as large - * as we need to. Use the bottom half unless there is a break - * there, in which case we use the top half. - */ - x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; - x = min(x, (unsigned)blks); - bbuf = PTOV(V86_IO_BUFFER); - maxfer = x; /* limit transfers to bounce region size */ - } else { - bbuf = NULL; - maxfer = 0; + if (result == 0) + break; } - - while (resid > 0) { - /* - * Play it safe and don't cross track boundaries. - * (XXX this is probably unnecessary) - */ - sec = dblk % BD(dev).bd_sec; /* offset into track */ - x = min(BD(dev).bd_sec - sec, resid); - if (maxfer > 0) - x = min(x, maxfer); /* fit bounce buffer */ - /* where do we transfer to? */ - xp = bbuf == NULL ? p : bbuf; - - /* - * Put your Data In, Put your Data out, - * Put your Data In, and shake it all about - */ - if (dowrite == BD_WR && bbuf != NULL) - bcopy(p, bbuf, x * BD(dev).bd_sectorsize); - - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } - - if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, dowrite); - else - result = bd_chs_io(dev, dblk, x, xp, dowrite); - if (result == 0) - break; + /* + * 0x20 - Controller failure. This is common error when the + * media is not present. + */ + if (result != 0 && result != 0x20) { + if (dowrite == BD_WR) { + printf("%s%d: Write %d sector(s) from %p (0x%x) " + "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dest, VTOP(dest), dblk, + result); + } else { + printf("%s%d: Read %d sector(s) from %lld to %p " + "(0x%x): 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dblk, dest, VTOP(dest), + result); } - - if (dowrite == BD_WR) - DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, - p, VTOP(p), dblk, result ? "failed" : "ok"); - else - DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, - dblk, p, VTOP(p), result ? "failed" : "ok"); - if (result) { - return (result); - } - if (dowrite == BD_RD && bbuf != NULL) - bcopy(bbuf, p, x * BD(dev).bd_sectorsize); - p += (x * BD(dev).bd_sectorsize); - dblk += x; - resid -= x; } - return (0); + return (result); } /* From owner-svn-src-stable@freebsd.org Thu Nov 29 13:54:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D08B113CB5A; Thu, 29 Nov 2018 13:54:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0A646C52A; Thu, 29 Nov 2018 13:54:07 +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 818EA1A6C0; Thu, 29 Nov 2018 13:54:07 +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 wATDs7Au047081; Thu, 29 Nov 2018 13:54:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATDs7vS047080; Thu, 29 Nov 2018 13:54:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291354.wATDs7vS047080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:54: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: r341228 - stable/12/stand/i386/libi386 X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/i386/libi386 X-SVN-Commit-Revision: 341228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0A646C52A X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.16)[-0.161,0]; NEURAL_SPAM_LONG(0.32)[0.321,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:54:08 -0000 Author: tsoome Date: Thu Nov 29 13:54:07 2018 New Revision: 341228 URL: https://svnweb.freebsd.org/changeset/base/341228 Log: MFC r339959: loader: issue edd probe before legacy ah=08 and detect no media while probing for drives, use int13 extended info before standard one and provide workaround for case we are not getting needed information in case of floppy drive. In case of INT13 errors, there are (at least) 3 error codes appearing in case of missing media - 20h, 31h and 80h. Flag the no media and do not print an error. Differential Revision: https://reviews.freebsd.org/D17667 Modified: stable/12/stand/i386/libi386/biosdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:44:37 2018 (r341227) +++ stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:54:07 2018 (r341228) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -81,8 +80,10 @@ static struct bdinfo #define BD_MODEINT13 0x0000 #define BD_MODEEDD1 0x0001 #define BD_MODEEDD3 0x0002 +#define BD_MODEEDD (BD_MODEEDD1 | BD_MODEEDD3) #define BD_MODEMASK 0x0003 #define BD_FLOPPY 0x0004 +#define BD_NO_MEDIA 0x0008 int bd_type; /* BIOS 'drive type' (floppy only) */ uint16_t bd_sectorsize; /* Sector size */ uint64_t bd_sectors; /* Disk size */ @@ -188,60 +189,83 @@ bd_init(void) } /* - * Try to detect a device supported by the legacy int13 BIOS + * Return EDD version or 0 if EDD is not supported on this drive. */ static int -bd_int13probe(struct bdinfo *bd) +bd_check_extensions(int unit) { - struct edd_params params; - int ret = 1; /* assume success */ + /* Determine if we can use EDD with this device. */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4100; + v86.edx = unit; + v86.ebx = 0x55aa; + v86int(); + if (V86_CY(v86.efl) || /* carry set */ + (v86.ebx & 0xffff) != 0xaa55) /* signature */ + return (0); + + /* extended disk access functions (AH=42h-44h,47h,48h) supported */ + if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) + return (0); + + return ((v86.eax >> 8) & 0xff); +} + +static void +bd_reset_disk(int unit) +{ + /* reset disk */ v86.ctl = V86_FLAGS; v86.addr = 0x13; + v86.eax = 0; + v86.edx = unit; + v86int(); +} + +/* + * Read CHS info. Return 0 on success, error otherwise. + */ +static int +bd_get_diskinfo_std(struct bdinfo *bd) +{ + bzero(&v86, sizeof(v86)); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; v86.eax = 0x800; v86.edx = bd->bd_unit; v86int(); - /* Don't error out if we get bad sector number, try EDD as well */ - if (V86_CY(v86.efl) || /* carry set */ - (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ - return (0); /* skip device */ + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) + return ((v86.eax & 0xff00) >> 8); - if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ - ret = 0; /* set error */ + /* return custom error on absurd sector number */ + if ((v86.ecx & 0x3f) == 0) + return (0x60); - /* Convert max cyl # -> # of cylinders */ bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; /* Convert max head # -> # of heads */ bd->bd_hds = ((v86.edx & 0xff00) >> 8) + 1; bd->bd_sec = v86.ecx & 0x3f; - bd->bd_type = v86.ebx & 0xff; - bd->bd_flags |= BD_MODEINT13; + bd->bd_type = v86.ebx; + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - /* Calculate sectors count from the geometry */ - bd->bd_sectors = bd->bd_cyl * bd->bd_hds * bd->bd_sec; - bd->bd_sectorsize = BIOSDISK_SECSIZE; - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, - bd->bd_hds, bd->bd_sec); + return (0); +} - /* Determine if we can use EDD with this device. */ - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4100; - v86.edx = bd->bd_unit; - v86.ebx = 0x55aa; - v86int(); - if (V86_CY(v86.efl) || /* carry set */ - (v86.ebx & 0xffff) != 0xaa55 || /* signature */ - (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) - return (ret); /* return code from int13 AH=08 */ +/* + * Read EDD info. Return 0 on success, error otherwise. + */ +static int +bd_get_diskinfo_ext(struct bdinfo *bd) +{ + struct edd_params params; + uint64_t total; - /* EDD supported */ - bd->bd_flags |= BD_MODEEDD1; - if ((v86.eax & 0xff00) >= 0x3000) - bd->bd_flags |= BD_MODEEDD3; /* Get disk params */ - params.len = sizeof(struct edd_params); + bzero(¶ms, sizeof(params)); + params.len = sizeof(params); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4800; @@ -249,37 +273,120 @@ bd_int13probe(struct bdinfo *bd) v86.ds = VTOPSEG(¶ms); v86.esi = VTOPOFF(¶ms); v86int(); - if (!V86_CY(v86.efl)) { - uint64_t total; - /* - * Sector size must be a multiple of 512 bytes. - * An alternate test would be to check power of 2, - * powerof2(params.sector_size). - * 4K is largest read buffer we can use at this time. - */ - if (params.sector_size >= 512 && - params.sector_size <= 4096 && - (params.sector_size % BIOSDISK_SECSIZE) == 0) - bd->bd_sectorsize = params.sector_size; + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) + return ((v86.eax & 0xff00) >> 8); - total = bd->bd_sectorsize * params.sectors; - if (params.sectors != 0) { - /* Only update if we did not overflow. */ - if (total > params.sectors) - bd->bd_sectors = params.sectors; - } + /* + * Sector size must be a multiple of 512 bytes. + * An alternate test would be to check power of 2, + * powerof2(params.sector_size). + * 4K is largest read buffer we can use at this time. + */ + if (params.sector_size >= 512 && + params.sector_size <= 4096 && + (params.sector_size % BIOSDISK_SECSIZE) == 0) + bd->bd_sectorsize = params.sector_size; + bd->bd_cyl = params.cylinders; + bd->bd_hds = params.heads; + bd->bd_sec = params.sectors_per_track; + + if (params.sectors != 0) { + total = params.sectors; + } else { total = (uint64_t)params.cylinders * params.heads * params.sectors_per_track; - if (total > 0 && bd->bd_sectors > total) - bd->bd_sectors = total; + } + bd->bd_sectors = total; - ret = 1; + return (0); +} + +/* + * Try to detect a device supported by the legacy int13 BIOS + */ +static int +bd_int13probe(struct bdinfo *bd) +{ + int edd; + int ret; + + bd->bd_flags &= ~BD_NO_MEDIA; + + edd = bd_check_extensions(bd->bd_unit); + if (edd == 0) + bd->bd_flags |= BD_MODEINT13; + else if (edd < 0x30) + bd->bd_flags |= BD_MODEEDD1; + else + bd->bd_flags |= BD_MODEEDD3; + + /* Default sector size */ + bd->bd_sectorsize = BIOSDISK_SECSIZE; + + /* + * Test if the floppy device is present, so we can avoid receiving + * bogus information from bd_get_diskinfo_std(). + */ + if (bd->bd_unit < 0x80) { + /* reset disk */ + bd_reset_disk(bd->bd_unit); + + /* Get disk type */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x1500; + v86.edx = bd->bd_unit; + v86int(); + if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) + return (0); } - DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", - bd->bd_unit, bd->bd_flags, bd->bd_sectors, bd->bd_sectorsize); - return (ret); + + ret = 1; + if (edd != 0) + ret = bd_get_diskinfo_ext(bd); + if (ret != 0 || bd->bd_sectors == 0) + ret = bd_get_diskinfo_std(bd); + + if (ret != 0 && bd->bd_unit < 0x80) { + /* Set defaults for 1.44 floppy */ + bd->bd_cyl = 80; + bd->bd_hds = 2; + bd->bd_sec = 18; + bd->bd_type = 4; + bd->bd_sectors = 2880; + /* Since we are there, there most likely is no media */ + bd->bd_flags |= BD_NO_MEDIA; + ret = 0; + } + + if (ret != 0) { + if (bd->bd_sectors != 0 && edd != 0) { + bd->bd_sec = 63; + bd->bd_hds = 255; + bd->bd_cyl = + (bd->bd_sectors + bd->bd_sec * bd->bd_hds - 1) / + bd->bd_sec * bd->bd_hds; + } else { + printf("Can not get information about %s unit %#x\n", + biosdisk.dv_name, bd->bd_unit); + return (0); + } + } + + if (bd->bd_sec == 0) + bd->bd_sec = 63; + if (bd->bd_hds == 0) + bd->bd_hds = 255; + + if (bd->bd_sectors == 0) + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; + + DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, + bd->bd_hds, bd->bd_sec); + + return (1); } /* @@ -301,9 +408,11 @@ bd_print(int verbose) for (i = 0; i < nbdinfo; i++) { snprintf(line, sizeof(line), - " disk%d: BIOS drive %c (%ju X %u):\n", i, + " disk%d: BIOS drive %c (%s%ju X %u):\n", i, (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): ('C' + bdinfo[i].bd_unit - 0x80), + (bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? + "no media, " : "", (uintmax_t)bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize); if ((ret = pager_output(line)) != 0) @@ -376,6 +485,11 @@ bd_open(struct open_file *f, ...) if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) return (EIO); + + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { + if (!bd_int13probe(&BD(dev))) + return (EIO); + } if (BD(dev).bd_bcache == NULL) BD(dev).bd_bcache = bcache_allocate(); @@ -503,7 +617,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * partition. */ if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE returns bytes. */ + /* DIOCGMEDIASIZE does return bytes. */ disk_blocks /= BD(dev).bd_sectorsize; } else { /* We should not get here. Just try to survive. */ @@ -689,29 +803,33 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks if (dowrite == BD_RD && dblk >= 0x100000000) bd_io_workaround(dev); for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } - - if (BD(dev).bd_flags & BD_MODEEDD1) + if (BD(dev).bd_flags & BD_MODEEDD) result = bd_edd_io(dev, dblk, blks, dest, dowrite); else result = bd_chs_io(dev, dblk, blks, dest, dowrite); - if (result == 0) + if (result == 0) { + if (BD(dev).bd_flags & BD_NO_MEDIA) + BD(dev).bd_flags &= ~BD_NO_MEDIA; break; + } + + bd_reset_disk(BD(dev).bd_unit); + + /* + * Error codes: + * 20h controller failure + * 31h no media in drive (IBM/MS INT 13 extensions) + * 80h no media in drive, VMWare (Fusion) + * There is no reason to repeat the IO with errors above. + */ + if (result == 0x20 || result == 0x31 || result == 0x80) { + BD(dev).bd_flags |= BD_NO_MEDIA; + break; + } } - /* - * 0x20 - Controller failure. This is common error when the - * media is not present. - */ - if (result != 0 && result != 0x20) { + if (result != 0 && (BD(dev).bd_flags & BD_NO_MEDIA) == 0) { if (dowrite == BD_WR) { printf("%s%d: Write %d sector(s) from %p (0x%x) " "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, From owner-svn-src-stable@freebsd.org Thu Nov 29 13:55:58 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A288113CC3A; Thu, 29 Nov 2018 13:55:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0D136C6B7; Thu, 29 Nov 2018 13:55:57 +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 827751A6C6; Thu, 29 Nov 2018 13:55:57 +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 wATDtv3i047237; Thu, 29 Nov 2018 13:55:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATDtvEI047236; Thu, 29 Nov 2018 13:55:57 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291355.wATDtvEI047236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:55: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: r341229 - stable/12/stand/i386/libi386 X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/i386/libi386 X-SVN-Commit-Revision: 341229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0D136C6B7 X-Spamd-Result: default: False [0.27 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; NEURAL_HAM_SHORT(-0.18)[-0.180,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:55:58 -0000 Author: tsoome Date: Thu Nov 29 13:55:57 2018 New Revision: 341229 URL: https://svnweb.freebsd.org/changeset/base/341229 Log: MFC r340049: loader: biosdisk should check if the media is present The bd_print/bd_open/bd_strategy need to make sure the device does have media, before getting into performing IO operations. Some systems can hung if the device without a media is accessed. Reported by: yuripv Modified: stable/12/stand/i386/libi386/biosdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:54:07 2018 (r341228) +++ stable/12/stand/i386/libi386/biosdisk.c Thu Nov 29 13:55:57 2018 (r341229) @@ -418,6 +418,9 @@ bd_print(int verbose) if ((ret = pager_output(line)) != 0) break; + if ((bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + continue; + dev.dd.d_dev = &biosdisk; dev.dd.d_unit = i; dev.d_slice = -1; @@ -489,6 +492,8 @@ bd_open(struct open_file *f, ...) if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { if (!bd_int13probe(&BD(dev))) return (EIO); + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + return (EIO); } if (BD(dev).bd_bcache == NULL) BD(dev).bd_bcache = bcache_allocate(); @@ -572,6 +577,9 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s size_t blks, blkoff, bsize, rest; caddr_t bbuf; int rc; + + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + return (EIO); /* * First make sure the IO size is a multiple of 512 bytes. While we do From owner-svn-src-stable@freebsd.org Thu Nov 29 13:58:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDB2113CD30; Thu, 29 Nov 2018 13:58:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 523336C849; Thu, 29 Nov 2018 13:58:42 +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 311391A6CA; Thu, 29 Nov 2018 13:58:42 +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 wATDwggH047418; Thu, 29 Nov 2018 13:58:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATDwgg9047417; Thu, 29 Nov 2018 13:58:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291358.wATDwgg9047417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 13:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341230 - stable/12/stand/i386/loader X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/i386/loader X-SVN-Commit-Revision: 341230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 523336C849 X-Spamd-Result: default: False [0.27 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; NEURAL_HAM_SHORT(-0.18)[-0.180,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:58:42 -0000 Author: tsoome Date: Thu Nov 29 13:58:41 2018 New Revision: 341230 URL: https://svnweb.freebsd.org/changeset/base/341230 Log: MFC r340047: loader: do not probe floppy devices for zfs Floppy devices do not have enough space for ZFS pool. Modified: stable/12/stand/i386/loader/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/loader/main.c ============================================================================== --- stable/12/stand/i386/loader/main.c Thu Nov 29 13:55:57 2018 (r341229) +++ stable/12/stand/i386/loader/main.c Thu Nov 29 13:58:41 2018 (r341230) @@ -399,6 +399,8 @@ i386_zfs_probe(void) for (unit = 0; unit < MAXBDDEV; unit++) { if (bd_unit2bios(unit) == -1) break; + if (bd_unit2bios(unit) < 0x80) + continue; sprintf(devname, "disk%d:", unit); zfs_probe_dev(devname, NULL); } From owner-svn-src-stable@freebsd.org Thu Nov 29 15:05:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448FC11400B7; Thu, 29 Nov 2018 15:05:48 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA4196FAAC; Thu, 29 Nov 2018 15:05:47 +0000 (UTC) (envelope-from yuripv@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 ACCFA1B23C; Thu, 29 Nov 2018 15:05:47 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATF5l8o083164; Thu, 29 Nov 2018 15:05:47 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATF5lxF083163; Thu, 29 Nov 2018 15:05:47 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811291505.wATF5lxF083163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 29 Nov 2018 15:05:47 +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: r341234 - stable/12/contrib/nvi/common X-SVN-Group: stable-12 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: stable/12/contrib/nvi/common X-SVN-Commit-Revision: 341234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA4196FAAC X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.20)[0.198,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:05:48 -0000 Author: yuripv Date: Thu Nov 29 15:05:47 2018 New Revision: 341234 URL: https://svnweb.freebsd.org/changeset/base/341234 Log: MFC r340976: vi: fix UTF-8 detection. PR: 202290 Submitted by: lampa@fit.vutbr.cz Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D17950 Modified: stable/12/contrib/nvi/common/encoding.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/nvi/common/encoding.c ============================================================================== --- stable/12/contrib/nvi/common/encoding.c Thu Nov 29 14:49:33 2018 (r341233) +++ stable/12/contrib/nvi/common/encoding.c Thu Nov 29 15:05:47 2018 (r341234) @@ -96,7 +96,7 @@ looks_utf8(const char *ibuf, size_t nbytes) if (i >= nbytes) goto done; - if (buf[i] & 0x40) /* 10xxxxxx */ + if ((buf[i] & 0xc0) != 0x80) /* 10xxxxxx */ return -1; } From owner-svn-src-stable@freebsd.org Thu Nov 29 15:08:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DF51114021B; Thu, 29 Nov 2018 15:08:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2F876FC9D; Thu, 29 Nov 2018 15:07:59 +0000 (UTC) (envelope-from yuripv@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 91D721B241; Thu, 29 Nov 2018 15:07:59 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATF7xWl083311; Thu, 29 Nov 2018 15:07:59 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATF7xRU083310; Thu, 29 Nov 2018 15:07:59 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811291507.wATF7xRU083310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 29 Nov 2018 15:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341235 - stable/11/contrib/nvi/common X-SVN-Group: stable-11 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: stable/11/contrib/nvi/common X-SVN-Commit-Revision: 341235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2F876FC9D X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.20)[0.198,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:08:00 -0000 Author: yuripv Date: Thu Nov 29 15:07:59 2018 New Revision: 341235 URL: https://svnweb.freebsd.org/changeset/base/341235 Log: MFC r340976: vi: fix UTF-8 detection. PR: 202290 Submitted by: lampa@fit.vutbr.cz Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D17950 Modified: stable/11/contrib/nvi/common/encoding.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/nvi/common/encoding.c ============================================================================== --- stable/11/contrib/nvi/common/encoding.c Thu Nov 29 15:05:47 2018 (r341234) +++ stable/11/contrib/nvi/common/encoding.c Thu Nov 29 15:07:59 2018 (r341235) @@ -96,7 +96,7 @@ looks_utf8(const char *ibuf, size_t nbytes) if (i >= nbytes) goto done; - if (buf[i] & 0x40) /* 10xxxxxx */ + if ((buf[i] & 0xc0) != 0x80) /* 10xxxxxx */ return -1; } From owner-svn-src-stable@freebsd.org Thu Nov 29 15:38:28 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE36F11415CB; Thu, 29 Nov 2018 15:38:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54C6C71214; Thu, 29 Nov 2018 15:38:28 +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 35F0A1B741; Thu, 29 Nov 2018 15:38:28 +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 wATFcShA098612; Thu, 29 Nov 2018 15:38:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATFcRTY098611; Thu, 29 Nov 2018 15:38:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291538.wATFcRTY098611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 15:38:27 +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: r341237 - stable/12/sys/geom/concat X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/geom/concat X-SVN-Commit-Revision: 341237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54C6C71214 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.220,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.29)[0.292,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:38:28 -0000 Author: markj Date: Thu Nov 29 15:38:27 2018 New Revision: 341237 URL: https://svnweb.freebsd.org/changeset/base/341237 Log: MFC r339900: Have gconcat advertise delete support if one of its disks does. PR: 232676 Modified: stable/12/sys/geom/concat/g_concat.c stable/12/sys/geom/concat/g_concat.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/concat/g_concat.c ============================================================================== --- stable/12/sys/geom/concat/g_concat.c Thu Nov 29 15:26:07 2018 (r341236) +++ stable/12/sys/geom/concat/g_concat.c Thu Nov 29 15:38:27 2018 (r341237) @@ -206,6 +206,27 @@ fail: } static void +g_concat_candelete(struct bio *bp) +{ + struct g_concat_softc *sc; + struct g_concat_disk *disk; + int i, *val; + + val = (int *)bp->bio_data; + *val = 0; + + sc = bp->bio_to->geom->softc; + for (i = 0; i < sc->sc_ndisks; i++) { + disk = &sc->sc_disks[i]; + if (!disk->d_removed && disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_concat_kernel_dump(struct bio *bp) { struct g_concat_softc *sc; @@ -327,6 +348,9 @@ g_concat_start(struct bio *bp) if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_concat_kernel_dump(bp); return; + } else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) { + g_concat_candelete(bp); + return; } /* To which provider it should be delivered? */ /* FALLTHROUGH */ @@ -408,6 +432,7 @@ g_concat_check_and_run(struct g_concat_softc *sc) struct g_provider *dp, *pp; u_int no, sectorsize = 0; off_t start; + int error; g_topology_assert(); if (g_concat_nvalid(sc) != sc->sc_ndisks) @@ -425,6 +450,16 @@ g_concat_check_and_run(struct g_concat_softc *sc) if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) disk->d_end -= dp->sectorsize; start = disk->d_end; + error = g_access(disk->d_consumer, 1, 0, 0); + if (error == 0) { + error = g_getattr("GEOM::candelete", disk->d_consumer, + &disk->d_candelete); + if (error != 0) + disk->d_candelete = 0; + (void)g_access(disk->d_consumer, -1, 0, 0); + } else + G_CONCAT_DEBUG(1, "Failed to access disk %s, error %d.", + dp->name, error); if (no == 0) sectorsize = dp->sectorsize; else Modified: stable/12/sys/geom/concat/g_concat.h ============================================================================== --- stable/12/sys/geom/concat/g_concat.h Thu Nov 29 15:26:07 2018 (r341236) +++ stable/12/sys/geom/concat/g_concat.h Thu Nov 29 15:38:27 2018 (r341237) @@ -74,6 +74,7 @@ struct g_concat_disk { struct g_concat_softc *d_softc; off_t d_start; off_t d_end; + int d_candelete; int d_removed; }; From owner-svn-src-stable@freebsd.org Thu Nov 29 15:42:34 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D49DC1141894; Thu, 29 Nov 2018 15:42: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7129571660; Thu, 29 Nov 2018 15:42: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 5234E1B8D5; Thu, 29 Nov 2018 15:42:33 +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 wATFgXnR003729; Thu, 29 Nov 2018 15:42:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATFgWZK003727; Thu, 29 Nov 2018 15:42:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291542.wATFgWZK003727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 15:42: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: r341238 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 341238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7129571660 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.23)[0.228,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.29)[0.292,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:42:34 -0000 Author: markj Date: Thu Nov 29 15:42:32 2018 New Revision: 341238 URL: https://svnweb.freebsd.org/changeset/base/341238 Log: MFC r340968: Plug routing sysctl leaks. Modified: stable/12/sys/net/if.h stable/12/sys/net/route.h stable/12/sys/net/rtsock.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.h ============================================================================== --- stable/12/sys/net/if.h Thu Nov 29 15:38:27 2018 (r341237) +++ stable/12/sys/net/if.h Thu Nov 29 15:42:32 2018 (r341238) @@ -271,6 +271,7 @@ struct if_msghdr { int ifm_addrs; /* like rtm_addrs */ int ifm_flags; /* value of if_flags */ u_short ifm_index; /* index for associated ifp */ + u_short _ifm_spare1; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -296,6 +297,7 @@ struct if_msghdrl { u_short _ifm_spare1; /* spare space to grow if_index, see if_var.h */ u_short ifm_len; /* length of if_msghdrl incl. if_data */ u_short ifm_data_off; /* offset of if_data from beginning */ + int _ifm_spare2; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -311,6 +313,7 @@ struct ifa_msghdr { int ifam_addrs; /* like rtm_addrs */ int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ + u_short _ifam_spare1; int ifam_metric; /* value of ifa_ifp->if_metric */ }; @@ -352,6 +355,7 @@ struct ifma_msghdr { int ifmam_addrs; /* like rtm_addrs */ int ifmam_flags; /* value of ifa_flags */ u_short ifmam_index; /* index for associated ifp */ + u_short _ifmam_spare1; }; /* Modified: stable/12/sys/net/route.h ============================================================================== --- stable/12/sys/net/route.h Thu Nov 29 15:38:27 2018 (r341237) +++ stable/12/sys/net/route.h Thu Nov 29 15:42:32 2018 (r341238) @@ -251,6 +251,7 @@ struct rt_msghdr { u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_short rtm_index; /* index for associated ifp */ + u_short _rtm_spare1; int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ int rtm_addrs; /* bitmask identifying sockaddrs in msg */ pid_t rtm_pid; /* identify sender */ Modified: stable/12/sys/net/rtsock.c ============================================================================== --- stable/12/sys/net/rtsock.c Thu Nov 29 15:38:27 2018 (r341237) +++ stable/12/sys/net/rtsock.c Thu Nov 29 15:42:32 2018 (r341238) @@ -83,6 +83,7 @@ struct if_msghdr32 { int32_t ifm_addrs; int32_t ifm_flags; uint16_t ifm_index; + uint16_t _ifm_spare1; struct if_data ifm_data; }; @@ -96,6 +97,7 @@ struct if_msghdrl32 { uint16_t _ifm_spare1; uint16_t ifm_len; uint16_t ifm_data_off; + uint32_t _ifm_spare2; struct if_data ifm_data; }; @@ -1219,8 +1221,11 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo dlen = ALIGN(len) - len; if (buflen < dlen) cp = NULL; - else + else { + bzero(cp, dlen); + cp += dlen; buflen -= dlen; + } } len = ALIGN(len); @@ -1577,6 +1582,8 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) if (w->w_req && w->w_tmem) { struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; + bzero(&rtm->rtm_index, + sizeof(*rtm) - offsetof(struct rt_msghdr, rtm_index)); if (rt->rt_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | (rt->rt_flags & ~RTF_GWFLAG_COMPAT); @@ -1584,7 +1591,6 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) rtm->rtm_flags = rt->rt_flags; rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_index = rt->rt_ifp->if_index; - rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, (caddr_t)rtm, size); return (error); @@ -1612,6 +1618,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm32->_ifm_spare1 = 0; ifm32->ifm_len = sizeof(*ifm32); ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); + ifm32->_ifm_spare2 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1622,6 +1629,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm->_ifm_spare1 = 0; ifm->ifm_len = sizeof(*ifm); ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + ifm->_ifm_spare2 = 0; ifd = &ifm->ifm_data; } @@ -1647,6 +1655,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm32->ifm_addrs = info->rti_addrs; ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm32->ifm_index = ifp->if_index; + ifm32->_ifm_spare1 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1654,6 +1663,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm->ifm_addrs = info->rti_addrs; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; ifd = &ifm->ifm_data; } @@ -1722,6 +1732,7 @@ sysctl_iflist_ifam(struct ifaddr *ifa, struct rt_addri ifam->ifam_addrs = info->rti_addrs; ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; ifam->ifam_metric = ifa->ifa_ifp->if_metric; return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); @@ -1833,6 +1844,7 @@ sysctl_ifmalist(int af, struct walkarg *w) ifmam->ifmam_index = ifma->ifma_ifp->if_index; ifmam->ifmam_flags = 0; ifmam->ifmam_addrs = info.rti_addrs; + ifmam->_ifmam_spare1 = 0; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error != 0) break; From owner-svn-src-stable@freebsd.org Thu Nov 29 15:48:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328CA1141B36; Thu, 29 Nov 2018 15:48:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98F7718D4; Thu, 29 Nov 2018 15:48:37 +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 AA6221B8E0; Thu, 29 Nov 2018 15:48:37 +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 wATFmb7B004104; Thu, 29 Nov 2018 15:48:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATFmapA004098; Thu, 29 Nov 2018 15:48:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811291548.wATFmapA004098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Nov 2018 15:48: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: r341239 - in stable/12: gnu/usr.bin/binutils tools/build/mk tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: gnu/usr.bin/binutils tools/build/mk tools/build/options X-SVN-Commit-Revision: 341239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C98F7718D4 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.23)[0.228,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; NEURAL_SPAM_LONG(0.29)[0.292,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:48:38 -0000 Author: emaste Date: Thu Nov 29 15:48:36 2018 New Revision: 341239 URL: https://svnweb.freebsd.org/changeset/base/341239 Log: MFC r340984: Do not install GNU ld if lld is /usr/bin/ld GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken binaries when ifuncs are in use. When LLD_IS_LD is default we have an ifunc-capable system linker and can just avoid installing ld.bfd. Merged to stable/12 as libc's ifunc use has been merged there; ifunc use has not been merged to releng/12.0 so this change does not need to be either. Modified: stable/12/gnu/usr.bin/binutils/Makefile stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/tools/build/options/WITHOUT_BINUTILS stable/12/tools/build/options/WITH_BINUTILS Directory Properties: stable/12/ (props changed) Modified: stable/12/gnu/usr.bin/binutils/Makefile ============================================================================== --- stable/12/gnu/usr.bin/binutils/Makefile Thu Nov 29 15:42:32 2018 (r341238) +++ stable/12/gnu/usr.bin/binutils/Makefile Thu Nov 29 15:48:36 2018 (r341239) @@ -8,9 +8,13 @@ SUBDIR= doc\ libopcodes \ libbinutils \ as \ - ld \ objdump +# When we use ld.lld as /usr/bin/ld, do not install the non-ifunc-capable +# GNU binutils 2.17.50 ld. +.if ${MK_LLD_IS_LD} == "no" +SUBDIR+=ld +.endif SUBDIR_DEPEND_libbinutils=libbfd # for bfdver.h SUBDIR_DEPEND_as=libbfd libiberty libopcodes Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Nov 29 15:42:32 2018 (r341238) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Nov 29 15:48:36 2018 (r341239) @@ -208,7 +208,6 @@ OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld OLD_FILES+=usr/share/man/man1/ld.1.gz .endif -OLD_FILES+=usr/bin/ld.bfd OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn @@ -411,6 +410,9 @@ OLD_FILES+=usr/share/man/man7/as.7.gz OLD_FILES+=usr/share/man/man7/ld.7.gz OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz +.endif +.if ${MK_BINUTILS} == no || ${MK_LLD_IS_LD} == yes +OLD_FILES+=usr/bin/ld.bfd .endif .if ${MK_BLACKLIST} == no Modified: stable/12/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- stable/12/tools/build/options/WITHOUT_BINUTILS Thu Nov 29 15:42:32 2018 (r341238) +++ stable/12/tools/build/options/WITHOUT_BINUTILS Thu Nov 29 15:48:36 2018 (r341239) @@ -1,4 +1,9 @@ .\" $FreeBSD$ -Set to not build or install binutils (as, ld, and objdump) as part +Set to not build or install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. The resulting system cannot build programs from source. Modified: stable/12/tools/build/options/WITH_BINUTILS ============================================================================== --- stable/12/tools/build/options/WITH_BINUTILS Thu Nov 29 15:42:32 2018 (r341238) +++ stable/12/tools/build/options/WITH_BINUTILS Thu Nov 29 15:48:36 2018 (r341239) @@ -1,3 +1,8 @@ .\" $FreeBSD$ -Set to build and install binutils (as, ld, and objdump) as part +Set to build and install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. From owner-svn-src-stable@freebsd.org Thu Nov 29 15:53:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F40081141E76; Thu, 29 Nov 2018 15:53:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9996071DBB; Thu, 29 Nov 2018 15:53:11 +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 750121BAA3; Thu, 29 Nov 2018 15:53:11 +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 wATFrBkG008750; Thu, 29 Nov 2018 15:53:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATFrBcn008749; Thu, 29 Nov 2018 15:53:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811291553.wATFrBcn008749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Nov 2018 15:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341240 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 341240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9996071DBB X-Spamd-Result: default: False [0.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.21)[0.212,0]; NEURAL_SPAM_MEDIUM(0.19)[0.193,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:53:12 -0000 Author: emaste Date: Thu Nov 29 15:53:10 2018 New Revision: 341240 URL: https://svnweb.freebsd.org/changeset/base/341240 Log: regen src.conf.5 after r341239 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Thu Nov 29 15:48:36 2018 (r341239) +++ stable/12/share/man/man5/src.conf.5 Thu Nov 29 15:53:10 2018 (r341240) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd November 20, 2018 +.Dd November 29, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -144,7 +144,12 @@ associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -Set to not build or install binutils (as, ld, and objdump) as part +Set to not build or install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. The resulting system cannot build programs from source. .Pp @@ -157,7 +162,12 @@ When set, it enforces these options: .Va WITHOUT_GDB .El .It Va WITH_BINUTILS -Set to build and install binutils (as, ld, and objdump) as part +Set to build and install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. .Pp This is a default setting on From owner-svn-src-stable@freebsd.org Thu Nov 29 15:56:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B3831141FA6; Thu, 29 Nov 2018 15:56:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF2D371F92; Thu, 29 Nov 2018 15:56:47 +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 942981BAA9; Thu, 29 Nov 2018 15:56:47 +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 wATFulAu008965; Thu, 29 Nov 2018 15:56:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATFukDj008962; Thu, 29 Nov 2018 15:56:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291556.wATFukDj008962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 15:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341241 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 341241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF2D371F92 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.29)[0.292,0]; NEURAL_SPAM_SHORT(0.23)[0.228,0]; NEURAL_SPAM_MEDIUM(0.25)[0.254,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:56:48 -0000 Author: markj Date: Thu Nov 29 15:56:46 2018 New Revision: 341241 URL: https://svnweb.freebsd.org/changeset/base/341241 Log: MFC r340968: Plug routing sysctl leaks. Modified: stable/11/sys/net/if.h stable/11/sys/net/route.h stable/11/sys/net/rtsock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Thu Nov 29 15:53:10 2018 (r341240) +++ stable/11/sys/net/if.h Thu Nov 29 15:56:46 2018 (r341241) @@ -264,6 +264,7 @@ struct if_msghdr { int ifm_addrs; /* like rtm_addrs */ int ifm_flags; /* value of if_flags */ u_short ifm_index; /* index for associated ifp */ + u_short _ifm_spare1; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -289,6 +290,7 @@ struct if_msghdrl { u_short _ifm_spare1; /* spare space to grow if_index, see if_var.h */ u_short ifm_len; /* length of if_msghdrl incl. if_data */ u_short ifm_data_off; /* offset of if_data from beginning */ + int _ifm_spare2; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -304,6 +306,7 @@ struct ifa_msghdr { int ifam_addrs; /* like rtm_addrs */ int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ + u_short _ifam_spare1; int ifam_metric; /* value of ifa_ifp->if_metric */ }; @@ -345,6 +348,7 @@ struct ifma_msghdr { int ifmam_addrs; /* like rtm_addrs */ int ifmam_flags; /* value of ifa_flags */ u_short ifmam_index; /* index for associated ifp */ + u_short _ifmam_spare1; }; /* Modified: stable/11/sys/net/route.h ============================================================================== --- stable/11/sys/net/route.h Thu Nov 29 15:53:10 2018 (r341240) +++ stable/11/sys/net/route.h Thu Nov 29 15:56:46 2018 (r341241) @@ -251,6 +251,7 @@ struct rt_msghdr { u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_short rtm_index; /* index for associated ifp */ + u_short _rtm_spare1; int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ int rtm_addrs; /* bitmask identifying sockaddrs in msg */ pid_t rtm_pid; /* identify sender */ Modified: stable/11/sys/net/rtsock.c ============================================================================== --- stable/11/sys/net/rtsock.c Thu Nov 29 15:53:10 2018 (r341240) +++ stable/11/sys/net/rtsock.c Thu Nov 29 15:56:46 2018 (r341241) @@ -81,6 +81,7 @@ struct if_msghdr32 { int32_t ifm_addrs; int32_t ifm_flags; uint16_t ifm_index; + uint16_t _ifm_spare1; struct if_data ifm_data; }; @@ -94,6 +95,7 @@ struct if_msghdrl32 { uint16_t _ifm_spare1; uint16_t ifm_len; uint16_t ifm_data_off; + uint32_t _ifm_spare2; struct if_data ifm_data; }; @@ -1211,8 +1213,11 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo dlen = ALIGN(len) - len; if (buflen < dlen) cp = NULL; - else + else { + bzero(cp, dlen); + cp += dlen; buflen -= dlen; + } } len = ALIGN(len); @@ -1566,6 +1571,8 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) if (w->w_req && w->w_tmem) { struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; + bzero(&rtm->rtm_index, + sizeof(*rtm) - offsetof(struct rt_msghdr, rtm_index)); if (rt->rt_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | (rt->rt_flags & ~RTF_GWFLAG_COMPAT); @@ -1573,7 +1580,6 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) rtm->rtm_flags = rt->rt_flags; rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_index = rt->rt_ifp->if_index; - rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, (caddr_t)rtm, size); return (error); @@ -1601,6 +1607,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm32->_ifm_spare1 = 0; ifm32->ifm_len = sizeof(*ifm32); ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); + ifm32->_ifm_spare2 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1611,6 +1618,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm->_ifm_spare1 = 0; ifm->ifm_len = sizeof(*ifm); ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + ifm->_ifm_spare2 = 0; ifd = &ifm->ifm_data; } @@ -1636,6 +1644,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm32->ifm_addrs = info->rti_addrs; ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm32->ifm_index = ifp->if_index; + ifm32->_ifm_spare1 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1643,6 +1652,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm->ifm_addrs = info->rti_addrs; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; ifd = &ifm->ifm_data; } @@ -1711,6 +1721,7 @@ sysctl_iflist_ifam(struct ifaddr *ifa, struct rt_addri ifam->ifam_addrs = info->rti_addrs; ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; ifam->ifam_metric = ifa->ifa_ifp->if_metric; return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); @@ -1825,6 +1836,7 @@ sysctl_ifmalist(int af, struct walkarg *w) ifmam->ifmam_index = ifma->ifma_ifp->if_index; ifmam->ifmam_flags = 0; ifmam->ifmam_addrs = info.rti_addrs; + ifmam->_ifmam_spare1 = 0; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error != 0) break; From owner-svn-src-stable@freebsd.org Thu Nov 29 17:35:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C01E11459A9; Thu, 29 Nov 2018 17:35:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5D6477D67; Thu, 29 Nov 2018 17:35:37 +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 C698F1CBC2; Thu, 29 Nov 2018 17:35:37 +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 wATHZbj2063945; Thu, 29 Nov 2018 17:35:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATHZbkE063944; Thu, 29 Nov 2018 17:35:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291735.wATHZbkE063944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 17:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341249 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 341249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5D6477D67 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; NEURAL_HAM_SHORT(-0.39)[-0.386,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:35:38 -0000 Author: markj Date: Thu Nov 29 17:35:37 2018 New Revision: 341249 URL: https://svnweb.freebsd.org/changeset/base/341249 Log: MFC r341247: Update the free page count when blacklisting pages. PR: 231296 Approved by: re (gjb, insta-MFC) Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Thu Nov 29 16:49:56 2018 (r341248) +++ stable/12/sys/vm/vm_page.c Thu Nov 29 17:35:37 2018 (r341249) @@ -355,7 +355,8 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose) vm_domain_free_lock(vmd); ret = vm_phys_unfree_page(m); vm_domain_free_unlock(vmd); - if (ret) { + if (ret != 0) { + vm_domain_freecnt_inc(vmd, -1); TAILQ_INSERT_TAIL(&blacklist_head, m, listq); if (verbose) printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); From owner-svn-src-stable@freebsd.org Thu Nov 29 17:42:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9326D1145E82; Thu, 29 Nov 2018 17:42:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F68E78372; Thu, 29 Nov 2018 17:42:31 +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 E47EE1CD57; Thu, 29 Nov 2018 17:42:30 +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 wATHgUcE068833; Thu, 29 Nov 2018 17:42:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATHgUn4068832; Thu, 29 Nov 2018 17:42:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291742.wATHgUn4068832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 17:42:30 +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: r341250 - stable/12/usr.sbin/newsyslog X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/newsyslog X-SVN-Commit-Revision: 341250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F68E78372 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.39)[-0.386,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:42:31 -0000 Author: markj Date: Thu Nov 29 17:42:30 2018 New Revision: 341250 URL: https://svnweb.freebsd.org/changeset/base/341250 Log: MFC r341248: Fix age_old_log() after r337468. PR: 233633 Modified: stable/12/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/12/usr.sbin/newsyslog/newsyslog.c Thu Nov 29 17:35:37 2018 (r341249) +++ stable/12/usr.sbin/newsyslog/newsyslog.c Thu Nov 29 17:42:30 2018 (r341250) @@ -2426,6 +2426,7 @@ age_old_log(const char *file) const char *logfile_suffix; static unsigned int suffix_maxlen = 0; char *tmp; + size_t tmpsiz; time_t mtime; int c; @@ -2435,33 +2436,34 @@ age_old_log(const char *file) strlen(compress_type[c].suffix)); } - tmp = alloca(MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1); + tmpsiz = MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1; + tmp = alloca(tmpsiz); if (archtodir) { char *p; /* build name of archive directory into tmp */ if (*archdirname == '/') { /* absolute */ - strlcpy(tmp, archdirname, sizeof(tmp)); + strlcpy(tmp, archdirname, tmpsiz); } else { /* relative */ /* get directory part of logfile */ - strlcpy(tmp, file, sizeof(tmp)); + strlcpy(tmp, file, tmpsiz); if ((p = strrchr(tmp, '/')) == NULL) tmp[0] = '\0'; else *(p + 1) = '\0'; - strlcat(tmp, archdirname, sizeof(tmp)); + strlcat(tmp, archdirname, tmpsiz); } - strlcat(tmp, "/", sizeof(tmp)); + strlcat(tmp, "/", tmpsiz); /* get filename part of logfile */ if ((p = strrchr(file, '/')) == NULL) - strlcat(tmp, file, sizeof(tmp)); + strlcat(tmp, file, tmpsiz); else - strlcat(tmp, p + 1, sizeof(tmp)); + strlcat(tmp, p + 1, tmpsiz); } else { - (void) strlcpy(tmp, file, sizeof(tmp)); + (void) strlcpy(tmp, file, tmpsiz); } if (timefnamefmt != NULL) { @@ -2469,11 +2471,11 @@ age_old_log(const char *file) if (mtime == -1) return (-1); } else { - strlcat(tmp, ".0", sizeof(tmp)); + strlcat(tmp, ".0", tmpsiz); logfile_suffix = get_logfile_suffix(tmp); if (logfile_suffix == NULL) return (-1); - (void) strlcat(tmp, logfile_suffix, sizeof(tmp)); + (void) strlcat(tmp, logfile_suffix, tmpsiz); if (stat(tmp, &sb) < 0) return (-1); mtime = sb.st_mtime; From owner-svn-src-stable@freebsd.org Thu Nov 29 20:14:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5329C114BB7D; Thu, 29 Nov 2018 20:14: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC7498096A; Thu, 29 Nov 2018 20:14:09 +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 CD4441E647; Thu, 29 Nov 2018 20:14:09 +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 wATKE9BJ047395; Thu, 29 Nov 2018 20:14:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATKE9mQ047394; Thu, 29 Nov 2018 20:14:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811292014.wATKE9mQ047394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Nov 2018 20:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r341258 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 341258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC7498096A X-Spamd-Result: default: False [0.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; NEURAL_HAM_SHORT(-0.05)[-0.050,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 20:14:10 -0000 Author: emaste Date: Thu Nov 29 20:14:09 2018 New Revision: 341258 URL: https://svnweb.freebsd.org/changeset/base/341258 Log: MFC r340260: Avoid buffer underwrite in icmp_error icmp_error allocates either an mbuf (with pkthdr) or a cluster depending on the size of data to be quoted in the ICMP reply, but the calculation failed to account for the additional padding that m_align may apply. Include the ip header in the size passed to m_align. On 64-bit archs this will have the net effect of moving everything 4 bytes later in the mbuf or cluster. This will result in slightly pessimal alignment for the ICMP data copy. Also add an assertion that we do not move m_data before the beginning of the mbuf or cluster. Reported by: A reddit user Security: CVE-2018-17156 Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/netinet/ip_icmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_icmp.c ============================================================================== --- stable/10/sys/netinet/ip_icmp.c Thu Nov 29 19:28:01 2018 (r341257) +++ stable/10/sys/netinet/ip_icmp.c Thu Nov 29 20:14:09 2018 (r341258) @@ -299,7 +299,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs mac_netinet_icmp_reply(n, m); #endif icmplen = min(icmplen, M_TRAILINGSPACE(m) - sizeof(struct ip) - ICMP_MINLEN); - m_align(m, ICMP_MINLEN + icmplen); + m_align(m, sizeof(struct ip) + ICMP_MINLEN + icmplen); + m->m_data += sizeof(struct ip); m->m_len = ICMP_MINLEN + icmplen; /* XXX MRT make the outgoing packet use the same FIB @@ -341,6 +342,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs * reply should bypass as well. */ m->m_flags |= n->m_flags & M_SKIP_FIREWALL; + KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ip), + ("insufficient space for ip header")); m->m_data -= sizeof(struct ip); m->m_len += sizeof(struct ip); m->m_pkthdr.len = m->m_len; From owner-svn-src-stable@freebsd.org Thu Nov 29 20:25:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06B7E114BF0B; Thu, 29 Nov 2018 20:25:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A14B880E6C; Thu, 29 Nov 2018 20:25:48 +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 813C91E7DC; Thu, 29 Nov 2018 20:25:48 +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 wATKPmjO052671; Thu, 29 Nov 2018 20:25:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATKPmGH052669; Thu, 29 Nov 2018 20:25:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811292025.wATKPmGH052669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 20:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341259 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 341259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A14B880E6C X-Spamd-Result: default: False [0.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.072,0]; NEURAL_SPAM_MEDIUM(0.24)[0.241,0]; NEURAL_SPAM_LONG(0.29)[0.292,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 20:25:49 -0000 Author: markj Date: Thu Nov 29 20:25:47 2018 New Revision: 341259 URL: https://svnweb.freebsd.org/changeset/base/341259 Log: MFC r340483 (by jtl): Add some additional length checks to the IPv4 fragmentation code. Modified: stable/12/sys/netinet/ip_reass.c stable/12/sys/netinet/ip_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_reass.c ============================================================================== --- stable/12/sys/netinet/ip_reass.c Thu Nov 29 20:14:09 2018 (r341258) +++ stable/12/sys/netinet/ip_reass.c Thu Nov 29 20:25:47 2018 (r341259) @@ -211,19 +211,21 @@ ip_reass(struct mbuf *m) * convert offset of this to bytes. */ ip->ip_len = htons(ntohs(ip->ip_len) - hlen); - if (ip->ip_off & htons(IP_MF)) { - /* - * Make sure that fragments have a data length - * that's a non-zero multiple of 8 bytes. - */ - if (ip->ip_len == htons(0) || (ntohs(ip->ip_len) & 0x7) != 0) { - IPSTAT_INC(ips_toosmall); /* XXX */ - IPSTAT_INC(ips_fragdropped); - m_freem(m); - return (NULL); - } + /* + * Make sure that fragments have a data length + * that's a non-zero multiple of 8 bytes, unless + * this is the last fragment. + */ + if (ip->ip_len == htons(0) || + ((ip->ip_off & htons(IP_MF)) && (ntohs(ip->ip_len) & 0x7) != 0)) { + IPSTAT_INC(ips_toosmall); /* XXX */ + IPSTAT_INC(ips_fragdropped); + m_freem(m); + return (NULL); + } + if (ip->ip_off & htons(IP_MF)) m->m_flags |= M_IP_FRAG; - } else + else m->m_flags &= ~M_IP_FRAG; ip->ip_off = htons(ntohs(ip->ip_off) << 3); @@ -301,9 +303,28 @@ ip_reass(struct mbuf *m) fp->ipq_src = ip->ip_src; fp->ipq_dst = ip->ip_dst; fp->ipq_frags = m; + if (m->m_flags & M_IP_FRAG) + fp->ipq_maxoff = -1; + else + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); m->m_nextpkt = NULL; goto done; } else { + /* + * If we already saw the last fragment, make sure + * this fragment's offset looks sane. Otherwise, if + * this is the last fragment, record its endpoint. + */ + if (fp->ipq_maxoff > 0) { + i = ntohs(ip->ip_off) + ntohs(ip->ip_len); + if (((m->m_flags & M_IP_FRAG) && i >= fp->ipq_maxoff) || + ((m->m_flags & M_IP_FRAG) == 0 && + i != fp->ipq_maxoff)) { + fp = NULL; + goto dropfrag; + } + } else if ((m->m_flags & M_IP_FRAG) == 0) + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); fp->ipq_nfrags++; atomic_add_int(&nfrags, 1); #ifdef MAC Modified: stable/12/sys/netinet/ip_var.h ============================================================================== --- stable/12/sys/netinet/ip_var.h Thu Nov 29 20:14:09 2018 (r341258) +++ stable/12/sys/netinet/ip_var.h Thu Nov 29 20:25:47 2018 (r341259) @@ -61,6 +61,7 @@ struct ipq { u_char ipq_ttl; /* time for reass q to live */ u_char ipq_p; /* protocol of this fragment */ u_short ipq_id; /* sequence id for reassembly */ + int ipq_maxoff; /* total length of packet */ struct mbuf *ipq_frags; /* to ip headers of fragments */ struct in_addr ipq_src,ipq_dst; u_char ipq_nfrags; /* # frags in this packet */ From owner-svn-src-stable@freebsd.org Thu Nov 29 20:38:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41E1A114C2FE; Thu, 29 Nov 2018 20:38:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEF2381484; Thu, 29 Nov 2018 20:38:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 957C21E978; Thu, 29 Nov 2018 20:38:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATKcOTj057771; Thu, 29 Nov 2018 20:38:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATKcOXm057769; Thu, 29 Nov 2018 20:38:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811292038.wATKcOXm057769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 20:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341260 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 341260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEF2381484 X-Spamd-Result: default: False [0.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.24)[0.241,0]; NEURAL_HAM_SHORT(-0.07)[-0.072,0]; NEURAL_SPAM_LONG(0.29)[0.292,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 20:38:25 -0000 Author: markj Date: Thu Nov 29 20:38:23 2018 New Revision: 341260 URL: https://svnweb.freebsd.org/changeset/base/341260 Log: MFC r340483 (by jtl): Add some additional length checks to the IPv4 fragmentation code. Modified: stable/11/sys/netinet/ip_reass.c stable/11/sys/netinet/ip_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Thu Nov 29 20:25:47 2018 (r341259) +++ stable/11/sys/netinet/ip_reass.c Thu Nov 29 20:38:23 2018 (r341260) @@ -211,19 +211,21 @@ ip_reass(struct mbuf *m) * convert offset of this to bytes. */ ip->ip_len = htons(ntohs(ip->ip_len) - hlen); - if (ip->ip_off & htons(IP_MF)) { - /* - * Make sure that fragments have a data length - * that's a non-zero multiple of 8 bytes. - */ - if (ip->ip_len == htons(0) || (ntohs(ip->ip_len) & 0x7) != 0) { - IPSTAT_INC(ips_toosmall); /* XXX */ - IPSTAT_INC(ips_fragdropped); - m_freem(m); - return (NULL); - } + /* + * Make sure that fragments have a data length + * that's a non-zero multiple of 8 bytes, unless + * this is the last fragment. + */ + if (ip->ip_len == htons(0) || + ((ip->ip_off & htons(IP_MF)) && (ntohs(ip->ip_len) & 0x7) != 0)) { + IPSTAT_INC(ips_toosmall); /* XXX */ + IPSTAT_INC(ips_fragdropped); + m_freem(m); + return (NULL); + } + if (ip->ip_off & htons(IP_MF)) m->m_flags |= M_IP_FRAG; - } else + else m->m_flags &= ~M_IP_FRAG; ip->ip_off = htons(ntohs(ip->ip_off) << 3); @@ -291,9 +293,28 @@ ip_reass(struct mbuf *m) fp->ipq_src = ip->ip_src; fp->ipq_dst = ip->ip_dst; fp->ipq_frags = m; + if (m->m_flags & M_IP_FRAG) + fp->ipq_maxoff = -1; + else + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); m->m_nextpkt = NULL; goto done; } else { + /* + * If we already saw the last fragment, make sure + * this fragment's offset looks sane. Otherwise, if + * this is the last fragment, record its endpoint. + */ + if (fp->ipq_maxoff > 0) { + i = ntohs(ip->ip_off) + ntohs(ip->ip_len); + if (((m->m_flags & M_IP_FRAG) && i >= fp->ipq_maxoff) || + ((m->m_flags & M_IP_FRAG) == 0 && + i != fp->ipq_maxoff)) { + fp = NULL; + goto dropfrag; + } + } else if ((m->m_flags & M_IP_FRAG) == 0) + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); fp->ipq_nfrags++; atomic_add_int(&nfrags, 1); #ifdef MAC Modified: stable/11/sys/netinet/ip_var.h ============================================================================== --- stable/11/sys/netinet/ip_var.h Thu Nov 29 20:25:47 2018 (r341259) +++ stable/11/sys/netinet/ip_var.h Thu Nov 29 20:38:23 2018 (r341260) @@ -58,6 +58,7 @@ struct ipq { u_char ipq_ttl; /* time for reass q to live */ u_char ipq_p; /* protocol of this fragment */ u_short ipq_id; /* sequence id for reassembly */ + int ipq_maxoff; /* total length of packet */ struct mbuf *ipq_frags; /* to ip headers of fragments */ struct in_addr ipq_src,ipq_dst; u_char ipq_nfrags; /* # frags in this packet */ From owner-svn-src-stable@freebsd.org Thu Nov 29 20:48:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66193114C71F; Thu, 29 Nov 2018 20:48:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FCB481990; Thu, 29 Nov 2018 20:48:39 +0000 (UTC) (envelope-from marius@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 D54081EB2E; Thu, 29 Nov 2018 20:48:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATKmc1g062670; Thu, 29 Nov 2018 20:48:38 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATKmcfi062667; Thu, 29 Nov 2018 20:48:38 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811292048.wATKmcfi062667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 29 Nov 2018 20:48: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: r341261 - in stable/12: . sys/modules/iavf X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/12: . sys/modules/iavf X-SVN-Commit-Revision: 341261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FCB481990 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.28)[0.283,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 20:48:39 -0000 Author: marius Date: Thu Nov 29 20:48:38 2018 New Revision: 341261 URL: https://svnweb.freebsd.org/changeset/base/341261 Log: MFC: r341016 - Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338. - Likewise, add ixlv.4.gz to OLD_FILES, - and link if_ixlv.ko to if_iavf.ko in order to aid a bit in the transition. Modified: stable/12/ObsoleteFiles.inc stable/12/UPDATING stable/12/sys/modules/iavf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Thu Nov 29 20:38:23 2018 (r341260) +++ stable/12/ObsoleteFiles.inc Thu Nov 29 20:48:38 2018 (r341261) @@ -60,6 +60,8 @@ OLD_LIBS+=usr/lib32/libcap_pwd.so.0 OLD_LIBS+=usr/lib32/libcap_random.so.0 OLD_LIBS+=usr/lib32/libcap_dns.so.0 OLD_LIBS+=usr/lib32/libcap_syslog.so.0 +# 20181012: rename of ixlv(4) to iavf(4) +OLD_FILES+=usr/share/man/man4/ixlv.4.gz # 20181009: OpenSSL 1.1.1 OLD_FILES+=usr/include/openssl/des_old.h OLD_FILES+=usr/include/openssl/dso.h Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Thu Nov 29 20:38:23 2018 (r341260) +++ stable/12/UPDATING Thu Nov 29 20:48:38 2018 (r341261) @@ -52,6 +52,13 @@ from older version of current across the gcc/clang cut loading from X11 startup. These will become the defaults in 13-current shortly. +20181012: + The ixlv(4) driver has been renamed to iavf(4). As a consequence, + custom kernel and module loading configuration files must be updated + accordingly. Moreover, interfaces previous presented as ixlvN to the + system are now exposed as iavfN and network configuration files must + be adjusted as necessary. + 20181009: OpenSSL has been updated to version 1.1.1. This update included additional various API changes througout the base system. It is Modified: stable/12/sys/modules/iavf/Makefile ============================================================================== --- stable/12/sys/modules/iavf/Makefile Thu Nov 29 20:38:23 2018 (r341260) +++ stable/12/sys/modules/iavf/Makefile Thu Nov 29 20:48:38 2018 (r341261) @@ -15,4 +15,6 @@ SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c # Enable asserts and other debugging facilities # CFLAGS += -DINVARIANTS -DINVARIANTS_SUPPORT -DWITNESS +LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_ixlv.ko + .include From owner-svn-src-stable@freebsd.org Thu Nov 29 21:10:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D17114CF80; Thu, 29 Nov 2018 21:10:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1096182ECF; Thu, 29 Nov 2018 21:10:19 +0000 (UTC) (envelope-from marius@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 E60FE1EE97; Thu, 29 Nov 2018 21:10:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATLAIXf073526; Thu, 29 Nov 2018 21:10:18 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATLAIBU073525; Thu, 29 Nov 2018 21:10:18 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811292110.wATLAIBU073525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 29 Nov 2018 21:10: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: r341264 - stable/12/sys/contrib/ck/include/gcc/sparcv9 X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/contrib/ck/include/gcc/sparcv9 X-SVN-Commit-Revision: 341264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1096182ECF X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.29)[0.292,0]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_SPAM_MEDIUM(0.24)[0.241,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 21:10:19 -0000 Author: marius Date: Thu Nov 29 21:10:18 2018 New Revision: 341264 URL: https://svnweb.freebsd.org/changeset/base/341264 Log: MFV: r341039, MFC: r341041 Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its sparcv9 atomics compatible with the FreeBSD kernel by using instructions which access the appropriate address space. Atomic operations within the kernel must access the nucleus address space instead of the default primary one. Without this change but the increased use of CK in the kernel, machines started to panic after some minutes of uptime due to an unresolvable fault in ck_pr_cas_64_value(). Modified: stable/12/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h ============================================================================== --- stable/12/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Thu Nov 29 21:00:56 2018 (r341263) +++ stable/12/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Thu Nov 29 21:10:18 2018 (r341264) @@ -136,11 +136,26 @@ CK_PR_STORE_S(int, int, "stsw") #undef CK_PR_STORE_S #undef CK_PR_STORE +/* Use the appropriate address space for atomics within the FreeBSD kernel. */ +#if defined(__FreeBSD__) && defined(_KERNEL) +#include +#include +#define CK_PR_INS_CAS "casa" +#define CK_PR_INS_CASX "casxa" +#define CK_PR_INS_SWAP "swapa" +#define CK_PR_ASI_ATOMIC __XSTRING(__ASI_ATOMIC) +#else +#define CK_PR_INS_CAS "cas" +#define CK_PR_INS_CASX "casx" +#define CK_PR_INS_SWAP "swap" +#define CK_PR_ASI_ATOMIC "" +#endif + CK_CC_INLINE static bool ck_pr_cas_64_value(uint64_t *target, uint64_t compare, uint64_t set, uint64_t *value) { - __asm__ __volatile__("casx [%1], %2, %0" + __asm__ __volatile__(CK_PR_INS_CASX " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" : "+&r" (set) : "r" (target), "r" (compare) @@ -154,7 +169,7 @@ CK_CC_INLINE static bool ck_pr_cas_64(uint64_t *target, uint64_t compare, uint64_t set) { - __asm__ __volatile__("casx [%1], %2, %0" + __asm__ __volatile__(CK_PR_INS_CASX " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" : "+&r" (set) : "r" (target), "r" (compare) @@ -181,7 +196,7 @@ ck_pr_cas_ptr_value(void *target, void *compare, void CK_CC_INLINE static bool \ ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \ { \ - __asm__ __volatile__("cas [%1], %2, %0" \ + __asm__ __volatile__(CK_PR_INS_CAS " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" \ : "+&r" (set) \ : "r" (target), \ "r" (compare) \ @@ -192,7 +207,7 @@ ck_pr_cas_ptr_value(void *target, void *compare, void CK_CC_INLINE static bool \ ck_pr_cas_##N(T *target, T compare, T set) \ { \ - __asm__ __volatile__("cas [%1], %2, %0" \ + __asm__ __volatile__(CK_PR_INS_CAS " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" \ : "+&r" (set) \ : "r" (target), \ "r" (compare) \ @@ -211,7 +226,7 @@ CK_PR_CAS(int, int) ck_pr_fas_##N(T *target, T update) \ { \ \ - __asm__ __volatile__("swap [%1], %0" \ + __asm__ __volatile__(CK_PR_INS_SWAP " [%1] " CK_PR_ASI_ATOMIC ", %0" \ : "+&r" (update) \ : "r" (target) \ : "memory"); \ @@ -223,6 +238,11 @@ CK_PR_FAS(uint, unsigned int) CK_PR_FAS(32, uint32_t) #undef CK_PR_FAS + +#undef CK_PR_INS_CAS +#undef CK_PR_INS_CASX +#undef CK_PR_INS_SWAP +#undef CK_PR_ASI_ATOMIC #endif /* CK_PR_SPARCV9_H */ From owner-svn-src-stable@freebsd.org Fri Nov 30 01:45:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 843CC1153E02; Fri, 30 Nov 2018 01:45:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338BE8CA23; Fri, 30 Nov 2018 01:45:56 +0000 (UTC) (envelope-from dab@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 12F5D21CDC; Fri, 30 Nov 2018 01:45:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU1jua5017971; Fri, 30 Nov 2018 01:45:56 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU1jtdm017965; Fri, 30 Nov 2018 01:45:55 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201811300145.wAU1jtdm017965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 30 Nov 2018 01:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341274 - stable/12/tests/sys/kqueue/libkqueue X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 341274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 338BE8CA23 X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.32)[0.321,0]; NEURAL_SPAM_SHORT(0.50)[0.498,0]; NEURAL_SPAM_MEDIUM(0.30)[0.297,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 01:45:56 -0000 Author: dab Date: Fri Nov 30 01:45:54 2018 New Revision: 341274 URL: https://svnweb.freebsd.org/changeset/base/341274 Log: MFC r341068: Make whitespace more consistent in libkqueue tests. After r337820, which "corrected" some spaces-instead-of-tab whitespace issues in the libkqueue tests, jmg@ pointed out that these files were originally space-based, not tab-spaced, and so the correction should have been to get rid of the tabs that had been introduced in previous changes, not the spaces. This change does that. This is a whitespace only change; no functional change is intended. Reported by: jmg@ Sponsored by: Dell EMC Isilon Modified: stable/12/tests/sys/kqueue/libkqueue/main.c stable/12/tests/sys/kqueue/libkqueue/proc.c stable/12/tests/sys/kqueue/libkqueue/signal.c stable/12/tests/sys/kqueue/libkqueue/timer.c stable/12/tests/sys/kqueue/libkqueue/user.c stable/12/tests/sys/kqueue/libkqueue/vnode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/main.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/main.c Fri Nov 30 01:45:54 2018 (r341274) @@ -85,7 +85,7 @@ kevent_get(int kqfd) struct kevent *kev; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); if (nfds < 1) @@ -103,7 +103,7 @@ kevent_get_timeout(int kqfd, int seconds) struct timespec timeout = {seconds, 0}; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, &timeout); if (nfds < 0) { @@ -123,10 +123,10 @@ kevent_fflags_dump(struct kevent *kev) #define KEVFFL_DUMP(attrib) \ if (kev->fflags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); /* Not every filter has meaningful fflags */ if (kev->filter == EVFILT_PROC) { @@ -160,7 +160,7 @@ kevent_fflags_dump(struct kevent *kev) #endif buf[strlen(buf) - 1] = ')'; } else { - snprintf(buf, 1024, "fflags = %x", kev->fflags); + snprintf(buf, 1024, "fflags = %x", kev->fflags); } return (buf); @@ -173,10 +173,10 @@ kevent_flags_dump(struct kevent *kev) #define KEVFL_DUMP(attrib) \ if (kev->flags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); snprintf(buf, 1024, "flags = %d (", kev->flags); KEVFL_DUMP(EV_ADD); @@ -208,17 +208,17 @@ kevent_to_str(struct kevent *kev) snprintf(&buf[0], sizeof(buf), "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, " - "ext=[%jx %jx %jx %jx]", + "ext=[%jx %jx %jx %jx]", (uintmax_t) kev->ident, kev->filter, flags_str, fflags_str, (uintmax_t)kev->data, kev->udata, - (uintmax_t)kev->ext[0], - (uintmax_t)kev->ext[1], - (uintmax_t)kev->ext[2], - (uintmax_t)kev->ext[3]); + (uintmax_t)kev->ext[0], + (uintmax_t)kev->ext[1], + (uintmax_t)kev->ext[2], + (uintmax_t)kev->ext[3]); free(flags_str); free(fflags_str); @@ -239,10 +239,10 @@ kevent_add(int kqfd, struct kevent *kev, EV_SET(kev, ident, filter, flags, fflags, data, NULL); if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { - kev_str = kevent_to_str(kev); - printf("Unable to add the following kevent:\n%s\n", - kev_str); - free(kev_str); + kev_str = kevent_to_str(kev); + printf("Unable to add the following kevent:\n%s\n", + kev_str); + free(kev_str); err(1, "kevent(): %s", strerror(errno)); } } @@ -265,12 +265,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) k1->data != k2->data || k1->udata != k2->udata || k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { - kev1_str = kevent_to_str(k1); - kev2_str = kevent_to_str(k2); - printf("kevent_cmp: mismatch:\n %s !=\n %s\n", - kev1_str, kev2_str); - free(kev1_str); - free(kev2_str); + kev1_str = kevent_to_str(k1); + kev2_str = kevent_to_str(k2); + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", + kev1_str, kev2_str); + free(kev1_str); + free(kev2_str); abort(); } } Modified: stable/12/tests/sys/kqueue/libkqueue/proc.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/proc.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/proc.c Fri Nov 30 01:45:54 2018 (r341274) @@ -45,7 +45,7 @@ add_and_delete(void) struct stat s; if (fstat(kqfd, &s) != -1) errx(1, "kqueue inherited across fork! (%s() at %s:%d)", - __func__, __FILE__, __LINE__); + __func__, __FILE__, __LINE__); pause(); exit(2); Modified: stable/12/tests/sys/kqueue/libkqueue/signal.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/signal.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/signal.c Fri Nov 30 01:45:54 2018 (r341274) @@ -188,12 +188,12 @@ test_kevent_signal_oneshot(void) void test_evfilt_signal() { - kqfd = kqueue(); - test_kevent_signal_add(); - test_kevent_signal_del(); - test_kevent_signal_get(); - test_kevent_signal_disable(); - test_kevent_signal_enable(); - test_kevent_signal_oneshot(); - close(kqfd); + kqfd = kqueue(); + test_kevent_signal_add(); + test_kevent_signal_del(); + test_kevent_signal_get(); + test_kevent_signal_disable(); + test_kevent_signal_enable(); + test_kevent_signal_oneshot(); + close(kqfd); } Modified: stable/12/tests/sys/kqueue/libkqueue/timer.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/timer.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/timer.c Fri Nov 30 01:45:54 2018 (r341274) @@ -34,11 +34,10 @@ int kqfd; static long now(void) { - - struct timeval tv; + struct timeval tv; - gettimeofday(&tv, NULL); - return SEC_TO_US(tv.tv_sec) + tv.tv_usec; + gettimeofday(&tv, NULL); + return SEC_TO_US(tv.tv_sec) + tv.tv_usec; } /* Sleep for a given number of milliseconds. The timeout is assumed to @@ -47,13 +46,12 @@ now(void) void mssleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(MS_TO_US(t)), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(MS_TO_US(t)), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } /* Sleep for a given number of microseconds. The timeout is assumed to @@ -62,13 +60,12 @@ mssleep(int t) void ussleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(t), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(t), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } void @@ -241,7 +238,7 @@ test_abstime(void) kevent_cmp(&kev, kevent_get(kqfd)); stop = time(NULL); if (stop < start + timeout) - err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); + err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); /* Check if the event occurs again */ sleep(3); @@ -264,16 +261,16 @@ test_update(void) /* First set the timer to 1 second */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, SEC_TO_US(1), (void *)1); + NOTE_USECONDS, SEC_TO_US(1), (void *)1); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Now reduce the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), (void *)2); + NOTE_USECONDS, MS_TO_US(1), (void *)2); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -288,9 +285,9 @@ test_update(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); if (elapsed > SEC_TO_US(1)) - errx(1, "late timer expiration: %ld us", elapsed); + errx(1, "late timer expiration: %ld us", elapsed); success(); } @@ -309,9 +306,9 @@ test_update_equal(void) /* First set the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Sleep for a significant fraction of the timeout. */ ussleep(600); @@ -319,7 +316,7 @@ test_update_equal(void) /* Now re-add the timer with the same parameters */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -334,7 +331,7 @@ test_update_equal(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); success(); } @@ -353,9 +350,9 @@ test_update_expired(void) /* Set the timer to 1ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for 2 ms to give the timer plenty of time to expire. */ mssleep(2); @@ -363,7 +360,7 @@ test_update_expired(void) /* Now re-add the timer */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -378,7 +375,7 @@ test_update_expired(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Make sure the re-added timer does not fire. In other words, * test that the event received above was the only event from the @@ -405,7 +402,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -420,7 +417,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(2), NULL); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -434,12 +431,12 @@ test_update_periodic(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(2)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Delete the event */ kev.flags = EV_DELETE; if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); success(); } @@ -467,46 +464,46 @@ test_update_timing(void) * received is from the update and not the original timer add. */ for (sleeptime = MIN_SLEEP, iteration = 1; - sleeptime < MAX_SLEEP; - ++sleeptime, ++iteration) { + sleeptime < MAX_SLEEP; + ++sleeptime, ++iteration) { - /* First set the timer to 1 ms */ - EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* First set the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Delay; the delay ranges from less than to greater than the - * timer period. - */ - ussleep(sleeptime); + /* Delay; the delay ranges from less than to greater than the + * timer period. + */ + ussleep(sleeptime); - /* Now re-add the timer with the same parameters */ - start = now(); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* Now re-add the timer with the same parameters */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Wait for the event */ - kev.flags |= EV_CLEAR; - kev.fflags &= ~NOTE_USECONDS; - kev.data = 1; - kevent_cmp(&kev, kevent_get(kqfd)); - stop = now(); - elapsed = stop - start; + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + stop = now(); + elapsed = stop - start; - /* Check that the timer expired after at least 1 ms. This - * check is to make sure that the timer re-started and that - * the event is not from the original add of the timer. - */ - if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + /* Check that the timer expired after at least 1 ms. This + * check is to make sure that the timer re-started and that + * the event is not from the original add of the timer. + */ + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); - /* Make sure the re-added timer does not fire. In other words, - * test that the event received above was the only event from - * the add and re-add of the timer. - */ - mssleep(2); - test_no_kevents_quietly(); + /* Make sure the re-added timer does not fire. In other words, + * test that the event received above was the only event from + * the add and re-add of the timer. + */ + mssleep(2); + test_no_kevents_quietly(); } success(); @@ -515,18 +512,18 @@ test_update_timing(void) void test_evfilt_timer() { - kqfd = kqueue(); - test_kevent_timer_add(); - test_kevent_timer_del(); - test_kevent_timer_get(); - test_oneshot(); - test_periodic(); - test_abstime(); - test_update(); - test_update_equal(); - test_update_expired(); - test_update_timing(); - test_update_periodic(); - disable_and_enable(); - close(kqfd); + kqfd = kqueue(); + test_kevent_timer_add(); + test_kevent_timer_del(); + test_kevent_timer_get(); + test_oneshot(); + test_periodic(); + test_abstime(); + test_update(); + test_update_equal(); + test_update_expired(); + test_update_timing(); + test_update_periodic(); + disable_and_enable(); + close(kqfd); } Modified: stable/12/tests/sys/kqueue/libkqueue/user.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/user.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/user.c Fri Nov 30 01:45:54 2018 (r341274) @@ -117,7 +117,7 @@ oneshot(void) void test_evfilt_user() { - kqfd = kqueue(); + kqfd = kqueue(); add_and_delete(); event_wait(); @@ -125,5 +125,5 @@ test_evfilt_user() oneshot(); /* TODO: try different fflags operations */ - close(kqfd); + close(kqfd); } Modified: stable/12/tests/sys/kqueue/libkqueue/vnode.c ============================================================================== --- stable/12/tests/sys/kqueue/libkqueue/vnode.c Fri Nov 30 00:47:36 2018 (r341273) +++ stable/12/tests/sys/kqueue/libkqueue/vnode.c Fri Nov 30 01:45:54 2018 (r341274) @@ -251,16 +251,16 @@ test_kevent_vnode_dispatch(void) void test_evfilt_vnode() { - kqfd = kqueue(); - test_kevent_vnode_add(); - test_kevent_vnode_del(); - test_kevent_vnode_disable_and_enable(); + kqfd = kqueue(); + test_kevent_vnode_add(); + test_kevent_vnode_del(); + test_kevent_vnode_disable_and_enable(); #if HAVE_EV_DISPATCH - test_kevent_vnode_dispatch(); + test_kevent_vnode_dispatch(); #endif - test_kevent_vnode_note_write(); - test_kevent_vnode_note_attrib(); - test_kevent_vnode_note_rename(); - test_kevent_vnode_note_delete(); - close(kqfd); + test_kevent_vnode_note_write(); + test_kevent_vnode_note_attrib(); + test_kevent_vnode_note_rename(); + test_kevent_vnode_note_delete(); + close(kqfd); } From owner-svn-src-stable@freebsd.org Fri Nov 30 02:06:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B47E1154681; Fri, 30 Nov 2018 02:06:32 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0F38DABB; Fri, 30 Nov 2018 02:06:32 +0000 (UTC) (envelope-from dab@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 13EEC22032; Fri, 30 Nov 2018 02:06:32 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU26WdW028470; Fri, 30 Nov 2018 02:06:32 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU26U2M028462; Fri, 30 Nov 2018 02:06:30 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201811300206.wAU26U2M028462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 30 Nov 2018 02:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341275 - in stable/11: sys/dev/netmap tests/sys/kqueue/libkqueue X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in stable/11: sys/dev/netmap tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 341275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D0F38DABB X-Spamd-Result: default: False [1.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.499,0]; NEURAL_SPAM_MEDIUM(0.35)[0.352,0]; NEURAL_SPAM_LONG(0.35)[0.349,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 02:06:32 -0000 Author: dab Date: Fri Nov 30 02:06:30 2018 New Revision: 341275 URL: https://svnweb.freebsd.org/changeset/base/341275 Log: MFC r337812,r337814,r337820,r341068: Fix several memory leaks (r337812 & r337814). The libkqueue tests have several places that leak memory by using an idiom like: puts(kevent_to_str(kevp)); Rework to save the pointer returned from kevent_to_str() and then free() it after it has been used. r337812 also fixed a bug in the netmap kevent code. The inclusion of that fix was an oversight that I didn't notice until this MFC. Reference the code review and PR here in the MFC for completeness. r337820 & r341068 were white-space only changes as a follow-up to r337812 & r337814: After r337820, which "corrected" some spaces-instead-of-tab whitespace issues in the libkqueue tests, jmg@ pointed out that these files were originally space-based, not tab-spaced, and so the correction should have been to get rid of the tabs that had been introduced in previous changes, not the spaces. This change does that. This is a whitespace only change; no functional change is intended. PR: 206053 Differential Revision: https://reviews.freebsd.org/D16531 Sponsored by: Dell EMC Isilon Modified: stable/11/sys/dev/netmap/netmap_freebsd.c stable/11/tests/sys/kqueue/libkqueue/common.h stable/11/tests/sys/kqueue/libkqueue/main.c stable/11/tests/sys/kqueue/libkqueue/proc.c stable/11/tests/sys/kqueue/libkqueue/signal.c stable/11/tests/sys/kqueue/libkqueue/timer.c stable/11/tests/sys/kqueue/libkqueue/user.c stable/11/tests/sys/kqueue/libkqueue/vnode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/11/sys/dev/netmap/netmap_freebsd.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/sys/dev/netmap/netmap_freebsd.c Fri Nov 30 02:06:30 2018 (r341275) @@ -778,7 +778,7 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; - knlist_add(&si->si.si_note, kn, 1); + knlist_add(&si->si.si_note, kn, 0); // XXX unlock(priv) ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", na, na->ifp->if_xname, curthread, priv, kn, Modified: stable/11/tests/sys/kqueue/libkqueue/common.h ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/common.h Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/common.h Fri Nov 30 02:06:30 2018 (r341275) @@ -43,7 +43,7 @@ extern char *cur_test_id; int vnode_fd; -extern const char * kevent_to_str(struct kevent *); +extern char * kevent_to_str(struct kevent *); struct kevent * kevent_get(int); struct kevent * kevent_get_timeout(int, int); Modified: stable/11/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/main.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/main.c Fri Nov 30 02:06:30 2018 (r341275) @@ -41,13 +41,16 @@ test_no_kevents(void) int nfds; struct timespec timeo; struct kevent kev; + char *kev_str; puts("confirming that there are no events pending"); memset(&timeo, 0, sizeof(timeo)); nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); if (nfds != 0) { puts("\nUnexpected event:"); - puts(kevent_to_str(&kev)); + kev_str = kevent_to_str(&kev); + puts(kev_str); + free(kev_str); errx(1, "%d event(s) pending, but none expected:", nfds); } } @@ -61,12 +64,15 @@ test_no_kevents_quietly(void) int nfds; struct timespec timeo; struct kevent kev; + char *kev_str; memset(&timeo, 0, sizeof(timeo)); nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); if (nfds != 0) { puts("\nUnexpected event:"); - puts(kevent_to_str(&kev)); + kev_str = kevent_to_str(&kev); + puts(kev_str); + free(kev_str); errx(1, "%d event(s) pending, but none expected:", nfds); } } @@ -79,7 +85,7 @@ kevent_get(int kqfd) struct kevent *kev; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); if (nfds < 1) @@ -97,7 +103,7 @@ kevent_get_timeout(int kqfd, int seconds) struct timespec timeout = {seconds, 0}; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, &timeout); if (nfds < 0) { @@ -117,10 +123,10 @@ kevent_fflags_dump(struct kevent *kev) #define KEVFFL_DUMP(attrib) \ if (kev->fflags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); /* Not every filter has meaningful fflags */ if (kev->filter == EVFILT_PROC) { @@ -154,7 +160,7 @@ kevent_fflags_dump(struct kevent *kev) #endif buf[strlen(buf) - 1] = ')'; } else { - snprintf(buf, 1024, "fflags = %x", kev->fflags); + snprintf(buf, 1024, "fflags = %x", kev->fflags); } return (buf); @@ -167,10 +173,10 @@ kevent_flags_dump(struct kevent *kev) #define KEVFL_DUMP(attrib) \ if (kev->flags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); snprintf(buf, 1024, "flags = %d (", kev->flags); KEVFL_DUMP(EV_ADD); @@ -193,20 +199,25 @@ kevent_flags_dump(struct kevent *kev) } /* Copied from ../kevent.c kevent_dump() and improved */ -const char * +char * kevent_to_str(struct kevent *kev) { char buf[512]; + char *flags_str = kevent_flags_dump(kev); + char *fflags_str = kevent_fflags_dump(kev); snprintf(&buf[0], sizeof(buf), - "[ident=%d, filter=%d, %s, %s, data=%d, udata=%p]", - (u_int) kev->ident, + "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p]", + (uintmax_t) kev->ident, kev->filter, - kevent_flags_dump(kev), - kevent_fflags_dump(kev), - (int) kev->data, + flags_str, + fflags_str, + (uintmax_t)kev->data, kev->udata); + free(flags_str); + free(fflags_str); + return (strdup(buf)); } @@ -219,10 +230,14 @@ kevent_add(int kqfd, struct kevent *kev, intptr_t data, void *udata) { + char *kev_str; + EV_SET(kev, ident, filter, flags, fflags, data, NULL); if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { + kev_str = kevent_to_str(kev); printf("Unable to add the following kevent:\n%s\n", - kevent_to_str(kev)); + kev_str); + free(kev_str); err(1, "kevent(): %s", strerror(errno)); } } @@ -230,6 +245,9 @@ kevent_add(int kqfd, struct kevent *kev, void kevent_cmp(struct kevent *k1, struct kevent *k2) { + char *kev1_str; + char *kev2_str; + /* XXX- Workaround for inconsistent implementation of kevent(2) */ @@ -238,8 +256,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) k2->flags |= EV_ADD; #endif if (memcmp(k1, k2, sizeof(*k1)) != 0) { + kev1_str = kevent_to_str(k1); + kev2_str = kevent_to_str(k2); printf("kevent_cmp: mismatch:\n %s !=\n %s\n", - kevent_to_str(k1), kevent_to_str(k2)); + kev1_str, kev2_str); + free(kev1_str); + free(kev2_str); abort(); } } Modified: stable/11/tests/sys/kqueue/libkqueue/proc.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/proc.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/proc.c Fri Nov 30 02:06:30 2018 (r341275) @@ -45,7 +45,7 @@ add_and_delete(void) struct stat s; if (fstat(kqfd, &s) != -1) errx(1, "kqueue inherited across fork! (%s() at %s:%d)", - __func__, __FILE__, __LINE__); + __func__, __FILE__, __LINE__); pause(); exit(2); @@ -172,6 +172,7 @@ proc_track(int sleep_time) int gchild_note = 0; pid_t gchild_pid = -1; int done = 0; + char *kev_str; while (!done) { @@ -182,7 +183,9 @@ proc_track(int sleep_time) if (kevp == NULL) { done = 1; } else { - printf(" -- Received kevent: %s\n", kevent_to_str(kevp)); + kev_str = kevent_to_str(kevp); + printf(" -- Received kevent: %s\n", kev_str); + free(kev_str); if ((kevp->fflags & NOTE_CHILD) && (kevp->fflags & NOTE_EXIT)) { errx(1, "NOTE_CHILD and NOTE_EXIT in same kevent: %s", kevent_to_str(kevp)); Modified: stable/11/tests/sys/kqueue/libkqueue/signal.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/signal.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/signal.c Fri Nov 30 02:06:30 2018 (r341275) @@ -188,12 +188,12 @@ test_kevent_signal_oneshot(void) void test_evfilt_signal() { - kqfd = kqueue(); - test_kevent_signal_add(); - test_kevent_signal_del(); - test_kevent_signal_get(); - test_kevent_signal_disable(); - test_kevent_signal_enable(); - test_kevent_signal_oneshot(); - close(kqfd); + kqfd = kqueue(); + test_kevent_signal_add(); + test_kevent_signal_del(); + test_kevent_signal_get(); + test_kevent_signal_disable(); + test_kevent_signal_enable(); + test_kevent_signal_oneshot(); + close(kqfd); } Modified: stable/11/tests/sys/kqueue/libkqueue/timer.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/timer.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/timer.c Fri Nov 30 02:06:30 2018 (r341275) @@ -34,11 +34,10 @@ int kqfd; static long now(void) { - - struct timeval tv; + struct timeval tv; - gettimeofday(&tv, NULL); - return SEC_TO_US(tv.tv_sec) + tv.tv_usec; + gettimeofday(&tv, NULL); + return SEC_TO_US(tv.tv_sec) + tv.tv_usec; } /* Sleep for a given number of milliseconds. The timeout is assumed to @@ -47,13 +46,12 @@ now(void) void mssleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(MS_TO_US(t)), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(MS_TO_US(t)), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } /* Sleep for a given number of microseconds. The timeout is assumed to @@ -62,13 +60,12 @@ mssleep(int t) void ussleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(t), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(t), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } void @@ -229,16 +226,16 @@ test_update(void) /* First set the timer to 1 second */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, SEC_TO_US(1), (void *)1); + NOTE_USECONDS, SEC_TO_US(1), (void *)1); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Now reduce the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), (void *)2); + NOTE_USECONDS, MS_TO_US(1), (void *)2); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -253,9 +250,9 @@ test_update(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); if (elapsed > SEC_TO_US(1)) - errx(1, "late timer expiration: %ld us", elapsed); + errx(1, "late timer expiration: %ld us", elapsed); success(); } @@ -274,9 +271,9 @@ test_update_equal(void) /* First set the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Sleep for a significant fraction of the timeout. */ ussleep(600); @@ -284,7 +281,7 @@ test_update_equal(void) /* Now re-add the timer with the same parameters */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -299,7 +296,7 @@ test_update_equal(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); success(); } @@ -318,9 +315,9 @@ test_update_expired(void) /* Set the timer to 1ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for 2 ms to give the timer plenty of time to expire. */ mssleep(2); @@ -328,7 +325,7 @@ test_update_expired(void) /* Now re-add the timer */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -343,7 +340,7 @@ test_update_expired(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Make sure the re-added timer does not fire. In other words, * test that the event received above was the only event from the @@ -370,7 +367,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -385,7 +382,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(2), NULL); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -399,12 +396,12 @@ test_update_periodic(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(2)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Delete the event */ kev.flags = EV_DELETE; if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); success(); } @@ -432,46 +429,46 @@ test_update_timing(void) * received is from the update and not the original timer add. */ for (sleeptime = MIN_SLEEP, iteration = 1; - sleeptime < MAX_SLEEP; - ++sleeptime, ++iteration) { + sleeptime < MAX_SLEEP; + ++sleeptime, ++iteration) { - /* First set the timer to 1 ms */ - EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* First set the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Delay; the delay ranges from less than to greater than the - * timer period. - */ - ussleep(sleeptime); + /* Delay; the delay ranges from less than to greater than the + * timer period. + */ + ussleep(sleeptime); - /* Now re-add the timer with the same parameters */ - start = now(); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* Now re-add the timer with the same parameters */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Wait for the event */ - kev.flags |= EV_CLEAR; - kev.fflags &= ~NOTE_USECONDS; - kev.data = 1; - kevent_cmp(&kev, kevent_get(kqfd)); - stop = now(); - elapsed = stop - start; + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + stop = now(); + elapsed = stop - start; - /* Check that the timer expired after at least 1 ms. This - * check is to make sure that the timer re-started and that - * the event is not from the original add of the timer. - */ - if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + /* Check that the timer expired after at least 1 ms. This + * check is to make sure that the timer re-started and that + * the event is not from the original add of the timer. + */ + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); - /* Make sure the re-added timer does not fire. In other words, - * test that the event received above was the only event from - * the add and re-add of the timer. - */ - mssleep(2); - test_no_kevents_quietly(); + /* Make sure the re-added timer does not fire. In other words, + * test that the event received above was the only event from + * the add and re-add of the timer. + */ + mssleep(2); + test_no_kevents_quietly(); } success(); @@ -480,17 +477,17 @@ test_update_timing(void) void test_evfilt_timer() { - kqfd = kqueue(); - test_kevent_timer_add(); - test_kevent_timer_del(); - test_kevent_timer_get(); - test_oneshot(); - test_periodic(); - test_update(); - test_update_equal(); - test_update_expired(); - test_update_timing(); - test_update_periodic(); - disable_and_enable(); - close(kqfd); + kqfd = kqueue(); + test_kevent_timer_add(); + test_kevent_timer_del(); + test_kevent_timer_get(); + test_oneshot(); + test_periodic(); + test_update(); + test_update_equal(); + test_update_expired(); + test_update_timing(); + test_update_periodic(); + disable_and_enable(); + close(kqfd); } Modified: stable/11/tests/sys/kqueue/libkqueue/user.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/user.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/user.c Fri Nov 30 02:06:30 2018 (r341275) @@ -117,7 +117,7 @@ oneshot(void) void test_evfilt_user() { - kqfd = kqueue(); + kqfd = kqueue(); add_and_delete(); event_wait(); @@ -125,5 +125,5 @@ test_evfilt_user() oneshot(); /* TODO: try different fflags operations */ - close(kqfd); + close(kqfd); } Modified: stable/11/tests/sys/kqueue/libkqueue/vnode.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/vnode.c Fri Nov 30 01:45:54 2018 (r341274) +++ stable/11/tests/sys/kqueue/libkqueue/vnode.c Fri Nov 30 02:06:30 2018 (r341275) @@ -251,16 +251,16 @@ test_kevent_vnode_dispatch(void) void test_evfilt_vnode() { - kqfd = kqueue(); - test_kevent_vnode_add(); - test_kevent_vnode_del(); - test_kevent_vnode_disable_and_enable(); + kqfd = kqueue(); + test_kevent_vnode_add(); + test_kevent_vnode_del(); + test_kevent_vnode_disable_and_enable(); #if HAVE_EV_DISPATCH - test_kevent_vnode_dispatch(); + test_kevent_vnode_dispatch(); #endif - test_kevent_vnode_note_write(); - test_kevent_vnode_note_attrib(); - test_kevent_vnode_note_rename(); - test_kevent_vnode_note_delete(); - close(kqfd); + test_kevent_vnode_note_write(); + test_kevent_vnode_note_attrib(); + test_kevent_vnode_note_rename(); + test_kevent_vnode_note_delete(); + close(kqfd); } From owner-svn-src-stable@freebsd.org Fri Nov 30 06:44:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F38D1159CC3; Fri, 30 Nov 2018 06:44:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D26906F570; Fri, 30 Nov 2018 06:44:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1AFC24EB9; Fri, 30 Nov 2018 06:44:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU6iWt2071654; Fri, 30 Nov 2018 06:44:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU6iWnx071653; Fri, 30 Nov 2018 06:44:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811300644.wAU6iWnx071653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Nov 2018 06:44: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: r341287 - stable/12/libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/libexec/rc/rc.d X-SVN-Commit-Revision: 341287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D26906F570 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.070,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 06:44:33 -0000 Author: cy Date: Fri Nov 30 06:44:32 2018 New Revision: 341287 URL: https://svnweb.freebsd.org/changeset/base/341287 Log: MFC r340754: Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. Modified: stable/12/libexec/rc/rc.d/ipmon Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/ipmon ============================================================================== --- stable/12/libexec/rc/rc.d/ipmon Fri Nov 30 05:54:30 2018 (r341286) +++ stable/12/libexec/rc/rc.d/ipmon Fri Nov 30 06:44:32 2018 (r341287) @@ -21,7 +21,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then From owner-svn-src-stable@freebsd.org Fri Nov 30 06:45:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EAF91159D33; Fri, 30 Nov 2018 06:45:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C70856F6B8; Fri, 30 Nov 2018 06:45:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6EF824EBA; Fri, 30 Nov 2018 06:45:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU6jrDB071759; Fri, 30 Nov 2018 06:45:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU6jr9i071758; Fri, 30 Nov 2018 06:45:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811300645.wAU6jr9i071758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Nov 2018 06:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341288 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 341288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C70856F6B8 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; NEURAL_HAM_SHORT(-0.07)[-0.070,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 06:45:54 -0000 Author: cy Date: Fri Nov 30 06:45:53 2018 New Revision: 341288 URL: https://svnweb.freebsd.org/changeset/base/341288 Log: This is a direct commit to the stable/11 branch. This would have been MFC r340754 except that etc/rc.d has been moved in HEAD which would have resulted in a tree conflict if merged. Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. Modified: stable/11/etc/rc.d/ipmon Modified: stable/11/etc/rc.d/ipmon ============================================================================== --- stable/11/etc/rc.d/ipmon Fri Nov 30 06:44:32 2018 (r341287) +++ stable/11/etc/rc.d/ipmon Fri Nov 30 06:45:53 2018 (r341288) @@ -21,7 +21,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then From owner-svn-src-stable@freebsd.org Fri Nov 30 06:47:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF6001159DAA; Fri, 30 Nov 2018 06:47:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37A876F80C; Fri, 30 Nov 2018 06:47:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 184F324EBC; Fri, 30 Nov 2018 06:47:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU6l1r5071847; Fri, 30 Nov 2018 06:47:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU6l1Si071846; Fri, 30 Nov 2018 06:47:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811300647.wAU6l1Si071846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Nov 2018 06:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r341289 - stable/10/etc/rc.d X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/10/etc/rc.d X-SVN-Commit-Revision: 341289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37A876F80C X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.070,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 06:47:02 -0000 Author: cy Date: Fri Nov 30 06:47:01 2018 New Revision: 341289 URL: https://svnweb.freebsd.org/changeset/base/341289 Log: This is a direct commit to the stable/10 branch. This would have been MFC r340754 except that etc/rc.d has been moved in HEAD which would have resulted in a tree conflict if merged. Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. Modified: stable/10/etc/rc.d/ipmon Modified: stable/10/etc/rc.d/ipmon ============================================================================== --- stable/10/etc/rc.d/ipmon Fri Nov 30 06:45:53 2018 (r341288) +++ stable/10/etc/rc.d/ipmon Fri Nov 30 06:47:01 2018 (r341289) @@ -20,7 +20,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then From owner-svn-src-stable@freebsd.org Fri Nov 30 09:56:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7181F113CE6E; Fri, 30 Nov 2018 09:56:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 186BD79AB7; Fri, 30 Nov 2018 09:56:48 +0000 (UTC) (envelope-from arybchik@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 ED75126F86; Fri, 30 Nov 2018 09:56:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU9uldq073117; Fri, 30 Nov 2018 09:56:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU9ulA6073116; Fri, 30 Nov 2018 09:56:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300956.wAU9ulA6073116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 09:56:47 +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: r341330 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 341330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 186BD79AB7 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.197,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 09:56:48 -0000 Author: arybchik Date: Fri Nov 30 09:56:47 2018 New Revision: 341330 URL: https://svnweb.freebsd.org/changeset/base/341330 Log: MFC r340765 sfxge(4): cleanup: move into right place Due to incorrect merge the piece of code was put in incorrect place and diverge from libefx in other locations. Sponsored by: Solarflare Communications, Inc. Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 08:42:14 2018 (r341329) +++ stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 09:56:47 2018 (r341330) @@ -1092,6 +1092,18 @@ ef10_get_datapath_caps( CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + + /* * Check if firmware provides packet memory and Rx datapath * counters. */ @@ -1104,18 +1116,6 @@ ef10_get_datapath_caps( */ encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; - - /* - * Check if firmware-verified NVRAM updates must be used. - * - * The firmware trusted installer requires all NVRAM updates to use - * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) - * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated - * partition and report the result). - */ - encp->enc_fw_verified_nvram_update_required = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-stable@freebsd.org Fri Nov 30 09:58:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CEBB113D06F; Fri, 30 Nov 2018 09:58:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB0579D12; Fri, 30 Nov 2018 09:58:12 +0000 (UTC) (envelope-from arybchik@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 E490B26F87; Fri, 30 Nov 2018 09:58:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU9wBuJ073236; Fri, 30 Nov 2018 09:58:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU9wBuc073235; Fri, 30 Nov 2018 09:58:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300958.wAU9wBuc073235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 09:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341331 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/11/sys/dev/sfxge/common X-SVN-Commit-Revision: 341331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EB0579D12 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.20)[0.197,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 09:58:12 -0000 Author: arybchik Date: Fri Nov 30 09:58:11 2018 New Revision: 341331 URL: https://svnweb.freebsd.org/changeset/base/341331 Log: MFC r340765 sfxge(4): cleanup: move into right place Due to incorrect merge the piece of code was put in incorrect place and diverge from libefx in other locations. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18024 Modified: stable/11/sys/dev/sfxge/common/ef10_nic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 09:56:47 2018 (r341330) +++ stable/11/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 09:58:11 2018 (r341331) @@ -1092,6 +1092,18 @@ ef10_get_datapath_caps( CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + + /* * Check if firmware provides packet memory and Rx datapath * counters. */ @@ -1104,18 +1116,6 @@ ef10_get_datapath_caps( */ encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; - - /* - * Check if firmware-verified NVRAM updates must be used. - * - * The firmware trusted installer requires all NVRAM updates to use - * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) - * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated - * partition and report the result). - */ - encp->enc_fw_verified_nvram_update_required = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-stable@freebsd.org Fri Nov 30 10:00:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D68113D1E0; Fri, 30 Nov 2018 10:00:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 766C379F45; Fri, 30 Nov 2018 10:00:10 +0000 (UTC) (envelope-from arybchik@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 3A3AE26F8B; Fri, 30 Nov 2018 10:00:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUA0AU2073450; Fri, 30 Nov 2018 10:00:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUA0AWQ073449; Fri, 30 Nov 2018 10:00:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811301000.wAUA0AWQ073449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 10:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r341332 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/10/sys/dev/sfxge/common X-SVN-Commit-Revision: 341332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 766C379F45 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.20)[0.197,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 10:00:11 -0000 Author: arybchik Date: Fri Nov 30 10:00:09 2018 New Revision: 341332 URL: https://svnweb.freebsd.org/changeset/base/341332 Log: MFC r340765 sfxge(4): cleanup: move into right place Due to incorrect merge the piece of code was put in incorrect place and diverge from libefx in other locations. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18024 Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 09:58:11 2018 (r341331) +++ stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 10:00:09 2018 (r341332) @@ -1092,6 +1092,18 @@ ef10_get_datapath_caps( CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + + /* * Check if firmware provides packet memory and Rx datapath * counters. */ @@ -1104,18 +1116,6 @@ ef10_get_datapath_caps( */ encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; - - /* - * Check if firmware-verified NVRAM updates must be used. - * - * The firmware trusted installer requires all NVRAM updates to use - * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) - * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated - * partition and report the result). - */ - encp->enc_fw_verified_nvram_update_required = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-stable@freebsd.org Fri Nov 30 11:19:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC5F1140692; Fri, 30 Nov 2018 11:19:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B40337CFAA; Fri, 30 Nov 2018 11:19:04 +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 910EA27D03; Fri, 30 Nov 2018 11:19:04 +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 wAUBJ4Ru015083; Fri, 30 Nov 2018 11:19:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUBJ41N015082; Fri, 30 Nov 2018 11:19:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811301119.wAUBJ41N015082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 30 Nov 2018 11:19: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: r341336 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 341336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B40337CFAA X-Spamd-Result: default: False [0.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.49)[0.487,0]; NEURAL_SPAM_MEDIUM(0.18)[0.183,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:19:05 -0000 Author: ae Date: Fri Nov 30 11:19:04 2018 New Revision: 341336 URL: https://svnweb.freebsd.org/changeset/base/341336 Log: MFC r340477: Allow configuration of several ipsec interfaces with the same tunnel endpoints. This can be used to configure several IPsec tunnels between two hosts with different security associations. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/net/if_ipsec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_ipsec.c ============================================================================== --- stable/12/sys/net/if_ipsec.c Fri Nov 30 10:50:07 2018 (r341335) +++ stable/12/sys/net/if_ipsec.c Fri Nov 30 11:19:04 2018 (r341336) @@ -968,7 +968,7 @@ static int ipsec_set_addresses(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) { - struct ipsec_softc *sc, *tsc; + struct ipsec_softc *sc; struct secasindex *saidx; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); @@ -982,18 +982,6 @@ ipsec_set_addresses(struct ifnet *ifp, struct sockaddr key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) return (0); /* Nothing has been changed. */ - } - /* Check that given addresses aren't already configured */ - CK_LIST_FOREACH(tsc, ipsec_srchash(src), srchash) { - if (tsc == sc) - continue; - MPASS(tsc->family == src->sa_family); - saidx = ipsec_getsaidx(tsc, IPSEC_DIR_OUTBOUND, tsc->family); - if (key_sockaddrcmp(&saidx->src.sa, src, 0) == 0 && - key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) { - /* We already have tunnel with such addresses */ - return (EADDRNOTAVAIL); - } } /* If reqid is not set, generate new one. */ if (ipsec_init_reqid(sc) != 0) From owner-svn-src-stable@freebsd.org Fri Nov 30 19:58:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF17A114E53A; Fri, 30 Nov 2018 19:58:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95D1C73488; Fri, 30 Nov 2018 19:58:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76CA955D9; Fri, 30 Nov 2018 19:58:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUJwtZH089412; Fri, 30 Nov 2018 19:58:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUJwtDS089411; Fri, 30 Nov 2018 19:58:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811301958.wAUJwtDS089411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 30 Nov 2018 19:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341349 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 341349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95D1C73488 X-Spamd-Result: default: False [0.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.423,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:58:56 -0000 Author: oshogbo Date: Fri Nov 30 19:58:55 2018 New Revision: 341349 URL: https://svnweb.freebsd.org/changeset/base/341349 Log: MFC r339502 Add link to the setproctitle_fast function. Modified: stable/11/lib/libc/gen/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/Makefile.inc ============================================================================== --- stable/11/lib/libc/gen/Makefile.inc Fri Nov 30 19:40:16 2018 (r341348) +++ stable/11/lib/libc/gen/Makefile.inc Fri Nov 30 19:58:55 2018 (r341349) @@ -471,6 +471,7 @@ MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 siglongjmp.3 \ setjmp.3 sigsetjmp.3 MLINKS+=setmode.3 getmode.3 +MLINKS+=setproctitle.3 setproctitle_fast.3 MLINKS+=sigsetops.3 sigaddset.3 \ sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 \ From owner-svn-src-stable@freebsd.org Fri Nov 30 19:59:29 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FB1114E5E1; Fri, 30 Nov 2018 19:59:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB7E735D6; Fri, 30 Nov 2018 19:59:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD2755DA; Fri, 30 Nov 2018 19:59:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUJxSqY089488; Fri, 30 Nov 2018 19:59:28 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUJxSNl089487; Fri, 30 Nov 2018 19:59:28 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811301959.wAUJxSNl089487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 30 Nov 2018 19:59:28 +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: r341350 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 341350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AB7E735D6 X-Spamd-Result: default: False [0.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.42)[0.423,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:59:29 -0000 Author: oshogbo Date: Fri Nov 30 19:59:28 2018 New Revision: 341350 URL: https://svnweb.freebsd.org/changeset/base/341350 Log: MFC r339502 Add link to the setproctitle_fast function. Modified: stable/12/lib/libc/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/gen/Makefile.inc Fri Nov 30 19:58:55 2018 (r341349) +++ stable/12/lib/libc/gen/Makefile.inc Fri Nov 30 19:59:28 2018 (r341350) @@ -489,6 +489,7 @@ MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 siglongjmp.3 \ setjmp.3 sigsetjmp.3 MLINKS+=setmode.3 getmode.3 +MLINKS+=setproctitle.3 setproctitle_fast.3 MLINKS+=sigsetops.3 sigaddset.3 \ sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 \ From owner-svn-src-stable@freebsd.org Fri Nov 30 23:51:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31DE1153723; Fri, 30 Nov 2018 23:51:53 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 997EE7CEE6; Fri, 30 Nov 2018 23:51:53 +0000 (UTC) (envelope-from ygy@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 7A7537C72; Fri, 30 Nov 2018 23:51:53 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUNprJw018508; Fri, 30 Nov 2018 23:51:53 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUNprgT018507; Fri, 30 Nov 2018 23:51:53 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811302351.wAUNprgT018507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Fri, 30 Nov 2018 23:51: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: r341355 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 341355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 997EE7CEE6 X-Spamd-Result: default: False [0.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.02)[-0.016,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 23:51:54 -0000 Author: ygy (doc committer) Date: Fri Nov 30 23:51:53 2018 New Revision: 341355 URL: https://svnweb.freebsd.org/changeset/base/341355 Log: MFC r340792: Fix a minor typo in ipfw(8) manual page. PR: 230747 Submitted by: f.toscan@hotmail.it Modified: stable/12/sbin/ipfw/ipfw.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Fri Nov 30 23:47:57 2018 (r341354) +++ stable/12/sbin/ipfw/ipfw.8 Fri Nov 30 23:51:53 2018 (r341355) @@ -4588,7 +4588,7 @@ The ipfw core (ipfw2) has been completely redesigned a reimplemented by Luigi Rizzo in summer 2002. Further actions and -options have been added by various developer over the years. +options have been added by various developers over the years. .Pp .An -nosplit In-kernel NAT support written by From owner-svn-src-stable@freebsd.org Sat Dec 1 11:50:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E50B313148B8; Sat, 1 Dec 2018 11:50:53 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5197DAAA; Sat, 1 Dec 2018 11:50:53 +0000 (UTC) (envelope-from vmaffione@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 0D48B17660; Sat, 1 Dec 2018 11:50:53 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1Boqw7090137; Sat, 1 Dec 2018 11:50:52 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1BoqDq090136; Sat, 1 Dec 2018 11:50:52 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812011150.wB1BoqDq090136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 1 Dec 2018 11:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341361 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 341361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E5197DAAA X-Spamd-Result: default: False [0.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.053,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 11:50:54 -0000 Author: vmaffione Date: Sat Dec 1 11:50:52 2018 New Revision: 341361 URL: https://svnweb.freebsd.org/changeset/base/341361 Log: MFC r341144 netmap: set IFCAP_NETMAP in if_capabilities Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP in if_capabilities on netmap_attach. This patch reverts this change. Differential Revision: https://reviews.freebsd.org/D17987 Modified: stable/12/sys/dev/netmap/netmap_freebsd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_freebsd.c Sat Dec 1 09:59:32 2018 (r341360) +++ stable/12/sys/dev/netmap/netmap_freebsd.c Sat Dec 1 11:50:52 2018 (r341361) @@ -1549,6 +1549,7 @@ out: void nm_os_onattach(struct ifnet *ifp) { + ifp->if_capabilities |= IFCAP_NETMAP; } void From owner-svn-src-stable@freebsd.org Sat Dec 1 11:52:14 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A8213149C4; Sat, 1 Dec 2018 11:52:14 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21F3C7DE0A; Sat, 1 Dec 2018 11:52:14 +0000 (UTC) (envelope-from vmaffione@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 04494177DB; Sat, 1 Dec 2018 11:52:14 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1BqDMA093167; Sat, 1 Dec 2018 11:52:13 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1BqDh1093165; Sat, 1 Dec 2018 11:52:13 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812011152.wB1BqDh1093165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 1 Dec 2018 11:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341362 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 341362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21F3C7DE0A X-Spamd-Result: default: False [0.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.053,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 11:52:14 -0000 Author: vmaffione Date: Sat Dec 1 11:52:13 2018 New Revision: 341362 URL: https://svnweb.freebsd.org/changeset/base/341362 Log: MFC r341145 cxgbe: revert r309725 After the fix contained in r341144, cxgbe does not need anymore to set the IFCAP_NETMAP flag manually. Differential Revision: https://reviews.freebsd.org/D17987 Modified: stable/12/sys/dev/cxgbe/t4_main.c stable/12/sys/dev/cxgbe/t4_netmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Sat Dec 1 11:50:52 2018 (r341361) +++ stable/12/sys/dev/cxgbe/t4_main.c Sat Dec 1 11:52:13 2018 (r341362) @@ -1522,10 +1522,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) if (vi->nofldrxq != 0) ifp->if_capabilities |= IFCAP_TOE; #endif -#ifdef DEV_NETMAP - if (vi->nnmrxq != 0) - ifp->if_capabilities |= IFCAP_NETMAP; -#endif #ifdef RATELIMIT if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) { ifp->if_capabilities |= IFCAP_TXRTLMT; @@ -1541,7 +1537,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP - if (ifp->if_capabilities & IFCAP_NETMAP) + if (vi->nnmrxq != 0) cxgbe_nm_attach(vi); #endif sb = sbuf_new_auto(); Modified: stable/12/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_netmap.c Sat Dec 1 11:50:52 2018 (r341361) +++ stable/12/sys/dev/cxgbe/t4_netmap.c Sat Dec 1 11:52:13 2018 (r341362) @@ -913,7 +913,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - netmap_attach(&na); + netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ } void From owner-svn-src-stable@freebsd.org Sat Dec 1 12:08:18 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 064801315C9A; Sat, 1 Dec 2018 12:08:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E4207EA73; Sat, 1 Dec 2018 12:08:17 +0000 (UTC) (envelope-from vmaffione@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 7114917985; Sat, 1 Dec 2018 12:08:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1C8HEZ098432; Sat, 1 Dec 2018 12:08:17 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1C8HKB098431; Sat, 1 Dec 2018 12:08:17 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812011208.wB1C8HKB098431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 1 Dec 2018 12:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341363 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 341363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E4207EA73 X-Spamd-Result: default: False [0.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; NEURAL_HAM_SHORT(-0.05)[-0.053,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 12:08:18 -0000 Author: vmaffione Date: Sat Dec 1 12:08:16 2018 New Revision: 341363 URL: https://svnweb.freebsd.org/changeset/base/341363 Log: MFC r339548 man: fix vale(4) port naming The current documentation describing the syntax of a VALE port is wrong. This patch fixes it to make it consistent. Differential Revision: https://reviews.freebsd.org/D17411 Modified: stable/11/share/man/man4/vale.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vale.4 ============================================================================== --- stable/11/share/man/man4/vale.4 Sat Dec 1 11:52:13 2018 (r341362) +++ stable/11/share/man/man4/vale.4 Sat Dec 1 12:08:16 2018 (r341363) @@ -59,18 +59,18 @@ API. .Pp .Nm ports are named -.Pa vale[bdg:][port] +.Pa valeSSS:PPP where .Pa vale is the prefix indicating a VALE switch rather than a standard interface, -.Pa bdg +.Pa SSS indicates a specific switch (the colon is a separator), and -.Pa port +.Pa PPP indicates a port within the switch. -Bridge and port names are arbitrary strings, the only -constraint being that the full name must fit within 16 -characters. +Both SSS and PPP have the form [0-9a-zA-Z_]+ , the string cannot +exceed IFNAMSIZ characters, and PPP cannot be the name of any +existing OS network interface. .Pp See .Xr netmap 4 @@ -97,22 +97,20 @@ Set to non-zero values to enable in-kernel diagnostics Create one switch, with a traffic generator connected to one port, and a netmap-enabled tcpdump instance on another port: .Bd -literal -offset indent -tcpdump -ni vale-a:1 & -pkt-gen -i vale-a:0 -f tx & +tcpdump -ni valea:1 & +pkt-gen -i valea:0 -f tx & .Ed .Pp Create two switches, each connected to two qemu machines on different ports. .Bd -literal -offset indent -qemu -net nic -net netmap,ifname=vale-1:a ... & -qemu -net nic -net netmap,ifname=vale-1:b ... & -qemu -net nic -net netmap,ifname=vale-2:c ... & -qemu -net nic -net netmap,ifname=vale-2:d ... & +qemu -net nic -net netmap,ifname=vale1:a ... & +qemu -net nic -net netmap,ifname=vale1:b ... & +qemu -net nic -net netmap,ifname=vale2:c ... & +qemu -net nic -net netmap,ifname=vale2:d ... & .Ed .Sh SEE ALSO .Xr netmap 4 -.Pp -.Xr http://info.iet.unipi.it/~luigi/vale/ .Pp Luigi Rizzo, Giuseppe Lettieri: VALE, a switched ethernet for virtual machines, June 2012, http://info.iet.unipi.it/~luigi/vale/ From owner-svn-src-stable@freebsd.org Sat Dec 1 17:48:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD041323087; Sat, 1 Dec 2018 17:48:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1976DB00; Sat, 1 Dec 2018 17:48:30 +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 064971B0C9; Sat, 1 Dec 2018 17:48:30 +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 wB1HmTIh078040; Sat, 1 Dec 2018 17:48:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1HmTGT078037; Sat, 1 Dec 2018 17:48:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812011748.wB1HmTGT078037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 1 Dec 2018 17:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341376 - in stable/12/sys: compat/linux kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: compat/linux kern sys X-SVN-Commit-Revision: 341376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B1976DB00 X-Spamd-Result: default: False [0.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.32)[0.321,0]; NEURAL_SPAM_SHORT(0.45)[0.455,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 17:48:30 -0000 Author: markj Date: Sat Dec 1 17:48:28 2018 New Revision: 341376 URL: https://svnweb.freebsd.org/changeset/base/341376 Log: MFC r340861, r340900: Minor kevent(2) cleanups. Modified: stable/12/sys/compat/linux/linux_event.c stable/12/sys/kern/kern_event.c stable/12/sys/kern/vfs_aio.c stable/12/sys/sys/event.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_event.c ============================================================================== --- stable/12/sys/compat/linux/linux_event.c Sat Dec 1 16:50:12 2018 (r341375) +++ stable/12/sys/compat/linux/linux_event.c Sat Dec 1 17:48:28 2018 (r341376) @@ -504,7 +504,7 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ * and the EV_ADD flag is not set. */ kev[0].flags &= ~EV_ADD; - error = kqfd_register(args->epfd, &kev[0], td, 1); + error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK); if (error != ENOENT) { error = EEXIST; goto leave0; Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Sat Dec 1 16:50:12 2018 (r341375) +++ stable/12/sys/kern/kern_event.c Sat Dec 1 17:48:28 2018 (r341376) @@ -102,13 +102,13 @@ TASKQUEUE_DEFINE_THREAD(kqueue_ctx); static int kevent_copyout(void *arg, struct kevent *kevp, int count); static int kevent_copyin(void *arg, struct kevent *kevp, int count); static int kqueue_register(struct kqueue *kq, struct kevent *kev, - struct thread *td, int waitok); + struct thread *td, int mflag); static int kqueue_acquire(struct file *fp, struct kqueue **kqp); static void kqueue_release(struct kqueue *kq, int locked); static void kqueue_destroy(struct kqueue *kq); static void kqueue_drain(struct kqueue *kq, struct thread *td); static int kqueue_expand(struct kqueue *kq, struct filterops *fops, - uintptr_t ident, int waitok); + uintptr_t ident, int mflag); static void kqueue_task(void *arg, int pending); static int kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, @@ -150,7 +150,7 @@ static void knote_drop_detached(struct knote *kn, str static void knote_enqueue(struct knote *kn); static void knote_dequeue(struct knote *kn); static void knote_init(void); -static struct knote *knote_alloc(int waitok); +static struct knote *knote_alloc(int mflag); static void knote_free(struct knote *kn); static void filt_kqdetach(struct knote *kn); @@ -582,7 +582,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; @@ -596,7 +596,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) @@ -1229,7 +1229,7 @@ kqueue_kevent(struct kqueue *kq, struct thread *td, in if (!kevp->filter) continue; kevp->flags &= ~EV_SYSFLAGS; - error = kqueue_register(kq, kevp, td, 1); + error = kqueue_register(kq, kevp, td, M_WAITOK); if (error || (kevp->flags & EV_RECEIPT)) { if (nevents == 0) return (error); @@ -1370,12 +1370,11 @@ kqueue_fo_release(int filt) } /* - * A ref to kq (obtained via kqueue_acquire) must be held. waitok will - * influence if memory allocation should wait. Make sure it is 0 if you - * hold any mutexes. + * A ref to kq (obtained via kqueue_acquire) must be held. */ static int -kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int waitok) +kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, + int mflag) { struct filterops *fops; struct file *fp; @@ -1405,7 +1404,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, * allocation failures are handled in the loop, only * if the spare knote appears to be actually required. */ - tkn = knote_alloc(waitok); + tkn = knote_alloc(mflag); } else { tkn = NULL; } @@ -1421,11 +1420,11 @@ findkn: goto done; if ((kev->flags & EV_ADD) == EV_ADD && kqueue_expand(kq, fops, - kev->ident, 0) != 0) { + kev->ident, M_NOWAIT) != 0) { /* try again */ fdrop(fp, td); fp = NULL; - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error) goto done; goto findkn; @@ -1462,7 +1461,7 @@ findkn: } } else { if ((kev->flags & EV_ADD) == EV_ADD) { - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error != 0) goto done; } @@ -1690,19 +1689,14 @@ kqueue_schedtask(struct kqueue *kq) * Expand the kq to make sure we have storage for fops/ident pair. * * Return 0 on success (or no work necessary), return errno on failure. - * - * Not calling hashinit w/ waitok (proper malloc flag) should be safe. - * If kqueue_register is called from a non-fd context, there usually/should - * be no locks held. */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, - int waitok) + int mflag) { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; int error, fd, size; - int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); @@ -1740,8 +1734,9 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } } else { if (kq->kq_knhashmask == 0) { - tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask); + tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, + &tmp_knhashmask, (mflag & M_WAITOK) != 0 ? + HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return (ENOMEM); KQ_LOCK(kq); @@ -1830,7 +1825,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct k asbt = -1; } else asbt = 0; - marker = knote_alloc(1); + marker = knote_alloc(M_WAITOK); marker->kn_status = KN_MARKER; KQ_LOCK(kq); @@ -2706,11 +2701,10 @@ knote_init(void) SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL); static struct knote * -knote_alloc(int waitok) +knote_alloc(int mflag) { - return (uma_zalloc(knote_zone, (waitok ? M_WAITOK : M_NOWAIT) | - M_ZERO)); + return (uma_zalloc(knote_zone, mflag | M_ZERO)); } static void @@ -2724,7 +2718,7 @@ knote_free(struct knote *kn) * Register the kev w/ the kq specified by fd. */ int -kqfd_register(int fd, struct kevent *kev, struct thread *td, int waitok) +kqfd_register(int fd, struct kevent *kev, struct thread *td, int mflag) { struct kqueue *kq; struct file *fp; @@ -2737,7 +2731,7 @@ kqfd_register(int fd, struct kevent *kev, struct threa if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; - error = kqueue_register(kq, kev, td, waitok); + error = kqueue_register(kq, kev, td, mflag); kqueue_release(kq, 0); noacquire: Modified: stable/12/sys/kern/vfs_aio.c ============================================================================== --- stable/12/sys/kern/vfs_aio.c Sat Dec 1 16:50:12 2018 (r341375) +++ stable/12/sys/kern/vfs_aio.c Sat Dec 1 17:48:28 2018 (r341376) @@ -1595,7 +1595,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; kev.data = (intptr_t)job; kev.udata = job->uaiocb.aio_sigevent.sigev_value.sival_ptr; - error = kqfd_register(kqfd, &kev, td, 1); + error = kqfd_register(kqfd, &kev, td, M_WAITOK); if (error) goto aqueue_fail; @@ -2164,7 +2164,8 @@ kern_lio_listio(struct thread *td, int mode, struct ai /* pass user defined sigval data */ kev.udata = lj->lioj_signal.sigev_value.sival_ptr; error = kqfd_register( - lj->lioj_signal.sigev_notify_kqueue, &kev, td, 1); + lj->lioj_signal.sigev_notify_kqueue, &kev, td, + M_WAITOK); if (error) { uma_zfree(aiolio_zone, lj); return (error); Modified: stable/12/sys/sys/event.h ============================================================================== --- stable/12/sys/sys/event.h Sat Dec 1 16:50:12 2018 (r341375) +++ stable/12/sys/sys/event.h Sat Dec 1 17:48:28 2018 (r341376) @@ -348,7 +348,7 @@ void knlist_cleardel(struct knlist *knl, struct thread knlist_cleardel((knl), (td), (islocked), 1) void knote_fdclose(struct thread *p, int fd); int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); + int mflag); int kqueue_add_filteropts(int filt, struct filterops *filtops); int kqueue_del_filteropts(int filt); From owner-svn-src-stable@freebsd.org Sat Dec 1 18:09:18 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD80132367A; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1E9C6E48C; Sat, 1 Dec 2018 18:09:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C65FD1B40A; Sat, 1 Dec 2018 18:09:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1I9HnO088326; Sat, 1 Dec 2018 18:09:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1I9Hkj088325; Sat, 1 Dec 2018 18:09:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011809.wB1I9Hkj088325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341378 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1E9C6E48C X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.408,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:09:18 -0000 Author: cy Date: Sat Dec 1 18:09:17 2018 New Revision: 341378 URL: https://svnweb.freebsd.org/changeset/base/341378 Log: MFC r340909: Combine two lines into one following unifdef for r255332. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 17:59:41 2018 (r341377) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) @@ -299,8 +299,7 @@ ipfdetach(softc) * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode -, p) +ipfioctl(dev, cmd, data, mode, p) struct thread *p; # define p_cred td_ucred # define p_uid td_ucred->cr_ruid From owner-svn-src-stable@freebsd.org Sat Dec 1 18:09:18 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87E31132367D; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 308956E48D; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BD7D1B40B; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1I9Hpb088332; Sat, 1 Dec 2018 18:09:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1I9HMZ088331; Sat, 1 Dec 2018 18:09:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011809.wB1I9HMZ088331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:09: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: r341378 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 308956E48D X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.408,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:09:18 -0000 Author: cy Date: Sat Dec 1 18:09:17 2018 New Revision: 341378 URL: https://svnweb.freebsd.org/changeset/base/341378 Log: MFC r340909: Combine two lines into one following unifdef for r255332. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 17:59:41 2018 (r341377) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) @@ -299,8 +299,7 @@ ipfdetach(softc) * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode -, p) +ipfioctl(dev, cmd, data, mode, p) struct thread *p; # define p_cred td_ucred # define p_uid td_ucred->cr_ruid From owner-svn-src-stable@freebsd.org Sat Dec 1 18:09:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AEC01323684; Sat, 1 Dec 2018 18:09:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B22EE6E493; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 771A41B40C; Sat, 1 Dec 2018 18:09:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1I9IH8088339; Sat, 1 Dec 2018 18:09:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1I9Io9088338; Sat, 1 Dec 2018 18:09:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011809.wB1I9Io9088338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r341378 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B22EE6E493 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.408,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:09:19 -0000 Author: cy Date: Sat Dec 1 18:09:17 2018 New Revision: 341378 URL: https://svnweb.freebsd.org/changeset/base/341378 Log: MFC r340909: Combine two lines into one following unifdef for r255332. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 17:59:41 2018 (r341377) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) @@ -289,8 +289,7 @@ ipfdetach(softc) * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode -, p) +ipfioctl(dev, cmd, data, mode, p) struct thread *p; # define p_cred td_ucred # define p_uid td_ucred->cr_ruid From owner-svn-src-stable@freebsd.org Sat Dec 1 18:17:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144491323E20; Sat, 1 Dec 2018 18:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2D1D6EEC5; Sat, 1 Dec 2018 18:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DB7F1B5B5; Sat, 1 Dec 2018 18:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1IHpQx093615; Sat, 1 Dec 2018 18:17:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1IHplZ093614; Sat, 1 Dec 2018 18:17:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011817.wB1IHplZ093614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341379 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2D1D6EEC5 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.41)[0.408,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:17:52 -0000 Author: cy Date: Sat Dec 1 18:17:51 2018 New Revision: 341379 URL: https://svnweb.freebsd.org/changeset/base/341379 Log: MFC r340868: An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source file. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:17:51 2018 (r341379) @@ -66,9 +66,6 @@ static const char rcsid[] = "@(#)$Id$"; #define VNET_DECLARE(_t, _v) extern _t _v #define VNET(arg) arg #endif -#if defined(__osf__) -# include -#endif #include #include #include From owner-svn-src-stable@freebsd.org Sat Dec 1 18:17:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F60C1323E28; Sat, 1 Dec 2018 18:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 447AE6EEC7; Sat, 1 Dec 2018 18:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 270FD1B5B7; Sat, 1 Dec 2018 18:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1IHq6m093627; Sat, 1 Dec 2018 18:17:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1IHq9g093626; Sat, 1 Dec 2018 18:17:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011817.wB1IHq9g093626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r341379 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 447AE6EEC7 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.408,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:17:52 -0000 Author: cy Date: Sat Dec 1 18:17:51 2018 New Revision: 341379 URL: https://svnweb.freebsd.org/changeset/base/341379 Log: MFC r340868: An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source file. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:17:51 2018 (r341379) @@ -61,9 +61,6 @@ static const char rcsid[] = "@(#)$Id$"; #define CURVNET_SET(arg) #define CURVNET_RESTORE() #endif -#if defined(__osf__) -# include -#endif #include #include #include From owner-svn-src-stable@freebsd.org Sat Dec 1 18:17:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D201323E24; Sat, 1 Dec 2018 18:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFBD96EEC6; Sat, 1 Dec 2018 18:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1681B5B6; Sat, 1 Dec 2018 18:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1IHphq093621; Sat, 1 Dec 2018 18:17:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1IHpSc093620; Sat, 1 Dec 2018 18:17:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011817.wB1IHpSc093620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:17:51 +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: r341379 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFBD96EEC6 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.41)[0.408,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:17:52 -0000 Author: cy Date: Sat Dec 1 18:17:51 2018 New Revision: 341379 URL: https://svnweb.freebsd.org/changeset/base/341379 Log: MFC r340868: An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source file. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:09:17 2018 (r341378) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:17:51 2018 (r341379) @@ -66,9 +66,6 @@ static const char rcsid[] = "@(#)$Id$"; #define VNET_DECLARE(_t, _v) extern _t _v #define VNET(arg) arg #endif -#if defined(__osf__) -# include -#endif #include #include #include From owner-svn-src-stable@freebsd.org Sat Dec 1 18:23:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C24811324237; Sat, 1 Dec 2018 18:23:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68EEB6F6A8; Sat, 1 Dec 2018 18:23:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49DC71B74C; Sat, 1 Dec 2018 18:23:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1INgm3098737; Sat, 1 Dec 2018 18:23:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1INgjD098736; Sat, 1 Dec 2018 18:23:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011823.wB1INgjD098736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341380 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68EEB6F6A8 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.26)[0.262,0]; NEURAL_SPAM_SHORT(0.41)[0.408,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:23:42 -0000 Author: cy Date: Sat Dec 1 18:23:41 2018 New Revision: 341380 URL: https://svnweb.freebsd.org/changeset/base/341380 Log: MFC r340867: FreeBSD 7 has been history for many moons. Remove some dead code. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:17:51 2018 (r341379) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:23:41 2018 (r341380) @@ -57,15 +57,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) #include -#else -#define CURVNET_SET(arg) -#define CURVNET_RESTORE() -#define VNET_DEFINE(_t, _v) _t _v -#define VNET_DECLARE(_t, _v) extern _t _v -#define VNET(arg) arg -#endif #include #include #include From owner-svn-src-stable@freebsd.org Sat Dec 1 18:23:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 787581324233; Sat, 1 Dec 2018 18:23:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A92D6F6A7; Sat, 1 Dec 2018 18:23:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9EF1B74B; Sat, 1 Dec 2018 18:23:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1INfNZ098731; Sat, 1 Dec 2018 18:23:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1INfhE098730; Sat, 1 Dec 2018 18:23:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011823.wB1INfhE098730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 18:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341380 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A92D6F6A7 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.408,0]; NEURAL_SPAM_MEDIUM(0.03)[0.035,0]; NEURAL_SPAM_LONG(0.26)[0.262,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 18:23:42 -0000 Author: cy Date: Sat Dec 1 18:23:41 2018 New Revision: 341380 URL: https://svnweb.freebsd.org/changeset/base/341380 Log: MFC r340867: FreeBSD 7 has been history for many moons. Remove some dead code. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:17:51 2018 (r341379) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 18:23:41 2018 (r341380) @@ -57,15 +57,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) #include -#else -#define CURVNET_SET(arg) -#define CURVNET_RESTORE() -#define VNET_DEFINE(_t, _v) _t _v -#define VNET_DECLARE(_t, _v) extern _t _v -#define VNET(arg) arg -#endif #include #include #include