From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 00:37:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08B2153E744; Mon, 8 Feb 2021 00:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYnDd6qdSz3tLB; Mon, 8 Feb 2021 00:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD66A6187; Mon, 8 Feb 2021 00:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1180brrm007786; Mon, 8 Feb 2021 00:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1180brmY007785; Mon, 8 Feb 2021 00:37:53 GMT (envelope-from git) Date: Mon, 8 Feb 2021 00:37:53 GMT Message-Id: <202102080037.1180brmY007785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4f5c38d25798 - stable/13 - cpucontrol(8): Fix display. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f5c38d257982e173c5889fd0238d3492488ccf5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 00:37:54 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5c38d257982e173c5889fd0238d3492488ccf5 commit 4f5c38d257982e173c5889fd0238d3492488ccf5 Author: Konstantin Belousov AuthorDate: 2021-02-05 01:00:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-08 00:36:22 +0000 cpucontrol(8): Fix display. (cherry picked from commit 856789c123d69de86684c5aa1ad8a53427dd47fc) --- usr.sbin/cpucontrol/cpucontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/cpucontrol/cpucontrol.8 b/usr.sbin/cpucontrol/cpucontrol.8 index 4e54bb51bafc..e347d5e49bfe 100644 --- a/usr.sbin/cpucontrol/cpucontrol.8 +++ b/usr.sbin/cpucontrol/cpucontrol.8 @@ -33,8 +33,8 @@ .Xr cpuctl 4 device .Sh SYNOPSIS -.Nm .Bk +.Nm .Op Fl v .Fl m Ar msr .Ar device From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 00:37:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AFDF53EA84; Mon, 8 Feb 2021 00:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYnDg0BHvz3tNf; Mon, 8 Feb 2021 00:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED9F05A6B; Mon, 8 Feb 2021 00:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1180bsHV007808; Mon, 8 Feb 2021 00:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1180bslR007807; Mon, 8 Feb 2021 00:37:54 GMT (envelope-from git) Date: Mon, 8 Feb 2021 00:37:54 GMT Message-Id: <202102080037.1180bslR007807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6d74fa5a1b66 - stable/13 - amd64 GENERIC: compile in mlx5en(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d74fa5a1b66a98f08ace2034bc85348ddd800f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 00:37:55 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6d74fa5a1b66a98f08ace2034bc85348ddd800f3 commit 6d74fa5a1b66a98f08ace2034bc85348ddd800f3 Author: Konstantin Belousov AuthorDate: 2021-02-03 12:19:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-08 00:36:51 +0000 amd64 GENERIC: compile in mlx5en(4) (cherry picked from commit 5832a3e398642f721381dc2bdc8e954ae43c17a7) --- sys/amd64/conf/GENERIC | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 56376ad9d14c..f16247e68137 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -121,6 +121,8 @@ device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support +options COMPAT_LINUXKPI + # Floppy drives device fdc @@ -245,6 +247,12 @@ device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support @@ -313,6 +321,7 @@ device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 00:47:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAD6053EF7B; Mon, 8 Feb 2021 00:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYnS15s6Kz3vF9; Mon, 8 Feb 2021 00:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBA826162; Mon, 8 Feb 2021 00:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1180ljNh020818; Mon, 8 Feb 2021 00:47:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1180ljul020817; Mon, 8 Feb 2021 00:47:45 GMT (envelope-from git) Date: Mon, 8 Feb 2021 00:47:45 GMT Message-Id: <202102080047.1180ljul020817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 87eac7608343 - stable/13 - Enable pvscsi and vmx in arm64 GENERIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 87eac7608343d86f2d33d15139ca467565bd7623 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 00:47:45 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87eac7608343d86f2d33d15139ca467565bd7623 commit 87eac7608343d86f2d33d15139ca467565bd7623 Author: Ed Maste AuthorDate: 2021-02-05 00:14:12 +0000 Commit: Ed Maste CommitDate: 2021-02-08 00:47:23 +0000 Enable pvscsi and vmx in arm64 GENERIC FreeBSD pvscsi and vmx work with VMware ESXi Arm "Fling"; provide these in GENERIC for a convenient out-of-the-box experience. PR: 253202 Reported by: Vincent Milum Jr Sponsored by: The FreeBSD Foundation (cherry picked from commit 375d797b81916eb3d16927c9dac8c42975784252) --- sys/arm64/conf/GENERIC | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 3be3b5e7b706..43d891eb4ccd 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -147,6 +147,7 @@ options PCI_IOV # PCI SR-IOV support device ahci device scbus device da +device pvscsi # VMware PVSCSI # ATA/SCSI peripherals device cd # CD @@ -260,6 +261,7 @@ device pl011 device iflib device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel 10Gb Ethernet Family +device vmx # VMware VMXNET3 Ethernet # Ethernet NICs device mdio From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 03:04:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D82CA54242F; Mon, 8 Feb 2021 03:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYrTh5hkVz4Xsx; Mon, 8 Feb 2021 03:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B258A7FA5; Mon, 8 Feb 2021 03:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11834OxB003514; Mon, 8 Feb 2021 03:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11834OF6003513; Mon, 8 Feb 2021 03:04:24 GMT (envelope-from git) Date: Mon, 8 Feb 2021 03:04:24 GMT Message-Id: <202102080304.11834OF6003513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 606bf913f9a3 - stable/13 - release: disable the 'reldoc' target after the ASCIIDoctor switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 606bf913f9a33a47005efcac84a430ffb7ec4778 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 03:04:24 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=606bf913f9a33a47005efcac84a430ffb7ec4778 commit 606bf913f9a33a47005efcac84a430ffb7ec4778 Author: Glen Barber AuthorDate: 2021-02-05 16:46:49 +0000 Commit: Glen Barber CommitDate: 2021-02-08 03:04:09 +0000 release: disable the 'reldoc' target after the ASCIIDoctor switch The 'reldoc' target includes release-related documentation on installation medium. Since the switch from XML to ASCIIDoctor, the file locations have moved, and it will take some time to sort out how this target should work now. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac) --- release/Makefile | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/release/Makefile b/release/Makefile index 31fa254ef5e3..4bde39efb22b 100644 --- a/release/Makefile +++ b/release/Makefile @@ -88,9 +88,9 @@ EXTRA_PACKAGES+= ports.txz .if !defined(NOSRC) EXTRA_PACKAGES+= src.txz .endif -.if !defined(NODOC) -EXTRA_PACKAGES+= reldoc -.endif +#.if !defined(NODOC) +#EXTRA_PACKAGES+= reldoc +#.endif RELEASE_TARGETS= ftp IMAGES= @@ -119,9 +119,9 @@ CLEANFILES+= ${I}.xz CLEANFILES+= pkg-stage .endif CLEANDIRS= dist ftp disc1 bootonly dvd -.if !defined(NODOC) -CLEANDIRS+= reldoc rdoc -.endif +#.if !defined(NODOC) +#CLEANDIRS+= reldoc rdoc +#.endif beforeclean: chflags -R noschg . .include @@ -161,22 +161,22 @@ ports.txz: --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \ ${XZ_CMD} > ${.OBJDIR}/ports.txz -reldoc: - cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ - env MAN4DIR=${WORLDDIR}/share/man/man4 \ - _BRANCH=${BRANCH} \ - ${MAKE} all install clean "FORMATS=html txt" \ - INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ - WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc - mkdir -p reldoc -.for i in hardware readme relnotes errata - ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ - reldoc/${i:tu}.TXT - ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ - reldoc/${i:tu}.HTML -.endfor - cp ${.OBJDIR}/rdoc/docbook.css \ - reldoc/ +#reldoc: +# cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ +# env MAN4DIR=${WORLDDIR}/share/man/man4 \ +# _BRANCH=${BRANCH} \ +# ${MAKE} all install clean "FORMATS=html txt" \ +# INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ +# WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc +# mkdir -p reldoc +#.for i in hardware readme relnotes errata +# ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ +# reldoc/${i:tu}.TXT +# ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ +# reldoc/${i:tu}.HTML +#.endfor +# cp ${.OBJDIR}/rdoc/docbook.css \ +# reldoc/ disc1: packagesystem # Install system @@ -194,9 +194,9 @@ disc1: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -221,9 +221,9 @@ bootonly: packagesystem mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -245,9 +245,9 @@ dvd: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 08:36:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E558652A15F; Mon, 8 Feb 2021 08:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYzrp66Xgz4rMb; Mon, 8 Feb 2021 08:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C092E143DE; Mon, 8 Feb 2021 08:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1188aQxa034978; Mon, 8 Feb 2021 08:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1188aQK7034977; Mon, 8 Feb 2021 08:36:26 GMT (envelope-from git) Date: Mon, 8 Feb 2021 08:36:26 GMT Message-Id: <202102080836.1188aQK7034977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ac86c042fbce - stable/13 - MFC 85d8d30f9f70: Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac86c042fbced7f210cb0627525832774d0a9b88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 08:36:27 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ac86c042fbced7f210cb0627525832774d0a9b88 commit ac86c042fbced7f210cb0627525832774d0a9b88 Author: Hans Petter Selasky AuthorDate: 2021-01-26 14:01:38 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-08 08:32:48 +0000 MFC 85d8d30f9f70: Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. Reviewed by: rrs@ Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 85d8d30f9f7046f5e89295352ded49135b25fbe3) --- sys/netinet/in_pcb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 5adac0fddddf..8232003b3808 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3399,7 +3399,12 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp, INP_WLOCK_ASSERT(inp); - if (*st != NULL) + /* + * If there is already a send tag, or the INP is being torn + * down, allocating a new send tag is not allowed. Else send + * tags may leak. + */ + if (*st != NULL || (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) != 0) return (EINVAL); error = m_snd_tag_alloc(ifp, ¶ms, st); From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 08:36:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F123B52A395; Mon, 8 Feb 2021 08:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYzrq6Xbkz4rY3; Mon, 8 Feb 2021 08:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3C4114667; Mon, 8 Feb 2021 08:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1188aRSa035001; Mon, 8 Feb 2021 08:36:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1188aRhH035000; Mon, 8 Feb 2021 08:36:27 GMT (envelope-from git) Date: Mon, 8 Feb 2021 08:36:27 GMT Message-Id: <202102080836.1188aRhH035000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e326cb03bcd8 - stable/13 - MFC 093e72319089: Add missing decrement of active ratelimit connections. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e326cb03bcd8b145057b9179b41940d4abb709d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 08:36:28 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e326cb03bcd8b145057b9179b41940d4abb709d3 commit e326cb03bcd8b145057b9179b41940d4abb709d3 Author: Hans Petter Selasky AuthorDate: 2021-01-26 15:59:42 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-08 08:33:12 +0000 MFC 093e72319089: Add missing decrement of active ratelimit connections. Reviewed by: rrs@ Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 093e7231908908b651b91c68ac03fb697c3a8352) --- sys/netinet/in_pcb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 8232003b3808..59695ee3715d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3446,6 +3446,9 @@ in_pcbdetach_txrtlmt(struct inpcb *inp) return; m_snd_tag_rele(mst); +#ifdef INET + counter_u64_add(rate_limit_active, -1); +#endif } int From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 08:43:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB01B52A9B2; Mon, 8 Feb 2021 08:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ00w4TDDz4sGB; Mon, 8 Feb 2021 08:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C34714B04; Mon, 8 Feb 2021 08:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1188hSS7047519; Mon, 8 Feb 2021 08:43:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1188hSnf047518; Mon, 8 Feb 2021 08:43:28 GMT (envelope-from git) Date: Mon, 8 Feb 2021 08:43:28 GMT Message-Id: <202102080843.1188hSnf047518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 6a97a237a258 - stable/12 - MFC 85d8d30f9f70: Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6a97a237a25832395182076acc1f1dd23fca9818 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 08:43:28 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6a97a237a25832395182076acc1f1dd23fca9818 commit 6a97a237a25832395182076acc1f1dd23fca9818 Author: Hans Petter Selasky AuthorDate: 2021-01-26 14:01:38 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-08 08:42:19 +0000 MFC 85d8d30f9f70: Don't allow allocating a new send tag on an INP which is being torn down. This fixes a potential send tag leak. Reviewed by: rrs@ Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 85d8d30f9f7046f5e89295352ded49135b25fbe3) --- sys/netinet/in_pcb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 56920d3e973a..b8f06a96fe27 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3323,7 +3323,12 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp, INP_WLOCK_ASSERT(inp); - if (inp->inp_snd_tag != NULL) + /* + * If there is already a send tag, or the INP is being torn + * down, allocating a new send tag is not allowed. Else send + * tags may leak. + */ + if (inp->inp_snd_tag != NULL || (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) != 0) return (EINVAL); if (ifp->if_snd_tag_alloc == NULL) { From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 22:34:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DDD85443B9; Mon, 8 Feb 2021 22:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLRG1gKJz3Fsk; Mon, 8 Feb 2021 22:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C1931F6C9; Mon, 8 Feb 2021 22:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118MY20B029865; Mon, 8 Feb 2021 22:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118MY2XK029864; Mon, 8 Feb 2021 22:34:02 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:34:02 GMT Message-Id: <202102082234.118MY2XK029864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 0ace2cce386a - stable/13 - Catch up with 6edfd179c86: document M_EXTPG. While here sore flags as they are in sys/mbuf.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ace2cce386aebfe4eab3741f61a9c497316426d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:34:02 -0000 The branch stable/13 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0ace2cce386aebfe4eab3741f61a9c497316426d commit 0ace2cce386aebfe4eab3741f61a9c497316426d Author: Gleb Smirnoff AuthorDate: 2021-01-28 20:56:36 +0000 Commit: Gleb Smirnoff CommitDate: 2021-02-08 22:31:54 +0000 Catch up with 6edfd179c86: document M_EXTPG. While here sore flags as they are in sys/mbuf.h (cherry picked from commit cf6ff85fe847225e7b7ca1c3669cab6412076765) --- share/man/man9/mbuf.9 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index 8d5d40da15bf..9089ab56d58c 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2020 +.Dd January 28, 2021 .Dt MBUF 9 .Os .\" @@ -213,12 +213,12 @@ flag bits are defined as follows: #define M_PKTHDR 0x00000002 /* start of record */ #define M_EOR 0x00000004 /* end of record */ #define M_RDONLY 0x00000008 /* associated data marked read-only */ -#define M_NOMAP 0x00000100 /* mbuf data is unmapped */ -#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_BCAST 0x00000010 /* send/received as link-level broadcast */ #define M_MCAST 0x00000020 /* send/received as link-level multicast */ #define M_PROMISC 0x00000040 /* packet was not for us */ #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ +#define M_EXTPG 0x00000100 /* has array of unmapped pages and TLS */ +#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ #define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically hw-stamped on port (useful for IEEE 1588 From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 22:34:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B36965445AD; Mon, 8 Feb 2021 22:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLRH4btsz3G1K; Mon, 8 Feb 2021 22:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6519A1FB09; Mon, 8 Feb 2021 22:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118MY3eF029886; Mon, 8 Feb 2021 22:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118MY3JF029885; Mon, 8 Feb 2021 22:34:03 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:34:03 GMT Message-Id: <202102082234.118MY3JF029885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 97ded49caef6 - stable/13 - Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97ded49caef6a97994655f5e065c3591359ee8d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:34:03 -0000 The branch stable/13 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=97ded49caef6a97994655f5e065c3591359ee8d3 commit 97ded49caef6a97994655f5e065c3591359ee8d3 Author: Gleb Smirnoff AuthorDate: 2021-01-28 21:08:48 +0000 Commit: Gleb Smirnoff CommitDate: 2021-02-08 22:33:35 +0000 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. Originally IFCAP_NOMAP meant that the mbuf has external storage pointer that points to unmapped address. Then, this was extended to array of such pointers. Then, such mbufs were augmented with header/trailer. Basically, extended mbufs are extended, and set of features is subject to change. The new name should be generic enough to avoid further renaming. (cherry-picked from commit 3f43ada98c89bce5ae416e203ba0e81595a5cd88) --- sbin/ifconfig/ifconfig.8 | 16 +++++++++------- sbin/ifconfig/ifconfig.c | 4 ++-- sys/dev/cxgbe/t4_main.c | 6 +++--- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 6 +++--- sys/kern/uipc_ktls.c | 2 +- sys/net/if.h | 2 +- sys/net/if_vlan.c | 4 ++-- sys/net/iflib.c | 8 ++++---- sys/netinet/ip_output.c | 2 +- sys/netinet6/ip6_output.c | 2 +- 10 files changed, 27 insertions(+), 25 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index bbaaa00d419b..b8adad3c75b0 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd November 1, 2020 +.Dd January 28, 2021 .Dt IFCONFIG 8 .Os .Sh NAME @@ -554,12 +554,14 @@ and Enable use of rate limiting (packet pacing) for TLS offload. .It Fl txtlsrtlmt Disable use of rate limiting for TLS offload. -.It Cm nomap -If the driver supports unmapped network buffers, -enable them on the interface. -.It Fl nomap -If the driver supports unmapped network buffers, -disable them on the interface. +.It Cm mextpg +If the driver supports extended multi-page +.Xr mbuf 9 +buffers, enable them on the interface. +.It Fl mextpg +If the driver supports extended multi-page +.Xr mbuf 9 +biffers, disable them on the interface. .It Cm wol , wol_ucast , wol_mcast , wol_magic Enable Wake On Lan (WOL) support, if available. WOL is a facility whereby a machine in a low power state may be woken diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e6e7908e18cd..451532246d40 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1658,8 +1658,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-link2", -IFF_LINK2, setifflags), DEF_CMD("monitor", IFF_MONITOR, setifflags), DEF_CMD("-monitor", -IFF_MONITOR, setifflags), - DEF_CMD("nomap", IFCAP_NOMAP, setifcap), - DEF_CMD("-nomap", -IFCAP_NOMAP, setifcap), + DEF_CMD("mextpg", IFCAP_MEXTPG, setifcap), + DEF_CMD("-mextpg", -IFCAP_MEXTPG, setifcap), DEF_CMD("staticarp", IFF_STATICARP, setifflags), DEF_CMD("-staticarp", -IFF_STATICARP, setifflags), DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap), diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e01429f93825..18a83df763ab 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1782,7 +1782,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ - IFCAP_HWRXTSTMP | IFCAP_NOMAP) + IFCAP_HWRXTSTMP | IFCAP_MEXTPG) #define T4_CAP_ENABLE (T4_CAP) static int @@ -2182,8 +2182,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) rxq->iq.flags &= ~IQ_RX_TIMESTAMP; } } - if (mask & IFCAP_NOMAP) - ifp->if_capenable ^= IFCAP_NOMAP; + if (mask & IFCAP_MEXTPG) + ifp->if_capenable ^= IFCAP_MEXTPG; #ifdef KERN_TLS if (mask & IFCAP_TXTLS) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 023f519f7ced..296252875888 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3379,8 +3379,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) "tso6 disabled due to -txcsum6.\n"); } } - if (mask & IFCAP_NOMAP) - ifp->if_capenable ^= IFCAP_NOMAP; + if (mask & IFCAP_MEXTPG) + ifp->if_capenable ^= IFCAP_MEXTPG; if (mask & IFCAP_TXTLS4) ifp->if_capenable ^= IFCAP_TXTLS4; if (mask & IFCAP_TXTLS6) @@ -4397,7 +4397,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO; ifp->if_capabilities |= IFCAP_HWSTATS | IFCAP_HWRXTSTMP; - ifp->if_capabilities |= IFCAP_NOMAP; + ifp->if_capabilities |= IFCAP_MEXTPG; ifp->if_capabilities |= IFCAP_TXTLS4 | IFCAP_TXTLS6; #ifdef RATELIMIT ifp->if_capabilities |= IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT; diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 72c228e80199..700206681965 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -868,7 +868,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, params.hdr.numa_domain = inp->inp_numa_domain; INP_RUNLOCK(inp); - if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { + if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { error = EOPNOTSUPP; goto out; } diff --git a/sys/net/if.h b/sys/net/if.h index a886474780dd..eabd4e053733 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -245,7 +245,7 @@ struct if_data { #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ #define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ #define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */ -#define IFCAP_NOMAP 0x4000000 /* can TX unmapped mbufs */ +#define IFCAP_MEXTPG 0x4000000 /* understands M_EXTPG mbufs */ #define IFCAP_TXTLS4 0x8000000 /* can do TLS encryption and segmentation for TCP */ #define IFCAP_TXTLS6 0x10000000 /* can do TLS encryption and segmentation for TCP6 */ #define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */ diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 26fb48257c11..2f48a5aa2f56 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1797,8 +1797,8 @@ vlan_capabilities(struct ifvlan *ifv) * are prepended in normal mbufs to unmapped mbufs holding * payload data. */ - cap |= (p->if_capabilities & IFCAP_NOMAP); - ena |= (mena & IFCAP_NOMAP); + cap |= (p->if_capabilities & IFCAP_MEXTPG); + ena |= (mena & IFCAP_MEXTPG); /* * If the parent interface can offload encryption and segmentation diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d10c11f865fe..cfc6972bf987 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4231,7 +4231,7 @@ iflib_if_qflush(if_t ifp) #define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ - IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_NOMAP) + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) @@ -4358,7 +4358,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) oldmask = if_getcapenable(ifp); mask = ifr->ifr_reqcap ^ oldmask; - mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_NOMAP; + mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_MEXTPG; setmask = 0; #ifdef TCP_OFFLOAD setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); @@ -4759,9 +4759,9 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct #endif if_setcapabilities(ifp, - scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_NOMAP); + scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_MEXTPG); if_setcapenable(ifp, - scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_NOMAP); + scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_MEXTPG); if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && scctx->isc_ntxqsets_max < scctx->isc_ntxqsets)) scctx->isc_ntxqsets = scctx->isc_ntxqsets_max; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 2d45d583df15..405490e890c0 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -746,7 +746,7 @@ sendit: } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } else if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { + } else if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { m = mb_unmapped_to_ext(m); if (m == NULL) { IPSTAT_INC(ips_odropped); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 4e8f22a01b0a..df1e9e6f2dcd 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -225,7 +225,7 @@ ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags, #if defined(SCTP) || defined(SCTP_SUPPORT) (csum_flags & CSUM_SCTP_IPV6) || #endif - (!frag && (ifp->if_capenable & IFCAP_NOMAP) == 0)) { + (!frag && (ifp->if_capenable & IFCAP_MEXTPG) == 0)) { m = mb_unmapped_to_ext(m); if (m == NULL) { if (frag) From owner-dev-commits-src-branches@freebsd.org Mon Feb 8 22:39:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC36454446D; Mon, 8 Feb 2021 22:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLYL5Pmvz3GMW; Mon, 8 Feb 2021 22:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABC1B1FAE8; Mon, 8 Feb 2021 22:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118MdIAE030904; Mon, 8 Feb 2021 22:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118MdIAb030903; Mon, 8 Feb 2021 22:39:18 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:39:18 GMT Message-Id: <202102082239.118MdIAb030903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b122886de25a - stable/13 - serf: Fix the default return value of the BIO control method. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b122886de25a51e3587d94ab2988a6ccb1e6a4e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:39:18 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b122886de25a51e3587d94ab2988a6ccb1e6a4e7 commit b122886de25a51e3587d94ab2988a6ccb1e6a4e7 Author: John Baldwin AuthorDate: 2021-02-03 22:59:32 +0000 Commit: John Baldwin CommitDate: 2021-02-08 22:38:59 +0000 serf: Fix the default return value of the BIO control method. OpenSSL BIO classes provide an abstraction for dealing with I/O. OpenSSL provides BIO classes for commonly used I/O primitives backed by file descriptors, sockets, etc. as well as permitting consumers of OpenSSL to define custom BIO classes. One of the methods BIO classes implement is a control method invoked by BIO_ctrl() for various ancilliary tasks somewhat analgous to fcntl() and ioctl() on file descriptors. According to the BIO_ctrl(3) manual page, control methods should return 0 for unknown control requests. KTLS support in OpenSSL adds new control requests. Two of those new requests are queries to determine if KTLS is enabled for either reading or writing. These control reuquest return 1 if KTLS is enabled and 0 if it is not. serf includes two custom BIO classes for wrapping I/O requests from files and from a buffer in memory. These BIO classes both use a custom control method. However, this custom control method was returning 1 for unknown or unsupported control requests instead of 0. As a result, OpenSSL with KTLS believed that these BIOs were using KTLS and were thus adding headers and doing encryption/decryption in the BIO. Correcting the return value removes this confusion. PR: 253135 Reported by: Guido Falsi Sponsored by: Netflix (cherry picked from commit cb7cc72c546e0f87598961c3860e17391f42866c) --- contrib/serf/buckets/ssl_buckets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/serf/buckets/ssl_buckets.c b/contrib/serf/buckets/ssl_buckets.c index b01e5359db08..3c8b7e2a685f 100644 --- a/contrib/serf/buckets/ssl_buckets.c +++ b/contrib/serf/buckets/ssl_buckets.c @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) { - long ret = 1; + long ret = 0; switch (cmd) { default: @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_FLUSH: /* At this point we can't force a flush. */ + ret = 1; break; case BIO_CTRL_PUSH: case BIO_CTRL_POP: From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 04:15:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E1F652E666; Tue, 9 Feb 2021 04:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZV1G71X3z3vFn; Tue, 9 Feb 2021 04:15:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3C9224394; Tue, 9 Feb 2021 04:15:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1194FU6x074862; Tue, 9 Feb 2021 04:15:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1194FU7A074861; Tue, 9 Feb 2021 04:15:30 GMT (envelope-from git) Date: Tue, 9 Feb 2021 04:15:30 GMT Message-Id: <202102090415.1194FU7A074861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7d9e00cd8bd3 - stable/13 - rtld: Fix null-pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d9e00cd8bd317c681b0817b84607182160f5f54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 04:15:31 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7d9e00cd8bd317c681b0817b84607182160f5f54 commit 7d9e00cd8bd317c681b0817b84607182160f5f54 Author: David Chisnall AuthorDate: 2021-02-02 14:06:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 04:14:48 +0000 rtld: Fix null-pointer dereference (cherry picked from commit 43d44842aef3972cc86ce673e84e31f372257b15) --- libexec/rtld-elf/rtld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7b8bfba84d7d..b186bebbfefc 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -894,8 +894,10 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff) target = (Elf_Addr)(defobj->relocbase + def->st_value); dbg("\"%s\" in \"%s\" ==> %p in \"%s\"", - defobj->strtab + def->st_name, basename(obj->path), - (void *)target, basename(defobj->path)); + defobj->strtab + def->st_name, + obj->path == NULL ? NULL : basename(obj->path), + (void *)target, + defobj->path == NULL ? NULL : basename(defobj->path)); /* * Write the new contents for the jmpslot. Note that depending on From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61D10535EE5; Tue, 9 Feb 2021 08:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpm2PB9z4g58; Tue, 9 Feb 2021 08:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4512F276CF; Tue, 9 Feb 2021 08:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198amNm013826; Tue, 9 Feb 2021 08:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198amvk013825; Tue, 9 Feb 2021 08:36:48 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:48 GMT Message-Id: <202102090836.1198amvk013825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a7c9e79f70e8 - stable/12 - pgrp: Prevent use after free. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a7c9e79f70e865909970aafa4a1ca9f5e50b168d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:48 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7c9e79f70e865909970aafa4a1ca9f5e50b168d commit a7c9e79f70e865909970aafa4a1ca9f5e50b168d Author: Konstantin Belousov AuthorDate: 2020-12-31 13:44:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:35:28 +0000 pgrp: Prevent use after free. Tested by: pho (cherry picked from commit ef739c7373d8b3833979ad471b31cb9e215411fd) --- sys/kern/kern_proc.c | 20 +++++++++++++++----- sys/kern/kern_prot.c | 13 +++++-------- sys/sys/proc.h | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 04d82d30f8c2..4a202f0a7411 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -103,7 +103,6 @@ SDT_PROBE_DEFINE3(proc, , dtor, return, "struct proc *", "int", "void *"); SDT_PROBE_DEFINE3(proc, , init, entry, "struct proc *", "int", "int"); SDT_PROBE_DEFINE3(proc, , init, return, "struct proc *", "int", "int"); -MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); MALLOC_DEFINE(M_SESSION, "session", "session header"); static MALLOC_DEFINE(M_PROC, "proc", "Proc structures"); MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures"); @@ -117,6 +116,7 @@ static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread); static void pgadjustjobc(struct pgrp *pgrp, bool entering); static void pgdelete(struct pgrp *); +static int pgrp_init(void *mem, int size, int flags); static int proc_ctor(void *mem, int size, void *arg, int flags); static void proc_dtor(void *mem, int size, void *arg); static int proc_init(void *mem, int size, int flags); @@ -137,6 +137,7 @@ struct sx __exclusive_cache_line allproc_lock; struct sx __exclusive_cache_line proctree_lock; struct mtx __exclusive_cache_line ppeers_lock; uma_zone_t proc_zone; +uma_zone_t pgrp_zone; /* * The offset of various fields in struct proc and struct thread. @@ -194,6 +195,8 @@ procinit(void) proc_zone = uma_zcreate("PROC", sched_sizeof_proc(), proc_ctor, proc_dtor, proc_init, proc_fini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + pgrp_zone = uma_zcreate("PGRP", sizeof(struct pgrp), NULL, NULL, + pgrp_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uihashinit(); } @@ -297,6 +300,16 @@ proc_fini(void *mem, int size) #endif } +static int +pgrp_init(void *mem, int size, int flags) +{ + struct pgrp *pg; + + pg = mem; + mtx_init(&pg->pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK); + return (0); +} + /* * Is p an inferior of the current process? */ @@ -476,8 +489,6 @@ enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess) KASSERT(!SESS_LEADER(p), ("enterpgrp: session leader attempted setpgrp")); - mtx_init(&pgrp->pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK); - if (sess != NULL) { /* * new session @@ -701,8 +712,7 @@ pgdelete(struct pgrp *pgrp) tty_rel_pgrp(tp, pgrp); } - mtx_destroy(&pgrp->pg_mtx); - free(pgrp, M_PGRP); + uma_zfree(pgrp_zone, pgrp); sess_release(savesess); } diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index a62b6f76da74..0f4814c59e78 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -325,7 +325,7 @@ sys_setsid(struct thread *td, struct setsid_args *uap) error = 0; pgrp = NULL; - newpgrp = malloc(sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO); + newpgrp = uma_zalloc(pgrp_zone, M_WAITOK); newsess = malloc(sizeof(struct session), M_SESSION, M_WAITOK | M_ZERO); sx_xlock(&proctree_lock); @@ -343,10 +343,8 @@ sys_setsid(struct thread *td, struct setsid_args *uap) sx_xunlock(&proctree_lock); - if (newpgrp != NULL) - free(newpgrp, M_PGRP); - if (newsess != NULL) - free(newsess, M_SESSION); + uma_zfree(pgrp_zone, newpgrp); + free(newsess, M_SESSION); return (error); } @@ -385,7 +383,7 @@ sys_setpgid(struct thread *td, struct setpgid_args *uap) error = 0; - newpgrp = malloc(sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO); + newpgrp = uma_zalloc(pgrp_zone, M_WAITOK); sx_xlock(&proctree_lock); if (uap->pid != 0 && uap->pid != curp->p_pid) { @@ -448,8 +446,7 @@ done: sx_xunlock(&proctree_lock); KASSERT((error == 0) || (newpgrp != NULL), ("setpgid failed and newpgrp is NULL")); - if (newpgrp != NULL) - free(newpgrp, M_PGRP); + uma_zfree(pgrp_zone, newpgrp); return (error); } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index a12646c951c5..9784d26a1215 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -841,7 +841,6 @@ struct proc { #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PARGS); -MALLOC_DECLARE(M_PGRP); MALLOC_DECLARE(M_SESSION); MALLOC_DECLARE(M_SUBPROC); #endif @@ -1011,6 +1010,7 @@ extern struct proclist zombproc; /* List of zombie processes. */ extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ extern struct uma_zone *proc_zone; +extern struct uma_zone *pgrp_zone; struct proc *pfind(pid_t); /* Find process by id. */ struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77AC85361CC; Tue, 9 Feb 2021 08:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpn3257z4g7V; Tue, 9 Feb 2021 08:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B0222789A; Tue, 9 Feb 2021 08:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198anbV013844; Tue, 9 Feb 2021 08:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198anUm013843; Tue, 9 Feb 2021 08:36:49 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:49 GMT Message-Id: <202102090836.1198anUm013843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 86316d8265b7 - stable/12 - Lock proctree in around fill_kinfo_proc(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 86316d8265b7640f24b42df83738730c9a8222b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:49 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=86316d8265b7640f24b42df83738730c9a8222b9 commit 86316d8265b7640f24b42df83738730c9a8222b9 Author: Konstantin Belousov AuthorDate: 2020-12-31 22:29:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:35:39 +0000 Lock proctree in around fill_kinfo_proc(). Tested by: pho (cherry picked from commit 4daea938130b4a219e01d678e9499f0bdb715f82) --- sys/kern/imgact_elf.c | 2 ++ sys/kern/kern_proc.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index e436c34d1d1b..18b83d6b499a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2326,8 +2326,10 @@ __elfN(note_procstat_proc)(void *arg, struct sbuf *sb, size_t *sizep) KASSERT(*sizep == size, ("invalid size")); structsize = sizeof(elf_kinfo_proc_t); sbuf_bcat(sb, &structsize, sizeof(structsize)); + sx_slock(&proctree_lock); PROC_LOCK(p); kern_proc_out(p, sb, ELF_KERN_PROC_MASK); + sx_sunlock(&proctree_lock); } *sizep = size; } diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 4a202f0a7411..739046cca413 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1603,9 +1603,11 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); + sx_slock(&proctree_lock); error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error == 0) error = sysctl_out_proc(p, req, flags); + sx_sunlock(&proctree_lock); return (error); } @@ -1634,6 +1636,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); } + sx_slock(&proctree_lock); sx_slock(&allproc_lock); for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { if (!doingzomb) @@ -1740,6 +1743,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } out: sx_sunlock(&allproc_lock); + sx_sunlock(&proctree_lock); return (error); } From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60465535E6F; Tue, 9 Feb 2021 08:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpp5xbZz4gKY; Tue, 9 Feb 2021 08:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9989527826; Tue, 9 Feb 2021 08:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198aobj013863; Tue, 9 Feb 2021 08:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198aorp013862; Tue, 9 Feb 2021 08:36:50 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:50 GMT Message-Id: <202102090836.1198aorp013862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fcba16c23bd5 - stable/12 - kinfo_proc: move job-control related data collection into a new helper. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fcba16c23bd56d061d8981d0f82bd6a71c6a2c9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:51 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fcba16c23bd56d061d8981d0f82bd6a71c6a2c9d commit fcba16c23bd56d061d8981d0f82bd6a71c6a2c9d Author: Konstantin Belousov AuthorDate: 2020-12-31 22:46:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:35:45 +0000 kinfo_proc: move job-control related data collection into a new helper. Tested by: pho (cherry picked from commit cf4f802e77a3a438bce5335b67c88ac6f0e21a6e) --- sys/kern/kern_proc.c | 86 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 739046cca413..9798abe96708 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1035,22 +1035,18 @@ fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp) } /* - * Clear kinfo_proc and fill in any information that is common - * to all threads in the process. + * Fill in any information that is common to all threads in the process. * Must be called with the target process locked. */ static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) { struct thread *td0; - struct tty *tp; - struct session *sp; struct ucred *cred; struct sigacts *ps; struct timeval boottime; PROC_LOCK_ASSERT(p, MA_OWNED); - bzero(kp, sizeof(*kp)); kp->ki_structsize = sizeof(*kp); kp->ki_paddr = p; @@ -1142,36 +1138,6 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) FOREACH_THREAD_IN_PROC(p, td0) kp->ki_cow += td0->td_cow; - tp = NULL; - if (p->p_pgrp) { - kp->ki_pgid = p->p_pgrp->pg_id; - kp->ki_jobc = p->p_pgrp->pg_jobc; - sp = p->p_pgrp->pg_session; - - if (sp != NULL) { - kp->ki_sid = sp->s_sid; - SESS_LOCK(sp); - strlcpy(kp->ki_login, sp->s_login, - sizeof(kp->ki_login)); - if (sp->s_ttyvp) - kp->ki_kiflag |= KI_CTTY; - if (SESS_LEADER(p)) - kp->ki_kiflag |= KI_SLEADER; - /* XXX proctree_lock */ - tp = sp->s_ttyp; - SESS_UNLOCK(sp); - } - } - if ((p->p_flag & P_CONTROLT) && tp != NULL) { - kp->ki_tdev = tty_udev(tp); - kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ - kp->ki_tpgid = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID; - if (tp->t_session) - kp->ki_tsid = tp->t_session->s_sid; - } else { - kp->ki_tdev = NODEV; - kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ - } if (p->p_comm[0] != '\0') strlcpy(kp->ki_comm, p->p_comm, sizeof(kp->ki_comm)); if (p->p_sysent && p->p_sysent->sv_name != NULL && @@ -1188,6 +1154,53 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) } } +/* + * Fill job-related process information. + */ +static void +fill_kinfo_proc_pgrp(struct proc *p, struct kinfo_proc *kp) +{ + struct tty *tp; + struct session *sp; + struct pgrp *pgrp; + + sx_assert(&proctree_lock, SA_LOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + + pgrp = p->p_pgrp; + if (pgrp == NULL) + return; + + kp->ki_pgid = pgrp->pg_id; + kp->ki_jobc = pgrp->pg_jobc; + + sp = pgrp->pg_session; + tp = NULL; + + if (sp != NULL) { + kp->ki_sid = sp->s_sid; + SESS_LOCK(sp); + strlcpy(kp->ki_login, sp->s_login, sizeof(kp->ki_login)); + if (sp->s_ttyvp) + kp->ki_kiflag |= KI_CTTY; + if (SESS_LEADER(p)) + kp->ki_kiflag |= KI_SLEADER; + tp = sp->s_ttyp; + SESS_UNLOCK(sp); + } + + if ((p->p_flag & P_CONTROLT) && tp != NULL) { + kp->ki_tdev = tty_udev(tp); + kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ + kp->ki_tpgid = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID; + if (tp->t_session) + kp->ki_tsid = tp->t_session->s_sid; + } else { + kp->ki_tdev = NODEV; + kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ + } +} + /* * Fill in information that is thread specific. Must be called with * target process locked. If 'preferthread' is set, overwrite certain @@ -1310,6 +1323,9 @@ fill_kinfo_proc(struct proc *p, struct kinfo_proc *kp) MPASS(FIRST_THREAD_IN_PROC(p) != NULL); + bzero(kp, sizeof(*kp)); + + fill_kinfo_proc_pgrp(p,kp); fill_kinfo_proc_only(p, kp); fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp, 0); fill_kinfo_aggregate(p, kp); From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5B4A536355; Tue, 9 Feb 2021 08:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbps6Q2Sz4gMP; Tue, 9 Feb 2021 08:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CE5276D0; Tue, 9 Feb 2021 08:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198aqiU013903; Tue, 9 Feb 2021 08:36:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198aqM0013902; Tue, 9 Feb 2021 08:36:52 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:52 GMT Message-Id: <202102090836.1198aqM0013902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ae19883a1695 - stable/12 - Implement malloc_domainset_aligned(9). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ae19883a16950043127aae0b65cf66be37bbc8b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:55 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ae19883a16950043127aae0b65cf66be37bbc8b9 commit ae19883a16950043127aae0b65cf66be37bbc8b9 Author: Konstantin Belousov AuthorDate: 2021-01-14 03:59:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:35:56 +0000 Implement malloc_domainset_aligned(9). Tested by: pho (cherry picked from commit 3b15beb30b3b4ba17bae3d1d43c8c04ff862bb57) (cherry picked from commit 0781c79d4872a84a8ebeee3b5eb5520a682b8e7b) (cherry picked from commit 1ac7c34486ab9177c2472278739568d4607e1acc) --- sys/kern/kern_malloc.c | 39 +++++++++++++++++++++++++++++++++++++-- sys/sys/malloc.h | 3 +++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 506da31ab12f..5e8af96cb1eb 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -658,6 +658,37 @@ malloc_domainset(size_t size, struct malloc_type *mtp, struct domainset *ds, return (ret); } +void * +malloc_domainset_aligned(size_t size, size_t align, + struct malloc_type *mtp, struct domainset *ds, int flags) +{ + void *res; + size_t asize; + + KASSERT(align != 0 && powerof2(align), + ("malloc_domainset_aligned: wrong align %#zx size %#zx", + align, size)); + KASSERT(align <= PAGE_SIZE, + ("malloc_domainset_aligned: align %#zx (size %#zx) too large", + align, size)); + + /* + * Round the allocation size up to the next power of 2, + * because we can only guarantee alignment for + * power-of-2-sized allocations. Further increase the + * allocation size to align if the rounded size is less than + * align, since malloc zones provide alignment equal to their + * size. + */ + asize = size <= align ? align : 1UL << flsl(size - 1); + + res = malloc_domainset(asize, mtp, ds, flags); + KASSERT(res == NULL || ((uintptr_t)res & (align - 1)) == 0, + ("malloc_domainset_aligned: result not aligned %p size %#zx " + "allocsize %#zx align %#zx", res, size, asize, align)); + return (res); +} + void * mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) { @@ -1024,8 +1055,12 @@ mallocinit(void *dummy) for (i = 0, indx = 0; kmemzones[indx].kz_size != 0; indx++) { int size = kmemzones[indx].kz_size; char *name = kmemzones[indx].kz_name; + size_t align; int subzone; + align = UMA_ALIGN_PTR; + if (powerof2(size) && size > sizeof(void *)) + align = MIN(size, PAGE_SIZE) - 1; for (subzone = 0; subzone < numzones; subzone++) { kmemzones[indx].kz_zone[subzone] = uma_zcreate(name, size, @@ -1034,8 +1069,8 @@ mallocinit(void *dummy) #else NULL, NULL, NULL, NULL, #endif - UMA_ALIGN_PTR, UMA_ZONE_MALLOC); - } + align, UMA_ZONE_MALLOC); + } for (;i <= size; i+= KMEM_ZBASE) kmemsize[i >> KMEM_ZSHIFT] = indx; diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index ffbdc4befd11..fd50dbc495b4 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -249,6 +249,9 @@ void *realloc(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); +void *malloc_domainset_aligned(size_t size, size_t align, + struct malloc_type *mtp, struct domainset *ds, int flags) + __malloc_like __result_use_check __alloc_size(1); struct malloc_type *malloc_desc2type(const char *desc); From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C20E535E79; Tue, 9 Feb 2021 08:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpr30Ngz4g5M; Tue, 9 Feb 2021 08:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3CFE2727F; Tue, 9 Feb 2021 08:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198apif013881; Tue, 9 Feb 2021 08:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198apeJ013880; Tue, 9 Feb 2021 08:36:51 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:51 GMT Message-Id: <202102090836.1198apeJ013880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 328a4f451f14 - stable/12 - jobc: rework detection of orphaned groups. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 328a4f451f14fb4d830c74c12445a4a80ee61b4c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:55 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=328a4f451f14fb4d830c74c12445a4a80ee61b4c commit 328a4f451f14fb4d830c74c12445a4a80ee61b4c Author: Konstantin Belousov AuthorDate: 2020-12-29 00:41:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:35:50 +0000 jobc: rework detection of orphaned groups. Tested by: pho For MFC, pg_jobc member is left in struct pgrp, but it is unused now. (cherry picked from commit 5844bd058aed6f3d0c8cbbddd6aa95993ece0189) --- lib/libkvm/kvm_proc.c | 2 +- sys/kern/kern_proc.c | 209 ++++++++++++++------------------------------------ sys/kern/kern_sig.c | 6 +- sys/kern/tty.c | 8 +- sys/sys/proc.h | 3 + 5 files changed, 68 insertions(+), 160 deletions(-) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index c97a347decd7..d13aa762652b 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -272,7 +272,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p, return (-1); } kp->ki_pgid = pgrp.pg_id; - kp->ki_jobc = pgrp.pg_jobc; + kp->ki_jobc = -1; /* Or calculate? Arguably not. */ if (KREAD(kd, (u_long)pgrp.pg_session, &sess)) { _kvm_err(kd, kd->program, "can't read session at %p", pgrp.pg_session); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 9798abe96708..5b7a663f0d62 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -107,14 +107,12 @@ MALLOC_DEFINE(M_SESSION, "session", "session header"); static MALLOC_DEFINE(M_PROC, "proc", "Proc structures"); MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures"); -static void fixjobc_enterpgrp(struct proc *p, struct pgrp *pgrp); static void doenterpgrp(struct proc *, struct pgrp *); static void orphanpg(struct pgrp *pg); static void fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread); -static void pgadjustjobc(struct pgrp *pgrp, bool entering); static void pgdelete(struct pgrp *); static int pgrp_init(void *mem, int size, int flags); static int proc_ctor(void *mem, int size, void *arg, int flags); @@ -516,13 +514,13 @@ enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess) } pgrp->pg_id = pgid; LIST_INIT(&pgrp->pg_members); + pgrp->pg_flags = 0; /* * As we have an exclusive lock of proctree_lock, * this should not deadlock. */ LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash); - pgrp->pg_jobc = 0; SLIST_INIT(&pgrp->pg_sigiolst); PGRP_UNLOCK(pgrp); @@ -562,6 +560,7 @@ static bool isjobproc(struct proc *q, struct pgrp *pgrp) { sx_assert(&proctree_lock, SX_LOCKED); + return (q->p_pgrp != pgrp && q->p_pgrp->pg_session == pgrp->pg_session); } @@ -571,7 +570,7 @@ jobc_reaper(struct proc *p) { struct proc *pp; - sx_assert(&proctree_lock, SX_LOCKED); + sx_assert(&proctree_lock, SA_LOCKED); for (pp = p;;) { pp = pp->p_reaper; @@ -582,43 +581,40 @@ jobc_reaper(struct proc *p) } static struct proc * -jobc_parent(struct proc *p) +jobc_parent(struct proc *p, struct proc *p_exiting) { struct proc *pp; - sx_assert(&proctree_lock, SX_LOCKED); + sx_assert(&proctree_lock, SA_LOCKED); pp = proc_realparent(p); - if (pp->p_pptr == NULL || + if (pp->p_pptr == NULL || pp == p_exiting || (pp->p_treeflag & P_TREE_GRPEXITED) == 0) return (pp); return (jobc_reaper(pp)); } -#ifdef INVARIANTS -static void -check_pgrp_jobc(struct pgrp *pgrp) +static int +pgrp_calc_jobc(struct pgrp *pgrp) { struct proc *q; int cnt; - sx_assert(&proctree_lock, SX_LOCKED); - PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED); +#ifdef INVARIANTS + if (!mtx_owned(&pgrp->pg_mtx)) + sx_assert(&proctree_lock, SA_LOCKED); +#endif cnt = 0; - PGRP_LOCK(pgrp); LIST_FOREACH(q, &pgrp->pg_members, p_pglist) { if ((q->p_treeflag & P_TREE_GRPEXITED) != 0 || q->p_pptr == NULL) continue; - if (isjobproc(jobc_parent(q), pgrp)) + if (isjobproc(jobc_parent(q, NULL), pgrp)) cnt++; } - KASSERT(pgrp->pg_jobc == cnt, ("pgrp %d %p pg_jobc %d cnt %d", - pgrp->pg_id, pgrp, pgrp->pg_jobc, cnt)); - PGRP_UNLOCK(pgrp); + return (cnt); } -#endif /* * Move p to a process group @@ -627,6 +623,7 @@ static void doenterpgrp(struct proc *p, struct pgrp *pgrp) { struct pgrp *savepgrp; + struct proc *pp; sx_assert(&proctree_lock, SX_XLOCKED); PROC_LOCK_ASSERT(p, MA_NOTOWNED); @@ -635,24 +632,19 @@ doenterpgrp(struct proc *p, struct pgrp *pgrp) SESS_LOCK_ASSERT(p->p_session, MA_NOTOWNED); savepgrp = p->p_pgrp; - -#ifdef INVARIANTS - check_pgrp_jobc(pgrp); - check_pgrp_jobc(savepgrp); -#endif - - /* - * Adjust eligibility of affected pgrps to participate in job control. - */ - fixjobc_enterpgrp(p, pgrp); + pp = jobc_parent(p, NULL); PGRP_LOCK(pgrp); PGRP_LOCK(savepgrp); + if (isjobproc(pp, savepgrp) && pgrp_calc_jobc(savepgrp) == 1) + orphanpg(savepgrp); PROC_LOCK(p); LIST_REMOVE(p, p_pglist); p->p_pgrp = pgrp; PROC_UNLOCK(p); LIST_INSERT_HEAD(&pgrp->pg_members, p, p_pglist); + if (isjobproc(pp, pgrp)) + pgrp->pg_flags &= ~PGRP_ORPHANED; PGRP_UNLOCK(savepgrp); PGRP_UNLOCK(pgrp); if (LIST_EMPTY(&savepgrp->pg_members)) @@ -716,102 +708,6 @@ pgdelete(struct pgrp *pgrp) sess_release(savesess); } -static void -pgadjustjobc(struct pgrp *pgrp, bool entering) -{ - - PGRP_LOCK(pgrp); - if (entering) { - MPASS(pgrp->pg_jobc >= 0); - pgrp->pg_jobc++; - } else { - MPASS(pgrp->pg_jobc > 0); - --pgrp->pg_jobc; - if (pgrp->pg_jobc == 0) - orphanpg(pgrp); - } - PGRP_UNLOCK(pgrp); -} - -static void -fixjobc_enterpgrp_q(struct pgrp *pgrp, struct proc *p, struct proc *q, bool adj) -{ - struct pgrp *childpgrp; - bool future_jobc; - - sx_assert(&proctree_lock, SX_LOCKED); - - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) - return; - childpgrp = q->p_pgrp; - future_jobc = childpgrp != pgrp && - childpgrp->pg_session == pgrp->pg_session; - - if ((adj && !isjobproc(p, childpgrp) && future_jobc) || - (!adj && isjobproc(p, childpgrp) && !future_jobc)) - pgadjustjobc(childpgrp, adj); -} - -/* - * Adjust pgrp jobc counters when specified process changes process group. - * We count the number of processes in each process group that "qualify" - * the group for terminal job control (those with a parent in a different - * process group of the same session). If that count reaches zero, the - * process group becomes orphaned. Check both the specified process' - * process group and that of its children. - * We increment eligibility counts before decrementing, otherwise we - * could reach 0 spuriously during the decrement. - */ -static void -fixjobc_enterpgrp(struct proc *p, struct pgrp *pgrp) -{ - struct proc *q; - - sx_assert(&proctree_lock, SX_LOCKED); - PROC_LOCK_ASSERT(p, MA_NOTOWNED); - PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED); - SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED); - - if (p->p_pgrp == pgrp) - return; - - if (isjobproc(jobc_parent(p), pgrp)) - pgadjustjobc(pgrp, true); - LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_ORPHANED) != 0) - continue; - fixjobc_enterpgrp_q(pgrp, p, q, true); - } - LIST_FOREACH(q, &p->p_orphans, p_orphan) - fixjobc_enterpgrp_q(pgrp, p, q, true); - - if (isjobproc(jobc_parent(p), p->p_pgrp)) - pgadjustjobc(p->p_pgrp, false); - LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_ORPHANED) != 0) - continue; - fixjobc_enterpgrp_q(pgrp, p, q, false); - } - LIST_FOREACH(q, &p->p_orphans, p_orphan) - fixjobc_enterpgrp_q(pgrp, p, q, false); -} - -static void -fixjobc_kill_q(struct proc *p, struct proc *q, bool adj) -{ - struct pgrp *childpgrp; - - sx_assert(&proctree_lock, SX_LOCKED); - - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) - return; - childpgrp = q->p_pgrp; - - if ((adj && isjobproc(jobc_reaper(q), childpgrp) && - !isjobproc(p, childpgrp)) || (!adj && !isjobproc(jobc_reaper(q), - childpgrp) && isjobproc(p, childpgrp))) - pgadjustjobc(childpgrp, adj); -} static void fixjobc_kill(struct proc *p) @@ -824,9 +720,6 @@ fixjobc_kill(struct proc *p) pgrp = p->p_pgrp; PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED); SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED); -#ifdef INVARIANTS - check_pgrp_jobc(pgrp); -#endif /* * p no longer affects process group orphanage for children. @@ -837,35 +730,46 @@ fixjobc_kill(struct proc *p) p->p_treeflag |= P_TREE_GRPEXITED; /* - * Check p's parent to see whether p qualifies its own process - * group; if so, adjust count for p's process group. + * Check if exiting p orphans its own group. */ - if (isjobproc(jobc_parent(p), pgrp)) - pgadjustjobc(pgrp, false); + pgrp = p->p_pgrp; + if (isjobproc(jobc_parent(p, NULL), pgrp)) { + PGRP_LOCK(pgrp); + if (pgrp_calc_jobc(pgrp) == 0) + orphanpg(pgrp); + PGRP_UNLOCK(pgrp); + } /* * Check this process' children to see whether they qualify - * their process groups after reparenting to reaper. If so, - * adjust counts for children's process groups. + * their process groups after reparenting to reaper. */ LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_ORPHANED) != 0) - continue; - fixjobc_kill_q(p, q, true); + pgrp = q->p_pgrp; + PGRP_LOCK(pgrp); + if (pgrp_calc_jobc(pgrp) == 0) { + /* + * We want to handle exactly the children that + * has p as realparent. Then, when calculating + * jobc_parent for children, we should ignore + * P_TREE_GRPEXITED flag already set on p. + */ + if (jobc_parent(q, p) == p && isjobproc(p, pgrp)) + orphanpg(pgrp); + } else + pgrp->pg_flags &= ~PGRP_ORPHANED; + PGRP_UNLOCK(pgrp); } - LIST_FOREACH(q, &p->p_orphans, p_orphan) - fixjobc_kill_q(p, q, true); - LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_ORPHANED) != 0) - continue; - fixjobc_kill_q(p, q, false); + LIST_FOREACH(q, &p->p_orphans, p_orphan) { + pgrp = q->p_pgrp; + PGRP_LOCK(pgrp); + if (pgrp_calc_jobc(pgrp) == 0) { + if (isjobproc(p, pgrp)) + orphanpg(pgrp); + } else + pgrp->pg_flags &= ~PGRP_ORPHANED; + PGRP_UNLOCK(pgrp); } - LIST_FOREACH(q, &p->p_orphans, p_orphan) - fixjobc_kill_q(p, q, false); - -#ifdef INVARIANTS - check_pgrp_jobc(pgrp); -#endif } void @@ -929,8 +833,8 @@ killjobc(void) } /* - * A process group has become orphaned; - * if there are any stopped processes in the group, + * A process group has become orphaned, mark it as such for signal + * delivery code. If there are any stopped processes in the group, * hang-up all process in that group. */ static void @@ -940,6 +844,8 @@ orphanpg(struct pgrp *pg) PGRP_LOCK_ASSERT(pg, MA_OWNED); + pg->pg_flags |= PGRP_ORPHANED; + LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); if (P_SHOULDSTOP(p) == P_STOPPED_SIG) { @@ -1172,7 +1078,7 @@ fill_kinfo_proc_pgrp(struct proc *p, struct kinfo_proc *kp) return; kp->ki_pgid = pgrp->pg_id; - kp->ki_jobc = pgrp->pg_jobc; + kp->ki_jobc = pgrp_calc_jobc(pgrp); sp = pgrp->pg_session; tp = NULL; @@ -1320,7 +1226,6 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread) void fill_kinfo_proc(struct proc *p, struct kinfo_proc *kp) { - MPASS(FIRST_THREAD_IN_PROC(p) != NULL); bzero(kp, sizeof(*kp)); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 9fbb6d86457a..07102f6de5a5 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2209,7 +2209,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) * and don't clear any pending SIGCONT. */ if ((prop & SIGPROP_TTYSTOP) != 0 && - p->p_pgrp->pg_jobc == 0 && + (p->p_pgrp->pg_flags & PGRP_ORPHANED) != 0 && action == SIG_DFL) { if (ksi && (ksi->ksi_flags & KSI_INS)) ksiginfo_tryfree(ksi); @@ -2952,8 +2952,8 @@ issignal(struct thread *td) if (prop & SIGPROP_STOP) { mtx_unlock(&ps->ps_mtx); if ((p->p_flag & (P_TRACED | P_WEXIT | - P_SINGLE_EXIT)) != 0 || - (p->p_pgrp->pg_jobc == 0 && + P_SINGLE_EXIT)) != 0 || ((p->p_pgrp-> + pg_flags & PGRP_ORPHANED) != 0 && (prop & SIGPROP_TTYSTOP) != 0)) { mtx_lock(&ps->ps_mtx); break; /* == ignore */ diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 693032908b3a..eea5d1b26ddd 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -461,7 +461,8 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) return (sig == SIGTTOU ? 0 : EIO); } - if ((p->p_flag & P_PPWAIT) != 0 || pg->pg_jobc == 0) { + if ((p->p_flag & P_PPWAIT) != 0 || + (pg->pg_flags & PGRP_ORPHANED) != 0) { /* Don't allow the action to happen. */ PROC_UNLOCK(p); PGRP_UNLOCK(pg); @@ -2380,9 +2381,8 @@ DB_SHOW_COMMAND(tty, db_show_tty) _db_show_hooks("\t", tp->t_hook); /* Process info. */ - db_printf("\tpgrp: %p gid %d jobc %d\n", tp->t_pgrp, - tp->t_pgrp ? tp->t_pgrp->pg_id : 0, - tp->t_pgrp ? tp->t_pgrp->pg_jobc : 0); + db_printf("\tpgrp: %p gid %d\n", tp->t_pgrp, + tp->t_pgrp ? tp->t_pgrp->pg_id : 0); db_printf("\tsession: %p", tp->t_session); if (tp->t_session != NULL) db_printf(" count %u leader %p tty %p sid %d login %s", diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 9784d26a1215..005be45435d0 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -110,8 +110,11 @@ struct pgrp { pid_t pg_id; /* (c) Process group id. */ int pg_jobc; /* (m) Job control process count. */ struct mtx pg_mtx; /* Mutex to protect members */ + int pg_flags; /* (m) PGRP_ flags */ }; +#define PGRP_ORPHANED 0x00000001 /* Group is orphaned */ + /* * pargs, used to hold a copy of the command line, if it had a sane length. */ From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3212E536254; Tue, 9 Feb 2021 08:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpv2cwWz4gPr; Tue, 9 Feb 2021 08:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A41327664; Tue, 9 Feb 2021 08:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198arJm013922; Tue, 9 Feb 2021 08:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198ar00013921; Tue, 9 Feb 2021 08:36:53 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:53 GMT Message-Id: <202102090836.1198ar00013921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ef12434ebf65 - stable/12 - x86 busdma_bounce: use malloc_domainset_aligned(9). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ef12434ebf656923061761fda775e0e90383c99a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:59 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ef12434ebf656923061761fda775e0e90383c99a commit ef12434ebf656923061761fda775e0e90383c99a Author: Konstantin Belousov AuthorDate: 2021-01-14 04:02:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:02 +0000 x86 busdma_bounce: use malloc_domainset_aligned(9). Tested by: pho (cherry picked from commit f3ea417f96b011a7eb4f43e3142e572833287ef4) --- sys/x86/x86/busdma_bounce.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index 43cf37230d72..d25f29ff8e38 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -435,9 +435,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, /* * Allocate the buffer from the malloc(9) allocator if... - * - It's small enough to fit into a single power of two sized bucket. - * - The alignment is less than or equal to the maximum size + * - It's small enough to fit into a single page. * - The low address requirement is fulfilled. + * - Default cache attributes are requested (WB). * else allocate non-contiguous pages if... * - The page count that could get allocated doesn't exceed * nsegments also when the maximum segment size is less @@ -447,19 +447,19 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, * else allocate a block of contiguous pages because one or more of the * constraints is something that only the contig allocator can fulfill. * - * NOTE: The (dmat->common.alignment <= dmat->maxsize) check - * below is just a quick hack. The exact alignment guarantees - * of malloc(9) need to be nailed down, and the code below - * should be rewritten to take that into account. - * - * In the meantime warn the user if malloc gets it wrong. + * Warn the user if malloc gets it wrong. */ if (dmat->common.maxsize <= PAGE_SIZE && - dmat->common.alignment <= dmat->common.maxsize && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF, + *vaddr = malloc_domainset_aligned(dmat->common.maxsize, + dmat->common.alignment, M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), mflags); + KASSERT(*vaddr == NULL || ((uintptr_t)*vaddr & PAGE_MASK) + + dmat->common.maxsize <= PAGE_SIZE, + ("bounce_bus_dmamem_alloc: multi-page alloc %p maxsize " + "%#jx align %#jx", *vaddr, (uintmax_t)dmat->common.maxsize, + (uintmax_t)dmat->common.alignment)); } else if (dmat->common.nsegments >= howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1B7B536358; Tue, 9 Feb 2021 08:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpw5RmLz4gQ6; Tue, 9 Feb 2021 08:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18C07274F6; Tue, 9 Feb 2021 08:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198at8A013943; Tue, 9 Feb 2021 08:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198athi013942; Tue, 9 Feb 2021 08:36:55 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:55 GMT Message-Id: <202102090836.1198athi013942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a7158b84dfaa - stable/12 - Add ddb 'show timecounter' command. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a7158b84dfaa3adadb939e12b6760de73ad0d003 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:36:57 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7158b84dfaa3adadb939e12b6760de73ad0d003 commit a7158b84dfaa3adadb939e12b6760de73ad0d003 Author: Konstantin Belousov AuthorDate: 2021-01-18 07:25:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:08 +0000 Add ddb 'show timecounter' command. (cherry picked from commit 36bcc44e2c578dd016940c9c5068c348e1d77f99) --- sys/kern/kern_tc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 745c5e2fc485..f916cbc75ac8 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -2165,3 +2165,33 @@ tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) return (enabled); } #endif + +#include "opt_ddb.h" +#ifdef DDB +#include + +DB_SHOW_COMMAND(timecounter, db_show_timecounter) +{ + struct timehands *th; + struct timecounter *tc; + u_int val1, val2; + + th = timehands; + tc = th->th_counter; + val1 = tc->tc_get_timecount(tc); + __compiler_membar(); + val2 = tc->tc_get_timecount(tc); + + db_printf("timecounter %p %s\n", tc, tc->tc_name); + db_printf(" mask %#x freq %ju qual %d flags %#x priv %p\n", + tc->tc_counter_mask, (uintmax_t)tc->tc_frequency, tc->tc_quality, + tc->tc_flags, tc->tc_priv); + db_printf(" val %#x %#x\n", val1, val2); + db_printf("timehands adj %#jx scale %#jx ldelta %d off_cnt %d gen %d\n", + (uintmax_t)th->th_adjustment, (uintmax_t)th->th_scale, + th->th_large_delta, th->th_offset_count, th->th_generation); + db_printf(" offset %jd %jd boottime %jd %jd\n", + (intmax_t)th->th_offset.sec, (uintmax_t)th->th_offset.frac, + (intmax_t)th->th_boottime.sec, (uintmax_t)th->th_boottime.frac); +} +#endif From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3678353650C; Tue, 9 Feb 2021 08:37:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpy4pJ8z4gMs; Tue, 9 Feb 2021 08:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF722789B; Tue, 9 Feb 2021 08:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198avsB013987; Tue, 9 Feb 2021 08:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198avaj013985; Tue, 9 Feb 2021 08:36:57 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:57 GMT Message-Id: <202102090836.1198avaj013985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d1a6826939fb - stable/12 - x86 vdso gettc: reorganize ifunctions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d1a6826939fb2bb3fef1a8ea0cb3198248e6bfe8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:02 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d1a6826939fb2bb3fef1a8ea0cb3198248e6bfe8 commit d1a6826939fb2bb3fef1a8ea0cb3198248e6bfe8 Author: Konstantin Belousov AuthorDate: 2021-01-05 21:14:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:15 +0000 x86 vdso gettc: reorganize ifunctions. Tested by: pho (cherry picked from commit de898cb96042a026ef703d81aea6cdf1ffce8f32) --- lib/libc/x86/sys/__vdso_gettc.c | 68 ++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c index 0781e97e2ce5..f9365eb33cf2 100644 --- a/lib/libc/x86/sys/__vdso_gettc.c +++ b/lib/libc/x86/sys/__vdso_gettc.c @@ -53,57 +53,83 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static void -rdtsc_mb_lfence(void) +static inline u_int +rdtsc_low(const struct vdso_timehands *th) { + u_int rv; - lfence(); + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); + return (rv); } -static void -rdtsc_mb_mfence(void) +static u_int +rdtsc_low_mb_lfence(const struct vdso_timehands *th) { + lfence(); + return (rdtsc_low(th)); +} +static u_int +rdtsc_low_mb_mfence(const struct vdso_timehands *th) +{ mfence(); + return (rdtsc_low(th)); } -static void -rdtsc_mb_none(void) +static u_int +rdtsc_low_mb_none(const struct vdso_timehands *th) { + return (rdtsc_low(th)); } -DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static) +DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc_low, + (const struct vdso_timehands *th), static) { u_int p[4]; /* Not a typo, string matches our do_cpuid() registers use. */ static const char intel_id[] = "GenuntelineI"; if ((cpu_feature & CPUID_SSE2) == 0) - return (rdtsc_mb_none); + return (rdtsc_low_mb_none); do_cpuid(0, p); return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? - rdtsc_mb_lfence : rdtsc_mb_mfence); + rdtsc_low_mb_lfence : rdtsc_low_mb_mfence); } static u_int -__vdso_gettc_rdtsc_low(const struct vdso_timehands *th) +rdtsc32_mb_lfence(void) { - u_int rv; - - rdtsc_mb(); - __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); - return (rv); + lfence(); + return (rdtsc32()); } static u_int -__vdso_rdtsc32(void) +rdtsc32_mb_mfence(void) { + mfence(); + return (rdtsc32()); +} - rdtsc_mb(); +static u_int +rdtsc32_mb_none(void) +{ return (rdtsc32()); } +DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc32, (void), static) +{ + u_int p[4]; + /* Not a typo, string matches our do_cpuid() registers use. */ + static const char intel_id[] = "GenuntelineI"; + + if ((cpu_feature & CPUID_SSE2) == 0) + return (rdtsc32_mb_none); + do_cpuid(0, p); + return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? + rdtsc32_mb_lfence : rdtsc32_mb_mfence); +} + #define HPET_DEV_MAP_MAX 10 static volatile char *hpet_dev_map[HPET_DEV_MAP_MAX]; @@ -199,7 +225,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc *tsc_ref, u_int *tc) scale = tsc_ref->tsc_scale; ofs = tsc_ref->tsc_ofs; - rdtsc_mb(); + mfence(); /* XXXKIB */ tsc = rdtsc(); /* ret = ((tsc * scale) >> 64) + ofs */ @@ -231,7 +257,7 @@ __vdso_gettc(const struct vdso_timehands *th, u_int *tc) switch (th->th_algo) { case VDSO_TH_ALGO_X86_TSC: *tc = th->th_x86_shift > 0 ? __vdso_gettc_rdtsc_low(th) : - __vdso_rdtsc32(); + __vdso_gettc_rdtsc32(); return (0); case VDSO_TH_ALGO_X86_HPET: idx = th->th_x86_hpet_idx; From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:36:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF00F535EFD; Tue, 9 Feb 2021 08:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpx6sltz4gLH; Tue, 9 Feb 2021 08:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C035274F7; Tue, 9 Feb 2021 08:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198auXa013965; Tue, 9 Feb 2021 08:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198auf9013964; Tue, 9 Feb 2021 08:36:56 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:56 GMT Message-Id: <202102090836.1198auf9013964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4ab4f06952ea - stable/12 - tsc: add RDTSCP or faster variants of get_timecount() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4ab4f06952eaee865326e0da7512f49c580d8a32 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:00 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ab4f06952eaee865326e0da7512f49c580d8a32 commit 4ab4f06952eaee865326e0da7512f49c580d8a32 Author: Konstantin Belousov AuthorDate: 2021-01-05 21:00:14 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:08 +0000 tsc: add RDTSCP or faster variants of get_timecount() Tested by: pho (cherry picked from commit 9e680e4005b77e3028d28377ee3722a5260f4422) (cherry picked from commit a013e285dfd6b89b1908ca13febb0fdb0a7f3b1f) (cherry picked from commit 9f47eeffa3cfdcb512e2011fb00fc23c7c1a7d75) --- sys/x86/x86/tsc.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index cb1ba0758db9..f14e0707651c 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -96,6 +96,8 @@ static u_int tsc_get_timecount_lfence(struct timecounter *tc); static u_int tsc_get_timecount_low_lfence(struct timecounter *tc); static u_int tsc_get_timecount_mfence(struct timecounter *tc); static u_int tsc_get_timecount_low_mfence(struct timecounter *tc); +static u_int tscp_get_timecount(struct timecounter *tc); +static u_int tscp_get_timecount_low(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); static uint32_t x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc); @@ -632,7 +634,18 @@ init_TSC_tc(void) init: for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++) ; - if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) { + + /* + * Timecounter implementation selection, top to bottom: + * - If RDTSCP is available, use RDTSCP. + * - If fence instructions are provided (SSE2), use LFENCE;RDTSC + * on Intel, and MFENCE;RDTSC on AMD. + * - For really old CPUs, just use RDTSC. + */ + if ((amd_feature & AMDID_RDTSCP) != 0) { + tsc_timecounter.tc_get_timecount = shift > 0 ? + tscp_get_timecount_low : tscp_get_timecount; + } else if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) { if (cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_HYGON) { tsc_timecounter.tc_get_timecount = shift > 0 ? @@ -785,6 +798,13 @@ tsc_get_timecount(struct timecounter *tc __unused) return (rdtsc32()); } +static u_int +tscp_get_timecount(struct timecounter *tc __unused) +{ + + return (rdtscp32()); +} + static inline u_int tsc_get_timecount_low(struct timecounter *tc) { @@ -795,6 +815,16 @@ tsc_get_timecount_low(struct timecounter *tc) return (rv); } +static u_int +tscp_get_timecount_low(struct timecounter *tc) +{ + uint32_t rv; + + __asm __volatile("rdtscp; movl %1, %%ecx; shrd %%cl, %%edx, %0" + : "=&a" (rv) : "m" (tc->tc_priv) : "ecx", "edx"); + return (rv); +} + static u_int tsc_get_timecount_lfence(struct timecounter *tc __unused) { From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8688E536507; Tue, 9 Feb 2021 08:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbpz1Tycz4gLK; Tue, 9 Feb 2021 08:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CF13276D1; Tue, 9 Feb 2021 08:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198awIc014005; Tue, 9 Feb 2021 08:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198awAV014004; Tue, 9 Feb 2021 08:36:58 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:58 GMT Message-Id: <202102090836.1198awAV014004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d4cd9db346bc - stable/12 - x86 vdso gettc: eliminate duplicated code in ifunc selectors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d4cd9db346bc6382b90d585d1aa6b86eda66b7a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:01 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4cd9db346bc6382b90d585d1aa6b86eda66b7a3 commit d4cd9db346bc6382b90d585d1aa6b86eda66b7a3 Author: Konstantin Belousov AuthorDate: 2021-01-06 15:00:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:20 +0000 x86 vdso gettc: eliminate duplicated code in ifunc selectors. Tested by: pho (cherry picked from commit 5bf4bafd13a4044b7c3d2e8246684a597c6f2134) --- lib/libc/x86/sys/__vdso_gettc.c | 87 ++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 22 deletions(-) diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c index f9365eb33cf2..c3ace1685561 100644 --- a/lib/libc/x86/sys/__vdso_gettc.c +++ b/lib/libc/x86/sys/__vdso_gettc.c @@ -83,20 +83,6 @@ rdtsc_low_mb_none(const struct vdso_timehands *th) return (rdtsc_low(th)); } -DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc_low, - (const struct vdso_timehands *th), static) -{ - u_int p[4]; - /* Not a typo, string matches our do_cpuid() registers use. */ - static const char intel_id[] = "GenuntelineI"; - - if ((cpu_feature & CPUID_SSE2) == 0) - return (rdtsc_low_mb_none); - do_cpuid(0, p); - return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? - rdtsc_low_mb_lfence : rdtsc_low_mb_mfence); -} - static u_int rdtsc32_mb_lfence(void) { @@ -117,17 +103,74 @@ rdtsc32_mb_none(void) return (rdtsc32()); } -DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc32, (void), static) +struct tsc_selector_tag { + u_int (*ts_rdtsc32)(void); + u_int (*ts_rdtsc_low)(const struct vdso_timehands *); +}; + +static const struct tsc_selector_tag tsc_selector[] = { + [0] = { /* Intel or AMD Zen+, LFENCE */ + .ts_rdtsc32 = rdtsc32_mb_lfence, + .ts_rdtsc_low = rdtsc_low_mb_lfence, + }, + [1] = { /* AMD, MFENCE */ + .ts_rdtsc32 = rdtsc32_mb_mfence, + .ts_rdtsc_low = rdtsc_low_mb_mfence, + }, + [2] = { /* No SSE2 */ + .ts_rdtsc32 = rdtsc32_mb_none, + .ts_rdtsc_low = rdtsc_low_mb_none, + }, +}; + +static int +tsc_selector_idx(u_int cpu_feature) { - u_int p[4]; - /* Not a typo, string matches our do_cpuid() registers use. */ - static const char intel_id[] = "GenuntelineI"; + u_int amd_feature, cpu_exthigh, cpu_id, p[4], v[3]; + static const char amd_id[] = "AuthenticAMD"; + static const char hygon_id[] = "HygonGenuine"; + bool amd_cpu; + + if (cpu_feature == 0) + return (2); /* should not happen due to RDTSC */ - if ((cpu_feature & CPUID_SSE2) == 0) - return (rdtsc32_mb_none); do_cpuid(0, p); - return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? - rdtsc32_mb_lfence : rdtsc32_mb_mfence); + v[0] = p[1]; + v[1] = p[3]; + v[2] = p[2]; + amd_cpu = memcmp(v, amd_id, sizeof(amd_id) - 1) == 0 || + memcmp(v, hygon_id, sizeof(hygon_id) - 1) == 0; + + do_cpuid(1, p); + cpu_id = p[0]; + + if (cpu_feature != 0) { + do_cpuid(0x80000000, p); + cpu_exthigh = p[0]; + } else { + cpu_exthigh = 0; + } + if (cpu_exthigh >= 0x80000001) { + do_cpuid(0x80000001, p); + amd_feature = p[3]; + } else { + amd_feature = 0; + } + + if ((cpu_feature & CPUID_SSE2) == 0) + return (2); + return (amd_cpu ? 1 : 0); +} + +DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc_low, + (const struct vdso_timehands *th), static) +{ + return (tsc_selector[tsc_selector_idx(cpu_feature)].ts_rdtsc_low); +} + +DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc32, (void), static) +{ + return (tsc_selector[tsc_selector_idx(cpu_feature)].ts_rdtsc32); } #define HPET_DEV_MAP_MAX 10 From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DC9E535F75; Tue, 9 Feb 2021 08:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq334ldz4gNB; Tue, 9 Feb 2021 08:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0863274F8; Tue, 9 Feb 2021 08:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198axJJ014027; Tue, 9 Feb 2021 08:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198axV2014026; Tue, 9 Feb 2021 08:36:59 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:36:59 GMT Message-Id: <202102090836.1198axV2014026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6494841a80aa - stable/12 - x86 vdso gettc: Add RDTSCP support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6494841a80aa7913ead34ea7f5fdc6be78c9c8d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:03 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6494841a80aa7913ead34ea7f5fdc6be78c9c8d6 commit 6494841a80aa7913ead34ea7f5fdc6be78c9c8d6 Author: Konstantin Belousov AuthorDate: 2021-01-06 15:05:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:25 +0000 x86 vdso gettc: Add RDTSCP support Tested by: pho (cherry picked from commit cd240c9cf100bec3def38ceb4a320611b1d02693) (cherry picked from commit 523d94dbeab5ccb1cce21b8cad350b700c3d01b2) --- lib/libc/x86/sys/__vdso_gettc.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c index c3ace1685561..1f3e8133040f 100644 --- a/lib/libc/x86/sys/__vdso_gettc.c +++ b/lib/libc/x86/sys/__vdso_gettc.c @@ -63,6 +63,16 @@ rdtsc_low(const struct vdso_timehands *th) return (rv); } +static inline u_int +rdtscp_low(const struct vdso_timehands *th) +{ + u_int rv; + + __asm __volatile("rdtscp; movl %%edi,%%ecx; shrd %%cl, %%edx, %0" + : "=a" (rv) : "D" (th->th_x86_shift) : "ecx", "edx"); + return (rv); +} + static u_int rdtsc_low_mb_lfence(const struct vdso_timehands *th) { @@ -103,13 +113,19 @@ rdtsc32_mb_none(void) return (rdtsc32()); } +static u_int +rdtscp32_(void) +{ + return (rdtscp32()); +} + struct tsc_selector_tag { u_int (*ts_rdtsc32)(void); u_int (*ts_rdtsc_low)(const struct vdso_timehands *); }; static const struct tsc_selector_tag tsc_selector[] = { - [0] = { /* Intel or AMD Zen+, LFENCE */ + [0] = { /* Intel, LFENCE */ .ts_rdtsc32 = rdtsc32_mb_lfence, .ts_rdtsc_low = rdtsc_low_mb_lfence, }, @@ -121,6 +137,10 @@ static const struct tsc_selector_tag tsc_selector[] = { .ts_rdtsc32 = rdtsc32_mb_none, .ts_rdtsc_low = rdtsc_low_mb_none, }, + [3] = { /* RDTSCP */ + .ts_rdtsc32 = rdtscp32_, + .ts_rdtsc_low = rdtscp_low, + }, }; static int @@ -157,6 +177,8 @@ tsc_selector_idx(u_int cpu_feature) amd_feature = 0; } + if ((amd_feature & AMDID_RDTSCP) != 0) + return (3); if ((cpu_feature & CPUID_SSE2) == 0) return (2); return (amd_cpu ? 1 : 0); From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C70AF536258; Tue, 9 Feb 2021 08:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq50RFtz4gQh; Tue, 9 Feb 2021 08:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF76274F9; Tue, 9 Feb 2021 08:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b0va014049; Tue, 9 Feb 2021 08:37:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b0cD014048; Tue, 9 Feb 2021 08:37:00 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:00 GMT Message-Id: <202102090837.1198b0cD014048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 068f6966c9dd - stable/12 - elf: add some definitions for i386 and amd64 relocations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 068f6966c9ddff46d048a1be346fbafce856c3f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:06 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=068f6966c9ddff46d048a1be346fbafce856c3f9 commit 068f6966c9ddff46d048a1be346fbafce856c3f9 Author: Konstantin Belousov AuthorDate: 2021-01-17 07:03:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 elf: add some definitions for i386 and amd64 relocations (cherry picked from commit f7d181543fd96a89b84878ddb2d5ac010fadd9b8) --- sys/sys/elf_common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index c469557a96e1..ed5352ba53a2 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -946,12 +946,17 @@ typedef struct { #define R_386_RELATIVE 8 /* Add load address of shared object. */ #define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ #define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ +#define R_386_32PLT 11 #define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ #define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ #define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ #define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ #define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ #define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_16 20 +#define R_386_PC16 21 +#define R_386_8 22 +#define R_386_PC8 23 #define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ #define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ #define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ @@ -966,7 +971,12 @@ typedef struct { #define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ #define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ #define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ +#define R_386_SIZE32 38 +#define R_386_TLS_GOTDESC 39 +#define R_386_TLS_DESC_CALL 40 +#define R_386_TLS_DESC 41 #define R_386_IRELATIVE 42 /* PLT entry resolved indirectly at runtime */ +#define R_386_GOT32X 43 #define R_AARCH64_NONE 0 /* No relocation */ #define R_AARCH64_ABS64 257 /* Absolute offset */ @@ -1427,6 +1437,10 @@ typedef struct { #define R_X86_64_TLSDESC_CALL 35 #define R_X86_64_TLSDESC 36 #define R_X86_64_IRELATIVE 37 +#define R_X86_64_RELATIVE64 38 +/* 39 and 40 were BND-related, already decomissioned */ +#define R_X86_64_GOTPCRELX 41 +#define R_X86_64_REX_GOTPCRELX 42 #endif /* !_SYS_ELF_COMMON_H_ */ From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E10E536511; Tue, 9 Feb 2021 08:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq572L2z4gbL; Tue, 9 Feb 2021 08:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2425276D2; Tue, 9 Feb 2021 08:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b1b9014067; Tue, 9 Feb 2021 08:37:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b1bf014066; Tue, 9 Feb 2021 08:37:01 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:01 GMT Message-Id: <202102090837.1198b1bf014066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e4866b81986f - stable/12 - nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e4866b81986f438b92b7325770bf20d5c10042fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:07 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e4866b81986f438b92b7325770bf20d5c10042fe commit e4866b81986f438b92b7325770bf20d5c10042fe Author: Konstantin Belousov AuthorDate: 2021-01-22 21:47:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write (cherry picked from commit aa8c1f8d84d2638a354e71f9593e978d00878243) (cherry picked from commit bd01a69f4836994b50b492883fb5367db41fb506) --- sys/fs/nfsclient/nfs_clbio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 61442d59dcdd..01595eea414b 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -893,7 +893,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount, noncontig_write, obcount; - int bp_cached, n, on, error = 0, error1, wouldcommit; + int bp_cached, n, on, error = 0, error1, save2, wouldcommit; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -985,6 +985,7 @@ ncl_write(struct vop_write_args *ap) if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); + save2 = curthread_pflags2_set(TDP2_SBPAGES); biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes @@ -1023,7 +1024,7 @@ ncl_write(struct vop_write_args *ap) error = ncl_vinvalbuf(vp, V_SAVE | ((ioflag & IO_VMIO) != 0 ? V_VMIO : 0), td, 1); if (error != 0) - return (error); + goto out; wouldcommit = biosize; } } @@ -1063,6 +1064,7 @@ again: NFSLOCKNODE(np); np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; + np->n_flag &= ~NVNSETSZSKIP; vnode_pager_setsize(vp, np->n_size); NFSUNLOCKNODE(np); @@ -1092,6 +1094,7 @@ again: if (uio->uio_offset + n > np->n_size) { np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; + np->n_flag &= ~NVNSETSZSKIP; vnode_pager_setsize(vp, np->n_size); } NFSUNLOCKNODE(np); @@ -1281,6 +1284,8 @@ again: } } +out: + curthread_pflags2_restore(save2); return (error); } From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D613F536464; Tue, 9 Feb 2021 08:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq76XWxz4gdw; Tue, 9 Feb 2021 08:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 208EC27A17; Tue, 9 Feb 2021 08:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b3OW014089; Tue, 9 Feb 2021 08:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b3a6014088; Tue, 9 Feb 2021 08:37:03 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:03 GMT Message-Id: <202102090837.1198b3a6014088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b70e482319de - stable/12 - WITH_OFED build option: fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b70e482319de88af072a105f2103ca0c82e84572 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:09 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b70e482319de88af072a105f2103ca0c82e84572 commit b70e482319de88af072a105f2103ca0c82e84572 Author: Konstantin Belousov AuthorDate: 2021-02-02 13:01:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 WITH_OFED build option: fix (cherry picked from commit ff975f15d86001d5b948ab538de1e4aca852d2f5) --- sys/conf/kern.opts.mk | 2 +- tools/build/options/WITHOUT_OFED | 4 ++++ tools/build/options/WITH_OFED | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index c63589ec9db0..e4334ce37237 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -41,6 +41,7 @@ __DEFAULT_YES_OPTIONS = \ MODULE_DRM \ MODULE_DRM2 \ NETGRAPH \ + OFED \ PF \ REPRODUCIBLE_BUILD \ SCTP_SUPPORT \ @@ -54,7 +55,6 @@ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ NAND \ - OFED \ RATELIMIT # Some options are totally broken on some architectures. We disable diff --git a/tools/build/options/WITHOUT_OFED b/tools/build/options/WITHOUT_OFED new file mode 100644 index 000000000000..18a6943b3580 --- /dev/null +++ b/tools/build/options/WITHOUT_OFED @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable the build of the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack, including kernel modules and userspace libraries. diff --git a/tools/build/options/WITH_OFED b/tools/build/options/WITH_OFED deleted file mode 100644 index a995fb8cdab8..000000000000 --- a/tools/build/options/WITH_OFED +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to build the -.Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30104536689; Tue, 9 Feb 2021 08:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq85zPpz4ghL; Tue, 9 Feb 2021 08:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DF0727A18; Tue, 9 Feb 2021 08:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b4ZU014111; Tue, 9 Feb 2021 08:37:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b4ZO014110; Tue, 9 Feb 2021 08:37:04 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:04 GMT Message-Id: <202102090837.1198b4ZO014110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bbba426c3a68 - stable/12 - cpucontrol(8): Fix display. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bbba426c3a680c1b66dff3c4f50bc4c8705ceecb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:10 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bbba426c3a680c1b66dff3c4f50bc4c8705ceecb commit bbba426c3a680c1b66dff3c4f50bc4c8705ceecb Author: Konstantin Belousov AuthorDate: 2021-02-05 01:00:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 cpucontrol(8): Fix display. (cherry picked from commit 856789c123d69de86684c5aa1ad8a53427dd47fc) --- usr.sbin/cpucontrol/cpucontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/cpucontrol/cpucontrol.8 b/usr.sbin/cpucontrol/cpucontrol.8 index 4e54bb51bafc..e347d5e49bfe 100644 --- a/usr.sbin/cpucontrol/cpucontrol.8 +++ b/usr.sbin/cpucontrol/cpucontrol.8 @@ -33,8 +33,8 @@ .Xr cpuctl 4 device .Sh SYNOPSIS -.Nm .Bk +.Nm .Op Fl v .Fl m Ar msr .Ar device From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 808F15364A9; Tue, 9 Feb 2021 08:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbqB6WF1z4gNS; Tue, 9 Feb 2021 08:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EEC127A19; Tue, 9 Feb 2021 08:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b6dg014151; Tue, 9 Feb 2021 08:37:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b6sa014150; Tue, 9 Feb 2021 08:37:06 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:06 GMT Message-Id: <202102090837.1198b6sa014150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 560c98ccc897 - stable/12 - rtld: Fix null-pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 560c98ccc8978c6e6426a6ca6d50a88193ccc600 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:12 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=560c98ccc8978c6e6426a6ca6d50a88193ccc600 commit 560c98ccc8978c6e6426a6ca6d50a88193ccc600 Author: David Chisnall AuthorDate: 2021-02-02 14:06:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 rtld: Fix null-pointer dereference (cherry picked from commit 43d44842aef3972cc86ce673e84e31f372257b15) --- libexec/rtld-elf/rtld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 73177fc0c931..791b50e3cd0e 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -877,8 +877,10 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff) target = (Elf_Addr)(defobj->relocbase + def->st_value); dbg("\"%s\" in \"%s\" ==> %p in \"%s\"", - defobj->strtab + def->st_name, basename(obj->path), - (void *)target, basename(defobj->path)); + defobj->strtab + def->st_name, + obj->path == NULL ? NULL : basename(obj->path), + (void *)target, + defobj->path == NULL ? NULL : basename(defobj->path)); /* * Write the new contents for the jmpslot. Note that depending on From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 08:37:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44A4F536519; Tue, 9 Feb 2021 08:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZbq94P62z4gf0; Tue, 9 Feb 2021 08:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A87274FA; Tue, 9 Feb 2021 08:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1198b5dN014133; Tue, 9 Feb 2021 08:37:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1198b5V1014132; Tue, 9 Feb 2021 08:37:05 GMT (envelope-from git) Date: Tue, 9 Feb 2021 08:37:05 GMT Message-Id: <202102090837.1198b5V1014132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0dc48b74478d - stable/12 - amd64 GENERIC: compile in mlx5en(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0dc48b74478d4298cf612e1ce3c196f711533abf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:37:10 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0dc48b74478d4298cf612e1ce3c196f711533abf commit 0dc48b74478d4298cf612e1ce3c196f711533abf Author: Konstantin Belousov AuthorDate: 2021-02-03 12:19:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-09 08:36:31 +0000 amd64 GENERIC: compile in mlx5en(4) (cherry picked from commit 5832a3e398642f721381dc2bdc8e954ae43c17a7) --- sys/amd64/conf/GENERIC | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 371e931c7a1d..1bd3c3762f53 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -109,6 +109,8 @@ device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support +options COMPAT_LINUXKPI + # Floppy drives device fdc @@ -236,6 +238,12 @@ device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support @@ -313,6 +321,7 @@ device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 13:46:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E36A053F0DE; Tue, 9 Feb 2021 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZkgf5lb0z52WZ; Tue, 9 Feb 2021 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B80703CE4; Tue, 9 Feb 2021 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119Dk6nP017188; Tue, 9 Feb 2021 13:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119Dk6I7017187; Tue, 9 Feb 2021 13:46:06 GMT (envelope-from git) Date: Tue, 9 Feb 2021 13:46:06 GMT Message-Id: <202102091346.119Dk6I7017187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 63317e36aae3 - stable/12 - MFC 4cd1807c7d2a67b633dd0c0bfde15091543a2514: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 63317e36aae3f0b5b418ec1937925cf43d9989d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 13:46:06 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=63317e36aae3f0b5b418ec1937925cf43d9989d4 commit 63317e36aae3f0b5b418ec1937925cf43d9989d4 Author: Cy Schubert AuthorDate: 2021-01-26 06:24:28 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 13:45:43 +0000 MFC 4cd1807c7d2a67b633dd0c0bfde15091543a2514: Retire the K&R/STD C __P prototype declarations. In the old days when K&R C and STD C were each in use a workaround (read hack) was required to allow the same code to work on each without modification. All C compilers support STD C. We can finally put the __P prototype to rest. (cherry picked from commit 4cd1807c7d2a67b633dd0c0bfde15091543a2514) --- contrib/ipfilter/bpf_filter.c | 4 +- contrib/ipfilter/ip_dstlist.c | 70 ++--- contrib/ipfilter/ip_dstlist.h | 4 +- contrib/ipfilter/ip_fil.c | 12 +- contrib/ipfilter/ip_fil_compat.c | 122 ++++---- contrib/ipfilter/ip_msnrpc_pxy.c | 12 +- contrib/ipfilter/ipf.h | 340 ++++++++++----------- contrib/ipfilter/iplang/iplang.h | 2 +- contrib/ipfilter/iplang/iplang_l.l | 16 +- contrib/ipfilter/iplang/iplang_y.y | 162 +++++----- contrib/ipfilter/ipmon.h | 14 +- contrib/ipfilter/ipsend/ipresend.c | 4 +- contrib/ipfilter/ipsend/ipsend.c | 8 +- contrib/ipfilter/ipsend/ipsend.h | 52 ++-- contrib/ipfilter/ipsend/iptest.c | 4 +- contrib/ipfilter/ipsend/resend.c | 2 +- contrib/ipfilter/ipsend/sock.c | 4 +- contrib/ipfilter/ipt.h | 6 +- contrib/ipfilter/kmem.h | 6 +- contrib/ipfilter/lib/facpri.h | 8 +- contrib/ipfilter/lib/inet_addr.c | 2 +- contrib/ipfilter/lib/initparse.c | 2 +- contrib/ipfilter/lib/interror.c | 2 +- contrib/ipfilter/lib/ipft_hx.c | 8 +- contrib/ipfilter/lib/ipft_pc.c | 10 +- contrib/ipfilter/lib/ipft_tx.c | 12 +- contrib/ipfilter/lib/kmem.h | 6 +- contrib/ipfilter/lib/printipfexpr.c | 8 +- contrib/ipfilter/lib/save_execute.c | 8 +- contrib/ipfilter/lib/save_file.c | 12 +- contrib/ipfilter/lib/save_nothing.c | 6 +- contrib/ipfilter/lib/save_syslog.c | 8 +- contrib/ipfilter/lib/save_v1trap.c | 20 +- contrib/ipfilter/lib/save_v2trap.c | 24 +- contrib/ipfilter/lib/var.c | 4 +- contrib/ipfilter/man/ipf.4 | 2 +- contrib/ipfilter/md5.c | 2 +- contrib/ipfilter/md5.h | 6 +- contrib/ipfilter/radix_ipf.c | 20 +- contrib/ipfilter/radix_ipf.h | 24 +- contrib/ipfilter/tools/ipf.c | 32 +- contrib/ipfilter/tools/ipf_y.y | 52 ++-- contrib/ipfilter/tools/ipfcomp.c | 38 +-- contrib/ipfilter/tools/ipfs.c | 28 +- contrib/ipfilter/tools/ipfstat.c | 76 ++--- contrib/ipfilter/tools/ipfsyncd.c | 22 +- contrib/ipfilter/tools/ipftest.c | 40 +-- contrib/ipfilter/tools/ipmon.c | 48 +-- contrib/ipfilter/tools/ipmon_y.y | 22 +- contrib/ipfilter/tools/ipnat.c | 24 +- contrib/ipfilter/tools/ipnat_y.y | 38 +-- contrib/ipfilter/tools/ippool.c | 34 +-- contrib/ipfilter/tools/ippool_y.y | 10 +- contrib/ipfilter/tools/ipscan_y.y | 32 +- contrib/ipfilter/tools/ipsyncm.c | 4 +- contrib/ipfilter/tools/ipsyncs.c | 4 +- contrib/ipfilter/tools/lexer.c | 14 +- contrib/ipfilter/tools/lexer.h | 14 +- sys/contrib/ipfilter/netinet/fil.c | 148 +++++----- sys/contrib/ipfilter/netinet/ip_auth.c | 14 +- sys/contrib/ipfilter/netinet/ip_auth.h | 40 +-- sys/contrib/ipfilter/netinet/ip_compat.h | 38 ++- sys/contrib/ipfilter/netinet/ip_dns_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_dstlist.c | 70 ++--- sys/contrib/ipfilter/netinet/ip_dstlist.h | 4 +- sys/contrib/ipfilter/netinet/ip_fil.h | 408 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 6 +- sys/contrib/ipfilter/netinet/ip_frag.c | 28 +- sys/contrib/ipfilter/netinet/ip_frag.h | 54 ++-- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 78 ++--- sys/contrib/ipfilter/netinet/ip_htable.c | 76 ++--- sys/contrib/ipfilter/netinet/ip_htable.h | 6 +- sys/contrib/ipfilter/netinet/ip_ipsec_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 14 +- sys/contrib/ipfilter/netinet/ip_lookup.c | 16 +- sys/contrib/ipfilter/netinet/ip_lookup.h | 92 +++--- sys/contrib/ipfilter/netinet/ip_nat.c | 98 +++---- sys/contrib/ipfilter/netinet/ip_nat.h | 176 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 30 +- sys/contrib/ipfilter/netinet/ip_netbios_pxy.c | 6 +- sys/contrib/ipfilter/netinet/ip_pool.c | 74 ++--- sys/contrib/ipfilter/netinet/ip_pool.h | 2 +- sys/contrib/ipfilter/netinet/ip_pptp_pxy.c | 18 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 4 +- sys/contrib/ipfilter/netinet/ip_proxy.h | 76 ++--- sys/contrib/ipfilter/netinet/ip_raudio_pxy.c | 10 +- sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c | 22 +- sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c | 60 ++-- sys/contrib/ipfilter/netinet/ip_rules.h | 16 +- sys/contrib/ipfilter/netinet/ip_scan.c | 12 +- sys/contrib/ipfilter/netinet/ip_scan.h | 16 +- sys/contrib/ipfilter/netinet/ip_state.c | 72 ++--- sys/contrib/ipfilter/netinet/ip_state.h | 66 ++--- sys/contrib/ipfilter/netinet/ip_sync.c | 18 +- sys/contrib/ipfilter/netinet/ip_sync.h | 34 +-- sys/contrib/ipfilter/netinet/ip_tftp_pxy.c | 26 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 16 +- sys/contrib/ipfilter/netinet/radix_ipf.c | 20 +- sys/contrib/ipfilter/netinet/radix_ipf.h | 22 +- 99 files changed, 1795 insertions(+), 1801 deletions(-) diff --git a/contrib/ipfilter/bpf_filter.c b/contrib/ipfilter/bpf_filter.c index bd465761a34e..85a38a88bf57 100644 --- a/contrib/ipfilter/bpf_filter.c +++ b/contrib/ipfilter/bpf_filter.c @@ -71,8 +71,8 @@ static const char rcsid[] = #define int32 bpf_int32 #define u_int32 bpf_u_int32 -static int m_xword __P((mb_t *, int, int *)); -static int m_xhalf __P((mb_t *, int, int *)); +static int m_xword(mb_t *, int, int *); +static int m_xhalf(mb_t *, int, int *); #ifndef LBL_ALIGN /* diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c index 99c7a22668df..14b071b0b95f 100644 --- a/contrib/ipfilter/ip_dstlist.c +++ b/contrib/ipfilter/ip_dstlist.c @@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s { } ipf_dstl_softc_t; -static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); -static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, - void *, u_int)); -static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, - iplookupflush_t *)); -static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, - void *)); -static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, - ipflookupiter_t *)); -static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); -static void *ipf_dstlist_table_find __P((void *, int, char *)); -static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, - ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, - ippool_dst_t *)); -static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); -static void *ipf_dstlist_select_ref __P((void *, int, char *)); -static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); -static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); -static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); +static void *ipf_dstlist_soft_create(ipf_main_softc_t *); +static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *); +static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *); +static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *); +static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int, + void *, u_int); +static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *, + iplookupflush_t *); +static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int, + void *); +static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *); +static int ipf_dstlist_node_add(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_node_del(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_add(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_del(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *); +static void *ipf_dstlist_table_find(void *, int, char *); +static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_remove(ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *, + ippool_dst_t *); +static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *); +static void *ipf_dstlist_select_ref(void *, int, char *); +static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *); +static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *); +static void ipf_dstlist_expire(ipf_main_softc_t *, void *); +static void ipf_dstlist_sync(ipf_main_softc_t *, void *); ipf_lookup_t ipf_dstlist_backend = { IPLT_DSTLIST, diff --git a/contrib/ipfilter/ip_dstlist.h b/contrib/ipfilter/ip_dstlist.h index e2885e5c47ad..c4acd78dfd94 100644 --- a/contrib/ipfilter/ip_dstlist.h +++ b/contrib/ipfilter/ip_dstlist.h @@ -62,7 +62,7 @@ typedef struct dstlist_stat_s { extern ipf_lookup_t ipf_dstlist_backend; -extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *, - frdest_t *)); +extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *, + frdest_t *); #endif /* __IP_DSTLIST_H__ */ diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 794d7e205bb3..327f90fc356c 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -23,12 +23,12 @@ static int nifs = 0; struct rtentry; -static void ipf_setifpaddr __P((struct ifnet *, char *)); -void init_ifp __P((void)); -static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); +static void ipf_setifpaddr(struct ifnet *, char *); +void init_ifp(void); +static int no_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); +static int write_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); struct ifaddr { struct sockaddr_storage ifa_addr; diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index 271c2e065738..fbcfc8a0088f 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -73,7 +73,7 @@ typedef struct tcpinfo4 { tcpdata_t ts_data[2]; } tcpinfo4_t; -static void ipf_v5tcpinfoto4 __P((tcpinfo_t *, tcpinfo4_t *)); +static void ipf_v5tcpinfoto4(tcpinfo_t *, tcpinfo4_t *); static void ipf_v5tcpinfoto4(v5, v4) @@ -1190,66 +1190,66 @@ typedef struct ipfrstat_4_1_1 { } ipfrstat_4_1_1_t; /* ------------------------------------------------------------------------ */ -static int ipf_addfrstr __P((char *, int, char *, int)); -static void ipf_v4iptov5 __P((frip4_t *, fr_ip_t *)); -static void ipf_v5iptov4 __P((fr_ip_t *, frip4_t *)); -static void ipfv4tuctov5 __P((frtuc4_t *, frtuc_t *)); -static void ipfv5tuctov4 __P((frtuc_t *, frtuc4_t *)); -static int ipf_v4fripftov5 __P((fripf4_t *, char *)); -static void ipf_v5fripftov4 __P((fripf_t *, fripf4_t *)); -static int fr_frflags4to5 __P((u_32_t)); -static int fr_frflags5to4 __P((u_32_t)); - -static void friostat_current_to_4_1_0 __P((void *, friostat_4_1_0_t *, int)); -static void friostat_current_to_4_1_33 __P((void *, friostat_4_1_33_t *, int)); -static void ipstate_current_to_4_1_0 __P((void *, ipstate_4_1_0_t *)); -static void ipstate_current_to_4_1_16 __P((void *, ipstate_4_1_16_t *)); -static void ipnat_current_to_4_1_0 __P((void *, ipnat_4_1_0_t *)); -static void ipnat_current_to_4_1_14 __P((void *, ipnat_4_1_14_t *)); -static void frauth_current_to_4_1_11 __P((void *, frauth_4_1_11_t *)); -static void frauth_current_to_4_1_23 __P((void *, frauth_4_1_23_t *)); -static void frauth_current_to_4_1_24 __P((void *, frauth_4_1_24_t *)); -static void frauth_current_to_4_1_29 __P((void *, frauth_4_1_29_t *)); -static void frentry_current_to_4_1_0 __P((void *, frentry_4_1_0_t *)); -static void frentry_current_to_4_1_16 __P((void *, frentry_4_1_16_t *)); -static void frentry_current_to_4_1_34 __P((void *, frentry_4_1_34_t *)); -static void fr_info_current_to_4_1_11 __P((void *, fr_info_4_1_11_t *)); -static void fr_info_current_to_4_1_23 __P((void *, fr_info_4_1_23_t *)); -static void fr_info_current_to_4_1_24 __P((void *, fr_info_4_1_24_t *)); -static void nat_save_current_to_4_1_3 __P((void *, nat_save_4_1_3_t *)); -static void nat_save_current_to_4_1_14 __P((void *, nat_save_4_1_14_t *)); -static void nat_save_current_to_4_1_16 __P((void *, nat_save_4_1_16_t *)); -static void ipstate_save_current_to_4_1_0 __P((void *, ipstate_save_4_1_0_t *)); -static void ipstate_save_current_to_4_1_16 __P((void *, ipstate_save_4_1_16_t *)); -static void ips_stat_current_to_4_1_0 __P((void *, ips_stat_4_1_0_t *)); -static void ips_stat_current_to_4_1_21 __P((void *, ips_stat_4_1_21_t *)); -static void natstat_current_to_4_1_0 __P((void *, natstat_4_1_0_t *)); -static void natstat_current_to_4_1_16 __P((void *, natstat_4_1_16_t *)); -static void natstat_current_to_4_1_27 __P((void *, natstat_4_1_27_t *)); -static void natstat_current_to_4_1_32 __P((void *, natstat_4_1_32_t *)); -static void nat_current_to_4_1_3 __P((void *, nat_4_1_3_t *)); -static void nat_current_to_4_1_14 __P((void *, nat_4_1_14_t *)); -static void nat_current_to_4_1_25 __P((void *, nat_4_1_25_t *)); - -static void friostat_4_1_0_to_current __P((friostat_4_1_0_t *, void *)); -static void friostat_4_1_33_to_current __P((friostat_4_1_33_t *, void *)); -static void ipnat_4_1_0_to_current __P((ipnat_4_1_0_t *, void *, int)); -static void ipnat_4_1_14_to_current __P((ipnat_4_1_14_t *, void *, int)); -static void frauth_4_1_11_to_current __P((frauth_4_1_11_t *, void *)); -static void frauth_4_1_23_to_current __P((frauth_4_1_23_t *, void *)); -static void frauth_4_1_24_to_current __P((frauth_4_1_24_t *, void *)); -static void frauth_4_1_29_to_current __P((frauth_4_1_29_t *, void *)); -static void frauth_4_1_32_to_current __P((frauth_4_1_32_t *, void *)); -static void frentry_4_1_0_to_current __P((ipf_main_softc_t *, frentry_4_1_0_t *, void *, int)); -static void frentry_4_1_16_to_current __P((ipf_main_softc_t *, frentry_4_1_16_t *, void *, int)); -static void frentry_4_1_34_to_current __P((ipf_main_softc_t *, frentry_4_1_34_t *, void *, int)); -static void fr_info_4_1_11_to_current __P((fr_info_4_1_11_t *, void *)); -static void fr_info_4_1_23_to_current __P((fr_info_4_1_23_t *, void *)); -static void fr_info_4_1_24_to_current __P((fr_info_4_1_24_t *, void *)); -static void fr_info_4_1_32_to_current __P((fr_info_4_1_32_t *, void *)); -static void nat_save_4_1_3_to_current __P((ipf_main_softc_t *, nat_save_4_1_3_t *, void *)); -static void nat_save_4_1_14_to_current __P((ipf_main_softc_t *, nat_save_4_1_14_t *, void *)); -static void nat_save_4_1_16_to_current __P((ipf_main_softc_t *, nat_save_4_1_16_t *, void *)); +static int ipf_addfrstr(char *, int, char *, int); +static void ipf_v4iptov5(frip4_t *, fr_ip_t *); +static void ipf_v5iptov4(fr_ip_t *, frip4_t *); +static void ipfv4tuctov5(frtuc4_t *, frtuc_t *); +static void ipfv5tuctov4(frtuc_t *, frtuc4_t *); +static int ipf_v4fripftov5(fripf4_t *, char *); +static void ipf_v5fripftov4(fripf_t *, fripf4_t *); +static int fr_frflags4to5(u_32_t); +static int fr_frflags5to4(u_32_t); + +static void friostat_current_to_4_1_0(void *, friostat_4_1_0_t *, int); +static void friostat_current_to_4_1_33(void *, friostat_4_1_33_t *, int); +static void ipstate_current_to_4_1_0(void *, ipstate_4_1_0_t *); +static void ipstate_current_to_4_1_16(void *, ipstate_4_1_16_t *); +static void ipnat_current_to_4_1_0(void *, ipnat_4_1_0_t *); +static void ipnat_current_to_4_1_14(void *, ipnat_4_1_14_t *); +static void frauth_current_to_4_1_11(void *, frauth_4_1_11_t *); +static void frauth_current_to_4_1_23(void *, frauth_4_1_23_t *); +static void frauth_current_to_4_1_24(void *, frauth_4_1_24_t *); +static void frauth_current_to_4_1_29(void *, frauth_4_1_29_t *); +static void frentry_current_to_4_1_0(void *, frentry_4_1_0_t *); +static void frentry_current_to_4_1_16(void *, frentry_4_1_16_t *); +static void frentry_current_to_4_1_34(void *, frentry_4_1_34_t *); +static void fr_info_current_to_4_1_11(void *, fr_info_4_1_11_t *); +static void fr_info_current_to_4_1_23(void *, fr_info_4_1_23_t *); +static void fr_info_current_to_4_1_24(void *, fr_info_4_1_24_t *); +static void nat_save_current_to_4_1_3(void *, nat_save_4_1_3_t *); +static void nat_save_current_to_4_1_14(void *, nat_save_4_1_14_t *); +static void nat_save_current_to_4_1_16(void *, nat_save_4_1_16_t *); +static void ipstate_save_current_to_4_1_0(void *, ipstate_save_4_1_0_t *); +static void ipstate_save_current_to_4_1_16(void *, ipstate_save_4_1_16_t *); +static void ips_stat_current_to_4_1_0(void *, ips_stat_4_1_0_t *); +static void ips_stat_current_to_4_1_21(void *, ips_stat_4_1_21_t *); +static void natstat_current_to_4_1_0(void *, natstat_4_1_0_t *); +static void natstat_current_to_4_1_16(void *, natstat_4_1_16_t *); +static void natstat_current_to_4_1_27(void *, natstat_4_1_27_t *); +static void natstat_current_to_4_1_32(void *, natstat_4_1_32_t *); +static void nat_current_to_4_1_3(void *, nat_4_1_3_t *); +static void nat_current_to_4_1_14(void *, nat_4_1_14_t *); +static void nat_current_to_4_1_25(void *, nat_4_1_25_t *); + +static void friostat_4_1_0_to_current(friostat_4_1_0_t *, void *); +static void friostat_4_1_33_to_current(friostat_4_1_33_t *, void *); +static void ipnat_4_1_0_to_current(ipnat_4_1_0_t *, void *, int); +static void ipnat_4_1_14_to_current(ipnat_4_1_14_t *, void *, int); +static void frauth_4_1_11_to_current(frauth_4_1_11_t *, void *); +static void frauth_4_1_23_to_current(frauth_4_1_23_t *, void *); +static void frauth_4_1_24_to_current(frauth_4_1_24_t *, void *); +static void frauth_4_1_29_to_current(frauth_4_1_29_t *, void *); +static void frauth_4_1_32_to_current(frauth_4_1_32_t *, void *); +static void frentry_4_1_0_to_current(ipf_main_softc_t *, frentry_4_1_0_t *, void *, int); +static void frentry_4_1_16_to_current(ipf_main_softc_t *, frentry_4_1_16_t *, void *, int); +static void frentry_4_1_34_to_current(ipf_main_softc_t *, frentry_4_1_34_t *, void *, int); +static void fr_info_4_1_11_to_current(fr_info_4_1_11_t *, void *); +static void fr_info_4_1_23_to_current(fr_info_4_1_23_t *, void *); +static void fr_info_4_1_24_to_current(fr_info_4_1_24_t *, void *); +static void fr_info_4_1_32_to_current(fr_info_4_1_32_t *, void *); +static void nat_save_4_1_3_to_current(ipf_main_softc_t *, nat_save_4_1_3_t *, void *); +static void nat_save_4_1_14_to_current(ipf_main_softc_t *, nat_save_4_1_14_t *, void *); +static void nat_save_4_1_16_to_current(ipf_main_softc_t *, nat_save_4_1_16_t *, void *); /* ------------------------------------------------------------------------ */ /* In this section is a series of short routines that deal with translating */ diff --git a/contrib/ipfilter/ip_msnrpc_pxy.c b/contrib/ipfilter/ip_msnrpc_pxy.c index 40bc084cbb5d..9cddd398edde 100644 --- a/contrib/ipfilter/ip_msnrpc_pxy.c +++ b/contrib/ipfilter/ip_msnrpc_pxy.c @@ -33,12 +33,12 @@ typedef struct msnrpchdr { u_char mrh_ans; } msnrpchdr_t; -int ippr_msnrpc_init __P((void)); -void ippr_msnrpc_fini __P((void)); -int ippr_msnrpc_new __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_out __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_in __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_check __P((ip_t *, msnrpchdr_t *)); +int ippr_msnrpc_init(void); +void ippr_msnrpc_fini(void); +int ippr_msnrpc_new(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_out(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_in(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_check(ip_t *, msnrpchdr_t *); static frentry_t msnfr; diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 834ba83f51f0..c7f7308a9ba9 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -175,12 +175,12 @@ typedef struct proxyrule { #if defined(__NetBSD__) || defined(__FreeBSD_version) || \ SOLARIS # include -typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...)); +typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...); #else -typedef int (* ioctlfunc_t) __P((dev_t, ioctlcmd_t, void *)); +typedef int (* ioctlfunc_t)(dev_t, ioctlcmd_t, void *); #endif -typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *)); -typedef int (* copyfunc_t) __P((void *, void *, size_t)); +typedef int (* addfunc_t)(int, ioctlfunc_t, void *); +typedef int (* copyfunc_t)(void *, void *, size_t); extern char thishost[MAXHOSTNAMELEN]; @@ -200,178 +200,178 @@ extern wordtab_t natfields[]; extern wordtab_t poolfields[]; -extern int addicmp __P((char ***, struct frentry *, int)); -extern int addipopt __P((char *, struct ipopt_names *, int, char *)); -extern int addkeep __P((char ***, struct frentry *, int)); -extern alist_t *alist_new __P((int, char *)); -extern void alist_free __P((alist_t *)); -extern void assigndefined __P((char *)); -extern void binprint __P((void *, size_t)); -extern u_32_t buildopts __P((char *, char *, int)); -extern int checkrev __P((char *)); -extern int connecttcp __P((char *, int)); -extern int count6bits __P((u_32_t *)); -extern int count4bits __P((u_32_t)); -extern char *fac_toname __P((int)); -extern int fac_findname __P((char *)); -extern const char *familyname __P((const int)); -extern void fill6bits __P((int, u_int *)); -extern wordtab_t *findword __P((wordtab_t *, char *)); -extern int ftov __P((int)); -extern char *ipf_geterror __P((int, ioctlfunc_t *)); -extern int genmask __P((int, char *, i6addr_t *)); -extern int gethost __P((int, char *, i6addr_t *)); -extern int geticmptype __P((int, char *)); -extern int getport __P((struct frentry *, char *, u_short *, char *)); -extern int getportproto __P((char *, int)); -extern int getproto __P((char *)); -extern char *getnattype __P((struct nat *)); -extern char *getsumd __P((u_32_t)); -extern u_32_t getoptbyname __P((char *)); -extern u_32_t getoptbyvalue __P((int)); -extern u_32_t getv6optbyname __P((char *)); -extern u_32_t getv6optbyvalue __P((int)); -extern char *icmptypename __P((int, int)); -extern void initparse __P((void)); -extern void ipf_dotuning __P((int, char *, ioctlfunc_t)); -extern int ipf_addrule __P((int, ioctlfunc_t, void *)); -extern void ipf_mutex_clean __P((void)); -extern int ipf_parsefile __P((int, addfunc_t, ioctlfunc_t *, char *)); -extern int ipf_parsesome __P((int, addfunc_t, ioctlfunc_t *, FILE *)); -extern void ipf_perror __P((int, char *)); -extern int ipf_perror_fd __P(( int, ioctlfunc_t, char *)); -extern void ipf_rwlock_clean __P((void)); -extern char *ipf_strerror __P((int)); -extern void ipferror __P((int, char *)); -extern int ipmon_parsefile __P((char *)); -extern int ipmon_parsesome __P((FILE *)); -extern int ipnat_addrule __P((int, ioctlfunc_t, void *)); -extern int ipnat_parsefile __P((int, addfunc_t, ioctlfunc_t, char *)); -extern int ipnat_parsesome __P((int, addfunc_t, ioctlfunc_t, FILE *)); -extern int ippool_parsefile __P((int, char *, ioctlfunc_t)); -extern int ippool_parsesome __P((int, FILE *, ioctlfunc_t)); -extern int kmemcpywrap __P((void *, void *, size_t)); -extern char *kvatoname __P((ipfunc_t, ioctlfunc_t)); -extern int load_dstlist __P((struct ippool_dst *, ioctlfunc_t, - ipf_dstnode_t *)); -extern int load_dstlistnode __P((int, char *, struct ipf_dstnode *, - ioctlfunc_t)); -extern alist_t *load_file __P((char *)); -extern int load_hash __P((struct iphtable_s *, struct iphtent_s *, - ioctlfunc_t)); -extern int load_hashnode __P((int, char *, struct iphtent_s *, int, - ioctlfunc_t)); -extern alist_t *load_http __P((char *)); -extern int load_pool __P((struct ip_pool_s *list, ioctlfunc_t)); -extern int load_poolnode __P((int, char *, ip_pool_node_t *, int, ioctlfunc_t)); -extern alist_t *load_url __P((char *)); -extern alist_t *make_range __P((int, struct in_addr, struct in_addr)); -extern void mb_hexdump __P((mb_t *, FILE *)); -extern ipfunc_t nametokva __P((char *, ioctlfunc_t)); -extern void nat_setgroupmap __P((struct ipnat *)); -extern int ntomask __P((int, int, u_32_t *)); -extern u_32_t optname __P((char ***, u_short *, int)); -extern wordtab_t *parsefields __P((wordtab_t *, char *)); -extern int *parseipfexpr __P((char *, char **)); -extern int parsewhoisline __P((char *, addrfamily_t *, addrfamily_t *)); -extern void pool_close __P((void)); -extern int pool_fd __P((void)); -extern int pool_ioctl __P((ioctlfunc_t, ioctlcmd_t, void *)); -extern int pool_open __P((void)); -extern char *portname __P((int, int)); -extern int pri_findname __P((char *)); -extern char *pri_toname __P((int)); -extern void print_toif __P((int, char *, char *, struct frdest *)); -extern void printaps __P((ap_session_t *, int, int)); -extern void printaddr __P((int, int, char *, int, u_32_t *, u_32_t *)); -extern void printbuf __P((char *, int, int)); -extern void printfieldhdr __P((wordtab_t *, wordtab_t *)); -extern void printfr __P((struct frentry *, ioctlfunc_t)); -extern struct iphtable_s *printhash __P((struct iphtable_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct iphtable_s *printhash_live __P((iphtable_t *, int, char *, - int, wordtab_t *)); -extern ippool_dst_t *printdstl_live __P((ippool_dst_t *, int, char *, - int, wordtab_t *)); -extern void printhashdata __P((iphtable_t *, int)); -extern struct iphtent_s *printhashnode __P((struct iphtable_s *, +extern int addicmp(char ***, struct frentry *, int); +extern int addipopt(char *, struct ipopt_names *, int, char *); +extern int addkeep(char ***, struct frentry *, int); +extern alist_t *alist_new(int, char *); +extern void alist_free(alist_t *); +extern void assigndefined(char *); +extern void binprint(void *, size_t); +extern u_32_t buildopts(char *, char *, int); +extern int checkrev(char *); +extern int connecttcp(char *, int); +extern int count6bits(u_32_t *); +extern int count4bits(u_32_t); +extern char *fac_toname(int); +extern int fac_findname(char *); +extern const char *familyname(const int); +extern void fill6bits(int, u_int *); +extern wordtab_t *findword(wordtab_t *, char *); +extern int ftov(int); +extern char *ipf_geterror(int, ioctlfunc_t *); +extern int genmask(int, char *, i6addr_t *); +extern int gethost(int, char *, i6addr_t *); +extern int geticmptype(int, char *); +extern int getport(struct frentry *, char *, u_short *, char *); +extern int getportproto(char *, int); +extern int getproto(char *); +extern char *getnattype(struct nat *); +extern char *getsumd(u_32_t); +extern u_32_t getoptbyname(char *); +extern u_32_t getoptbyvalue(int); +extern u_32_t getv6optbyname(char *); +extern u_32_t getv6optbyvalue(int); +extern char *icmptypename(int, int); +extern void initparse(void); +extern void ipf_dotuning(int, char *, ioctlfunc_t); +extern int ipf_addrule(int, ioctlfunc_t, void *); +extern void ipf_mutex_clean(void); +extern int ipf_parsefile(int, addfunc_t, ioctlfunc_t *, char *); +extern int ipf_parsesome(int, addfunc_t, ioctlfunc_t *, FILE *); +extern void ipf_perror(int, char *); +extern int ipf_perror_fd( int, ioctlfunc_t, char *); +extern void ipf_rwlock_clean(void); +extern char *ipf_strerror(int); +extern void ipferror(int, char *); +extern int ipmon_parsefile(char *); +extern int ipmon_parsesome(FILE *); +extern int ipnat_addrule(int, ioctlfunc_t, void *); +extern int ipnat_parsefile(int, addfunc_t, ioctlfunc_t, char *); +extern int ipnat_parsesome(int, addfunc_t, ioctlfunc_t, FILE *); +extern int ippool_parsefile(int, char *, ioctlfunc_t); +extern int ippool_parsesome(int, FILE *, ioctlfunc_t); +extern int kmemcpywrap(void *, void *, size_t); +extern char *kvatoname(ipfunc_t, ioctlfunc_t); +extern int load_dstlist(struct ippool_dst *, ioctlfunc_t, + ipf_dstnode_t *); +extern int load_dstlistnode(int, char *, struct ipf_dstnode *, + ioctlfunc_t); +extern alist_t *load_file(char *); +extern int load_hash(struct iphtable_s *, struct iphtent_s *, + ioctlfunc_t); +extern int load_hashnode(int, char *, struct iphtent_s *, int, + ioctlfunc_t); +extern alist_t *load_http(char *); +extern int load_pool(struct ip_pool_s *list, ioctlfunc_t); +extern int load_poolnode(int, char *, ip_pool_node_t *, int, ioctlfunc_t); +extern alist_t *load_url(char *); +extern alist_t *make_range(int, struct in_addr, struct in_addr); +extern void mb_hexdump(mb_t *, FILE *); +extern ipfunc_t nametokva(char *, ioctlfunc_t); +extern void nat_setgroupmap(struct ipnat *); +extern int ntomask(int, int, u_32_t *); +extern u_32_t optname(char ***, u_short *, int); +extern wordtab_t *parsefields(wordtab_t *, char *); +extern int *parseipfexpr(char *, char **); +extern int parsewhoisline(char *, addrfamily_t *, addrfamily_t *); +extern void pool_close(void); +extern int pool_fd(void); +extern int pool_ioctl(ioctlfunc_t, ioctlcmd_t, void *); +extern int pool_open(void); +extern char *portname(int, int); +extern int pri_findname(char *); +extern char *pri_toname(int); +extern void print_toif(int, char *, char *, struct frdest *); +extern void printaps(ap_session_t *, int, int); +extern void printaddr(int, int, char *, int, u_32_t *, u_32_t *); +extern void printbuf(char *, int, int); +extern void printfieldhdr(wordtab_t *, wordtab_t *); +extern void printfr(struct frentry *, ioctlfunc_t); +extern struct iphtable_s *printhash(struct iphtable_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct iphtable_s *printhash_live(iphtable_t *, int, char *, + int, wordtab_t *); +extern ippool_dst_t *printdstl_live(ippool_dst_t *, int, char *, + int, wordtab_t *); +extern void printhashdata(iphtable_t *, int); +extern struct iphtent_s *printhashnode(struct iphtable_s *, struct iphtent_s *, - copyfunc_t, int, wordtab_t *)); -extern void printhost __P((int, u_32_t *)); -extern void printhostmask __P((int, u_32_t *, u_32_t *)); -extern void printip __P((int, u_32_t *)); -extern void printlog __P((struct frentry *)); -extern void printlookup __P((char *, i6addr_t *addr, i6addr_t *mask)); -extern void printmask __P((int, u_32_t *)); -extern void printnataddr __P((int, char *, nat_addr_t *, int)); -extern void printnatfield __P((nat_t *, int)); -extern void printnatside __P((char *, nat_stat_side_t *)); -extern void printpacket __P((int, mb_t *)); -extern void printpacket6 __P((int, mb_t *)); -extern struct ippool_dst *printdstlist __P((struct ippool_dst *, copyfunc_t, + copyfunc_t, int, wordtab_t *); +extern void printhost(int, u_32_t *); +extern void printhostmask(int, u_32_t *, u_32_t *); +extern void printip(int, u_32_t *); +extern void printlog(struct frentry *); +extern void printlookup(char *, i6addr_t *addr, i6addr_t *mask); +extern void printmask(int, u_32_t *); +extern void printnataddr(int, char *, nat_addr_t *, int); +extern void printnatfield(nat_t *, int); +extern void printnatside(char *, nat_stat_side_t *); +extern void printpacket(int, mb_t *); +extern void printpacket6(int, mb_t *); +extern struct ippool_dst *printdstlist(struct ippool_dst *, copyfunc_t, char *, int, ipf_dstnode_t *, - wordtab_t *)); -extern void printdstlistdata __P((ippool_dst_t *, int)); -extern ipf_dstnode_t *printdstlistnode __P((ipf_dstnode_t *, copyfunc_t, - int, wordtab_t *)); -extern void printdstlistpolicy __P((ippool_policy_t)); -extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct ip_pool_s *printpool_live __P((struct ip_pool_s *, int, - char *, int, wordtab_t *)); -extern void printpooldata __P((ip_pool_t *, int)); -extern void printpoolfield __P((void *, int, int)); -extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *, - int, wordtab_t *)); -extern void printproto __P((struct protoent *, int, struct ipnat *)); -extern void printportcmp __P((int, struct frpcmp *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printtqtable __P((ipftq_t *)); -extern void printtunable __P((ipftune_t *)); -extern void printunit __P((int)); -extern void optprint __P((u_short *, u_long, u_long)); + wordtab_t *); +extern void printdstlistdata(ippool_dst_t *, int); +extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t, + int, wordtab_t *); +extern void printdstlistpolicy(ippool_policy_t); +extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int, + char *, int, wordtab_t *); +extern void printpooldata(ip_pool_t *, int); +extern void printpoolfield(void *, int, int); +extern struct ip_pool_node *printpoolnode(struct ip_pool_node *, + int, wordtab_t *); +extern void printproto(struct protoent *, int, struct ipnat *); +extern void printportcmp(int, struct frpcmp *); +extern void printstatefield(ipstate_t *, int); +extern void printtqtable(ipftq_t *); +extern void printtunable(ipftune_t *); +extern void printunit(int); +extern void optprint(u_short *, u_long, u_long); #ifdef USE_INET6 -extern void optprintv6 __P((u_short *, u_long, u_long)); +extern void optprintv6(u_short *, u_long, u_long); #endif -extern int remove_hash __P((struct iphtable_s *, ioctlfunc_t)); -extern int remove_hashnode __P((int, char *, struct iphtent_s *, ioctlfunc_t)); -extern int remove_pool __P((ip_pool_t *, ioctlfunc_t)); -extern int remove_poolnode __P((int, char *, ip_pool_node_t *, ioctlfunc_t)); -extern u_char tcpflags __P((char *)); -extern void printc __P((struct frentry *)); -extern void printC __P((int)); -extern void emit __P((int, int, void *, struct frentry *)); -extern u_char secbit __P((int)); -extern u_char seclevel __P((char *)); -extern void printfraginfo __P((char *, struct ipfr *)); -extern void printifname __P((char *, char *, void *)); -extern char *hostname __P((int, void *)); -extern struct ipstate *printstate __P((struct ipstate *, int, u_long)); -extern void printsbuf __P((char *)); -extern void printnat __P((struct ipnat *, int)); -extern void printactiveaddress __P((int, char *, i6addr_t *, char *)); -extern void printactivenat __P((struct nat *, int, u_long)); -extern void printhostmap __P((struct hostmap *, u_int)); -extern void printtcpflags __P((u_32_t, u_32_t)); -extern void printipfexpr __P((int *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printstatefieldhdr __P((int)); -extern int sendtrap_v1_0 __P((int, char *, char *, int, time_t)); -extern int sendtrap_v2_0 __P((int, char *, char *, int)); -extern int vtof __P((int)); - -extern void set_variable __P((char *, char *)); -extern char *get_variable __P((char *, char **, int)); -extern void resetlexer __P((void)); - -extern void debug __P((int, char *, ...)); -extern void verbose __P((int, char *, ...)); -extern void ipfkdebug __P((char *, ...)); -extern void ipfkverbose __P((char *, ...)); +extern int remove_hash(struct iphtable_s *, ioctlfunc_t); +extern int remove_hashnode(int, char *, struct iphtent_s *, ioctlfunc_t); +extern int remove_pool(ip_pool_t *, ioctlfunc_t); +extern int remove_poolnode(int, char *, ip_pool_node_t *, ioctlfunc_t); +extern u_char tcpflags(char *); +extern void printc(struct frentry *); +extern void printC(int); +extern void emit(int, int, void *, struct frentry *); +extern u_char secbit(int); +extern u_char seclevel(char *); +extern void printfraginfo(char *, struct ipfr *); +extern void printifname(char *, char *, void *); +extern char *hostname(int, void *); +extern struct ipstate *printstate(struct ipstate *, int, u_long); +extern void printsbuf(char *); +extern void printnat(struct ipnat *, int); +extern void printactiveaddress(int, char *, i6addr_t *, char *); +extern void printactivenat(struct nat *, int, u_long); +extern void printhostmap(struct hostmap *, u_int); +extern void printtcpflags(u_32_t, u_32_t); +extern void printipfexpr(int *); +extern void printstatefield(ipstate_t *, int); +extern void printstatefieldhdr(int); +extern int sendtrap_v1_0(int, char *, char *, int, time_t); +extern int sendtrap_v2_0(int, char *, char *, int); +extern int vtof(int); + +extern void set_variable(char *, char *); +extern char *get_variable(char *, char **, int); +extern void resetlexer(void); + +extern void debug(int, char *, ...); +extern void verbose(int, char *, ...); +extern void ipfkdebug(char *, ...); +extern void ipfkverbose(char *, ...); #if SOLARIS -extern int gethostname __P((char *, int )); -extern void sync __P((void)); +extern int gethostname(char *, int ); +extern void sync(void); #endif #endif /* __IPF_H__ */ diff --git a/contrib/ipfilter/iplang/iplang.h b/contrib/ipfilter/iplang/iplang.h index 63cc078322a3..f38ef9671701 100644 --- a/contrib/ipfilter/iplang/iplang.h +++ b/contrib/ipfilter/iplang/iplang.h @@ -50,5 +50,5 @@ typedef struct aniphdr { #define ah_udp ah_un.ahu_udp #define ah_icmp ah_un.ahu_icmp -extern int get_arpipv4 __P((char *, char *)); +extern int get_arpipv4(char *, char *); diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index e66867e2a455..f8b1b82d4707 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -29,14 +29,14 @@ extern int opts; int lineNum = 0, ipproto = 0, oldipproto = 0, next = -1, laststate = 0; int *prstack = NULL, numpr = 0, state = 0, token = 0; -void yyerror __P((char *)); -void push_proto __P((void)); -void pop_proto __P((void)); -int next_state __P((int, int)); -int next_item __P((int)); -int save_token __P((void)); -void swallow __P((void)); -int yylex __P((void)); +void yyerror(char *); +void push_proto(void); +void pop_proto(void); +int next_state(int, int); +int next_item(int); +int save_token(void); +void swallow(void); +int yylex(void); struct lwordtab { char *word; diff --git a/contrib/ipfilter/iplang/iplang_y.y b/contrib/ipfilter/iplang/iplang_y.y index b4570d390530..f3335636cee1 100644 --- a/contrib/ipfilter/iplang/iplang_y.y +++ b/contrib/ipfilter/iplang/iplang_y.y @@ -59,8 +59,8 @@ arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL; struct in_addr defrouter; send_t sending; char *sclass = NULL; -u_short c_chksum __P((u_short *, u_int, u_long)); -u_long p_chksum __P((u_short *, u_int)); +u_short c_chksum(u_short *, u_int, u_long); +u_long p_chksum(u_short *, u_int); u_long ipbuffer[67584/sizeof(u_long)]; /* 66K */ aniphdr_t *aniphead = NULL, *canip = NULL, **aniptail = &aniphead; @@ -74,85 +74,85 @@ struct statetoopt { int sto_op; }; -struct in_addr getipv4addr __P((char *arg)); -u_short getportnum __P((char *, char *)); -struct ether_addr *geteaddr __P((char *, struct ether_addr *)); -void *new_header __P((int)); -void free_aniplist __P((void)); -void inc_anipheaders __P((int)); -void new_data __P((void)); -void set_datalen __P((char **)); -void set_datafile __P((char **)); -void set_data __P((char **)); -void new_packet __P((void)); -void set_ipv4proto __P((char **)); -void set_ipv4src __P((char **)); -void set_ipv4dst __P((char **)); -void set_ipv4off __P((char **)); -void set_ipv4v __P((char **)); -void set_ipv4hl __P((char **)); -void set_ipv4ttl __P((char **)); -void set_ipv4tos __P((char **)); -void set_ipv4id __P((char **)); -void set_ipv4sum __P((char **)); -void set_ipv4len __P((char **)); -void new_tcpheader __P((void)); -void set_tcpsport __P((char **)); -void set_tcpdport __P((char **)); -void set_tcpseq __P((char **)); -void set_tcpack __P((char **)); -void set_tcpoff __P((char **)); -void set_tcpurp __P((char **)); -void set_tcpwin __P((char **)); -void set_tcpsum __P((char **)); -void set_tcpflags __P((char **)); -void set_tcpopt __P((int, char **)); -void end_tcpopt __P((void)); -void new_udpheader __P((void)); -void set_udplen __P((char **)); -void set_udpsum __P((char **)); -void prep_packet __P((void)); -void packet_done __P((void)); -void new_interface __P((void)); -void check_interface __P((void)); -void set_ifname __P((char **)); -void set_ifmtu __P((int)); -void set_ifv4addr __P((char **)); -void set_ifeaddr __P((char **)); -void new_arp __P((void)); -void set_arpeaddr __P((char **)); -void set_arpv4addr __P((char **)); -void reset_send __P((void)); -void set_sendif __P((char **)); -void set_sendvia __P((char **)); -void set_defaultrouter __P((char **)); -void new_icmpheader __P((void)); -void set_icmpcode __P((int)); -void set_icmptype __P((int)); -void set_icmpcodetok __P((char **)); -void set_icmptypetok __P((char **)); -void set_icmpid __P((int)); -void set_icmpseq __P((int)); -void set_icmpotime __P((int)); -void set_icmprtime __P((int)); -void set_icmpttime __P((int)); -void set_icmpmtu __P((int)); -void set_redir __P((int, char **)); -void new_ipv4opt __P((void)); -void set_icmppprob __P((int)); -void add_ipopt __P((int, void *)); -void end_ipopt __P((void)); -void set_secclass __P((char **)); -void free_anipheader __P((void)); -void end_ipv4 __P((void)); -void end_icmp __P((void)); -void end_udp __P((void)); -void end_tcp __P((void)); -void end_data __P((void)); -void yyerror __P((char *)); -void iplang __P((FILE *)); -int arp_getipv4 __P((char *, char *)); -int yyparse __P((void)); +struct in_addr getipv4addr(char *arg); +u_short getportnum(char *, char *); +struct ether_addr *geteaddr(char *, struct ether_addr *); +void *new_header(int); +void free_aniplist(void); +void inc_anipheaders(int); +void new_data(void); +void set_datalen(char **); +void set_datafile(char **); +void set_data(char **); +void new_packet(void); +void set_ipv4proto(char **); +void set_ipv4src(char **); +void set_ipv4dst(char **); +void set_ipv4off(char **); +void set_ipv4v(char **); +void set_ipv4hl(char **); +void set_ipv4ttl(char **); +void set_ipv4tos(char **); +void set_ipv4id(char **); +void set_ipv4sum(char **); +void set_ipv4len(char **); +void new_tcpheader(void); +void set_tcpsport(char **); +void set_tcpdport(char **); +void set_tcpseq(char **); +void set_tcpack(char **); +void set_tcpoff(char **); +void set_tcpurp(char **); +void set_tcpwin(char **); +void set_tcpsum(char **); +void set_tcpflags(char **); +void set_tcpopt(int, char **); +void end_tcpopt(void); +void new_udpheader(void); +void set_udplen(char **); +void set_udpsum(char **); +void prep_packet(void); +void packet_done(void); +void new_interface(void); +void check_interface(void); +void set_ifname(char **); +void set_ifmtu(int); +void set_ifv4addr(char **); +void set_ifeaddr(char **); +void new_arp(void); +void set_arpeaddr(char **); +void set_arpv4addr(char **); +void reset_send(void); +void set_sendif(char **); +void set_sendvia(char **); +void set_defaultrouter(char **); +void new_icmpheader(void); +void set_icmpcode(int); +void set_icmptype(int); +void set_icmpcodetok(char **); +void set_icmptypetok(char **); +void set_icmpid(int); +void set_icmpseq(int); +void set_icmpotime(int); +void set_icmprtime(int); +void set_icmpttime(int); +void set_icmpmtu(int); +void set_redir(int, char **); +void new_ipv4opt(void); +void set_icmppprob(int); +void add_ipopt(int, void *); *** 4116 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 13:46:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB6D53F372; Tue, 9 Feb 2021 13:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZkgg6s4Hz52Fd; Tue, 9 Feb 2021 13:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDCE439F0; Tue, 9 Feb 2021 13:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119Dk7iL017206; Tue, 9 Feb 2021 13:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119Dk7bK017205; Tue, 9 Feb 2021 13:46:07 GMT (envelope-from git) Date: Tue, 9 Feb 2021 13:46:07 GMT Message-Id: <202102091346.119Dk7bK017205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 7512d59d235d - stable/12 - MFC 7071734fae6019d1e3e44daf7deb4478582081cc: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7512d59d235da4cdf5659210f7f10d7d580f60ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 13:46:08 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7512d59d235da4cdf5659210f7f10d7d580f60ce commit 7512d59d235da4cdf5659210f7f10d7d580f60ce Author: Cy Schubert AuthorDate: 2021-01-27 15:25:00 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 13:45:44 +0000 MFC 7071734fae6019d1e3e44daf7deb4478582081cc: Indentation cleanup resulting from the cleanup of #ifdefs. The conscious decision was made not to perform any indentation or whitespace cleanup while cleaning out old redunant #ifdefs. The reason for this was to avoid confusing future readers of history and diffs with cosmetic changes, making bisection of any possible bugs introduced more difficult. This commit cleans up the whitespace detritus left behind from the previous #ifdef cleanup commits. (cherry picked from commit 7071734fae6019d1e3e44daf7deb4478582081cc) --- sys/contrib/ipfilter/netinet/fil.c | 12 +- sys/contrib/ipfilter/netinet/ip_auth.c | 18 +- sys/contrib/ipfilter/netinet/ip_compat.h | 282 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_dstlist.c | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 94 ++++----- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 21 +- sys/contrib/ipfilter/netinet/ip_pool.c | 2 +- 7 files changed, 215 insertions(+), 216 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 7402437d98c7..a79d441284bf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -48,7 +48,7 @@ #if !defined(__SVR4) # include #else -# include +# include # if (SOLARIS2 < 5) && defined(sun) # include # endif @@ -4117,11 +4117,11 @@ ipf_sync(softc, ifp) { int i; -# if !SOLARIS +#if !SOLARIS ipf_nat_sync(softc, ifp); ipf_state_sync(softc, ifp); ipf_lookup_sync(softc, ifp); -# endif +#endif WRITE_ENTER(&softc->ipf_mutex); (void) ipf_synclist(softc, softc->ipf_acct[0][softc->ipf_active], ifp); @@ -4168,13 +4168,13 @@ copyinptr(softc, src, dst, size) caddr_t ca; int error; -# if SOLARIS +#if SOLARIS error = COPYIN(src, &ca, sizeof(ca)); if (error != 0) return error; -# else +#else bcopy(src, (caddr_t)&ca, sizeof(ca)); -# endif +#endif error = COPYIN(ca, dst, size); if (error != 0) { IPFERROR(3); diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 18b8f3a65641..4864a8128494 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -81,13 +81,13 @@ # undef KERNEL #endif #include -# if defined(__FreeBSD_version) -# include -# define IF_QFULL _IF_QFULL -# define IF_DROP _IF_DROP -# endif -# include -# include +#if defined(__FreeBSD_version) +# include +# define IF_QFULL _IF_QFULL +# define IF_DROP _IF_DROP +#endif +#include +#include #include #include #include "netinet/ip_compat.h" @@ -298,9 +298,9 @@ ipf_auth_soft_destroy(softc, arg) { ipf_auth_softc_t *softa = arg; -# if SOLARIS && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) cv_destroy(&softa->ipf_auth_wait); -# endif +#endif MUTEX_DESTROY(&softa->ipf_auth_mx); RW_DESTROY(&softa->ipf_authlk); diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 4394b732e10c..756731480836 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -56,16 +56,16 @@ /* * This is a workaround for troubles on FreeBSD and OpenBSD. */ -# ifndef _KERNEL -# define ADD_KERNEL -# define _KERNEL -# define KERNEL -# endif -# include -# ifdef ADD_KERNEL -# undef _KERNEL -# undef KERNEL -# endif +#ifndef _KERNEL +# define ADD_KERNEL +# define _KERNEL +# define KERNEL +#endif +#include +#ifdef ADD_KERNEL +# undef _KERNEL +# undef KERNEL +#endif #define NETBSD_GE_REV(x) (defined(__NetBSD_Version__) && \ (__NetBSD_Version__ >= (x))) @@ -78,108 +78,108 @@ /* ----------------------------------------------------------------------- */ /* F R E E B S D */ /* ----------------------------------------------------------------------- */ -# define HAS_SYS_MD5_H 1 -# if defined(_KERNEL) -# include "opt_bpf.h" -# include "opt_inet6.h" -# if defined(INET6) && !defined(USE_INET6) -# define USE_INET6 -# endif -# else -# if !defined(USE_INET6) && !defined(NOINET6) -# define USE_INET6 -# endif +#define HAS_SYS_MD5_H 1 +#if defined(_KERNEL) +# include "opt_bpf.h" +# include "opt_inet6.h" +# if defined(INET6) && !defined(USE_INET6) +# define USE_INET6 # endif +#else +# if !defined(USE_INET6) && !defined(NOINET6) +# define USE_INET6 +# endif +#endif -# if defined(_KERNEL) -# include -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#if defined(_KERNEL) +# include +# define p_cred td_ucred +# define p_uid td_ucred->cr_ruid /* * When #define'd, the 5.2.1 kernel panics when used with the ftp proxy. * There may be other, safe, kernels but this is not extensively tested yet. */ -# define HAVE_M_PULLDOWN -# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) -# include "opt_ipfilter.h" -# endif -# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) -# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) +# define HAVE_M_PULLDOWN +# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) +# include "opt_ipfilter.h" +# endif +# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) +# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# else -# include -# endif /* _KERNEL */ +#else +# include +#endif /* _KERNEL */ -# include -# include -# include -# include -# define KRWLOCK_FILL_SZ 56 -# define KMUTEX_FILL_SZ 56 -# include -# define KMUTEX_T struct mtx -# define KRWLOCK_T struct rwlock +#include +#include +#include +#include +#define KRWLOCK_FILL_SZ 56 +#define KMUTEX_FILL_SZ 56 +#include +#define KMUTEX_T struct mtx +#define KRWLOCK_T struct rwlock #ifdef _KERNEL -# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) -# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) -# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) -# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) -# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) -# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) -# define RWLOCK_EXIT(x) do { \ +# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) +# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) +# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) +# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) +# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) +# define RWLOCK_EXIT(x) do { \ if (rw_wowned(&(x)->ipf_lk)) \ rw_wunlock(&(x)->ipf_lk); \ else \ rw_runlock(&(x)->ipf_lk); \ } while (0) -# include -# define GETKTIME(x) microtime((struct timeval *)x) -# define if_addrlist if_addrhead - -# include -# include -# include - -# define USE_MUTEXES -# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) -# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) -# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ +# include +# define GETKTIME(x) microtime((struct timeval *)x) +# define if_addrlist if_addrhead + +# include +# include +# include + +# define USE_MUTEXES +# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) +# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) +# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ MTX_DEF) -# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) -# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) +# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) +# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) /* * Whilst the sx(9) locks on FreeBSD have the right semantics and interface * for what we want to use them for, despite testing showing they work - * with a WITNESS kernel, it generates LOR messages. */ -# include -# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ +# include +# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ +# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) -# define ATOMIC_INC64(x) ATOMIC_INC(x) -# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) -# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) -# define ATOMIC_DEC64(x) ATOMIC_DEC(x) -# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) -# define SPL_X(x) ; -# define SPL_NET(x) ; -# define SPL_IMP(x) ; -# define SPL_SCHED(x) ; -# define GET_MINOR dev2unit -# define MSGDSIZE(m) mbufchainlen(m) -# define M_LEN(m) (m)->m_len -# define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) -# define M_DUP(m) m_dup(m, M_NOWAIT) -# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } +# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) +# define ATOMIC_INC64(x) ATOMIC_INC(x) +# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) +# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) +# define ATOMIC_DEC64(x) ATOMIC_DEC(x) +# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) +# define SPL_X(x) ; +# define SPL_NET(x) ; +# define SPL_IMP(x) ; +# define SPL_SCHED(x) ; +# define GET_MINOR dev2unit +# define MSGDSIZE(m) mbufchainlen(m) +# define M_LEN(m) (m)->m_len +# define M_ADJ(m,x) m_adj(m, x) +# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) +# define M_DUP(m) m_dup(m, M_NOWAIT) +# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; #else /* !_KERNEL */ -#ifndef _NET_IF_VAR_H_ +# ifndef _NET_IF_VAR_H_ /* * Userland emulation of struct ifnet. */ @@ -191,14 +191,14 @@ struct ifnet { int (*if_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); }; -#endif /* _NET_IF_VAR_H_ */ +# endif /* _NET_IF_VAR_H_ */ #endif /* _KERNEL */ -# define IFNAME(x) ((struct ifnet *)x)->if_xname -# define COPYIFNAME(v, x, b) \ - (void) strncpy(b, \ - ((struct ifnet *)x)->if_xname, \ - LIFNAMSIZ) +#define IFNAME(x) ((struct ifnet *)x)->if_xname +#define COPYIFNAME(v, x, b) \ + (void) strncpy(b, \ + ((struct ifnet *)x)->if_xname, \ + LIFNAMSIZ) typedef u_long ioctlcmd_t; typedef struct uio uio_t; @@ -226,12 +226,12 @@ typedef u_int32_t u_32_t; * Userland locking primitives */ #ifndef _KERNEL -#if !defined(KMUTEX_FILL_SZ) -# define KMUTEX_FILL_SZ 1 -#endif -#if !defined(KRWLOCK_FILL_SZ) -# define KRWLOCK_FILL_SZ 1 -#endif +# if !defined(KMUTEX_FILL_SZ) +# define KMUTEX_FILL_SZ 1 +# endif +# if !defined(KRWLOCK_FILL_SZ) +# define KRWLOCK_FILL_SZ 1 +# endif #endif typedef struct { @@ -455,54 +455,54 @@ typedef struct ip6_hdr ip6_t; # define COPYDATA m_copydata # define COPYBACK m_copyback # endif -# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ - defined(__FreeBSD__) -# include -# endif -# if NETBSD_GE_REV(105180000) -# include -# else -# include +# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ + defined(__FreeBSD__) +# include +# endif +# if NETBSD_GE_REV(105180000) +# include +# else +# include extern vm_map_t kmem_map; -# endif -# include +# endif +# include -# ifdef IPFILTER_M_IPFILTER -# include +# ifdef IPFILTER_M_IPFILTER +# include MALLOC_DECLARE(M_IPFILTER); +# define _M_IPF M_IPFILTER +# else /* IPFILTER_M_IPFILTER */ +# ifdef M_PFIL +# define _M_IPF M_PFIL +# else +# ifdef M_IPFILTER # define _M_IPF M_IPFILTER -# else /* IPFILTER_M_IPFILTER */ -# ifdef M_PFIL -# define _M_IPF M_PFIL # else -# ifdef M_IPFILTER -# define _M_IPF M_IPFILTER -# else -# define _M_IPF M_TEMP -# endif /* M_IPFILTER */ -# endif /* M_PFIL */ -# endif /* IPFILTER_M_IPFILTER */ -# if !defined(KMALLOC) -# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) -# endif -# if !defined(KMALLOCS) -# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) -# endif -# if !defined(KFREE) -# define KFREE(x) free((x), _M_IPF) -# endif -# if !defined(KFREES) +# define _M_IPF M_TEMP +# endif /* M_IPFILTER */ +# endif /* M_PFIL */ +# endif /* IPFILTER_M_IPFILTER */ +# if !defined(KMALLOC) +# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) +# endif +# if !defined(KMALLOCS) +# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) +# endif +# if !defined(KFREE) +# define KFREE(x) free((x), _M_IPF) +# endif +# if !defined(KFREES) # define KFREES(x,s) free((x), _M_IPF) -# endif -# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) -# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) -# define WAKEUP(id,x) wakeup(id+x) -# if !defined(POLLWAKEUP) -# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) -# endif -# define GETIFP(n, v) ifunit(n) -# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu -# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu +# endif +# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) +# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) +# define WAKEUP(id,x) wakeup(id+x) +# if !defined(POLLWAKEUP) +# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) +# endif +# define GETIFP(n, v) ifunit(n) +# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu +# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu # if !defined(USE_MUTEXES) && !defined(SPL_NET) # define SPL_IMP(x) x = splimp() @@ -804,8 +804,8 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB -# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB #ifndef IPVERSION # define IPVERSION 4 diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index 0c65e4cd6896..11e1a1846d89 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -27,7 +27,7 @@ # endif #endif #include -# include +#include #include #if defined(_KERNEL) && !defined(__SVR4) # include diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 3121e94f1488..0b5fc7285f93 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -11,7 +11,7 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ -# include +#include #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" @@ -19,7 +19,7 @@ # include #endif #if defined(BSD) && defined(_KERNEL) -# include +# include #endif #ifndef SOLARIS @@ -31,48 +31,48 @@ #endif #ifndef __P -# define __P(x) x +# define __P(x) x #endif -# define SIOCADAFR _IOW('r', 60, struct ipfobj) -# define SIOCRMAFR _IOW('r', 61, struct ipfobj) -# define SIOCSETFF _IOW('r', 62, u_int) -# define SIOCGETFF _IOR('r', 63, u_int) -# define SIOCGETFS _IOWR('r', 64, struct ipfobj) -# define SIOCIPFFL _IOWR('r', 65, int) -# define SIOCIPFFB _IOR('r', 66, int) -# define SIOCADIFR _IOW('r', 67, struct ipfobj) -# define SIOCRMIFR _IOW('r', 68, struct ipfobj) -# define SIOCSWAPA _IOR('r', 69, u_int) -# define SIOCINAFR _IOW('r', 70, struct ipfobj) -# define SIOCINIFR _IOW('r', 71, struct ipfobj) -# define SIOCFRENB _IOW('r', 72, u_int) -# define SIOCFRSYN _IOW('r', 73, u_int) -# define SIOCFRZST _IOWR('r', 74, struct ipfobj) -# define SIOCZRLST _IOWR('r', 75, struct ipfobj) -# define SIOCAUTHW _IOWR('r', 76, struct ipfobj) -# define SIOCAUTHR _IOWR('r', 77, struct ipfobj) -# define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) -# define SIOCSTLCK _IOWR('r', 79, u_int) -# define SIOCSTPUT _IOWR('r', 80, struct ipfobj) -# define SIOCSTGET _IOWR('r', 81, struct ipfobj) -# define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) -# define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) -# define SIOCSETLG _IOWR('r', 84, int) -# define SIOCGETLG _IOWR('r', 85, int) -# define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) -# define SIOCIPFGET _IOWR('r', 88, struct ipfobj) -# define SIOCIPFSET _IOWR('r', 89, struct ipfobj) -# define SIOCIPFL6 _IOWR('r', 90, int) -# define SIOCIPFITER _IOWR('r', 91, struct ipfobj) -# define SIOCGENITER _IOWR('r', 92, struct ipfobj) -# define SIOCGTABL _IOWR('r', 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR('r', 94, int) -# define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) -# define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR('r', 98, int) +#define SIOCADAFR _IOW('r', 60, struct ipfobj) +#define SIOCRMAFR _IOW('r', 61, struct ipfobj) +#define SIOCSETFF _IOW('r', 62, u_int) +#define SIOCGETFF _IOR('r', 63, u_int) +#define SIOCGETFS _IOWR('r', 64, struct ipfobj) +#define SIOCIPFFL _IOWR('r', 65, int) +#define SIOCIPFFB _IOR('r', 66, int) +#define SIOCADIFR _IOW('r', 67, struct ipfobj) +#define SIOCRMIFR _IOW('r', 68, struct ipfobj) +#define SIOCSWAPA _IOR('r', 69, u_int) +#define SIOCINAFR _IOW('r', 70, struct ipfobj) +#define SIOCINIFR _IOW('r', 71, struct ipfobj) +#define SIOCFRENB _IOW('r', 72, u_int) +#define SIOCFRSYN _IOW('r', 73, u_int) +#define SIOCFRZST _IOWR('r', 74, struct ipfobj) +#define SIOCZRLST _IOWR('r', 75, struct ipfobj) +#define SIOCAUTHW _IOWR('r', 76, struct ipfobj) +#define SIOCAUTHR _IOWR('r', 77, struct ipfobj) +#define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) +#define SIOCSTLCK _IOWR('r', 79, u_int) +#define SIOCSTPUT _IOWR('r', 80, struct ipfobj) +#define SIOCSTGET _IOWR('r', 81, struct ipfobj) +#define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) +#define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) +#define SIOCSETLG _IOWR('r', 84, int) +#define SIOCGETLG _IOWR('r', 85, int) +#define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) +#define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) +#define SIOCIPFGET _IOWR('r', 88, struct ipfobj) +#define SIOCIPFSET _IOWR('r', 89, struct ipfobj) +#define SIOCIPFL6 _IOWR('r', 90, int) +#define SIOCIPFITER _IOWR('r', 91, struct ipfobj) +#define SIOCGENITER _IOWR('r', 92, struct ipfobj) +#define SIOCGTABL _IOWR('r', 93, struct ipfobj) +#define SIOCIPFDELTOK _IOWR('r', 94, int) +#define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) +#define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) +#define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) +#define SIOCIPFINTERROR _IOR('r', 98, int) #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR @@ -1640,14 +1640,14 @@ extern int ipf_qout(queue_t *, mblk_t *); extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); -# ifdef IPFILTER_LKM +# ifdef IPFILTER_LKM extern int ipf_identify(char *); -# endif -# if defined(__FreeBSD_version) +# endif +# if defined(__FreeBSD_version) extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); -# elif defined(__NetBSD__) +# elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); -# endif +# endif # endif /* MENTAT */ # if defined(__FreeBSD_version) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 8e90821aaec7..51870782e235 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -32,9 +32,9 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include +#include #if defined(__FreeBSD_version) -#include +# include #endif #include #include @@ -42,7 +42,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include - #include #include #include @@ -72,19 +71,19 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #ifdef IPFILTER_SCAN -#include "netinet/ip_scan.h" +# include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" #include #include #ifdef CSUM_DATA_VALID -#include +# include #endif extern int ip_optcopy(struct ip *, struct ip *); -# ifdef IPFILTER_M_IPFILTER +#ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); -# endif +#endif static int ipf_send_ip(fr_info_t *, mb_t *); @@ -95,8 +94,8 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { }; #define V_ipfmain VNET(ipfmain) -# include -# include +#include +#include VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); @@ -288,8 +287,8 @@ ipfdetach(softc) int ipfioctl(dev, cmd, data, mode, p) struct thread *p; -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#define p_cred td_ucred +#define p_uid td_ucred->cr_ruid struct cdev *dev; ioctlcmd_t cmd; caddr_t data; diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index fc2e78bfe27b..51d810baa310 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -732,7 +732,7 @@ ipf_pool_select_add_ref(arg, unit, name) /* */ /* Searches for an exact match of an entry in the pool. */ /* ------------------------------------------------------------------------ */ -extern void printhostmask(int, u_32_t *, u_32_t *)); +extern void printhostmask(int, u_32_t *, u_32_t *); static ip_pool_node_t * ipf_pool_findeq(softp, ipo, addr, mask) ipf_pool_softc_t *softp; From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 13:46:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 613BF53F61C; Tue, 9 Feb 2021 13:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZkhW1lhbz52lZ; Tue, 9 Feb 2021 13:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E05433ED; Tue, 9 Feb 2021 13:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119DkpaV017431; Tue, 9 Feb 2021 13:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119DkpUP017430; Tue, 9 Feb 2021 13:46:51 GMT (envelope-from git) Date: Tue, 9 Feb 2021 13:46:51 GMT Message-Id: <202102091346.119DkpUP017430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 19bebaed370c - stable/11 - MFC7071734fae6019d1e3e44daf7deb4478582081cc: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 19bebaed370c527b531c79a7abbb9efcf8f37af1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 13:46:51 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=19bebaed370c527b531c79a7abbb9efcf8f37af1 commit 19bebaed370c527b531c79a7abbb9efcf8f37af1 Author: Cy Schubert AuthorDate: 2021-01-27 15:25:00 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 01:32:15 +0000 MFC7071734fae6019d1e3e44daf7deb4478582081cc: Indentation cleanup resulting from the cleanup of #ifdefs. The conscious decision was made not to perform any indentation or whitespace cleanup while cleaning out old redunant #ifdefs. The reason for this was to avoid confusing future readers of history and diffs with cosmetic changes, making bisection of any possible bugs introduced more difficult. This commit cleans up the whitespace detritus left behind from the previous #ifdef cleanup commits. (cherry picked from commit 7071734fae6019d1e3e44daf7deb4478582081cc) --- sys/contrib/ipfilter/netinet/fil.c | 12 +- sys/contrib/ipfilter/netinet/ip_auth.c | 18 +- sys/contrib/ipfilter/netinet/ip_compat.h | 278 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_dstlist.c | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 94 ++++----- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 21 +- sys/contrib/ipfilter/netinet/ip_pool.c | 2 +- 7 files changed, 213 insertions(+), 214 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 7402437d98c7..a79d441284bf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -48,7 +48,7 @@ #if !defined(__SVR4) # include #else -# include +# include # if (SOLARIS2 < 5) && defined(sun) # include # endif @@ -4117,11 +4117,11 @@ ipf_sync(softc, ifp) { int i; -# if !SOLARIS +#if !SOLARIS ipf_nat_sync(softc, ifp); ipf_state_sync(softc, ifp); ipf_lookup_sync(softc, ifp); -# endif +#endif WRITE_ENTER(&softc->ipf_mutex); (void) ipf_synclist(softc, softc->ipf_acct[0][softc->ipf_active], ifp); @@ -4168,13 +4168,13 @@ copyinptr(softc, src, dst, size) caddr_t ca; int error; -# if SOLARIS +#if SOLARIS error = COPYIN(src, &ca, sizeof(ca)); if (error != 0) return error; -# else +#else bcopy(src, (caddr_t)&ca, sizeof(ca)); -# endif +#endif error = COPYIN(ca, dst, size); if (error != 0) { IPFERROR(3); diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 18b8f3a65641..4864a8128494 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -81,13 +81,13 @@ # undef KERNEL #endif #include -# if defined(__FreeBSD_version) -# include -# define IF_QFULL _IF_QFULL -# define IF_DROP _IF_DROP -# endif -# include -# include +#if defined(__FreeBSD_version) +# include +# define IF_QFULL _IF_QFULL +# define IF_DROP _IF_DROP +#endif +#include +#include #include #include #include "netinet/ip_compat.h" @@ -298,9 +298,9 @@ ipf_auth_soft_destroy(softc, arg) { ipf_auth_softc_t *softa = arg; -# if SOLARIS && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) cv_destroy(&softa->ipf_auth_wait); -# endif +#endif MUTEX_DESTROY(&softa->ipf_auth_mx); RW_DESTROY(&softa->ipf_authlk); diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 20eca2c48bf5..39b94460d3b7 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -56,16 +56,16 @@ /* * This is a workaround for troubles on FreeBSD and OpenBSD. */ -# ifndef _KERNEL -# define ADD_KERNEL -# define _KERNEL -# define KERNEL -# endif -# include -# ifdef ADD_KERNEL -# undef _KERNEL -# undef KERNEL -# endif +#ifndef _KERNEL +# define ADD_KERNEL +# define _KERNEL +# define KERNEL +#endif +#include +#ifdef ADD_KERNEL +# undef _KERNEL +# undef KERNEL +#endif #define NETBSD_GE_REV(x) (defined(__NetBSD_Version__) && \ (__NetBSD_Version__ >= (x))) @@ -78,107 +78,107 @@ /* ----------------------------------------------------------------------- */ /* F R E E B S D */ /* ----------------------------------------------------------------------- */ -# define HAS_SYS_MD5_H 1 -# if defined(_KERNEL) -# include "opt_bpf.h" -# include "opt_inet6.h" -# if defined(INET6) && !defined(USE_INET6) -# define USE_INET6 -# endif -# else -# if !defined(USE_INET6) && !defined(NOINET6) -# define USE_INET6 -# endif +#define HAS_SYS_MD5_H 1 +#if defined(_KERNEL) +# include "opt_bpf.h" +# include "opt_inet6.h" +# if defined(INET6) && !defined(USE_INET6) +# define USE_INET6 # endif +#else +# if !defined(USE_INET6) && !defined(NOINET6) +# define USE_INET6 +# endif +#endif -# if defined(_KERNEL) -# include -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#if defined(_KERNEL) +# include +# define p_cred td_ucred +# define p_uid td_ucred->cr_ruid /* * When #define'd, the 5.2.1 kernel panics when used with the ftp proxy. * There may be other, safe, kernels but this is not extensively tested yet. */ -# define HAVE_M_PULLDOWN -# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) -# include "opt_ipfilter.h" -# endif -# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) -# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) +# define HAVE_M_PULLDOWN +# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) +# include "opt_ipfilter.h" +# endif +# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) +# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# else -# include -# endif /* _KERNEL */ +#else +# include +#endif /* _KERNEL */ -# include -# include -# include -# include -# define KRWLOCK_FILL_SZ 56 -# define KMUTEX_FILL_SZ 56 -# include -# define KMUTEX_T struct mtx -# define KRWLOCK_T struct rwlock +#include +#include +#include +#include +#define KRWLOCK_FILL_SZ 56 +#define KMUTEX_FILL_SZ 56 +#include +#define KMUTEX_T struct mtx +#define KRWLOCK_T struct rwlock #ifdef _KERNEL -# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) -# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) -# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) -# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) -# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) -# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) -# define RWLOCK_EXIT(x) do { \ +# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) +# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) +# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) +# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) +# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) +# define RWLOCK_EXIT(x) do { \ if (rw_wowned(&(x)->ipf_lk)) \ rw_wunlock(&(x)->ipf_lk); \ else \ rw_runlock(&(x)->ipf_lk); \ } while (0) -# include -# define GETKTIME(x) microtime((struct timeval *)x) +# include +# define GETKTIME(x) microtime((struct timeval *)x) -# include -# include -# include +# include +# include +# include -# define USE_MUTEXES -# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) -# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) -# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ +# define USE_MUTEXES +# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) +# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) +# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ MTX_DEF) -# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) -# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) +# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) +# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) /* * Whilst the sx(9) locks on FreeBSD have the right semantics and interface * for what we want to use them for, despite testing showing they work - * with a WITNESS kernel, it generates LOR messages. */ -# include -# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ +# include +# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ +# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) -# define ATOMIC_INC64(x) ATOMIC_INC(x) -# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) -# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) -# define ATOMIC_DEC64(x) ATOMIC_DEC(x) -# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) -# define SPL_X(x) ; -# define SPL_NET(x) ; -# define SPL_IMP(x) ; -# define SPL_SCHED(x) ; -# define GET_MINOR dev2unit -# define MSGDSIZE(m) mbufchainlen(m) -# define M_LEN(m) (m)->m_len -# define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copy((x), 0, M_COPYALL) -# define M_DUP(m) m_dup(m, M_NOWAIT) -# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } +# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) +# define ATOMIC_INC64(x) ATOMIC_INC(x) +# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) +# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) +# define ATOMIC_DEC64(x) ATOMIC_DEC(x) +# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) +# define SPL_X(x) ; +# define SPL_NET(x) ; +# define SPL_IMP(x) ; +# define SPL_SCHED(x) ; +# define GET_MINOR dev2unit +# define MSGDSIZE(m) mbufchainlen(m) +# define M_LEN(m) (m)->m_len +# define M_ADJ(m,x) m_adj(m, x) +# define M_COPY(x) m_copy((x), 0, M_COPYALL) +# define M_DUP(m) m_dup(m, M_NOWAIT) +# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; #else /* !_KERNEL */ -#ifndef _NET_IF_VAR_H_ +# ifndef _NET_IF_VAR_H_ /* * Userland emulation of struct ifnet. */ @@ -190,14 +190,14 @@ struct ifnet { int (*if_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); }; -#endif /* _NET_IF_VAR_H_ */ +# endif /* _NET_IF_VAR_H_ */ #endif /* _KERNEL */ -# define IFNAME(x) ((struct ifnet *)x)->if_xname -# define COPYIFNAME(v, x, b) \ - (void) strncpy(b, \ - ((struct ifnet *)x)->if_xname, \ - LIFNAMSIZ) +#define IFNAME(x) ((struct ifnet *)x)->if_xname +#define COPYIFNAME(v, x, b) \ + (void) strncpy(b, \ + ((struct ifnet *)x)->if_xname, \ + LIFNAMSIZ) typedef u_long ioctlcmd_t; typedef struct uio uio_t; @@ -225,12 +225,12 @@ typedef u_int32_t u_32_t; * Userland locking primitives */ #ifndef _KERNEL -#if !defined(KMUTEX_FILL_SZ) -# define KMUTEX_FILL_SZ 1 -#endif -#if !defined(KRWLOCK_FILL_SZ) -# define KRWLOCK_FILL_SZ 1 -#endif +# if !defined(KMUTEX_FILL_SZ) +# define KMUTEX_FILL_SZ 1 +# endif +# if !defined(KRWLOCK_FILL_SZ) +# define KRWLOCK_FILL_SZ 1 +# endif #endif typedef struct { @@ -454,54 +454,54 @@ typedef struct ip6_hdr ip6_t; # define COPYDATA m_copydata # define COPYBACK m_copyback # endif -# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ - defined(__FreeBSD__) -# include -# endif -# if NETBSD_GE_REV(105180000) -# include -# else -# include +# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ + defined(__FreeBSD__) +# include +# endif +# if NETBSD_GE_REV(105180000) +# include +# else +# include extern vm_map_t kmem_map; -# endif -# include +# endif +# include -# ifdef IPFILTER_M_IPFILTER -# include +# ifdef IPFILTER_M_IPFILTER +# include MALLOC_DECLARE(M_IPFILTER); +# define _M_IPF M_IPFILTER +# else /* IPFILTER_M_IPFILTER */ +# ifdef M_PFIL +# define _M_IPF M_PFIL +# else +# ifdef M_IPFILTER # define _M_IPF M_IPFILTER -# else /* IPFILTER_M_IPFILTER */ -# ifdef M_PFIL -# define _M_IPF M_PFIL # else -# ifdef M_IPFILTER -# define _M_IPF M_IPFILTER -# else -# define _M_IPF M_TEMP -# endif /* M_IPFILTER */ -# endif /* M_PFIL */ -# endif /* IPFILTER_M_IPFILTER */ -# if !defined(KMALLOC) -# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT) -# endif -# if !defined(KMALLOCS) -# define KMALLOCS(a, b, c) MALLOC((a), b, (c), _M_IPF, M_NOWAIT) -# endif -# if !defined(KFREE) -# define KFREE(x) FREE((x), _M_IPF) -# endif -# if !defined(KFREES) -# define KFREES(x,s) FREE((x), _M_IPF) -# endif -# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) -# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) -# define WAKEUP(id,x) wakeup(id+x) -# if !defined(POLLWAKEUP) -# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) -# endif -# define GETIFP(n, v) ifunit(n) -# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu -# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu +# define _M_IPF M_TEMP +# endif /* M_IPFILTER */ +# endif /* M_PFIL */ +# endif /* IPFILTER_M_IPFILTER */ +# if !defined(KMALLOC) +# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT) +# endif +# if !defined(KMALLOCS) +# define KMALLOCS(a, b, c) MALLOC((a), b, (c), _M_IPF, M_NOWAIT) +# endif +# if !defined(KFREE) +# define KFREE(x) FREE((x), _M_IPF) +# endif +# if !defined(KFREES) +# define KFREES(x,s) FREE((x), _M_IPF) +# endif +# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) +# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) +# define WAKEUP(id,x) wakeup(id+x) +# if !defined(POLLWAKEUP) +# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) +# endif +# define GETIFP(n, v) ifunit(n) +# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu +# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu # if !defined(USE_MUTEXES) && !defined(SPL_NET) # define SPL_IMP(x) x = splimp() @@ -803,8 +803,8 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB -# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB #ifndef IPVERSION # define IPVERSION 4 diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index 0c65e4cd6896..11e1a1846d89 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -27,7 +27,7 @@ # endif #endif #include -# include +#include #include #if defined(_KERNEL) && !defined(__SVR4) # include diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 3121e94f1488..0b5fc7285f93 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -11,7 +11,7 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ -# include +#include #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" @@ -19,7 +19,7 @@ # include #endif #if defined(BSD) && defined(_KERNEL) -# include +# include #endif #ifndef SOLARIS @@ -31,48 +31,48 @@ #endif #ifndef __P -# define __P(x) x +# define __P(x) x #endif -# define SIOCADAFR _IOW('r', 60, struct ipfobj) -# define SIOCRMAFR _IOW('r', 61, struct ipfobj) -# define SIOCSETFF _IOW('r', 62, u_int) -# define SIOCGETFF _IOR('r', 63, u_int) -# define SIOCGETFS _IOWR('r', 64, struct ipfobj) -# define SIOCIPFFL _IOWR('r', 65, int) -# define SIOCIPFFB _IOR('r', 66, int) -# define SIOCADIFR _IOW('r', 67, struct ipfobj) -# define SIOCRMIFR _IOW('r', 68, struct ipfobj) -# define SIOCSWAPA _IOR('r', 69, u_int) -# define SIOCINAFR _IOW('r', 70, struct ipfobj) -# define SIOCINIFR _IOW('r', 71, struct ipfobj) -# define SIOCFRENB _IOW('r', 72, u_int) -# define SIOCFRSYN _IOW('r', 73, u_int) -# define SIOCFRZST _IOWR('r', 74, struct ipfobj) -# define SIOCZRLST _IOWR('r', 75, struct ipfobj) -# define SIOCAUTHW _IOWR('r', 76, struct ipfobj) -# define SIOCAUTHR _IOWR('r', 77, struct ipfobj) -# define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) -# define SIOCSTLCK _IOWR('r', 79, u_int) -# define SIOCSTPUT _IOWR('r', 80, struct ipfobj) -# define SIOCSTGET _IOWR('r', 81, struct ipfobj) -# define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) -# define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) -# define SIOCSETLG _IOWR('r', 84, int) -# define SIOCGETLG _IOWR('r', 85, int) -# define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) -# define SIOCIPFGET _IOWR('r', 88, struct ipfobj) -# define SIOCIPFSET _IOWR('r', 89, struct ipfobj) -# define SIOCIPFL6 _IOWR('r', 90, int) -# define SIOCIPFITER _IOWR('r', 91, struct ipfobj) -# define SIOCGENITER _IOWR('r', 92, struct ipfobj) -# define SIOCGTABL _IOWR('r', 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR('r', 94, int) -# define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) -# define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR('r', 98, int) +#define SIOCADAFR _IOW('r', 60, struct ipfobj) +#define SIOCRMAFR _IOW('r', 61, struct ipfobj) +#define SIOCSETFF _IOW('r', 62, u_int) +#define SIOCGETFF _IOR('r', 63, u_int) +#define SIOCGETFS _IOWR('r', 64, struct ipfobj) +#define SIOCIPFFL _IOWR('r', 65, int) +#define SIOCIPFFB _IOR('r', 66, int) +#define SIOCADIFR _IOW('r', 67, struct ipfobj) +#define SIOCRMIFR _IOW('r', 68, struct ipfobj) +#define SIOCSWAPA _IOR('r', 69, u_int) +#define SIOCINAFR _IOW('r', 70, struct ipfobj) +#define SIOCINIFR _IOW('r', 71, struct ipfobj) +#define SIOCFRENB _IOW('r', 72, u_int) +#define SIOCFRSYN _IOW('r', 73, u_int) +#define SIOCFRZST _IOWR('r', 74, struct ipfobj) +#define SIOCZRLST _IOWR('r', 75, struct ipfobj) +#define SIOCAUTHW _IOWR('r', 76, struct ipfobj) +#define SIOCAUTHR _IOWR('r', 77, struct ipfobj) +#define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) +#define SIOCSTLCK _IOWR('r', 79, u_int) +#define SIOCSTPUT _IOWR('r', 80, struct ipfobj) +#define SIOCSTGET _IOWR('r', 81, struct ipfobj) +#define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) +#define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) +#define SIOCSETLG _IOWR('r', 84, int) +#define SIOCGETLG _IOWR('r', 85, int) +#define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) +#define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) +#define SIOCIPFGET _IOWR('r', 88, struct ipfobj) +#define SIOCIPFSET _IOWR('r', 89, struct ipfobj) +#define SIOCIPFL6 _IOWR('r', 90, int) +#define SIOCIPFITER _IOWR('r', 91, struct ipfobj) +#define SIOCGENITER _IOWR('r', 92, struct ipfobj) +#define SIOCGTABL _IOWR('r', 93, struct ipfobj) +#define SIOCIPFDELTOK _IOWR('r', 94, int) +#define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) +#define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) +#define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) +#define SIOCIPFINTERROR _IOR('r', 98, int) #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR @@ -1640,14 +1640,14 @@ extern int ipf_qout(queue_t *, mblk_t *); extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); -# ifdef IPFILTER_LKM +# ifdef IPFILTER_LKM extern int ipf_identify(char *); -# endif -# if defined(__FreeBSD_version) +# endif +# if defined(__FreeBSD_version) extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); -# elif defined(__NetBSD__) +# elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); -# endif +# endif # endif /* MENTAT */ # if defined(__FreeBSD_version) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index cf30319b1cc3..d819d6301454 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -32,9 +32,9 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include +#include #if defined(__FreeBSD_version) -#include +# include #endif #include #include @@ -42,7 +42,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include - #include #include #include @@ -72,19 +71,19 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #ifdef IPFILTER_SCAN -#include "netinet/ip_scan.h" +# include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" #include #include #ifdef CSUM_DATA_VALID -#include +# include #endif extern int ip_optcopy(struct ip *, struct ip *); -# ifdef IPFILTER_M_IPFILTER +#ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); -# endif +#endif static int ipf_send_ip(fr_info_t *, mb_t *); @@ -95,8 +94,8 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { }; #define V_ipfmain VNET(ipfmain) -# include -# include +#include +#include static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 @@ -284,8 +283,8 @@ ipfdetach(softc) int ipfioctl(dev, cmd, data, mode, p) struct thread *p; -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#define p_cred td_ucred +#define p_uid td_ucred->cr_ruid struct cdev *dev; ioctlcmd_t cmd; caddr_t data; diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index fc2e78bfe27b..51d810baa310 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -732,7 +732,7 @@ ipf_pool_select_add_ref(arg, unit, name) /* */ /* Searches for an exact match of an entry in the pool. */ /* ------------------------------------------------------------------------ */ -extern void printhostmask(int, u_32_t *, u_32_t *)); +extern void printhostmask(int, u_32_t *, u_32_t *); static ip_pool_node_t * ipf_pool_findeq(softp, ipo, addr, mask) ipf_pool_softc_t *softp; From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 13:46:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32CAC53F696; Tue, 9 Feb 2021 13:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZkhV0zVGz52dG; Tue, 9 Feb 2021 13:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 145373470; Tue, 9 Feb 2021 13:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119DkoJL017410; Tue, 9 Feb 2021 13:46:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119DknVG017407; Tue, 9 Feb 2021 13:46:49 GMT (envelope-from git) Date: Tue, 9 Feb 2021 13:46:49 GMT Message-Id: <202102091346.119DknVG017407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 0c7a33852aa5 - stable/11 - MFC 4cd1807c7d2a67b633dd0c0bfde15091543a2514: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 0c7a33852aa5cd28a9d9b19b8f8034d60a9cb50f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 13:46:50 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0c7a33852aa5cd28a9d9b19b8f8034d60a9cb50f commit 0c7a33852aa5cd28a9d9b19b8f8034d60a9cb50f Author: Cy Schubert AuthorDate: 2021-01-26 06:24:28 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 01:19:19 +0000 MFC 4cd1807c7d2a67b633dd0c0bfde15091543a2514: Retire the K&R/STD C __P prototype declarations. In the old days when K&R C and STD C were each in use a workaround (read hack) was required to allow the same code to work on each without modification. All C compilers support STD C. We can finally put the __P prototype to rest. (cherry picked from commit 4cd1807c7d2a67b633dd0c0bfde15091543a2514) --- contrib/ipfilter/bpf_filter.c | 4 +- contrib/ipfilter/ip_dstlist.c | 70 ++--- contrib/ipfilter/ip_dstlist.h | 4 +- contrib/ipfilter/ip_fil.c | 12 +- contrib/ipfilter/ip_fil_compat.c | 122 ++++---- contrib/ipfilter/ip_msnrpc_pxy.c | 12 +- contrib/ipfilter/ipf.h | 340 ++++++++++----------- contrib/ipfilter/iplang/iplang.h | 2 +- contrib/ipfilter/iplang/iplang_l.l | 16 +- contrib/ipfilter/iplang/iplang_y.y | 162 +++++----- contrib/ipfilter/ipmon.h | 14 +- contrib/ipfilter/ipsend/ipresend.c | 4 +- contrib/ipfilter/ipsend/ipsend.c | 8 +- contrib/ipfilter/ipsend/ipsend.h | 52 ++-- contrib/ipfilter/ipsend/iptest.c | 4 +- contrib/ipfilter/ipsend/resend.c | 2 +- contrib/ipfilter/ipsend/sock.c | 4 +- contrib/ipfilter/ipt.h | 6 +- contrib/ipfilter/kmem.h | 6 +- contrib/ipfilter/lib/facpri.h | 8 +- contrib/ipfilter/lib/inet_addr.c | 2 +- contrib/ipfilter/lib/initparse.c | 2 +- contrib/ipfilter/lib/interror.c | 2 +- contrib/ipfilter/lib/ipft_hx.c | 8 +- contrib/ipfilter/lib/ipft_pc.c | 10 +- contrib/ipfilter/lib/ipft_tx.c | 12 +- contrib/ipfilter/lib/kmem.h | 6 +- contrib/ipfilter/lib/printipfexpr.c | 8 +- contrib/ipfilter/lib/save_execute.c | 8 +- contrib/ipfilter/lib/save_file.c | 12 +- contrib/ipfilter/lib/save_nothing.c | 6 +- contrib/ipfilter/lib/save_syslog.c | 8 +- contrib/ipfilter/lib/save_v1trap.c | 20 +- contrib/ipfilter/lib/save_v2trap.c | 24 +- contrib/ipfilter/lib/var.c | 4 +- contrib/ipfilter/man/ipf.4 | 2 +- contrib/ipfilter/md5.c | 2 +- contrib/ipfilter/md5.h | 6 +- contrib/ipfilter/radix_ipf.c | 20 +- contrib/ipfilter/radix_ipf.h | 24 +- contrib/ipfilter/tools/ipf.c | 32 +- contrib/ipfilter/tools/ipf_y.y | 52 ++-- contrib/ipfilter/tools/ipfcomp.c | 38 +-- contrib/ipfilter/tools/ipfs.c | 28 +- contrib/ipfilter/tools/ipfstat.c | 76 ++--- contrib/ipfilter/tools/ipfsyncd.c | 22 +- contrib/ipfilter/tools/ipftest.c | 40 +-- contrib/ipfilter/tools/ipmon.c | 48 +-- contrib/ipfilter/tools/ipmon_y.y | 22 +- contrib/ipfilter/tools/ipnat.c | 24 +- contrib/ipfilter/tools/ipnat_y.y | 38 +-- contrib/ipfilter/tools/ippool.c | 34 +-- contrib/ipfilter/tools/ippool_y.y | 10 +- contrib/ipfilter/tools/ipscan_y.y | 32 +- contrib/ipfilter/tools/ipsyncm.c | 4 +- contrib/ipfilter/tools/ipsyncs.c | 4 +- contrib/ipfilter/tools/lexer.c | 14 +- contrib/ipfilter/tools/lexer.h | 14 +- sys/contrib/ipfilter/netinet/fil.c | 148 +++++----- sys/contrib/ipfilter/netinet/ip_auth.c | 14 +- sys/contrib/ipfilter/netinet/ip_auth.h | 40 +-- sys/contrib/ipfilter/netinet/ip_compat.h | 38 ++- sys/contrib/ipfilter/netinet/ip_dns_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_dstlist.c | 70 ++--- sys/contrib/ipfilter/netinet/ip_dstlist.h | 4 +- sys/contrib/ipfilter/netinet/ip_fil.h | 408 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 6 +- sys/contrib/ipfilter/netinet/ip_frag.c | 28 +- sys/contrib/ipfilter/netinet/ip_frag.h | 54 ++-- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 78 ++--- sys/contrib/ipfilter/netinet/ip_htable.c | 76 ++--- sys/contrib/ipfilter/netinet/ip_htable.h | 6 +- sys/contrib/ipfilter/netinet/ip_ipsec_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 14 +- sys/contrib/ipfilter/netinet/ip_lookup.c | 16 +- sys/contrib/ipfilter/netinet/ip_lookup.h | 92 +++--- sys/contrib/ipfilter/netinet/ip_nat.c | 98 +++---- sys/contrib/ipfilter/netinet/ip_nat.h | 176 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 30 +- sys/contrib/ipfilter/netinet/ip_netbios_pxy.c | 6 +- sys/contrib/ipfilter/netinet/ip_pool.c | 74 ++--- sys/contrib/ipfilter/netinet/ip_pool.h | 2 +- sys/contrib/ipfilter/netinet/ip_pptp_pxy.c | 18 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 4 +- sys/contrib/ipfilter/netinet/ip_proxy.h | 76 ++--- sys/contrib/ipfilter/netinet/ip_raudio_pxy.c | 10 +- sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c | 22 +- sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c | 60 ++-- sys/contrib/ipfilter/netinet/ip_rules.h | 16 +- sys/contrib/ipfilter/netinet/ip_scan.c | 12 +- sys/contrib/ipfilter/netinet/ip_scan.h | 16 +- sys/contrib/ipfilter/netinet/ip_state.c | 72 ++--- sys/contrib/ipfilter/netinet/ip_state.h | 66 ++--- sys/contrib/ipfilter/netinet/ip_sync.c | 18 +- sys/contrib/ipfilter/netinet/ip_sync.h | 34 +-- sys/contrib/ipfilter/netinet/ip_tftp_pxy.c | 26 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 16 +- sys/contrib/ipfilter/netinet/radix_ipf.c | 20 +- sys/contrib/ipfilter/netinet/radix_ipf.h | 22 +- 99 files changed, 1795 insertions(+), 1801 deletions(-) diff --git a/contrib/ipfilter/bpf_filter.c b/contrib/ipfilter/bpf_filter.c index bd465761a34e..85a38a88bf57 100644 --- a/contrib/ipfilter/bpf_filter.c +++ b/contrib/ipfilter/bpf_filter.c @@ -71,8 +71,8 @@ static const char rcsid[] = #define int32 bpf_int32 #define u_int32 bpf_u_int32 -static int m_xword __P((mb_t *, int, int *)); -static int m_xhalf __P((mb_t *, int, int *)); +static int m_xword(mb_t *, int, int *); +static int m_xhalf(mb_t *, int, int *); #ifndef LBL_ALIGN /* diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c index 99c7a22668df..14b071b0b95f 100644 --- a/contrib/ipfilter/ip_dstlist.c +++ b/contrib/ipfilter/ip_dstlist.c @@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s { } ipf_dstl_softc_t; -static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); -static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, - void *, u_int)); -static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, - iplookupflush_t *)); -static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, - void *)); -static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, - ipflookupiter_t *)); -static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); -static void *ipf_dstlist_table_find __P((void *, int, char *)); -static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, - ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, - ippool_dst_t *)); -static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); -static void *ipf_dstlist_select_ref __P((void *, int, char *)); -static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); -static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); -static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); +static void *ipf_dstlist_soft_create(ipf_main_softc_t *); +static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *); +static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *); +static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *); +static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int, + void *, u_int); +static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *, + iplookupflush_t *); +static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int, + void *); +static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *); +static int ipf_dstlist_node_add(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_node_del(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_add(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_del(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *); +static void *ipf_dstlist_table_find(void *, int, char *); +static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_remove(ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *, + ippool_dst_t *); +static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *); +static void *ipf_dstlist_select_ref(void *, int, char *); +static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *); +static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *); +static void ipf_dstlist_expire(ipf_main_softc_t *, void *); +static void ipf_dstlist_sync(ipf_main_softc_t *, void *); ipf_lookup_t ipf_dstlist_backend = { IPLT_DSTLIST, diff --git a/contrib/ipfilter/ip_dstlist.h b/contrib/ipfilter/ip_dstlist.h index e2885e5c47ad..c4acd78dfd94 100644 --- a/contrib/ipfilter/ip_dstlist.h +++ b/contrib/ipfilter/ip_dstlist.h @@ -62,7 +62,7 @@ typedef struct dstlist_stat_s { extern ipf_lookup_t ipf_dstlist_backend; -extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *, - frdest_t *)); +extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *, + frdest_t *); #endif /* __IP_DSTLIST_H__ */ diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 794d7e205bb3..327f90fc356c 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -23,12 +23,12 @@ static int nifs = 0; struct rtentry; -static void ipf_setifpaddr __P((struct ifnet *, char *)); -void init_ifp __P((void)); -static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); +static void ipf_setifpaddr(struct ifnet *, char *); +void init_ifp(void); +static int no_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); +static int write_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); struct ifaddr { struct sockaddr_storage ifa_addr; diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index 271c2e065738..fbcfc8a0088f 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -73,7 +73,7 @@ typedef struct tcpinfo4 { tcpdata_t ts_data[2]; } tcpinfo4_t; -static void ipf_v5tcpinfoto4 __P((tcpinfo_t *, tcpinfo4_t *)); +static void ipf_v5tcpinfoto4(tcpinfo_t *, tcpinfo4_t *); static void ipf_v5tcpinfoto4(v5, v4) @@ -1190,66 +1190,66 @@ typedef struct ipfrstat_4_1_1 { } ipfrstat_4_1_1_t; /* ------------------------------------------------------------------------ */ -static int ipf_addfrstr __P((char *, int, char *, int)); -static void ipf_v4iptov5 __P((frip4_t *, fr_ip_t *)); -static void ipf_v5iptov4 __P((fr_ip_t *, frip4_t *)); -static void ipfv4tuctov5 __P((frtuc4_t *, frtuc_t *)); -static void ipfv5tuctov4 __P((frtuc_t *, frtuc4_t *)); -static int ipf_v4fripftov5 __P((fripf4_t *, char *)); -static void ipf_v5fripftov4 __P((fripf_t *, fripf4_t *)); -static int fr_frflags4to5 __P((u_32_t)); -static int fr_frflags5to4 __P((u_32_t)); - -static void friostat_current_to_4_1_0 __P((void *, friostat_4_1_0_t *, int)); -static void friostat_current_to_4_1_33 __P((void *, friostat_4_1_33_t *, int)); -static void ipstate_current_to_4_1_0 __P((void *, ipstate_4_1_0_t *)); -static void ipstate_current_to_4_1_16 __P((void *, ipstate_4_1_16_t *)); -static void ipnat_current_to_4_1_0 __P((void *, ipnat_4_1_0_t *)); -static void ipnat_current_to_4_1_14 __P((void *, ipnat_4_1_14_t *)); -static void frauth_current_to_4_1_11 __P((void *, frauth_4_1_11_t *)); -static void frauth_current_to_4_1_23 __P((void *, frauth_4_1_23_t *)); -static void frauth_current_to_4_1_24 __P((void *, frauth_4_1_24_t *)); -static void frauth_current_to_4_1_29 __P((void *, frauth_4_1_29_t *)); -static void frentry_current_to_4_1_0 __P((void *, frentry_4_1_0_t *)); -static void frentry_current_to_4_1_16 __P((void *, frentry_4_1_16_t *)); -static void frentry_current_to_4_1_34 __P((void *, frentry_4_1_34_t *)); -static void fr_info_current_to_4_1_11 __P((void *, fr_info_4_1_11_t *)); -static void fr_info_current_to_4_1_23 __P((void *, fr_info_4_1_23_t *)); -static void fr_info_current_to_4_1_24 __P((void *, fr_info_4_1_24_t *)); -static void nat_save_current_to_4_1_3 __P((void *, nat_save_4_1_3_t *)); -static void nat_save_current_to_4_1_14 __P((void *, nat_save_4_1_14_t *)); -static void nat_save_current_to_4_1_16 __P((void *, nat_save_4_1_16_t *)); -static void ipstate_save_current_to_4_1_0 __P((void *, ipstate_save_4_1_0_t *)); -static void ipstate_save_current_to_4_1_16 __P((void *, ipstate_save_4_1_16_t *)); -static void ips_stat_current_to_4_1_0 __P((void *, ips_stat_4_1_0_t *)); -static void ips_stat_current_to_4_1_21 __P((void *, ips_stat_4_1_21_t *)); -static void natstat_current_to_4_1_0 __P((void *, natstat_4_1_0_t *)); -static void natstat_current_to_4_1_16 __P((void *, natstat_4_1_16_t *)); -static void natstat_current_to_4_1_27 __P((void *, natstat_4_1_27_t *)); -static void natstat_current_to_4_1_32 __P((void *, natstat_4_1_32_t *)); -static void nat_current_to_4_1_3 __P((void *, nat_4_1_3_t *)); -static void nat_current_to_4_1_14 __P((void *, nat_4_1_14_t *)); -static void nat_current_to_4_1_25 __P((void *, nat_4_1_25_t *)); - -static void friostat_4_1_0_to_current __P((friostat_4_1_0_t *, void *)); -static void friostat_4_1_33_to_current __P((friostat_4_1_33_t *, void *)); -static void ipnat_4_1_0_to_current __P((ipnat_4_1_0_t *, void *, int)); -static void ipnat_4_1_14_to_current __P((ipnat_4_1_14_t *, void *, int)); -static void frauth_4_1_11_to_current __P((frauth_4_1_11_t *, void *)); -static void frauth_4_1_23_to_current __P((frauth_4_1_23_t *, void *)); -static void frauth_4_1_24_to_current __P((frauth_4_1_24_t *, void *)); -static void frauth_4_1_29_to_current __P((frauth_4_1_29_t *, void *)); -static void frauth_4_1_32_to_current __P((frauth_4_1_32_t *, void *)); -static void frentry_4_1_0_to_current __P((ipf_main_softc_t *, frentry_4_1_0_t *, void *, int)); -static void frentry_4_1_16_to_current __P((ipf_main_softc_t *, frentry_4_1_16_t *, void *, int)); -static void frentry_4_1_34_to_current __P((ipf_main_softc_t *, frentry_4_1_34_t *, void *, int)); -static void fr_info_4_1_11_to_current __P((fr_info_4_1_11_t *, void *)); -static void fr_info_4_1_23_to_current __P((fr_info_4_1_23_t *, void *)); -static void fr_info_4_1_24_to_current __P((fr_info_4_1_24_t *, void *)); -static void fr_info_4_1_32_to_current __P((fr_info_4_1_32_t *, void *)); -static void nat_save_4_1_3_to_current __P((ipf_main_softc_t *, nat_save_4_1_3_t *, void *)); -static void nat_save_4_1_14_to_current __P((ipf_main_softc_t *, nat_save_4_1_14_t *, void *)); -static void nat_save_4_1_16_to_current __P((ipf_main_softc_t *, nat_save_4_1_16_t *, void *)); +static int ipf_addfrstr(char *, int, char *, int); +static void ipf_v4iptov5(frip4_t *, fr_ip_t *); +static void ipf_v5iptov4(fr_ip_t *, frip4_t *); +static void ipfv4tuctov5(frtuc4_t *, frtuc_t *); +static void ipfv5tuctov4(frtuc_t *, frtuc4_t *); +static int ipf_v4fripftov5(fripf4_t *, char *); +static void ipf_v5fripftov4(fripf_t *, fripf4_t *); +static int fr_frflags4to5(u_32_t); +static int fr_frflags5to4(u_32_t); + +static void friostat_current_to_4_1_0(void *, friostat_4_1_0_t *, int); +static void friostat_current_to_4_1_33(void *, friostat_4_1_33_t *, int); +static void ipstate_current_to_4_1_0(void *, ipstate_4_1_0_t *); +static void ipstate_current_to_4_1_16(void *, ipstate_4_1_16_t *); +static void ipnat_current_to_4_1_0(void *, ipnat_4_1_0_t *); +static void ipnat_current_to_4_1_14(void *, ipnat_4_1_14_t *); +static void frauth_current_to_4_1_11(void *, frauth_4_1_11_t *); +static void frauth_current_to_4_1_23(void *, frauth_4_1_23_t *); +static void frauth_current_to_4_1_24(void *, frauth_4_1_24_t *); +static void frauth_current_to_4_1_29(void *, frauth_4_1_29_t *); +static void frentry_current_to_4_1_0(void *, frentry_4_1_0_t *); +static void frentry_current_to_4_1_16(void *, frentry_4_1_16_t *); +static void frentry_current_to_4_1_34(void *, frentry_4_1_34_t *); +static void fr_info_current_to_4_1_11(void *, fr_info_4_1_11_t *); +static void fr_info_current_to_4_1_23(void *, fr_info_4_1_23_t *); +static void fr_info_current_to_4_1_24(void *, fr_info_4_1_24_t *); +static void nat_save_current_to_4_1_3(void *, nat_save_4_1_3_t *); +static void nat_save_current_to_4_1_14(void *, nat_save_4_1_14_t *); +static void nat_save_current_to_4_1_16(void *, nat_save_4_1_16_t *); +static void ipstate_save_current_to_4_1_0(void *, ipstate_save_4_1_0_t *); +static void ipstate_save_current_to_4_1_16(void *, ipstate_save_4_1_16_t *); +static void ips_stat_current_to_4_1_0(void *, ips_stat_4_1_0_t *); +static void ips_stat_current_to_4_1_21(void *, ips_stat_4_1_21_t *); +static void natstat_current_to_4_1_0(void *, natstat_4_1_0_t *); +static void natstat_current_to_4_1_16(void *, natstat_4_1_16_t *); +static void natstat_current_to_4_1_27(void *, natstat_4_1_27_t *); +static void natstat_current_to_4_1_32(void *, natstat_4_1_32_t *); +static void nat_current_to_4_1_3(void *, nat_4_1_3_t *); +static void nat_current_to_4_1_14(void *, nat_4_1_14_t *); +static void nat_current_to_4_1_25(void *, nat_4_1_25_t *); + +static void friostat_4_1_0_to_current(friostat_4_1_0_t *, void *); +static void friostat_4_1_33_to_current(friostat_4_1_33_t *, void *); +static void ipnat_4_1_0_to_current(ipnat_4_1_0_t *, void *, int); +static void ipnat_4_1_14_to_current(ipnat_4_1_14_t *, void *, int); +static void frauth_4_1_11_to_current(frauth_4_1_11_t *, void *); +static void frauth_4_1_23_to_current(frauth_4_1_23_t *, void *); +static void frauth_4_1_24_to_current(frauth_4_1_24_t *, void *); +static void frauth_4_1_29_to_current(frauth_4_1_29_t *, void *); +static void frauth_4_1_32_to_current(frauth_4_1_32_t *, void *); +static void frentry_4_1_0_to_current(ipf_main_softc_t *, frentry_4_1_0_t *, void *, int); +static void frentry_4_1_16_to_current(ipf_main_softc_t *, frentry_4_1_16_t *, void *, int); +static void frentry_4_1_34_to_current(ipf_main_softc_t *, frentry_4_1_34_t *, void *, int); +static void fr_info_4_1_11_to_current(fr_info_4_1_11_t *, void *); +static void fr_info_4_1_23_to_current(fr_info_4_1_23_t *, void *); +static void fr_info_4_1_24_to_current(fr_info_4_1_24_t *, void *); +static void fr_info_4_1_32_to_current(fr_info_4_1_32_t *, void *); +static void nat_save_4_1_3_to_current(ipf_main_softc_t *, nat_save_4_1_3_t *, void *); +static void nat_save_4_1_14_to_current(ipf_main_softc_t *, nat_save_4_1_14_t *, void *); +static void nat_save_4_1_16_to_current(ipf_main_softc_t *, nat_save_4_1_16_t *, void *); /* ------------------------------------------------------------------------ */ /* In this section is a series of short routines that deal with translating */ diff --git a/contrib/ipfilter/ip_msnrpc_pxy.c b/contrib/ipfilter/ip_msnrpc_pxy.c index 40bc084cbb5d..9cddd398edde 100644 --- a/contrib/ipfilter/ip_msnrpc_pxy.c +++ b/contrib/ipfilter/ip_msnrpc_pxy.c @@ -33,12 +33,12 @@ typedef struct msnrpchdr { u_char mrh_ans; } msnrpchdr_t; -int ippr_msnrpc_init __P((void)); -void ippr_msnrpc_fini __P((void)); -int ippr_msnrpc_new __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_out __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_in __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_check __P((ip_t *, msnrpchdr_t *)); +int ippr_msnrpc_init(void); +void ippr_msnrpc_fini(void); +int ippr_msnrpc_new(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_out(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_in(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_check(ip_t *, msnrpchdr_t *); static frentry_t msnfr; diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 834ba83f51f0..c7f7308a9ba9 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -175,12 +175,12 @@ typedef struct proxyrule { #if defined(__NetBSD__) || defined(__FreeBSD_version) || \ SOLARIS # include -typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...)); +typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...); #else -typedef int (* ioctlfunc_t) __P((dev_t, ioctlcmd_t, void *)); +typedef int (* ioctlfunc_t)(dev_t, ioctlcmd_t, void *); #endif -typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *)); -typedef int (* copyfunc_t) __P((void *, void *, size_t)); +typedef int (* addfunc_t)(int, ioctlfunc_t, void *); +typedef int (* copyfunc_t)(void *, void *, size_t); extern char thishost[MAXHOSTNAMELEN]; @@ -200,178 +200,178 @@ extern wordtab_t natfields[]; extern wordtab_t poolfields[]; -extern int addicmp __P((char ***, struct frentry *, int)); -extern int addipopt __P((char *, struct ipopt_names *, int, char *)); -extern int addkeep __P((char ***, struct frentry *, int)); -extern alist_t *alist_new __P((int, char *)); -extern void alist_free __P((alist_t *)); -extern void assigndefined __P((char *)); -extern void binprint __P((void *, size_t)); -extern u_32_t buildopts __P((char *, char *, int)); -extern int checkrev __P((char *)); -extern int connecttcp __P((char *, int)); -extern int count6bits __P((u_32_t *)); -extern int count4bits __P((u_32_t)); -extern char *fac_toname __P((int)); -extern int fac_findname __P((char *)); -extern const char *familyname __P((const int)); -extern void fill6bits __P((int, u_int *)); -extern wordtab_t *findword __P((wordtab_t *, char *)); -extern int ftov __P((int)); -extern char *ipf_geterror __P((int, ioctlfunc_t *)); -extern int genmask __P((int, char *, i6addr_t *)); -extern int gethost __P((int, char *, i6addr_t *)); -extern int geticmptype __P((int, char *)); -extern int getport __P((struct frentry *, char *, u_short *, char *)); -extern int getportproto __P((char *, int)); -extern int getproto __P((char *)); -extern char *getnattype __P((struct nat *)); -extern char *getsumd __P((u_32_t)); -extern u_32_t getoptbyname __P((char *)); -extern u_32_t getoptbyvalue __P((int)); -extern u_32_t getv6optbyname __P((char *)); -extern u_32_t getv6optbyvalue __P((int)); -extern char *icmptypename __P((int, int)); -extern void initparse __P((void)); -extern void ipf_dotuning __P((int, char *, ioctlfunc_t)); -extern int ipf_addrule __P((int, ioctlfunc_t, void *)); -extern void ipf_mutex_clean __P((void)); -extern int ipf_parsefile __P((int, addfunc_t, ioctlfunc_t *, char *)); -extern int ipf_parsesome __P((int, addfunc_t, ioctlfunc_t *, FILE *)); -extern void ipf_perror __P((int, char *)); -extern int ipf_perror_fd __P(( int, ioctlfunc_t, char *)); -extern void ipf_rwlock_clean __P((void)); -extern char *ipf_strerror __P((int)); -extern void ipferror __P((int, char *)); -extern int ipmon_parsefile __P((char *)); -extern int ipmon_parsesome __P((FILE *)); -extern int ipnat_addrule __P((int, ioctlfunc_t, void *)); -extern int ipnat_parsefile __P((int, addfunc_t, ioctlfunc_t, char *)); -extern int ipnat_parsesome __P((int, addfunc_t, ioctlfunc_t, FILE *)); -extern int ippool_parsefile __P((int, char *, ioctlfunc_t)); -extern int ippool_parsesome __P((int, FILE *, ioctlfunc_t)); -extern int kmemcpywrap __P((void *, void *, size_t)); -extern char *kvatoname __P((ipfunc_t, ioctlfunc_t)); -extern int load_dstlist __P((struct ippool_dst *, ioctlfunc_t, - ipf_dstnode_t *)); -extern int load_dstlistnode __P((int, char *, struct ipf_dstnode *, - ioctlfunc_t)); -extern alist_t *load_file __P((char *)); -extern int load_hash __P((struct iphtable_s *, struct iphtent_s *, - ioctlfunc_t)); -extern int load_hashnode __P((int, char *, struct iphtent_s *, int, - ioctlfunc_t)); -extern alist_t *load_http __P((char *)); -extern int load_pool __P((struct ip_pool_s *list, ioctlfunc_t)); -extern int load_poolnode __P((int, char *, ip_pool_node_t *, int, ioctlfunc_t)); -extern alist_t *load_url __P((char *)); -extern alist_t *make_range __P((int, struct in_addr, struct in_addr)); -extern void mb_hexdump __P((mb_t *, FILE *)); -extern ipfunc_t nametokva __P((char *, ioctlfunc_t)); -extern void nat_setgroupmap __P((struct ipnat *)); -extern int ntomask __P((int, int, u_32_t *)); -extern u_32_t optname __P((char ***, u_short *, int)); -extern wordtab_t *parsefields __P((wordtab_t *, char *)); -extern int *parseipfexpr __P((char *, char **)); -extern int parsewhoisline __P((char *, addrfamily_t *, addrfamily_t *)); -extern void pool_close __P((void)); -extern int pool_fd __P((void)); -extern int pool_ioctl __P((ioctlfunc_t, ioctlcmd_t, void *)); -extern int pool_open __P((void)); -extern char *portname __P((int, int)); -extern int pri_findname __P((char *)); -extern char *pri_toname __P((int)); -extern void print_toif __P((int, char *, char *, struct frdest *)); -extern void printaps __P((ap_session_t *, int, int)); -extern void printaddr __P((int, int, char *, int, u_32_t *, u_32_t *)); -extern void printbuf __P((char *, int, int)); -extern void printfieldhdr __P((wordtab_t *, wordtab_t *)); -extern void printfr __P((struct frentry *, ioctlfunc_t)); -extern struct iphtable_s *printhash __P((struct iphtable_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct iphtable_s *printhash_live __P((iphtable_t *, int, char *, - int, wordtab_t *)); -extern ippool_dst_t *printdstl_live __P((ippool_dst_t *, int, char *, - int, wordtab_t *)); -extern void printhashdata __P((iphtable_t *, int)); -extern struct iphtent_s *printhashnode __P((struct iphtable_s *, +extern int addicmp(char ***, struct frentry *, int); +extern int addipopt(char *, struct ipopt_names *, int, char *); +extern int addkeep(char ***, struct frentry *, int); +extern alist_t *alist_new(int, char *); +extern void alist_free(alist_t *); +extern void assigndefined(char *); +extern void binprint(void *, size_t); +extern u_32_t buildopts(char *, char *, int); +extern int checkrev(char *); +extern int connecttcp(char *, int); +extern int count6bits(u_32_t *); +extern int count4bits(u_32_t); +extern char *fac_toname(int); +extern int fac_findname(char *); +extern const char *familyname(const int); +extern void fill6bits(int, u_int *); +extern wordtab_t *findword(wordtab_t *, char *); +extern int ftov(int); +extern char *ipf_geterror(int, ioctlfunc_t *); +extern int genmask(int, char *, i6addr_t *); +extern int gethost(int, char *, i6addr_t *); +extern int geticmptype(int, char *); +extern int getport(struct frentry *, char *, u_short *, char *); +extern int getportproto(char *, int); +extern int getproto(char *); +extern char *getnattype(struct nat *); +extern char *getsumd(u_32_t); +extern u_32_t getoptbyname(char *); +extern u_32_t getoptbyvalue(int); +extern u_32_t getv6optbyname(char *); +extern u_32_t getv6optbyvalue(int); +extern char *icmptypename(int, int); +extern void initparse(void); +extern void ipf_dotuning(int, char *, ioctlfunc_t); +extern int ipf_addrule(int, ioctlfunc_t, void *); +extern void ipf_mutex_clean(void); +extern int ipf_parsefile(int, addfunc_t, ioctlfunc_t *, char *); +extern int ipf_parsesome(int, addfunc_t, ioctlfunc_t *, FILE *); +extern void ipf_perror(int, char *); +extern int ipf_perror_fd( int, ioctlfunc_t, char *); +extern void ipf_rwlock_clean(void); +extern char *ipf_strerror(int); +extern void ipferror(int, char *); +extern int ipmon_parsefile(char *); +extern int ipmon_parsesome(FILE *); +extern int ipnat_addrule(int, ioctlfunc_t, void *); +extern int ipnat_parsefile(int, addfunc_t, ioctlfunc_t, char *); +extern int ipnat_parsesome(int, addfunc_t, ioctlfunc_t, FILE *); +extern int ippool_parsefile(int, char *, ioctlfunc_t); +extern int ippool_parsesome(int, FILE *, ioctlfunc_t); +extern int kmemcpywrap(void *, void *, size_t); +extern char *kvatoname(ipfunc_t, ioctlfunc_t); +extern int load_dstlist(struct ippool_dst *, ioctlfunc_t, + ipf_dstnode_t *); +extern int load_dstlistnode(int, char *, struct ipf_dstnode *, + ioctlfunc_t); +extern alist_t *load_file(char *); +extern int load_hash(struct iphtable_s *, struct iphtent_s *, + ioctlfunc_t); +extern int load_hashnode(int, char *, struct iphtent_s *, int, + ioctlfunc_t); +extern alist_t *load_http(char *); +extern int load_pool(struct ip_pool_s *list, ioctlfunc_t); +extern int load_poolnode(int, char *, ip_pool_node_t *, int, ioctlfunc_t); +extern alist_t *load_url(char *); +extern alist_t *make_range(int, struct in_addr, struct in_addr); +extern void mb_hexdump(mb_t *, FILE *); +extern ipfunc_t nametokva(char *, ioctlfunc_t); +extern void nat_setgroupmap(struct ipnat *); +extern int ntomask(int, int, u_32_t *); +extern u_32_t optname(char ***, u_short *, int); +extern wordtab_t *parsefields(wordtab_t *, char *); +extern int *parseipfexpr(char *, char **); +extern int parsewhoisline(char *, addrfamily_t *, addrfamily_t *); +extern void pool_close(void); +extern int pool_fd(void); +extern int pool_ioctl(ioctlfunc_t, ioctlcmd_t, void *); +extern int pool_open(void); +extern char *portname(int, int); +extern int pri_findname(char *); +extern char *pri_toname(int); +extern void print_toif(int, char *, char *, struct frdest *); +extern void printaps(ap_session_t *, int, int); +extern void printaddr(int, int, char *, int, u_32_t *, u_32_t *); +extern void printbuf(char *, int, int); +extern void printfieldhdr(wordtab_t *, wordtab_t *); +extern void printfr(struct frentry *, ioctlfunc_t); +extern struct iphtable_s *printhash(struct iphtable_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct iphtable_s *printhash_live(iphtable_t *, int, char *, + int, wordtab_t *); +extern ippool_dst_t *printdstl_live(ippool_dst_t *, int, char *, + int, wordtab_t *); +extern void printhashdata(iphtable_t *, int); +extern struct iphtent_s *printhashnode(struct iphtable_s *, struct iphtent_s *, - copyfunc_t, int, wordtab_t *)); -extern void printhost __P((int, u_32_t *)); -extern void printhostmask __P((int, u_32_t *, u_32_t *)); -extern void printip __P((int, u_32_t *)); -extern void printlog __P((struct frentry *)); -extern void printlookup __P((char *, i6addr_t *addr, i6addr_t *mask)); -extern void printmask __P((int, u_32_t *)); -extern void printnataddr __P((int, char *, nat_addr_t *, int)); -extern void printnatfield __P((nat_t *, int)); -extern void printnatside __P((char *, nat_stat_side_t *)); -extern void printpacket __P((int, mb_t *)); -extern void printpacket6 __P((int, mb_t *)); -extern struct ippool_dst *printdstlist __P((struct ippool_dst *, copyfunc_t, + copyfunc_t, int, wordtab_t *); +extern void printhost(int, u_32_t *); +extern void printhostmask(int, u_32_t *, u_32_t *); +extern void printip(int, u_32_t *); +extern void printlog(struct frentry *); +extern void printlookup(char *, i6addr_t *addr, i6addr_t *mask); +extern void printmask(int, u_32_t *); +extern void printnataddr(int, char *, nat_addr_t *, int); +extern void printnatfield(nat_t *, int); +extern void printnatside(char *, nat_stat_side_t *); +extern void printpacket(int, mb_t *); +extern void printpacket6(int, mb_t *); +extern struct ippool_dst *printdstlist(struct ippool_dst *, copyfunc_t, char *, int, ipf_dstnode_t *, - wordtab_t *)); -extern void printdstlistdata __P((ippool_dst_t *, int)); -extern ipf_dstnode_t *printdstlistnode __P((ipf_dstnode_t *, copyfunc_t, - int, wordtab_t *)); -extern void printdstlistpolicy __P((ippool_policy_t)); -extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct ip_pool_s *printpool_live __P((struct ip_pool_s *, int, - char *, int, wordtab_t *)); -extern void printpooldata __P((ip_pool_t *, int)); -extern void printpoolfield __P((void *, int, int)); -extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *, - int, wordtab_t *)); -extern void printproto __P((struct protoent *, int, struct ipnat *)); -extern void printportcmp __P((int, struct frpcmp *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printtqtable __P((ipftq_t *)); -extern void printtunable __P((ipftune_t *)); -extern void printunit __P((int)); -extern void optprint __P((u_short *, u_long, u_long)); + wordtab_t *); +extern void printdstlistdata(ippool_dst_t *, int); +extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t, + int, wordtab_t *); +extern void printdstlistpolicy(ippool_policy_t); +extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int, + char *, int, wordtab_t *); +extern void printpooldata(ip_pool_t *, int); +extern void printpoolfield(void *, int, int); +extern struct ip_pool_node *printpoolnode(struct ip_pool_node *, + int, wordtab_t *); +extern void printproto(struct protoent *, int, struct ipnat *); +extern void printportcmp(int, struct frpcmp *); +extern void printstatefield(ipstate_t *, int); +extern void printtqtable(ipftq_t *); +extern void printtunable(ipftune_t *); +extern void printunit(int); +extern void optprint(u_short *, u_long, u_long); #ifdef USE_INET6 -extern void optprintv6 __P((u_short *, u_long, u_long)); +extern void optprintv6(u_short *, u_long, u_long); #endif -extern int remove_hash __P((struct iphtable_s *, ioctlfunc_t)); -extern int remove_hashnode __P((int, char *, struct iphtent_s *, ioctlfunc_t)); -extern int remove_pool __P((ip_pool_t *, ioctlfunc_t)); -extern int remove_poolnode __P((int, char *, ip_pool_node_t *, ioctlfunc_t)); -extern u_char tcpflags __P((char *)); -extern void printc __P((struct frentry *)); -extern void printC __P((int)); -extern void emit __P((int, int, void *, struct frentry *)); -extern u_char secbit __P((int)); -extern u_char seclevel __P((char *)); -extern void printfraginfo __P((char *, struct ipfr *)); -extern void printifname __P((char *, char *, void *)); -extern char *hostname __P((int, void *)); -extern struct ipstate *printstate __P((struct ipstate *, int, u_long)); -extern void printsbuf __P((char *)); -extern void printnat __P((struct ipnat *, int)); -extern void printactiveaddress __P((int, char *, i6addr_t *, char *)); -extern void printactivenat __P((struct nat *, int, u_long)); -extern void printhostmap __P((struct hostmap *, u_int)); -extern void printtcpflags __P((u_32_t, u_32_t)); -extern void printipfexpr __P((int *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printstatefieldhdr __P((int)); -extern int sendtrap_v1_0 __P((int, char *, char *, int, time_t)); -extern int sendtrap_v2_0 __P((int, char *, char *, int)); -extern int vtof __P((int)); - -extern void set_variable __P((char *, char *)); -extern char *get_variable __P((char *, char **, int)); -extern void resetlexer __P((void)); - -extern void debug __P((int, char *, ...)); -extern void verbose __P((int, char *, ...)); -extern void ipfkdebug __P((char *, ...)); -extern void ipfkverbose __P((char *, ...)); +extern int remove_hash(struct iphtable_s *, ioctlfunc_t); +extern int remove_hashnode(int, char *, struct iphtent_s *, ioctlfunc_t); +extern int remove_pool(ip_pool_t *, ioctlfunc_t); +extern int remove_poolnode(int, char *, ip_pool_node_t *, ioctlfunc_t); +extern u_char tcpflags(char *); +extern void printc(struct frentry *); +extern void printC(int); +extern void emit(int, int, void *, struct frentry *); +extern u_char secbit(int); +extern u_char seclevel(char *); +extern void printfraginfo(char *, struct ipfr *); +extern void printifname(char *, char *, void *); +extern char *hostname(int, void *); +extern struct ipstate *printstate(struct ipstate *, int, u_long); +extern void printsbuf(char *); +extern void printnat(struct ipnat *, int); +extern void printactiveaddress(int, char *, i6addr_t *, char *); +extern void printactivenat(struct nat *, int, u_long); +extern void printhostmap(struct hostmap *, u_int); +extern void printtcpflags(u_32_t, u_32_t); +extern void printipfexpr(int *); +extern void printstatefield(ipstate_t *, int); +extern void printstatefieldhdr(int); +extern int sendtrap_v1_0(int, char *, char *, int, time_t); +extern int sendtrap_v2_0(int, char *, char *, int); +extern int vtof(int); + +extern void set_variable(char *, char *); +extern char *get_variable(char *, char **, int); +extern void resetlexer(void); + +extern void debug(int, char *, ...); +extern void verbose(int, char *, ...); +extern void ipfkdebug(char *, ...); +extern void ipfkverbose(char *, ...); #if SOLARIS -extern int gethostname __P((char *, int )); -extern void sync __P((void)); +extern int gethostname(char *, int ); +extern void sync(void); #endif #endif /* __IPF_H__ */ diff --git a/contrib/ipfilter/iplang/iplang.h b/contrib/ipfilter/iplang/iplang.h index 63cc078322a3..f38ef9671701 100644 --- a/contrib/ipfilter/iplang/iplang.h +++ b/contrib/ipfilter/iplang/iplang.h @@ -50,5 +50,5 @@ typedef struct aniphdr { #define ah_udp ah_un.ahu_udp #define ah_icmp ah_un.ahu_icmp -extern int get_arpipv4 __P((char *, char *)); +extern int get_arpipv4(char *, char *); diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index e66867e2a455..f8b1b82d4707 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -29,14 +29,14 @@ extern int opts; int lineNum = 0, ipproto = 0, oldipproto = 0, next = -1, laststate = 0; int *prstack = NULL, numpr = 0, state = 0, token = 0; -void yyerror __P((char *)); -void push_proto __P((void)); -void pop_proto __P((void)); -int next_state __P((int, int)); -int next_item __P((int)); -int save_token __P((void)); -void swallow __P((void)); -int yylex __P((void)); +void yyerror(char *); +void push_proto(void); +void pop_proto(void); +int next_state(int, int); +int next_item(int); +int save_token(void); +void swallow(void); +int yylex(void); struct lwordtab { char *word; diff --git a/contrib/ipfilter/iplang/iplang_y.y b/contrib/ipfilter/iplang/iplang_y.y index b4570d390530..f3335636cee1 100644 --- a/contrib/ipfilter/iplang/iplang_y.y +++ b/contrib/ipfilter/iplang/iplang_y.y @@ -59,8 +59,8 @@ arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL; struct in_addr defrouter; send_t sending; char *sclass = NULL; -u_short c_chksum __P((u_short *, u_int, u_long)); -u_long p_chksum __P((u_short *, u_int)); +u_short c_chksum(u_short *, u_int, u_long); +u_long p_chksum(u_short *, u_int); u_long ipbuffer[67584/sizeof(u_long)]; /* 66K */ aniphdr_t *aniphead = NULL, *canip = NULL, **aniptail = &aniphead; @@ -74,85 +74,85 @@ struct statetoopt { int sto_op; }; -struct in_addr getipv4addr __P((char *arg)); -u_short getportnum __P((char *, char *)); -struct ether_addr *geteaddr __P((char *, struct ether_addr *)); -void *new_header __P((int)); -void free_aniplist __P((void)); -void inc_anipheaders __P((int)); -void new_data __P((void)); -void set_datalen __P((char **)); -void set_datafile __P((char **)); -void set_data __P((char **)); -void new_packet __P((void)); -void set_ipv4proto __P((char **)); -void set_ipv4src __P((char **)); -void set_ipv4dst __P((char **)); -void set_ipv4off __P((char **)); -void set_ipv4v __P((char **)); -void set_ipv4hl __P((char **)); -void set_ipv4ttl __P((char **)); -void set_ipv4tos __P((char **)); -void set_ipv4id __P((char **)); -void set_ipv4sum __P((char **)); -void set_ipv4len __P((char **)); -void new_tcpheader __P((void)); -void set_tcpsport __P((char **)); -void set_tcpdport __P((char **)); -void set_tcpseq __P((char **)); -void set_tcpack __P((char **)); -void set_tcpoff __P((char **)); -void set_tcpurp __P((char **)); -void set_tcpwin __P((char **)); -void set_tcpsum __P((char **)); -void set_tcpflags __P((char **)); -void set_tcpopt __P((int, char **)); -void end_tcpopt __P((void)); -void new_udpheader __P((void)); -void set_udplen __P((char **)); -void set_udpsum __P((char **)); -void prep_packet __P((void)); -void packet_done __P((void)); -void new_interface __P((void)); -void check_interface __P((void)); -void set_ifname __P((char **)); -void set_ifmtu __P((int)); -void set_ifv4addr __P((char **)); -void set_ifeaddr __P((char **)); -void new_arp __P((void)); -void set_arpeaddr __P((char **)); -void set_arpv4addr __P((char **)); -void reset_send __P((void)); -void set_sendif __P((char **)); -void set_sendvia __P((char **)); -void set_defaultrouter __P((char **)); -void new_icmpheader __P((void)); -void set_icmpcode __P((int)); -void set_icmptype __P((int)); -void set_icmpcodetok __P((char **)); -void set_icmptypetok __P((char **)); -void set_icmpid __P((int)); -void set_icmpseq __P((int)); -void set_icmpotime __P((int)); -void set_icmprtime __P((int)); -void set_icmpttime __P((int)); -void set_icmpmtu __P((int)); -void set_redir __P((int, char **)); -void new_ipv4opt __P((void)); -void set_icmppprob __P((int)); -void add_ipopt __P((int, void *)); -void end_ipopt __P((void)); -void set_secclass __P((char **)); -void free_anipheader __P((void)); -void end_ipv4 __P((void)); -void end_icmp __P((void)); -void end_udp __P((void)); -void end_tcp __P((void)); -void end_data __P((void)); -void yyerror __P((char *)); -void iplang __P((FILE *)); -int arp_getipv4 __P((char *, char *)); -int yyparse __P((void)); +struct in_addr getipv4addr(char *arg); +u_short getportnum(char *, char *); +struct ether_addr *geteaddr(char *, struct ether_addr *); +void *new_header(int); +void free_aniplist(void); +void inc_anipheaders(int); +void new_data(void); +void set_datalen(char **); +void set_datafile(char **); +void set_data(char **); +void new_packet(void); +void set_ipv4proto(char **); +void set_ipv4src(char **); +void set_ipv4dst(char **); +void set_ipv4off(char **); +void set_ipv4v(char **); +void set_ipv4hl(char **); +void set_ipv4ttl(char **); +void set_ipv4tos(char **); +void set_ipv4id(char **); +void set_ipv4sum(char **); +void set_ipv4len(char **); +void new_tcpheader(void); +void set_tcpsport(char **); +void set_tcpdport(char **); +void set_tcpseq(char **); +void set_tcpack(char **); +void set_tcpoff(char **); +void set_tcpurp(char **); +void set_tcpwin(char **); +void set_tcpsum(char **); +void set_tcpflags(char **); +void set_tcpopt(int, char **); +void end_tcpopt(void); +void new_udpheader(void); +void set_udplen(char **); +void set_udpsum(char **); +void prep_packet(void); +void packet_done(void); +void new_interface(void); +void check_interface(void); +void set_ifname(char **); +void set_ifmtu(int); +void set_ifv4addr(char **); +void set_ifeaddr(char **); +void new_arp(void); +void set_arpeaddr(char **); +void set_arpv4addr(char **); +void reset_send(void); +void set_sendif(char **); +void set_sendvia(char **); +void set_defaultrouter(char **); +void new_icmpheader(void); +void set_icmpcode(int); +void set_icmptype(int); +void set_icmpcodetok(char **); +void set_icmptypetok(char **); +void set_icmpid(int); +void set_icmpseq(int); +void set_icmpotime(int); +void set_icmprtime(int); +void set_icmpttime(int); +void set_icmpmtu(int); +void set_redir(int, char **); +void new_ipv4opt(void); +void set_icmppprob(int); +void add_ipopt(int, void *); *** 4116 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Feb 9 17:51:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76B2D545BF7; Tue, 9 Feb 2021 17:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZr6b2zp7z3Lr6; Tue, 9 Feb 2021 17:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 593D76FC0; Tue, 9 Feb 2021 17:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119HpJwU039771; Tue, 9 Feb 2021 17:51:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119HpJWK039770; Tue, 9 Feb 2021 17:51:19 GMT (envelope-from git) Date: Tue, 9 Feb 2021 17:51:19 GMT Message-Id: <202102091751.119HpJWK039770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 618dee602319 - stable/13 - Set file mode during zfs_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 618dee602319166c14c6e12971425d175d4630ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 17:51:19 -0000 The branch stable/13 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=618dee602319166c14c6e12971425d175d4630ed commit 618dee602319166c14c6e12971425d175d4630ed Author: Antonio Russo AuthorDate: 2021-02-08 17:15:05 +0000 Commit: Ryan Moeller CommitDate: 2021-02-09 17:51:04 +0000 Set file mode during zfs_write Apply https://github.com/openzfs/zfs/pull/11576 Direct commit from upstream openzfs. Full commit message below: Set file mode during zfs_write 3d40b65 refactored zfs_vnops.c, which shared much code verbatim between Linux and BSD. After a successful write, the suid/sgid bits are reset, and the mode to be written is stored in newmode. On Linux, this was propagated to both the in-memory inode and znode, which is then updated with sa_update. 3d40b65 accidentally removed the initialization of newmode, which happened to occur on the same line as the inode update (which has been moved out of the function). The uninitialized newmode can be saved to disk, leading to a crash on stat() of that file, in addition to a merely incorrect file mode. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Antonio Russo Closes #11474 Closes #11576 Obtained from: openzfs/zfs@f8ce8aed0 MFC after: 0 days Sponsored by: iXsystems, Inc. (cherry picked from commit e9d419a05357036ea2fd37218d853d2c713d55cc) --- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/contrib/openzfs/module/zfs/zfs_vnops.c b/sys/contrib/openzfs/module/zfs/zfs_vnops.c index 3b7c52b8dd34..2dcc231b30b6 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_vnops.c +++ b/sys/contrib/openzfs/module/zfs/zfs_vnops.c @@ -620,6 +620,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr) ((zp->z_mode & S_ISUID) != 0 && uid == 0)) != 0) { uint64_t newmode; zp->z_mode &= ~(S_ISUID | S_ISGID); + newmode = zp->z_mode; (void) sa_update(zp->z_sa_hdl, SA_ZPL_MODE(zfsvfs), (void *)&newmode, sizeof (uint64_t), tx); } From owner-dev-commits-src-branches@freebsd.org Wed Feb 10 02:53:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38CB7536E59; Wed, 10 Feb 2021 02:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Db47m16bfz4nZg; Wed, 10 Feb 2021 02:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18E0D16471; Wed, 10 Feb 2021 02:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11A2r7KJ050500; Wed, 10 Feb 2021 02:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11A2r71p050499; Wed, 10 Feb 2021 02:53:07 GMT (envelope-from git) Date: Wed, 10 Feb 2021 02:53:07 GMT Message-Id: <202102100253.11A2r71p050499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5e9e7ad9a2a4 - stable/13 - readelf: decode LA48 and ASG_DISABLE feature flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5e9e7ad9a2a4bc95326df76c90b9244470fea72e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 02:53:08 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5e9e7ad9a2a4bc95326df76c90b9244470fea72e commit 5e9e7ad9a2a4bc95326df76c90b9244470fea72e Author: Ed Maste AuthorDate: 2021-02-03 21:16:45 +0000 Commit: Ed Maste CommitDate: 2021-02-10 02:52:47 +0000 readelf: decode LA48 and ASG_DISABLE feature flags Sponsored by: The FreeBSD Foundation (cherry picked from commit e79b51e2b2e35d6256a1ef5311ce02ec4032d21f) --- contrib/elftoolchain/readelf/readelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 88d87f96bb72..fe8e0e70e7a1 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3680,6 +3680,8 @@ static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_PROTMAX_DISABLE, "PROTMAX_DISABLE" }, { NT_FREEBSD_FCTL_STKGAP_DISABLE, "STKGAP_DISABLE" }, { NT_FREEBSD_FCTL_WXNEEDED, "WXNEEDED" }, + { NT_FREEBSD_FCTL_LA48, "LA48" }, + { NT_FREEBSD_FCTL_ASG_DISABLE, "ASG_DISABLE" }, { 0, NULL } }; From owner-dev-commits-src-branches@freebsd.org Wed Feb 10 02:54:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BE4C537333; Wed, 10 Feb 2021 02:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Db4941J91z4njS; Wed, 10 Feb 2021 02:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F86316153; Wed, 10 Feb 2021 02:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11A2sGbm050766; Wed, 10 Feb 2021 02:54:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11A2sGp3050765; Wed, 10 Feb 2021 02:54:16 GMT (envelope-from git) Date: Wed, 10 Feb 2021 02:54:16 GMT Message-Id: <202102100254.11A2sGp3050765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2ac71adb4026 - stable/12 - readelf: decode LA48 and ASG_DISABLE feature flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2ac71adb4026c4faade5ac824c6a1b92e2504faf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 02:54:16 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2ac71adb4026c4faade5ac824c6a1b92e2504faf commit 2ac71adb4026c4faade5ac824c6a1b92e2504faf Author: Ed Maste AuthorDate: 2021-02-03 21:16:45 +0000 Commit: Ed Maste CommitDate: 2021-02-10 02:53:46 +0000 readelf: decode LA48 and ASG_DISABLE feature flags Sponsored by: The FreeBSD Foundation (cherry picked from commit e79b51e2b2e35d6256a1ef5311ce02ec4032d21f) --- contrib/elftoolchain/readelf/readelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 711aeb126113..d1c3c0a4b714 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3675,6 +3675,8 @@ static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_PROTMAX_DISABLE, "PROTMAX_DISABLE" }, { NT_FREEBSD_FCTL_STKGAP_DISABLE, "STKGAP_DISABLE" }, { NT_FREEBSD_FCTL_WXNEEDED, "WXNEEDED" }, + { NT_FREEBSD_FCTL_LA48, "LA48" }, + { NT_FREEBSD_FCTL_ASG_DISABLE, "ASG_DISABLE" }, { 0, NULL } }; From owner-dev-commits-src-branches@freebsd.org Wed Feb 10 03:20:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B213F537A63; Wed, 10 Feb 2021 03:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Db4l24k23z4qCL; Wed, 10 Feb 2021 03:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94B4A1676A; Wed, 10 Feb 2021 03:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11A3KEn4083357; Wed, 10 Feb 2021 03:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11A3KELi083351; Wed, 10 Feb 2021 03:20:14 GMT (envelope-from git) Date: Wed, 10 Feb 2021 03:20:14 GMT Message-Id: <202102100320.11A3KELi083351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brandon Bergren Subject: git: 187492ef639f - stable/13 - powerpc64: Fix boot on virtual-mode OF (PowerMac G5) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 187492ef639fecde6c122838cfff0a75d8b94608 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 03:20:14 -0000 The branch stable/13 has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=187492ef639fecde6c122838cfff0a75d8b94608 commit 187492ef639fecde6c122838cfff0a75d8b94608 Author: Brandon Bergren AuthorDate: 2021-02-07 22:05:41 +0000 Commit: Brandon Bergren CommitDate: 2021-02-10 03:19:45 +0000 powerpc64: Fix boot on virtual-mode OF (PowerMac G5) In 78599c32efed3247d165302a1fbe8d9203e38974, CFI endproc decoration was added to locore64.S. However, it missed the subtle detail that __restartkernel_virtual() falls through to __restartkernel(). This was causing boot failure on PowerMac G5, as it tried to execute the epilogue as code. Fix this by branching to __restartkernel() instead of intentionally running off the end of the function. While here, add some additional notes on how the virtual mode restart works. (cherry picked from commit d26f2a50ff48dacd38ba358d658882d51f7bdbc4) --- sys/powerpc/aim/locore64.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 0bc0619620d9..f0a183c4b331 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -255,6 +255,16 @@ ASENTRY_NOPROF(__restartkernel_virtual) addi %r14, %r14, 1 cmpdi %r14, 16 blt 1b + + /* + * Now that we are set up with a temporary direct map, we can + * continue with __restartkernel. Translation will be switched + * back on at the rfid, at which point we will be executing from + * the temporary direct map we just installed, until the kernel + * takes over responsibility for the MMU. + */ + bl __restartkernel + nop ASEND(__restartkernel_virtual) ASENTRY_NOPROF(__restartkernel) From owner-dev-commits-src-branches@freebsd.org Wed Feb 10 14:44:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8718E548E4C; Wed, 10 Feb 2021 14:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbMwF3LR0z4YY2; Wed, 10 Feb 2021 14:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 654851FA66; Wed, 10 Feb 2021 14:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AEiDtu079637; Wed, 10 Feb 2021 14:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AEiD5r079636; Wed, 10 Feb 2021 14:44:13 GMT (envelope-from git) Date: Wed, 10 Feb 2021 14:44:13 GMT Message-Id: <202102101444.11AEiD5r079636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 42167258150e - stable/12 - Upgrade to OpenPAM Tabebuia. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 42167258150ebaaade9c09e3dd05ba02249933aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 14:44:13 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=42167258150ebaaade9c09e3dd05ba02249933aa commit 42167258150ebaaade9c09e3dd05ba02249933aa Author: Dag-Erling Smørgrav AuthorDate: 2019-02-25 18:41:16 +0000 Commit: Ed Maste CommitDate: 2021-02-10 02:54:35 +0000 Upgrade to OpenPAM Tabebuia. PR: 235903 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28528 (cherry picked from commit 23d17223345108c52b96dcc5d7e6dab29e95f3e9) --- contrib/openpam/CREDITS | 1 + contrib/openpam/HISTORY | 9 +- contrib/openpam/LICENSE | 2 +- contrib/openpam/Makefile.in | 39 +- contrib/openpam/RELNOTES | 4 +- contrib/openpam/aclocal.m4 | 192 +++---- contrib/openpam/bin/Makefile.in | 31 +- .../openpam/bin/openpam_dump_policy/Makefile.in | 50 +- contrib/openpam/bin/pamtest/Makefile.in | 46 +- contrib/openpam/bin/pamtest/pamtest.1 | 4 +- contrib/openpam/bin/su/Makefile.in | 46 +- contrib/openpam/bin/su/su.1 | 4 +- contrib/openpam/compile | 13 +- contrib/openpam/config.h.in | 9 +- contrib/openpam/config.sub | 4 +- contrib/openpam/configure | 610 ++++++++++++--------- contrib/openpam/configure.ac | 38 +- contrib/openpam/depcomp | 10 +- contrib/openpam/doc/Makefile.in | 31 +- contrib/openpam/doc/man/Makefile.in | 29 +- contrib/openpam/doc/man/openpam.3 | 2 +- contrib/openpam/doc/man/openpam_borrow_cred.3 | 2 +- contrib/openpam/doc/man/openpam_free_data.3 | 2 +- contrib/openpam/doc/man/openpam_free_envlist.3 | 2 +- contrib/openpam/doc/man/openpam_get_feature.3 | 2 +- contrib/openpam/doc/man/openpam_get_option.3 | 2 +- contrib/openpam/doc/man/openpam_log.3 | 2 +- contrib/openpam/doc/man/openpam_nullconv.3 | 2 +- contrib/openpam/doc/man/openpam_readline.3 | 2 +- contrib/openpam/doc/man/openpam_readlinev.3 | 2 +- contrib/openpam/doc/man/openpam_readword.3 | 2 +- contrib/openpam/doc/man/openpam_restore_cred.3 | 2 +- contrib/openpam/doc/man/openpam_set_feature.3 | 2 +- contrib/openpam/doc/man/openpam_set_option.3 | 2 +- contrib/openpam/doc/man/openpam_straddch.3 | 2 +- contrib/openpam/doc/man/openpam_subst.3 | 2 +- contrib/openpam/doc/man/openpam_ttyconv.3 | 2 +- contrib/openpam/doc/man/pam.3 | 2 +- contrib/openpam/doc/man/pam.conf.5 | 4 +- contrib/openpam/doc/man/pam_acct_mgmt.3 | 2 +- contrib/openpam/doc/man/pam_authenticate.3 | 2 +- contrib/openpam/doc/man/pam_chauthtok.3 | 2 +- contrib/openpam/doc/man/pam_close_session.3 | 2 +- contrib/openpam/doc/man/pam_conv.3 | 4 +- contrib/openpam/doc/man/pam_end.3 | 2 +- contrib/openpam/doc/man/pam_error.3 | 2 +- contrib/openpam/doc/man/pam_get_authtok.3 | 2 +- contrib/openpam/doc/man/pam_get_data.3 | 2 +- contrib/openpam/doc/man/pam_get_item.3 | 2 +- contrib/openpam/doc/man/pam_get_user.3 | 2 +- contrib/openpam/doc/man/pam_getenv.3 | 4 +- contrib/openpam/doc/man/pam_getenvlist.3 | 2 +- contrib/openpam/doc/man/pam_info.3 | 2 +- contrib/openpam/doc/man/pam_open_session.3 | 2 +- contrib/openpam/doc/man/pam_prompt.3 | 2 +- contrib/openpam/doc/man/pam_putenv.3 | 2 +- contrib/openpam/doc/man/pam_set_data.3 | 2 +- contrib/openpam/doc/man/pam_set_item.3 | 2 +- contrib/openpam/doc/man/pam_setcred.3 | 2 +- contrib/openpam/doc/man/pam_setenv.3 | 2 +- contrib/openpam/doc/man/pam_sm_acct_mgmt.3 | 2 +- contrib/openpam/doc/man/pam_sm_authenticate.3 | 2 +- contrib/openpam/doc/man/pam_sm_chauthtok.3 | 2 +- contrib/openpam/doc/man/pam_sm_close_session.3 | 2 +- contrib/openpam/doc/man/pam_sm_open_session.3 | 2 +- contrib/openpam/doc/man/pam_sm_setcred.3 | 2 +- contrib/openpam/doc/man/pam_start.3 | 2 +- contrib/openpam/doc/man/pam_strerror.3 | 2 +- contrib/openpam/doc/man/pam_verror.3 | 2 +- contrib/openpam/doc/man/pam_vinfo.3 | 2 +- contrib/openpam/doc/man/pam_vprompt.3 | 2 +- contrib/openpam/include/Makefile.in | 31 +- contrib/openpam/include/security/Makefile.in | 29 +- contrib/openpam/include/security/openpam_version.h | 8 +- contrib/openpam/install-sh | 4 +- contrib/openpam/lib/Makefile.in | 31 +- contrib/openpam/lib/libpam/Makefile.in | 306 ++++++++--- contrib/openpam/lib/libpam/pam_getenv.c | 21 +- contrib/openpam/m4/ax_pkg_config.m4 | 157 ++++++ contrib/openpam/misc/Makefile.in | 29 +- contrib/openpam/missing | 16 +- contrib/openpam/modules/Makefile.in | 31 +- contrib/openpam/modules/pam_deny/Makefile.in | 71 ++- contrib/openpam/modules/pam_permit/Makefile.in | 71 ++- contrib/openpam/modules/pam_return/Makefile.in | 71 ++- contrib/openpam/modules/pam_unix/Makefile.in | 74 ++- contrib/openpam/t/Makefile.am | 11 +- contrib/openpam/t/Makefile.in | 169 ++++-- contrib/openpam/t/t_pam_env.c | 202 +++++++ contrib/openpam/t/t_pam_err.c | 63 +++ contrib/openpam/t/t_pam_err.h | 44 ++ contrib/openpam/test-driver | 6 +- 92 files changed, 1806 insertions(+), 919 deletions(-) diff --git a/contrib/openpam/CREDITS b/contrib/openpam/CREDITS index c294fb7cf8fc..b40c9d3b4826 100644 --- a/contrib/openpam/CREDITS +++ b/contrib/openpam/CREDITS @@ -49,5 +49,6 @@ ideas: Sebastian Krahmer Solar Designer Takanori Saneto + Tim Creech Wojciech A. Koszek Yar Tikhiy diff --git a/contrib/openpam/HISTORY b/contrib/openpam/HISTORY index bfcc4726652f..98032d7e5973 100644 --- a/contrib/openpam/HISTORY +++ b/contrib/openpam/HISTORY @@ -1,3 +1,10 @@ +OpenPAM Tabebuia 2019-02-24 + + - BUGFIX: Fix off-by-one bug in pam_getenv(3) which was introduced in + OpenPAM Radula. + + - ENHANCE: Add unit tests for pam_{get,put,set}env(3). +============================================================================ OpenPAM Resedacea 2017-04-30 - BUGFIX: Reinstore the NULL check in pam_end(3) which was removed in @@ -5,7 +12,7 @@ OpenPAM Resedacea 2017-04-30 - BUGFIX: Return PAM_SYMBOL_ERR instead of PAM_SYSTEM_ERR from the dispatcher when the required service function could not be found. - + - ENHANCE: Introduce the PAM_BAD_HANDLE error code for when pamh is NULL in API functions that have a NULL check. diff --git a/contrib/openpam/LICENSE b/contrib/openpam/LICENSE index d8957b3cedcb..879b34bc7beb 100644 --- a/contrib/openpam/LICENSE +++ b/contrib/openpam/LICENSE @@ -1,6 +1,6 @@ Copyright (c) 2002-2003 Networks Associates Technology, Inc. -Copyright (c) 2004-2017 Dag-Erling Smørgrav +Copyright (c) 2004-2019 Dag-Erling Smørgrav All rights reserved. This software was developed for the FreeBSD Project by ThinkSec AS and diff --git a/contrib/openpam/Makefile.in b/contrib/openpam/Makefile.in index 80b8f14d1131..05483ef6562d 100644 --- a/contrib/openpam/Makefile.in +++ b/contrib/openpam/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -92,10 +92,10 @@ host_triplet = @host@ @WITH_DOC_TRUE@am__append_1 = doc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -140,7 +140,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -221,9 +221,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -271,6 +271,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -319,6 +322,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -367,8 +371,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -512,7 +516,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -577,7 +584,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -603,7 +610,7 @@ dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -621,7 +628,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -631,7 +638,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff --git a/contrib/openpam/RELNOTES b/contrib/openpam/RELNOTES index 23b159a29366..895370ae8774 100644 --- a/contrib/openpam/RELNOTES +++ b/contrib/openpam/RELNOTES @@ -1,6 +1,6 @@ - Release notes for OpenPAM Resedacea - =================================== + Release notes for OpenPAM Tabebuia + ================================== OpenPAM is developed primarily on FreeBSD, but is expected to work on almost any POSIX-like platform that has GNU autotools, GNU make and diff --git a/contrib/openpam/aclocal.m4 b/contrib/openpam/aclocal.m4 index e41b4761640e..005a0f19d170 100644 --- a/contrib/openpam/aclocal.m4 +++ b/contrib/openpam/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -563,7 +553,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -605,7 +595,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -647,7 +637,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -655,49 +645,42 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -738,7 +721,7 @@ fi # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -765,7 +748,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -794,7 +777,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -841,7 +824,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -860,7 +843,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -941,7 +924,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1001,7 +984,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1029,7 +1012,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1048,7 +1031,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1179,6 +1162,7 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/ax_pkg_config.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/contrib/openpam/bin/Makefile.in b/contrib/openpam/bin/Makefile.in index 24ccda7b7865..05e3166a03ee 100644 --- a/contrib/openpam/bin/Makefile.in +++ b/contrib/openpam/bin/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ @WITH_SU_TRUE@am__append_2 = su subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -138,7 +138,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -199,9 +199,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -249,6 +249,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,6 +300,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -329,8 +333,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -447,7 +451,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/contrib/openpam/bin/openpam_dump_policy/Makefile.in b/contrib/openpam/bin/openpam_dump_policy/Makefile.in index bf89f6e5e878..374b6242bdd4 100644 --- a/contrib/openpam/bin/openpam_dump_policy/Makefile.in +++ b/contrib/openpam/bin/openpam_dump_policy/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ noinst_PROGRAMS = openpam_dump_policy$(EXEEXT) subdir = bin/openpam_dump_policy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,7 +129,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/openpam_dump_policy.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -190,9 +191,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -240,6 +241,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -288,6 +292,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -324,8 +329,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -356,7 +361,13 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openpam_dump_policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openpam_dump_policy.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -437,7 +448,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -507,7 +521,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/openpam_dump_policy.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -553,7 +567,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/openpam_dump_policy.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -574,9 +588,9 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff --git a/contrib/openpam/bin/pamtest/Makefile.in b/contrib/openpam/bin/pamtest/Makefile.in index 6659af8a3ef5..090367ff62a2 100644 --- a/contrib/openpam/bin/pamtest/Makefile.in +++ b/contrib/openpam/bin/pamtest/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ bin_PROGRAMS = pamtest$(EXEEXT) subdir = bin/pamtest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,7 +129,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/pamtest.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -221,9 +222,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -271,6 +272,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ *** 4622 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 02:50:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E541C537C33; Thu, 11 Feb 2021 02:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbh2J6960z4bpr; Thu, 11 Feb 2021 02:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C84C6B; Thu, 11 Feb 2021 02:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B2oW2D023330; Thu, 11 Feb 2021 02:50:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B2oWVL023329; Thu, 11 Feb 2021 02:50:32 GMT (envelope-from git) Date: Thu, 11 Feb 2021 02:50:32 GMT Message-Id: <202102110250.11B2oWVL023329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 574d0dfae501 - stable/13 - grep: fix null pattern and empty pattern file behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 574d0dfae5011a766aa967f1d1675ddf7b535936 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 02:50:33 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=574d0dfae5011a766aa967f1d1675ddf7b535936 commit 574d0dfae5011a766aa967f1d1675ddf7b535936 Author: Kyle Evans AuthorDate: 2021-02-04 21:26:45 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 02:49:44 +0000 grep: fix null pattern and empty pattern file behavior The null pattern semantics were terrible because I tried to match gnugrep, but I got it wrong. Let's unwind that: - The null pattern should match every line if neither -w nor -x. - The null pattern should match empty lines if -x. - The null pattern should not match any lines if -w. The first two will stop processing (shortcut) even if additional patterns are specified. In any other case, we will continue processing other patterns. If no other patterns are specified beside a null pattern, then we match if neither -w nor -x or set and do not match if either of those are specified. The justification for -w is that it should match on a whole word, but the null pattern deos not have a whole word to match on. Empty pattern files should never match anything, and more importantly, -v should cause everything to be written. PR: 253209 (cherry picked from commit f823c6dc730b0dd08b54a53be1d8fd587eee7021) --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 22 +++++++++++++++--- usr.bin/grep/grep.c | 11 --------- usr.bin/grep/util.c | 35 +++++++++++++---------------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index e094b15c6d67..ef3f0617465e 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -489,11 +489,11 @@ wflag_emptypat_body() atf_check -s exit:1 -o empty grep -w -e "" test1 - atf_check -o file:test2 grep -w -e "" test2 + atf_check -o file:test2 grep -vw -e "" test2 atf_check -s exit:1 -o empty grep -w -e "" test3 - atf_check -o file:test4 grep -w -e "" test4 + atf_check -o file:test4 grep -vw -e "" test4 } atf_test_case xflag_emptypat @@ -504,7 +504,6 @@ xflag_emptypat_body() printf "qaz" > test3 printf " qaz\n" > test4 - # -x is whole-line, more strict than -w. atf_check -s exit:1 -o empty grep -x -e "" test1 atf_check -o file:test2 grep -x -e "" test2 @@ -550,6 +549,22 @@ xflag_emptypat_plus_body() atf_check -o file:spacelines grep -Fxvf patlist1 target_spacelines } +atf_test_case emptyfile +emptyfile_descr() +{ + atf_set "descr" "Check for proper handling of empty pattern files (PR 253209)" +} +emptyfile_body() +{ + :> epatfile + echo "blubb" > subj + + # From PR 253209, bsdgrep was short-circuiting completely on an empty + # file, but we should have still been processing lines. + atf_check -s exit:1 -o empty fgrep -f epatfile subj + atf_check -o file:subj fgrep -vf epatfile subj +} + atf_test_case excessive_matches excessive_matches_head() { @@ -946,6 +961,7 @@ atf_init_test_cases() atf_add_test_case wflag_emptypat atf_add_test_case xflag_emptypat atf_add_test_case xflag_emptypat_plus + atf_add_test_case emptyfile atf_add_test_case excessive_matches atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 307a91353b66..33541e4fe734 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -69,13 +69,6 @@ const char *errstr[] = { int cflags = REG_NOSUB | REG_NEWLINE; int eflags = REG_STARTEND; -/* XXX TODO: Get rid of this flag. - * matchall is a gross hack that means that an empty pattern was passed to us. - * It is a necessary evil at the moment because our regex(3) implementation - * does not allow for empty patterns, as supported by POSIX's definition of - * grammar for BREs/EREs. When libregex becomes available, it would be wise - * to remove this and let regex(3) handle the dirty details of empty patterns. - */ bool matchall; /* Searching patterns */ @@ -637,10 +630,6 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; - /* Empty pattern file matches nothing */ - if (!needpattern && (patterns == 0) && !matchall) - exit(1); - /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index e517e4eaee6d..f22b7abd79ef 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -471,31 +471,28 @@ procline(struct parsec *pc) matchidx = pc->matchidx; - /* - * With matchall (empty pattern), we can try to take some shortcuts. - * Emtpy patterns trivially match every line except in the -w and -x - * cases. For -w (whole-word) cases, we only match if the first - * character isn't a word-character. For -x (whole-line) cases, we only - * match if the line is empty. - */ + /* Null pattern shortcuts. */ if (matchall) { - if (pc->ln.len == 0) + if (xflag && pc->ln.len == 0) { + /* Matches empty lines (-x). */ return (true); - if (wflag) { - wend = L' '; - if (sscanf(&pc->ln.dat[0], "%lc", &wend) == 1 && - !iswword(wend)) - return (true); - } else if (!xflag) + } else if (!wflag && !xflag) { + /* Matches every line (no -w or -x). */ return (true); + } /* - * If we don't have any other patterns, we really don't match. - * If we do have other patterns, we must fall through and check - * them. + * If we only have the NULL pattern, whether we match or not + * depends on if we got here with -w or -x. If either is set, + * the answer is no. If we have other patterns, we'll defer + * to them. */ - if (patterns == 0) - return (false); + if (patterns == 0) { + return (!(wflag || xflag)); + } + } else if (patterns == 0) { + /* Pattern file with no patterns. */ + return (false); } matched = false; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 02:50:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08CCE537CA3; Thu, 11 Feb 2021 02:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbh2K6vR6z4bs4; Thu, 11 Feb 2021 02:50:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF9FDDF6; Thu, 11 Feb 2021 02:50:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B2oXqV023352; Thu, 11 Feb 2021 02:50:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B2oXHx023351; Thu, 11 Feb 2021 02:50:33 GMT (envelope-from git) Date: Thu, 11 Feb 2021 02:50:33 GMT Message-Id: <202102110250.11B2oXHx023351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: bbce8cbba911 - stable/13 - grep: turn off -w if -x is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbce8cbba9116e5a5061e6e661bfa078ff0c783e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 02:50:34 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bbce8cbba9116e5a5061e6e661bfa078ff0c783e commit bbce8cbba9116e5a5061e6e661bfa078ff0c783e Author: Kyle Evans AuthorDate: 2021-02-04 21:35:58 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 02:49:55 +0000 grep: turn off -w if -x is specified -x overcomes -w in gnugrep, and it should here as well. Flip it off as needed to avoid confusing other parts of grep. (cherry picked from commit 2373acbbb77d694b997d90f3251810c6edf5d6d8) --- usr.bin/grep/grep.1 | 5 ++++- usr.bin/grep/grep.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index d3b30828c821..338af7e6d454 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd November 19, 2020 +.Dd February 4, 2021 .Dt GREP 1 .Os .Sh NAME @@ -405,6 +405,9 @@ and .Sq [[:>:]] ; see .Xr re_format 7 ) . +This option has no effect if +.Fl x +is also specified. .It Fl x , Fl Fl line-regexp Only input lines selected against an entire fixed string or regular expression are considered to be matching lines. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 33541e4fe734..166d3451774a 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -630,6 +630,10 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; + /* xflag takes precedence, don't confuse the matching bits. */ + if (wflag && xflag) + wflag = false; + /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 02:50:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4610D537C35; Thu, 11 Feb 2021 02:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbh2M1XCDz4bmb; Thu, 11 Feb 2021 02:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 252441230; Thu, 11 Feb 2021 02:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B2oYHf023371; Thu, 11 Feb 2021 02:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B2oYn9023370; Thu, 11 Feb 2021 02:50:34 GMT (envelope-from git) Date: Thu, 11 Feb 2021 02:50:34 GMT Message-Id: <202102110250.11B2oYn9023370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 08f25b50dbd3 - stable/13 - grep: fix -A handling in conjunction with -m match limitation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08f25b50dbd332e5c5c9380fd90c516e9af1ab36 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 02:50:35 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=08f25b50dbd332e5c5c9380fd90c516e9af1ab36 commit 08f25b50dbd332e5c5c9380fd90c516e9af1ab36 Author: Kyle Evans AuthorDate: 2021-02-08 18:31:17 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 02:49:59 +0000 grep: fix -A handling in conjunction with -m match limitation The basic issue here is that grep, when given -m 1, would stop all line processing once it hit the match count and exit immediately. The problem with exiting immediately is that -A processing only happens when subsequent lines are processed and do not match. The fix here is relatively easy; when bsdgrep matches a line, it resets the 'tail' of the matching context to the value supplied to -A and dumps anything that's been queued up for -B. After the current line has been printed and tail is reset, we check our mcount and do what's needed. Therefore, at the time that we decide we're doing nothing, we know that 'tail' of the context is correct and we can simply continue on if there's still more to pick up. With this change, we still bail out immediately if there's been no -A flag. If -A was supplied, we signal that we should continue on. However, subsequent lines will not even bothere to try and process the line. We have reached the match count, so even if the next line would match then we must process it if it hadn't. Thus, the loop in procfile() can short-circuit and just process the line as a non-match until procmatches() indicates that it's safe to stop. A test has been added to reflect both that we should be picking up the next line and that the next line should be considered a non-match even if it should have been. PR: 253350 (cherry picked from commit 3e2d96ac974db823255a6f40b90eeffa6e38d022) --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 17 +++++++++++++++++ usr.bin/grep/util.c | 21 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index ef3f0617465e..d2539a8250de 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -907,6 +907,22 @@ mflag_body() atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 } +atf_test_case mflag_trail_ctx +mflag_trail_ctx_head() +{ + atf_set "descr" "Check proper handling of -m with trailing context (PR 253350)" +} +mflag_trail_ctx_body() +{ + printf "foo\nfoo\nbar\nfoo\nbar\nfoo\nbar\n" > test1 + + # Should pick up the next line after matching the first. + atf_check -o inline:"foo\nfoo\n" grep -A1 -m1 foo test1 + + # Make sure the trailer is picked up as a non-match! + atf_check -o inline:"1:foo\n2-foo\n" grep -A1 -nm1 foo test1 +} + atf_test_case zgrep_multiple_files zgrep_multiple_files_head() { @@ -978,6 +994,7 @@ atf_init_test_cases() atf_add_test_case fgrep_oflag atf_add_test_case cflag atf_add_test_case mflag + atf_add_test_case mflag_trail_ctx atf_add_test_case zgrep_multiple_files # End FreeBSD } diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index f22b7abd79ef..a2520e24de8e 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -252,6 +252,16 @@ static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched) { + if (mflag && mcount <= 0) { + /* + * We already hit our match count, but we need to keep dumping + * lines until we've lost our tail. + */ + grep_printline(&pc->ln, '-'); + mc->tail--; + return (mc->tail != 0); + } + /* * XXX TODO: This should loop over pc->matches and handle things on a * line-by-line basis, setting up a `struct str` as needed. @@ -265,7 +275,7 @@ procmatches(struct mprintc *mc, struct parsec *pc, bool matched) /* XXX TODO: Decrement by number of matched lines */ mcount -= 1; if (mcount <= 0) - return (false); + return (mc->tail != 0); } } else if (mc->doctx) procmatch_nomatch(mc, pc); @@ -357,6 +367,15 @@ procfile(const char *fn) return (0); } + if (mflag && mcount <= 0) { + /* + * Short-circuit, already hit match count and now we're + * just picking up any remaining pieces. + */ + if (!procmatches(&mc, &pc, false)) + break; + continue; + } line_matched = procline(&pc) == !vflag; if (line_matched) ++lines; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 05:14:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F61253AAA8; Thu, 11 Feb 2021 05:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DblDW1Sfyz4kv6; Thu, 11 Feb 2021 05:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21198313E; Thu, 11 Feb 2021 05:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B5EYXV012273; Thu, 11 Feb 2021 05:14:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B5EYn0012272; Thu, 11 Feb 2021 05:14:34 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:14:34 GMT Message-Id: <202102110514.11B5EYn0012272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a60c5de933e1 - stable/13 - acpi: limit the AMDI0020/AMDI0010 workaround to an option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a60c5de933e1516f65ead98b0ee141224ad607f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:14:35 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a60c5de933e1516f65ead98b0ee141224ad607f4 commit a60c5de933e1516f65ead98b0ee141224ad607f4 Author: Warner Losh AuthorDate: 2021-02-08 21:43:25 +0000 Commit: Warner Losh CommitDate: 2021-02-11 05:13:04 +0000 acpi: limit the AMDI0020/AMDI0010 workaround to an option It appears that production versions of EPYC firmware get the _STA method right for these nodes. In fact, this workaround breaks on production hardware by including too many uart nodes. This work around was for pre-release hardware that wound up not having a large deployment. Move this work around to a kernel option since the machines that needed it have been powered off and are difficult to resurrect. Should there be a more significant deployment than is understood, we can restrict it based on smbios strings. Discussed with: mmacy@, seanc@, jhb@ MFC After: 3 days (cherry picked from commit 35af933173d516101f4c44af328fbe2d6e587869) --- sys/conf/options | 1 + sys/dev/acpica/acpi.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index 77979b72fe58..2f324143c574 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -705,6 +705,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h DEV_ACPI opt_acpi.h +ACPI_EARLY_EPYC_WAR opt_acpi.h # options for IOMMU support IOMMU opt_iommu.h diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 04c8c1b27625..18623a6ab240 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2273,6 +2273,8 @@ acpi_DeviceIsPresent(device_t dev) h = acpi_get_handle(dev); if (h == NULL) return (FALSE); + +#ifdef ACPI_EARLY_EPYC_WAR /* * Certain Treadripper boards always returns 0 for FreeBSD because it * only returns non-zero for the OS string "Windows 2015". Otherwise it @@ -2281,6 +2283,7 @@ acpi_DeviceIsPresent(device_t dev) */ if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); +#endif status = acpi_GetInteger(h, "_STA", &s); From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 05:14:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FCE753AD8A; Thu, 11 Feb 2021 05:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DblDX1m9zz4kk4; Thu, 11 Feb 2021 05:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EAE63316; Thu, 11 Feb 2021 05:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B5EaqZ012296; Thu, 11 Feb 2021 05:14:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B5Eaf2012295; Thu, 11 Feb 2021 05:14:36 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:14:36 GMT Message-Id: <202102110514.11B5Eaf2012295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0dc5c9467b5b - stable/13 - hid: bump HID_ITEM_MAXUSAGES to 8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0dc5c9467b5bbcf26a8232553a1c213bb95ce635 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:14:36 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0dc5c9467b5bbcf26a8232553a1c213bb95ce635 commit 0dc5c9467b5bbcf26a8232553a1c213bb95ce635 Author: Warner Losh AuthorDate: 2021-02-08 19:29:20 +0000 Commit: Warner Losh CommitDate: 2021-02-11 05:13:25 +0000 hid: bump HID_ITEM_MAXUSAGES to 8 My YOGA requires a minimum of 7 to parse w/o an error. Since the memory savings are trivial and the yoga a popular system, bump the default up to 8. There's no API/ABI issues in doing this. This hid_item struct isn't exported to userland and the one libusbhid has is different and only shares a name... MFC After: 3 days Reviewed by: wulf@ Differential Revision: https://reviews.freebsd.org/D28543 (cherry picked from commit db2f512381ac3c0c227f5c0354690bb929dcac17) --- sys/dev/hid/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index e88cbba04d9a..37ab8c9cdf7e 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -189,7 +189,7 @@ #if defined(_KERNEL) || defined(_STANDALONE) -#define HID_ITEM_MAXUSAGE 4 +#define HID_ITEM_MAXUSAGE 8 #define HID_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ #define HID_PNP_ID_SIZE 20 /* includes null terminator */ From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 05:15:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8909A53AF18; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DblFK3SGGz4lC4; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 693282F2B; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B5FH3g012510; Thu, 11 Feb 2021 05:15:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B5FHhY012509; Thu, 11 Feb 2021 05:15:17 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:15:17 GMT Message-Id: <202102110515.11B5FHhY012509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: 40c1f835412d - stable/12 - nvdimm: Fix error path mis-free MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 40c1f835412d3e00901a146db6c317d654e65980 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:15:17 -0000 The branch stable/12 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=40c1f835412d3e00901a146db6c317d654e65980 commit 40c1f835412d3e00901a146db6c317d654e65980 Author: Conrad Meyer AuthorDate: 2019-10-02 19:13:35 +0000 Commit: Ravi Pokala CommitDate: 2021-02-11 05:03:07 +0000 nvdimm: Fix error path mis-free (diff applied manually due to refactoring) Regression introduced in r343629 when malloc result was renamed from spa to spa_mapping and the 'spa' name was instead used to iterate a table, but the free() target was not updated. Reviewed by: kib, scottph Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21871 (cherry picked from commit 31f1c8fc84c850d73e74781126e12efceb50032b) --- sys/dev/nvdimm/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvdimm/nvdimm.c b/sys/dev/nvdimm/nvdimm.c index a2ab0f89a879..b2c716044d5d 100644 --- a/sys/dev/nvdimm/nvdimm.c +++ b/sys/dev/nvdimm/nvdimm.c @@ -460,7 +460,7 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, ACPI_TABLE_NFIT *nfitbl) error = nvdimm_spa_init(spa_mapping, *spa, spa_type); if (error != 0) { nvdimm_spa_fini(spa_mapping); - free(spa, M_NVDIMM); + free(spa_mapping, M_NVDIMM); break; } nvdimm_create_namespaces(spa_mapping, nfitbl); From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 05:15:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF28553AFBC; Thu, 11 Feb 2021 05:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DblG42GDLz4lNb; Thu, 11 Feb 2021 05:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4068427FD; Thu, 11 Feb 2021 05:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B5Fufs012721; Thu, 11 Feb 2021 05:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B5FuJA012720; Thu, 11 Feb 2021 05:15:56 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:15:56 GMT Message-Id: <202102110515.11B5FuJA012720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a7c68340584c - stable/12 - acpi: limit the AMDI0020/AMDI0010 workaround to an option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a7c68340584c942792188ad50593d4ef15cc8982 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:15:56 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a7c68340584c942792188ad50593d4ef15cc8982 commit a7c68340584c942792188ad50593d4ef15cc8982 Author: Warner Losh AuthorDate: 2021-02-08 21:43:25 +0000 Commit: Warner Losh CommitDate: 2021-02-11 05:15:08 +0000 acpi: limit the AMDI0020/AMDI0010 workaround to an option It appears that production versions of EPYC firmware get the _STA method right for these nodes. In fact, this workaround breaks on production hardware by including too many uart nodes. This work around was for pre-release hardware that wound up not having a large deployment. Move this work around to a kernel option since the machines that needed it have been powered off and are difficult to resurrect. Should there be a more significant deployment than is understood, we can restrict it based on smbios strings. Discussed with: mmacy@, seanc@, jhb@ MFC After: 3 days (cherry picked from commit 35af933173d516101f4c44af328fbe2d6e587869) --- sys/conf/options | 1 + sys/dev/acpica/acpi.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index 0644fb6e597e..561e2574b964 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -730,6 +730,7 @@ ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h ACPI_DMAR opt_acpi.h DEV_ACPI opt_acpi.h +ACPI_EARLY_EPYC_WAR opt_acpi.h # ISA support DEV_ISA opt_isa.h diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 6d7ed154c463..bcccd23c8c58 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2254,6 +2254,8 @@ acpi_DeviceIsPresent(device_t dev) h = acpi_get_handle(dev); if (h == NULL) return (FALSE); + +#ifdef ACPI_EARLY_EPYC_WAR /* * Onboard serial ports on certain AMD motherboards have an invalid _STA * method that always returns 0. Force them to always be treated as present. @@ -2262,6 +2264,7 @@ acpi_DeviceIsPresent(device_t dev) */ if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); +#endif status = acpi_GetInteger(h, "_STA", &s); From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:06:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A73652ADB0; Thu, 11 Feb 2021 15:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0MG3Z1Bz3sbg; Thu, 11 Feb 2021 15:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D594130C3; Thu, 11 Feb 2021 15:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BF6IMW083891; Thu, 11 Feb 2021 15:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BF6IZq083890; Thu, 11 Feb 2021 15:06:18 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:06:18 GMT Message-Id: <202102111506.11BF6IZq083890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 214ef320018d - stable/13 - arm64: Initialize VFP control register. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 214ef320018db339d52e6ec9a02bf2a5691b6575 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:06:18 -0000 The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=214ef320018db339d52e6ec9a02bf2a5691b6575 commit 214ef320018db339d52e6ec9a02bf2a5691b6575 Author: Michal Meloun AuthorDate: 2021-01-23 20:19:07 +0000 Commit: Michal Meloun CommitDate: 2021-02-11 15:05:58 +0000 arm64: Initialize VFP control register. The RW fields in this register reset to architecturally unknown values, so initialize these to the proper rounding and denormal mode. MFC after: 1 week (cherry picked from commit 65618fdda0f272a823e6701966421bdca0efa301) --- sys/arm64/arm64/vfp.c | 4 ++++ sys/arm64/arm64/vm_machdep.c | 3 +++ sys/arm64/include/md_var.h | 2 ++ sys/arm64/include/vfp.h | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 51fba7a8a300..62244ddc80e8 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -238,6 +239,9 @@ vfp_init(void) /* Disable to be enabled when it's used */ vfp_disable(); + + if (PCPU_GET(cpuid) == 0) + thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; } SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 90d628a7d6ee..9e9b588c7db1 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #endif +uint32_t initial_fpcr = VFPCR_DN | VFPCR_FZ; + #include /* @@ -106,6 +108,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; + td2->td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 0132ab0dd8fd..73cf642148b5 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -54,4 +54,6 @@ void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); +extern uint32_t initial_fpcr; + #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index b4b9bb524d30..b0ba01a2a319 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -32,6 +32,29 @@ #ifndef _MACHINE_VFP_H_ #define _MACHINE_VFP_H_ +/* VFPCR */ +#define VFPCR_AHP (0x04000000) /* alt. half-precision: */ +#define VFPCR_DN (0x02000000) /* default NaN enable */ +#define VFPCR_FZ (0x01000000) /* flush to zero enabled */ + +#define VFPCR_RMODE_OFF 22 /* rounding mode offset */ +#define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ +#define VFPCR_RMODE_RN (0x00000000) /* round nearest */ +#define VFPCR_RMODE_RPI (0x00400000) /* round to plus infinity */ +#define VFPCR_RMODE_RNI (0x00800000) /* round to neg infinity */ +#define VFPCR_RMODE_RM (0x00c00000) /* round to zero */ + +#define VFPCR_STRIDE_OFF 20 /* vector stride -1 */ +#define VFPCR_STRIDE_MASK (0x00300000) +#define VFPCR_LEN_OFF 16 /* vector length -1 */ +#define VFPCR_LEN_MASK (0x00070000) +#define VFPCR_IDE (0x00008000) /* input subnormal exc enable */ +#define VFPCR_IXE (0x00001000) /* inexact exception enable */ +#define VFPCR_UFE (0x00000800) /* underflow exception enable */ +#define VFPCR_OFE (0x00000400) /* overflow exception enable */ +#define VFPCR_DZE (0x00000200) /* div by zero exception en */ +#define VFPCR_IOE (0x00000100) /* invalid op exec enable */ + #ifndef LOCORE struct vfpstate { __uint128_t vfp_regs[32]; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:07:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 598BF52AF1B; Thu, 11 Feb 2021 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0P128R9z3sZ1; Thu, 11 Feb 2021 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 324CA130CC; Thu, 11 Feb 2021 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BF7nit084217; Thu, 11 Feb 2021 15:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BF7n1P084216; Thu, 11 Feb 2021 15:07:49 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:07:49 GMT Message-Id: <202102111507.11BF7n1P084216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: e8dfdf40bed9 - stable/13 - dwmmc: Multiple busdma fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8dfdf40bed9b016b4db2ed008d2d8333073f38c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:07:49 -0000 The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=e8dfdf40bed9b016b4db2ed008d2d8333073f38c commit e8dfdf40bed9b016b4db2ed008d2d8333073f38c Author: Michal Meloun AuthorDate: 2021-01-21 14:06:19 +0000 Commit: Michal Meloun CommitDate: 2021-02-11 15:07:16 +0000 dwmmc: Multiple busdma fixes. - limit maximum segment size to 2048 bytes. Although dwmmc supports a buffer fragment with a maximum length of 4095 bytes, use the nearest lower power of two as the maximum fragment size. Otherwise, busdma create excessive buffer fragments. - fix off by one error in computation of the maximum data transfer length. - in addition, reserve two DMA descriptors that can be used by busdma bouncing. The beginning or end of the buffer can be misaligned. - Don’t ignore errors passed to bus_dmamap_load() callback function. - In theory, a DMA engine may be running at time when next dma descriptor is constructed. Create a full DMA descriptor before OWN bit is set. MFC after: 2 weeks (cherry picked from commit 8727c174b0fe44766bb7ea765dac6d5f82818103) --- sys/dev/mmc/host/dwmmc.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 11521257ee0a..b31bb0d4e68b 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -107,8 +107,7 @@ __FBSDID("$FreeBSD$"); #define CARD_INIT_DONE 0x04 #define DWMMC_DATA_ERR_FLAGS (SDMMC_INTMASK_DRT | SDMMC_INTMASK_DCRC \ - |SDMMC_INTMASK_HTO | SDMMC_INTMASK_SBE \ - |SDMMC_INTMASK_EBE) + |SDMMC_INTMASK_SBE | SDMMC_INTMASK_EBE) #define DWMMC_CMD_ERR_FLAGS (SDMMC_INTMASK_RTO | SDMMC_INTMASK_RCRC \ |SDMMC_INTMASK_RE) #define DWMMC_ERR_FLAGS (DWMMC_DATA_ERR_FLAGS | DWMMC_CMD_ERR_FLAGS \ @@ -134,7 +133,16 @@ struct idmac_desc { #define IDMAC_DESC_SEGS (PAGE_SIZE / (sizeof(struct idmac_desc))) #define IDMAC_DESC_SIZE (sizeof(struct idmac_desc) * IDMAC_DESC_SEGS) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ -#define IDMAC_MAX_SIZE 4096 +/* + * Size field in DMA descriptor is 13 bits long (up to 4095 bytes), + * but must be a multiple of the data bus size.Additionally, we must ensure + * that bus_dmamap_load() doesn't additionally fragments buffer (because it + * is processed with page size granularity). Thus limit fragment size to half + * of page. + * XXX switch descriptor format to array and use second buffer pointer for + * second half of page + */ +#define IDMAC_MAX_SIZE 2048 static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); @@ -165,8 +173,11 @@ static void dwmmc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { + if (nsegs != 1) + panic("%s: nsegs != 1 (%d)\n", __func__, nsegs); if (error != 0) - return; + panic("%s: error != 0 (%d)\n", __func__, error); + *(bus_addr_t *)arg = segs[0].ds_addr; } @@ -176,15 +187,13 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) struct dwmmc_softc *sc; int idx; - if (error != 0) - return; - sc = arg; - dprintf("nsegs %d seg0len %lu\n", nsegs, segs[0].ds_len); + if (error != 0) + panic("%s: error != 0 (%d)\n", __func__, error); for (idx = 0; idx < nsegs; idx++) { - sc->desc_ring[idx].des0 = (DES0_OWN | DES0_DIC | DES0_CH); + sc->desc_ring[idx].des0 = DES0_DIC | DES0_CH; sc->desc_ring[idx].des1 = segs[idx].ds_len & DES1_BS1_MASK; sc->desc_ring[idx].des2 = segs[idx].ds_addr; @@ -195,6 +204,8 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) sc->desc_ring[idx].des0 &= ~(DES0_DIC | DES0_CH); sc->desc_ring[idx].des0 |= DES0_LD; } + wmb(); + sc->desc_ring[idx].des0 |= DES0_OWN; } } @@ -277,7 +288,7 @@ dma_setup(struct dwmmc_softc *sc) error = bus_dma_tag_create( bus_get_dma_tag(sc->dev), /* Parent tag. */ - CACHE_LINE_SIZE, 0, /* alignment, boundary */ + 8, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -786,7 +797,7 @@ dwmmc_attach(device_t dev) fail: mtx_unlock(&sc->sim_mtx); #endif - /* + /* * Schedule a card detection as we won't get an interrupt * if the card is inserted when we attach */ @@ -900,8 +911,8 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) sc = device_get_softc(brdev); ios = &sc->host.ios; - dprintf("Setting up clk %u bus_width %d\n", - ios->clock, ios->bus_width); + dprintf("Setting up clk %u bus_width %d, timming: %d\n", + ios->clock, ios->bus_width, ios->timing); if (ios->bus_width == bus_width_8) WRITE4(sc, SDMMC_CTYPE, SDMMC_CTYPE_8BIT); @@ -985,7 +996,7 @@ dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) reg = READ4(sc, SDMMC_INTMASK); reg &= ~(SDMMC_INTMASK_TXDR | SDMMC_INTMASK_RXDR); WRITE4(sc, SDMMC_INTMASK, reg); - + dprintf("%s: bus_dmamap_load size: %zu\n", __func__, data->len); err = bus_dmamap_load(sc->buf_tag, sc->buf_map, data->data, data->len, dwmmc_ring_setup, sc, BUS_DMA_NOWAIT); @@ -1358,7 +1369,13 @@ dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + /* + * Busdma may bounce buffers, so we must reserve 2 descriptors + * (on start and on end) for bounced fragments. + * + */ + *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / + MMC_SECTOR_SIZE - 3; break; case MMCBR_IVAR_TIMING: *(int *)result = sc->host.ios.timing; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:08:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBCAA52ACF4; Thu, 11 Feb 2021 15:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0Q96LWJz3slh; Thu, 11 Feb 2021 15:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCCDE13308; Thu, 11 Feb 2021 15:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BF8nhm084469; Thu, 11 Feb 2021 15:08:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BF8nWY084468; Thu, 11 Feb 2021 15:08:49 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:08:49 GMT Message-Id: <202102111508.11BF8nWY084468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 6930f97474e4 - stable/13 - arm32: Align arguments of sync_icache() syscall to cacheline size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6930f97474e409808ca5e220c2b3a86805f786b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:08:50 -0000 The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=6930f97474e409808ca5e220c2b3a86805f786b8 commit 6930f97474e409808ca5e220c2b3a86805f786b8 Author: Michal Meloun AuthorDate: 2021-02-09 10:36:36 +0000 Commit: Michal Meloun CommitDate: 2021-02-11 15:08:21 +0000 arm32: Align arguments of sync_icache() syscall to cacheline size. Otherwise, we may miss synchronization of the last cacheline. MFC after: 3 days (cherry picked from commit ec090f4a67654fa541e6d97fd5f74d3f66c1c0d0) --- sys/arm/arm/sys_machdep.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index d33ac75ad73b..fc424d0fad39 100644 --- a/sys/arm/arm/sys_machdep.c +++ b/sys/arm/arm/sys_machdep.c @@ -68,12 +68,9 @@ sync_icache(uintptr_t addr, size_t len) size_t size; vm_offset_t rv; - /* - * Align starting address to even number because value of "1" - * is used as return value for success. - */ - len += addr & 1; - addr &= ~1; + /* Align starting address to cacheline size */ + len += addr & cpuinfo.dcache_line_mask; + addr &= ~cpuinfo.dcache_line_mask; /* Break whole range to pages. */ do { From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:21:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2256952B5A6; Thu, 11 Feb 2021 15:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0hM0Wv2z3v7S; Thu, 11 Feb 2021 15:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0494B134A7; Thu, 11 Feb 2021 15:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFL6t3005544; Thu, 11 Feb 2021 15:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFL6fq005543; Thu, 11 Feb 2021 15:21:06 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:21:06 GMT Message-Id: <202102111521.11BFL6fq005543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 07c84bb078e1 - stable/12 - zgrep: fix exit status with multiple files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 07c84bb078e1974be265fc921481ee1608684103 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:21:07 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=07c84bb078e1974be265fc921481ee1608684103 commit 07c84bb078e1974be265fc921481ee1608684103 Author: Eric van Gyzen AuthorDate: 2020-10-01 21:48:22 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 15:19:13 +0000 zgrep: fix exit status with multiple files zgrep should exit with success when given multiple files and the pattern is found in at least one file. Prior to this change, it would exit with success only if the pattern was found in _every_ file. (cherry picked from commit 63c8336d4de15085d50c9d8c855cdc97ee018a04) --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 19 +++++++++++++++++++ usr.bin/grep/zgrep.sh | 17 ++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index 75ee254cc79b..e094b15c6d67 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -891,6 +891,24 @@ mflag_body() atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 } + +atf_test_case zgrep_multiple_files +zgrep_multiple_files_head() +{ + atf_set "descr" "Ensures that zgrep functions properly with multiple files" +} +zgrep_multiple_files_body() +{ + echo foo > test1 + echo foo > test2 + atf_check -o inline:"test1:foo\ntest2:foo\n" zgrep foo test1 test2 + + echo bar > test1 + atf_check -o inline:"test2:foo\n" zgrep foo test1 test2 + + echo bar > test2 + atf_check -s exit:1 zgrep foo test1 test2 +} # End FreeBSD atf_init_test_cases() @@ -944,5 +962,6 @@ atf_init_test_cases() atf_add_test_case fgrep_oflag atf_add_test_case cflag atf_add_test_case mflag + atf_add_test_case zgrep_multiple_files # End FreeBSD } diff --git a/usr.bin/grep/zgrep.sh b/usr.bin/grep/zgrep.sh index 49f2bb002634..105507f23708 100755 --- a/usr.bin/grep/zgrep.sh +++ b/usr.bin/grep/zgrep.sh @@ -157,28 +157,35 @@ then pattern_found=1 fi -ret=0 # call grep ... if [ $# -lt 1 ] then # ... on stdin if [ ${pattern_file} -eq 0 ]; then - ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? + ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - else - ${cattool} ${catargs} - | ${grep} ${grep_args} -- - || ret=$? + ${cattool} ${catargs} - | ${grep} ${grep_args} -- - fi + ret=$? else # ... on all files given on the command line if [ ${silent} -lt 1 -a $# -gt 1 ]; then grep_args="-H ${grep_args}" fi + # Succeed if any file matches. First assume no match. + ret=1 for file; do if [ ${pattern_file} -eq 0 ]; then ${cattool} ${catargs} -- "${file}" | - ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? + ${grep} --label="${file}" ${grep_args} -- "${pattern}" - else ${cattool} ${catargs} -- "${file}" | - ${grep} --label="${file}" ${grep_args} -- - || ret=$? + ${grep} --label="${file}" ${grep_args} -- - + fi + this_ret=$? + # A match (0) overrides a no-match (1). An error (>=2) overrides all. + if [ ${this_ret} -eq 0 -a ${ret} -eq 1 ] || [ ${this_ret} -ge 2 ]; then + ret=${this_ret} fi done fi From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:21:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A1E152B3ED; Thu, 11 Feb 2021 15:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0hN283zz3txs; Thu, 11 Feb 2021 15:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36E86134A8; Thu, 11 Feb 2021 15:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFL8t3005562; Thu, 11 Feb 2021 15:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFL83J005561; Thu, 11 Feb 2021 15:21:08 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:21:08 GMT Message-Id: <202102111521.11BFL83J005561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 92ddb6090b0c - stable/12 - grep: fix null pattern and empty pattern file behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 92ddb6090b0c5091a64855a514676a452c10750c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:21:08 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=92ddb6090b0c5091a64855a514676a452c10750c commit 92ddb6090b0c5091a64855a514676a452c10750c Author: Kyle Evans AuthorDate: 2021-02-04 21:26:45 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 15:19:26 +0000 grep: fix null pattern and empty pattern file behavior The null pattern semantics were terrible because I tried to match gnugrep, but I got it wrong. Let's unwind that: - The null pattern should match every line if neither -w nor -x. - The null pattern should match empty lines if -x. - The null pattern should not match any lines if -w. The first two will stop processing (shortcut) even if additional patterns are specified. In any other case, we will continue processing other patterns. If no other patterns are specified beside a null pattern, then we match if neither -w nor -x or set and do not match if either of those are specified. The justification for -w is that it should match on a whole word, but the null pattern deos not have a whole word to match on. Empty pattern files should never match anything, and more importantly, -v should cause everything to be written. PR: 253209 (cherry picked from commit f823c6dc730b0dd08b54a53be1d8fd587eee7021) --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 22 +++++++++++++++--- usr.bin/grep/grep.c | 11 --------- usr.bin/grep/util.c | 35 +++++++++++++---------------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index e094b15c6d67..ef3f0617465e 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -489,11 +489,11 @@ wflag_emptypat_body() atf_check -s exit:1 -o empty grep -w -e "" test1 - atf_check -o file:test2 grep -w -e "" test2 + atf_check -o file:test2 grep -vw -e "" test2 atf_check -s exit:1 -o empty grep -w -e "" test3 - atf_check -o file:test4 grep -w -e "" test4 + atf_check -o file:test4 grep -vw -e "" test4 } atf_test_case xflag_emptypat @@ -504,7 +504,6 @@ xflag_emptypat_body() printf "qaz" > test3 printf " qaz\n" > test4 - # -x is whole-line, more strict than -w. atf_check -s exit:1 -o empty grep -x -e "" test1 atf_check -o file:test2 grep -x -e "" test2 @@ -550,6 +549,22 @@ xflag_emptypat_plus_body() atf_check -o file:spacelines grep -Fxvf patlist1 target_spacelines } +atf_test_case emptyfile +emptyfile_descr() +{ + atf_set "descr" "Check for proper handling of empty pattern files (PR 253209)" +} +emptyfile_body() +{ + :> epatfile + echo "blubb" > subj + + # From PR 253209, bsdgrep was short-circuiting completely on an empty + # file, but we should have still been processing lines. + atf_check -s exit:1 -o empty fgrep -f epatfile subj + atf_check -o file:subj fgrep -vf epatfile subj +} + atf_test_case excessive_matches excessive_matches_head() { @@ -946,6 +961,7 @@ atf_init_test_cases() atf_add_test_case wflag_emptypat atf_add_test_case xflag_emptypat atf_add_test_case xflag_emptypat_plus + atf_add_test_case emptyfile atf_add_test_case excessive_matches atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 96be836601ad..cc860b0566d4 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -70,13 +70,6 @@ const char *errstr[] = { int cflags = REG_NOSUB | REG_NEWLINE; int eflags = REG_STARTEND; -/* XXX TODO: Get rid of this flag. - * matchall is a gross hack that means that an empty pattern was passed to us. - * It is a necessary evil at the moment because our regex(3) implementation - * does not allow for empty patterns, as supported by POSIX's definition of - * grammar for BREs/EREs. When libregex becomes available, it would be wise - * to remove this and let regex(3) handle the dirty details of empty patterns. - */ bool matchall; /* Searching patterns */ @@ -642,10 +635,6 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; - /* Empty pattern file matches nothing */ - if (!needpattern && (patterns == 0) && !matchall) - exit(1); - /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 33afe4d6b030..f2d845c97fed 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -469,31 +469,28 @@ procline(struct parsec *pc) matchidx = pc->matchidx; - /* - * With matchall (empty pattern), we can try to take some shortcuts. - * Emtpy patterns trivially match every line except in the -w and -x - * cases. For -w (whole-word) cases, we only match if the first - * character isn't a word-character. For -x (whole-line) cases, we only - * match if the line is empty. - */ + /* Null pattern shortcuts. */ if (matchall) { - if (pc->ln.len == 0) + if (xflag && pc->ln.len == 0) { + /* Matches empty lines (-x). */ return (true); - if (wflag) { - wend = L' '; - if (sscanf(&pc->ln.dat[0], "%lc", &wend) == 1 && - !iswword(wend)) - return (true); - } else if (!xflag) + } else if (!wflag && !xflag) { + /* Matches every line (no -w or -x). */ return (true); + } /* - * If we don't have any other patterns, we really don't match. - * If we do have other patterns, we must fall through and check - * them. + * If we only have the NULL pattern, whether we match or not + * depends on if we got here with -w or -x. If either is set, + * the answer is no. If we have other patterns, we'll defer + * to them. */ - if (patterns == 0) - return (false); + if (patterns == 0) { + return (!(wflag || xflag)); + } + } else if (patterns == 0) { + /* Pattern file with no patterns. */ + return (false); } matched = false; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:21:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6556252B62D; Thu, 11 Feb 2021 15:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0hP2BX4z3tm6; Thu, 11 Feb 2021 15:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D76A13616; Thu, 11 Feb 2021 15:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFL99p005585; Thu, 11 Feb 2021 15:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFL9s4005584; Thu, 11 Feb 2021 15:21:09 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:21:09 GMT Message-Id: <202102111521.11BFL9s4005584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 1db55207b661 - stable/12 - grep: turn off -w if -x is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1db55207b66154de839e515046736cd06e50fe30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:21:09 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1db55207b66154de839e515046736cd06e50fe30 commit 1db55207b66154de839e515046736cd06e50fe30 Author: Kyle Evans AuthorDate: 2021-02-04 21:35:58 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 15:20:18 +0000 grep: turn off -w if -x is specified -x overcomes -w in gnugrep, and it should here as well. Flip it off as needed to avoid confusing other parts of grep. (cherry picked from commit 2373acbbb77d694b997d90f3251810c6edf5d6d8) --- usr.bin/grep/grep.1 | 5 ++++- usr.bin/grep/grep.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index b6f6e6f31d22..9aac1cc6ca92 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd August 7, 2020 +.Dd February 11, 2021 .Dt GREP 1 .Os .Sh NAME @@ -405,6 +405,9 @@ and .Sq [[:>:]] ; see .Xr re_format 7 ) . +This option has no effect if +.Fl x +is also specified. .It Fl x , Fl Fl line-regexp Only input lines selected against an entire fixed string or regular expression are considered to be matching lines. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index cc860b0566d4..a9c67c268b47 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -635,6 +635,10 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; + /* xflag takes precedence, don't confuse the matching bits. */ + if (wflag && xflag) + wflag = false; + /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:21:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6915852B62F; Thu, 11 Feb 2021 15:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0hQ4Fmkz3v3d; Thu, 11 Feb 2021 15:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72E6B136A5; Thu, 11 Feb 2021 15:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFLA6s005603; Thu, 11 Feb 2021 15:21:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFLA4Z005602; Thu, 11 Feb 2021 15:21:10 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:21:10 GMT Message-Id: <202102111521.11BFLA4Z005602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ad488c9793fd - stable/12 - grep: fix -A handling in conjunction with -m match limitation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ad488c9793fd5040f8267620f370f319df31af2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:21:11 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ad488c9793fd5040f8267620f370f319df31af2d commit ad488c9793fd5040f8267620f370f319df31af2d Author: Kyle Evans AuthorDate: 2021-02-08 18:31:17 +0000 Commit: Kyle Evans CommitDate: 2021-02-11 15:20:26 +0000 grep: fix -A handling in conjunction with -m match limitation The basic issue here is that grep, when given -m 1, would stop all line processing once it hit the match count and exit immediately. The problem with exiting immediately is that -A processing only happens when subsequent lines are processed and do not match. The fix here is relatively easy; when bsdgrep matches a line, it resets the 'tail' of the matching context to the value supplied to -A and dumps anything that's been queued up for -B. After the current line has been printed and tail is reset, we check our mcount and do what's needed. Therefore, at the time that we decide we're doing nothing, we know that 'tail' of the context is correct and we can simply continue on if there's still more to pick up. With this change, we still bail out immediately if there's been no -A flag. If -A was supplied, we signal that we should continue on. However, subsequent lines will not even bothere to try and process the line. We have reached the match count, so even if the next line would match then we must process it if it hadn't. Thus, the loop in procfile() can short-circuit and just process the line as a non-match until procmatches() indicates that it's safe to stop. A test has been added to reflect both that we should be picking up the next line and that the next line should be considered a non-match even if it should have been. PR: 253350 (cherry picked from commit 3e2d96ac974db823255a6f40b90eeffa6e38d022) --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 17 +++++++++++++++++ usr.bin/grep/util.c | 21 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index ef3f0617465e..d2539a8250de 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -907,6 +907,22 @@ mflag_body() atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 } +atf_test_case mflag_trail_ctx +mflag_trail_ctx_head() +{ + atf_set "descr" "Check proper handling of -m with trailing context (PR 253350)" +} +mflag_trail_ctx_body() +{ + printf "foo\nfoo\nbar\nfoo\nbar\nfoo\nbar\n" > test1 + + # Should pick up the next line after matching the first. + atf_check -o inline:"foo\nfoo\n" grep -A1 -m1 foo test1 + + # Make sure the trailer is picked up as a non-match! + atf_check -o inline:"1:foo\n2-foo\n" grep -A1 -nm1 foo test1 +} + atf_test_case zgrep_multiple_files zgrep_multiple_files_head() { @@ -978,6 +994,7 @@ atf_init_test_cases() atf_add_test_case fgrep_oflag atf_add_test_case cflag atf_add_test_case mflag + atf_add_test_case mflag_trail_ctx atf_add_test_case zgrep_multiple_files # End FreeBSD } diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index f2d845c97fed..220ffaef7dab 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -250,6 +250,16 @@ static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched) { + if (mflag && mcount <= 0) { + /* + * We already hit our match count, but we need to keep dumping + * lines until we've lost our tail. + */ + grep_printline(&pc->ln, '-'); + mc->tail--; + return (mc->tail != 0); + } + /* * XXX TODO: This should loop over pc->matches and handle things on a * line-by-line basis, setting up a `struct str` as needed. @@ -263,7 +273,7 @@ procmatches(struct mprintc *mc, struct parsec *pc, bool matched) /* XXX TODO: Decrement by number of matched lines */ mcount -= 1; if (mcount <= 0) - return (false); + return (mc->tail != 0); } } else if (mc->doctx) procmatch_nomatch(mc, pc); @@ -355,6 +365,15 @@ procfile(const char *fn) return (0); } + if (mflag && mcount <= 0) { + /* + * Short-circuit, already hit match count and now we're + * just picking up any remaining pieces. + */ + if (!procmatches(&mc, &pc, false)) + break; + continue; + } line_matched = procline(&pc) == !vflag; if (line_matched) ++lines; From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 15:25:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60C9F52BBF4; Thu, 11 Feb 2021 15:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0nv2FzBz3vp2; Thu, 11 Feb 2021 15:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 403A0132D6; Thu, 11 Feb 2021 15:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFPttG010971; Thu, 11 Feb 2021 15:25:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFPtIN010970; Thu, 11 Feb 2021 15:25:55 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:25:55 GMT Message-Id: <202102111525.11BFPtIN010970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 860e0c7fb848 - stable/13 - armv8crypto: Fix some edge cases in the AES-GCM implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 860e0c7fb84863580521142825330aa941dee313 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:25:55 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=860e0c7fb84863580521142825330aa941dee313 commit 860e0c7fb84863580521142825330aa941dee313 Author: Mark Johnston AuthorDate: 2021-02-08 14:19:07 +0000 Commit: Mark Johnston CommitDate: 2021-02-11 15:25:39 +0000 armv8crypto: Fix some edge cases in the AES-GCM implementation - We were only hashing up to the first 16 bytes of the AAD. - When computing the digest during decryption, handle the case where len == trailer, i.e., len < AES_BLOCK_LEN, properly. While here: - trailer is always smaller than AES_BLOCK_LEN, so remove a pair of unnecessary modulus operations. - Replace some byte-by-byte loops with memcpy() and memset() calls. In particular, zero the full block before copying a partial block into it since we do that elsewhere and it means that the memset() length is known at compile time. Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D28501 (cherry picked from commit 0dc7076037a87100060309f7179ef6a01f32f99e) --- sys/crypto/armv8/armv8_crypto_wrap.c | 47 ++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/sys/crypto/armv8/armv8_crypto_wrap.c b/sys/crypto/armv8/armv8_crypto_wrap.c index ea93f1b9a176..2f880258bf46 100644 --- a/sys/crypto/armv8/armv8_crypto_wrap.c +++ b/sys/crypto/armv8/armv8_crypto_wrap.c @@ -263,9 +263,16 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, aes_counter[AES_BLOCK_LEN - 1] = 2; memset(Xi.c, 0, sizeof(Xi.c)); - memset(block, 0, sizeof(block)); - memcpy(block, authdata, min(authdatalen, sizeof(block))); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + trailer = authdatalen % AES_BLOCK_LEN; + if (authdatalen - trailer > 0) { + gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + authdata += authdatalen - trailer; + } + if (trailer > 0 || authdatalen == 0) { + memset(block, 0, sizeof(block)); + memcpy(block, authdata, trailer); + gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + } from64 = (const uint64_t*)from; to64 = (uint64_t*)to; @@ -288,13 +295,11 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, if (trailer) { aes_v8_encrypt(aes_counter, EKi.c, aes_key); AES_INC_COUNTER(aes_counter); + memset(block, 0, sizeof(block)); for (i = 0; i < trailer; i++) { - block[i] = to[i] = from[i] ^ EKi.c[i % AES_BLOCK_LEN]; + block[i] = to[i] = from[i] ^ EKi.c[i]; } - for (; i < AES_BLOCK_LEN; i++) - block[i] = 0; - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); } @@ -343,17 +348,23 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, aes_v8_encrypt(aes_counter, EK0.c, aes_key); memset(Xi.c, 0, sizeof(Xi.c)); - memset(block, 0, sizeof(block)); - memcpy(block, authdata, min(authdatalen, sizeof(block))); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); - trailer = len % AES_BLOCK_LEN; - gcm_ghash_v8(Xi.u, Htable, from, len - trailer); + trailer = authdatalen % AES_BLOCK_LEN; + if (authdatalen - trailer > 0) { + gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + authdata += authdatalen - trailer; + } + if (trailer > 0 || authdatalen == 0) { + memset(block, 0, sizeof(block)); + memcpy(block, authdata, trailer); + gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + } - if (trailer) { - for (i = 0; i < trailer; i++) - block[i] = from[len - trailer + i]; - for (; i < AES_BLOCK_LEN; i++) - block[i] = 0; + trailer = len % AES_BLOCK_LEN; + if (len - trailer > 0) + gcm_ghash_v8(Xi.u, Htable, from, len - trailer); + if (trailer > 0) { + memset(block, 0, sizeof(block)); + memcpy(block, from + len - trailer, trailer); gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); } @@ -392,7 +403,7 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, aes_v8_encrypt(aes_counter, EKi.c, aes_key); AES_INC_COUNTER(aes_counter); for (i = 0; i < trailer; i++) - to[i] = from[i] ^ EKi.c[i % AES_BLOCK_LEN]; + to[i] = from[i] ^ EKi.c[i]; } out: From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 21:11:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B231F5354A9; Thu, 11 Feb 2021 21:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc8SX4h1cz4nyF; Thu, 11 Feb 2021 21:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93BCA17BC6; Thu, 11 Feb 2021 21:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BLBOrc065787; Thu, 11 Feb 2021 21:11:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BLBO3J065786; Thu, 11 Feb 2021 21:11:24 GMT (envelope-from git) Date: Thu, 11 Feb 2021 21:11:24 GMT Message-Id: <202102112111.11BLBO3J065786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 980ce11f30f7 - stable/13 - Turn off forgotten multipath debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 980ce11f30f7587bbb897c3c3bd488a06f5f6b4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 21:11:24 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=980ce11f30f7587bbb897c3c3bd488a06f5f6b4f commit 980ce11f30f7587bbb897c3c3bd488a06f5f6b4f Author: Alexander V. Chernikov AuthorDate: 2021-02-08 20:11:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-11 21:08:19 +0000 Turn off forgotten multipath debug messages Reported by: mike tancsa (cherry picked from commit adc4ea97bd775cb49df5dbfd71dd497c834ae150) --- sys/net/route/nhgrp_ctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index c4f86500ca8d..c2119506370f 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -26,7 +26,6 @@ * * $FreeBSD$ */ -#define RTDEBUG #include "opt_inet.h" #include "opt_route.h" From owner-dev-commits-src-branches@freebsd.org Thu Feb 11 21:17:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CF2E535479; Thu, 11 Feb 2021 21:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc8Zz6Y4Mz4pMG; Thu, 11 Feb 2021 21:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3CB317BD9; Thu, 11 Feb 2021 21:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BLGxBs067582; Thu, 11 Feb 2021 21:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BLGxwt067581; Thu, 11 Feb 2021 21:16:59 GMT (envelope-from git) Date: Thu, 11 Feb 2021 21:16:59 GMT Message-Id: <202102112116.11BLGxwt067581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 538a81520b55 - stable/13 - When we are about to send down to the driver layer we need to make sure that the m_nextpkt field is NULL else the lower layers may do unwanted things. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 538a81520b557f9964c5ebe912f9dff5996bed56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 21:17:00 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=538a81520b557f9964c5ebe912f9dff5996bed56 commit 538a81520b557f9964c5ebe912f9dff5996bed56 Author: Randall Stewart AuthorDate: 2021-01-27 18:32:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-11 21:15:22 +0000 When we are about to send down to the driver layer we need to make sure that the m_nextpkt field is NULL else the lower layers may do unwanted things. Reviewed By: gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D28377 (cherry picked from commit 24a8f6d369962f189ad808f538029179b1e7dc2f) --- sys/netinet6/nd6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 386eb7cca922..497c0bfc10e8 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2460,6 +2460,7 @@ nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain, while (m_head) { m = m_head; m_head = m_head->m_nextpkt; + m->m_nextpkt = NULL; error = nd6_output_ifp(ifp, ifp, m, dst, NULL); } From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 04:03:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5B30542B84; Fri, 12 Feb 2021 04:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcKbz5X1Kz3rxk; Fri, 12 Feb 2021 04:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B09051D887; Fri, 12 Feb 2021 04:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C43RKn006533; Fri, 12 Feb 2021 04:03:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C43Rtg006532; Fri, 12 Feb 2021 04:03:27 GMT (envelope-from git) Date: Fri, 12 Feb 2021 04:03:27 GMT Message-Id: <202102120403.11C43Rtg006532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 5bbaea5d06b7 - stable/13 - Improve ACPI_NFIT_CONTROL_REGION formatting. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5bbaea5d06b778534efd158e297f233dc880e85b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 04:03:27 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=5bbaea5d06b778534efd158e297f233dc880e85b commit 5bbaea5d06b778534efd158e297f233dc880e85b Author: Alexander Motin AuthorDate: 2021-02-05 15:07:37 +0000 Commit: Alexander Motin CommitDate: 2021-02-12 04:03:14 +0000 Improve ACPI_NFIT_CONTROL_REGION formatting. MFC after: 1 week (cherry picked from commit 35e39fd95fda64699b638192f3bab955d0f1cf0c) --- usr.sbin/acpi/acpidump/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index c573c02b7f92..2753fb26bdd9 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1659,20 +1659,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex); printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId); printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId); - printf("\tRevisionId=%u\n", (u_int)ctlreg->RevisionId); + printf("\tRevisionId=0x%02x\n", (u_int)ctlreg->RevisionId); printf("\tSubsystemVendorId=0x%04x\n", (u_int)ctlreg->SubsystemVendorId); printf("\tSubsystemDeviceId=0x%04x\n", (u_int)ctlreg->SubsystemDeviceId); - printf("\tSubsystemRevisionId=%u\n", + printf("\tSubsystemRevisionId=0x%02x\n", (u_int)ctlreg->SubsystemRevisionId); printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields); - printf("\tManufacturingLocation=%u\n", + printf("\tManufacturingLocation=0x%02x\n", (u_int)ctlreg->ManufacturingLocation); - printf("\tManufacturingDate=%u\n", - (u_int)ctlreg->ManufacturingDate); - printf("\tSerialNumber=%u\n", - (u_int)ctlreg->SerialNumber); + printf("\tManufacturingDate=%04x\n", + (u_int)be16toh(ctlreg->ManufacturingDate)); + printf("\tSerialNumber=%08X\n", + (u_int)be32toh(ctlreg->SerialNumber)); printf("\tCode=0x%04x\n", (u_int)ctlreg->Code); printf("\tWindows=%u\n", (u_int)ctlreg->Windows); printf("\tWindowSize=0x%016jx\n", From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 04:03:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DBD3542D30; Fri, 12 Feb 2021 04:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcKc06pnTz3sJX; Fri, 12 Feb 2021 04:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB4E41D80C; Fri, 12 Feb 2021 04:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C43Scc006555; Fri, 12 Feb 2021 04:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C43SYi006554; Fri, 12 Feb 2021 04:03:28 GMT (envelope-from git) Date: Fri, 12 Feb 2021 04:03:28 GMT Message-Id: <202102120403.11C43SYi006554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 549d8329293e - stable/13 - Print DeviceHandle and PhysicalId in hex. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 549d8329293e1d3f8a8347f3546e9f548b76c152 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 04:03:29 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=549d8329293e1d3f8a8347f3546e9f548b76c152 commit 549d8329293e1d3f8a8347f3546e9f548b76c152 Author: Alexander Motin AuthorDate: 2021-02-05 21:13:55 +0000 Commit: Alexander Motin CommitDate: 2021-02-12 04:03:15 +0000 Print DeviceHandle and PhysicalId in hex. The first is actually a bitfield. The second is printed in hex by dmidecode, so uniformidy should be good. MFC after: 1 week (cherry picked from commit 92d0d6bb14d24abea0786edf546af316ff4a2afe) --- usr.sbin/acpi/acpidump/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 2753fb26bdd9..adb5b968f441 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1615,8 +1615,8 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) break; case ACPI_NFIT_TYPE_MEMORY_MAP: mmap = (ACPI_NFIT_MEMORY_MAP *)nfit; - printf("\tDeviceHandle=%u\n", (u_int)mmap->DeviceHandle); - printf("\tPhysicalId=%u\n", (u_int)mmap->PhysicalId); + printf("\tDeviceHandle=0x%x\n", (u_int)mmap->DeviceHandle); + printf("\tPhysicalId=0x%04x\n", (u_int)mmap->PhysicalId); printf("\tRegionId=%u\n", (u_int)mmap->RegionId); printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex); printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex); From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 04:04:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A11CE542D54; Fri, 12 Feb 2021 04:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcKcv3csHz3sfL; Fri, 12 Feb 2021 04:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F1461D070; Fri, 12 Feb 2021 04:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C44F5A006780; Fri, 12 Feb 2021 04:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C44FuV006779; Fri, 12 Feb 2021 04:04:15 GMT (envelope-from git) Date: Fri, 12 Feb 2021 04:04:15 GMT Message-Id: <202102120404.11C44FuV006779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: f8c7687febed - stable/12 - Improve ACPI_NFIT_CONTROL_REGION formatting. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f8c7687febedd758705f5fb9fcb8265fff955c1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 04:04:15 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c7687febedd758705f5fb9fcb8265fff955c1f commit f8c7687febedd758705f5fb9fcb8265fff955c1f Author: Alexander Motin AuthorDate: 2021-02-05 15:07:37 +0000 Commit: Alexander Motin CommitDate: 2021-02-12 04:04:10 +0000 Improve ACPI_NFIT_CONTROL_REGION formatting. MFC after: 1 week (cherry picked from commit 35e39fd95fda64699b638192f3bab955d0f1cf0c) --- usr.sbin/acpi/acpidump/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index f0ba4ee73e84..07edcf271fa2 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1653,20 +1653,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex); printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId); printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId); - printf("\tRevisionId=%u\n", (u_int)ctlreg->RevisionId); + printf("\tRevisionId=0x%02x\n", (u_int)ctlreg->RevisionId); printf("\tSubsystemVendorId=0x%04x\n", (u_int)ctlreg->SubsystemVendorId); printf("\tSubsystemDeviceId=0x%04x\n", (u_int)ctlreg->SubsystemDeviceId); - printf("\tSubsystemRevisionId=%u\n", + printf("\tSubsystemRevisionId=0x%02x\n", (u_int)ctlreg->SubsystemRevisionId); printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields); - printf("\tManufacturingLocation=%u\n", + printf("\tManufacturingLocation=0x%02x\n", (u_int)ctlreg->ManufacturingLocation); - printf("\tManufacturingDate=%u\n", - (u_int)ctlreg->ManufacturingDate); - printf("\tSerialNumber=%u\n", - (u_int)ctlreg->SerialNumber); + printf("\tManufacturingDate=%04x\n", + (u_int)be16toh(ctlreg->ManufacturingDate)); + printf("\tSerialNumber=%08X\n", + (u_int)be32toh(ctlreg->SerialNumber)); printf("\tCode=0x%04x\n", (u_int)ctlreg->Code); printf("\tWindows=%u\n", (u_int)ctlreg->Windows); printf("\tWindowSize=0x%016jx\n", From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 04:04:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACE7E542BAF; Fri, 12 Feb 2021 04:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcKcw4ZS2z3sfM; Fri, 12 Feb 2021 04:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9002F1D4D0; Fri, 12 Feb 2021 04:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C44GX5006798; Fri, 12 Feb 2021 04:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C44GTH006797; Fri, 12 Feb 2021 04:04:16 GMT (envelope-from git) Date: Fri, 12 Feb 2021 04:04:16 GMT Message-Id: <202102120404.11C44GTH006797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 9525ccc84e33 - stable/12 - Print DeviceHandle and PhysicalId in hex. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9525ccc84e337f4261425fc8fbf9f0de18500a1b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 04:04:16 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9525ccc84e337f4261425fc8fbf9f0de18500a1b commit 9525ccc84e337f4261425fc8fbf9f0de18500a1b Author: Alexander Motin AuthorDate: 2021-02-05 21:13:55 +0000 Commit: Alexander Motin CommitDate: 2021-02-12 04:04:11 +0000 Print DeviceHandle and PhysicalId in hex. The first is actually a bitfield. The second is printed in hex by dmidecode, so uniformidy should be good. MFC after: 1 week (cherry picked from commit 92d0d6bb14d24abea0786edf546af316ff4a2afe) --- usr.sbin/acpi/acpidump/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 07edcf271fa2..06891fa09543 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1609,8 +1609,8 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) break; case ACPI_NFIT_TYPE_MEMORY_MAP: mmap = (ACPI_NFIT_MEMORY_MAP *)nfit; - printf("\tDeviceHandle=%u\n", (u_int)mmap->DeviceHandle); - printf("\tPhysicalId=%u\n", (u_int)mmap->PhysicalId); + printf("\tDeviceHandle=0x%x\n", (u_int)mmap->DeviceHandle); + printf("\tPhysicalId=0x%04x\n", (u_int)mmap->PhysicalId); printf("\tRegionId=%u\n", (u_int)mmap->RegionId); printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex); printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex); From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 08:02:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A1BE547A0B; Fri, 12 Feb 2021 08:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcQvn0HNWz4Z9s; Fri, 12 Feb 2021 08:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0B0E20556; Fri, 12 Feb 2021 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C82SG4019652; Fri, 12 Feb 2021 08:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C82Sft019651; Fri, 12 Feb 2021 08:02:28 GMT (envelope-from git) Date: Fri, 12 Feb 2021 08:02:28 GMT Message-Id: <202102120802.11C82Sft019651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 752a51183695 - stable/13 - netgraph/ng_bridge: Deactivate old table ABI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 752a51183695f29cd6389d19d79a569a2135d40b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 08:02:29 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=752a51183695f29cd6389d19d79a569a2135d40b commit 752a51183695f29cd6389d19d79a569a2135d40b Author: Lutz Donnerhacke AuthorDate: 2021-02-12 07:59:26 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-12 08:01:45 +0000 netgraph/ng_bridge: Deactivate old table ABI This was announced to happen after the 12 releases. Deactivate a depeciated ABI. (refers to commit ed0a1527507e916c78e6937bcc4061bb81fd9da8) Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28518 --- sys/netgraph/ng_bridge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index e4b74efbfc5e..765d279bfdb1 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -49,8 +49,8 @@ * Please note: There is no API support! * You canno create new messages using the old API but messages conforming the * old ABI are understood. + * Define NGM_BRIDGE_TABLE_ABI to enable this in 13.x */ -#define NGM_BRIDGE_TABLE_ABI /* Node type name and magic cookie */ #define NG_BRIDGE_NODE_TYPE "bridge" From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 08:07:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25C1B547A41; Fri, 12 Feb 2021 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcR250cnhz4ZnF; Fri, 12 Feb 2021 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0769020558; Fri, 12 Feb 2021 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C87u3j020768; Fri, 12 Feb 2021 08:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C87uRh020767; Fri, 12 Feb 2021 08:07:56 GMT (envelope-from git) Date: Fri, 12 Feb 2021 08:07:56 GMT Message-Id: <202102120807.11C87uRh020767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: dd8f4fcd270d - stable/13 - netgraph/ng_source: Switch queuing framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dd8f4fcd270d1b7191591d040f54dcaa78a1d609 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 08:07:57 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=dd8f4fcd270d1b7191591d040f54dcaa78a1d609 commit dd8f4fcd270d1b7191591d040f54dcaa78a1d609 Author: Lutz Donnerhacke AuthorDate: 2021-01-29 11:03:17 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-12 08:05:19 +0000 netgraph/ng_source: Switch queuing framework Change the queuing framework from ifq to mbufq. Reported by: glebius Reviewed by: glebius, kp Differential Revision: https://reviews.freebsd.org/D28407 --- sys/netgraph/ng_source.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index 401548da65d0..0eee9ceb25c5 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -85,7 +85,7 @@ struct privdata { hook_p input; hook_p output; struct ng_source_stats stats; - struct ifqueue snd_queue; /* packets to send */ + struct mbufq snd_queue; /* packets to send */ struct mbuf *last_packet; /* last pkt in queue */ struct ifnet *output_ifp; struct callout intr_ch; @@ -284,7 +284,7 @@ ng_source_constructor(node_p node) NG_NODE_SET_PRIVATE(node, sc); sc->node = node; - sc->snd_queue.ifq_maxlen = 2048; /* XXX not checked */ + mbufq_init(&sc->snd_queue, 2048); ng_callout_init(&sc->intr_ch); return (0); @@ -374,7 +374,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) goto done; } sc->stats.queueOctets = sc->queueOctets; - sc->stats.queueFrames = sc->snd_queue.ifq_len; + sc->stats.queueFrames = mbufq_len(&sc->snd_queue); if ((sc->node->nd_flags & NG_SOURCE_ACTIVE) && !timevalisset(&sc->stats.endTime)) { getmicrotime(&sc->stats.elapsedTime); @@ -567,9 +567,12 @@ ng_source_rcvdata(hook_p hook, item_p item) } KASSERT(hook == sc->input, ("%s: no hook!", __func__)); - /* Enqueue packet. */ - /* XXX should we check IF_QFULL() ? */ - _IF_ENQUEUE(&sc->snd_queue, m); + /* Enqueue packet if the queue isn't full. */ + error = mbufq_enqueue(&sc->snd_queue, m); + if (error) { + NG_FREE_M(m); + return (error); + } sc->queueOctets += m->m_pkthdr.len; sc->last_packet = m; @@ -668,7 +671,7 @@ ng_source_clr_data (sc_p sc) struct mbuf *m; for (;;) { - _IF_DEQUEUE(&sc->snd_queue, m); + m = mbufq_dequeue(&sc->snd_queue); if (m == NULL) break; NG_FREE_M(m); @@ -741,7 +744,7 @@ ng_source_intr(node_p node, hook_p hook, void *arg1, int arg2) ifq = (struct ifqueue *)&sc->output_ifp->if_snd; packets = ifq->ifq_maxlen - ifq->ifq_len; } else - packets = sc->snd_queue.ifq_len; + packets = mbufq_len(&sc->snd_queue); if (sc->stats.maxPps != 0) { struct timeval now, elapsed; @@ -785,7 +788,7 @@ ng_source_send(sc_p sc, int tosend, int *sent_p) /* Go through the queue sending packets one by one. */ for (sent = 0; error == 0 && sent < tosend; ++sent) { - _IF_DEQUEUE(&sc->snd_queue, m); + m = mbufq_dequeue(&sc->snd_queue); if (m == NULL) break; @@ -793,14 +796,20 @@ ng_source_send(sc_p sc, int tosend, int *sent_p) error = ng_source_dup_mod(sc, m, &m2); if (error) { if (error == ENOBUFS) - _IF_PREPEND(&sc->snd_queue, m); + mbufq_prepend(&sc->snd_queue, m); else - _IF_ENQUEUE(&sc->snd_queue, m); + (void)mbufq_enqueue(&sc->snd_queue, m); break; } - /* Re-enqueue the original packet for us. */ - _IF_ENQUEUE(&sc->snd_queue, m); + /* + * Re-enqueue the original packet for us. The queue + * has a free slot, because we dequeued the packet + * above and this callout function runs under WRITER + * lock. + */ + error = mbufq_enqueue(&sc->snd_queue, m); + KASSERT(error == 0, ("%s: re-enqueue packet failed", __func__)); sc->stats.outFrames++; sc->stats.outOctets += m2->m_pkthdr.len; From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 08:09:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEB87547C51; Fri, 12 Feb 2021 08:09:45 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcR492H26z4ZZ2; Fri, 12 Feb 2021 08:09:44 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 11C89X41012276 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 12 Feb 2021 09:09:33 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 11C89XOm011913; Fri, 12 Feb 2021 09:09:33 +0100 Date: Fri, 12 Feb 2021 09:09:33 +0100 From: Lutz Donnerhacke To: Lutz Donnerhacke Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: dd8f4fcd270d - stable/13 - netgraph/ng_source: Switch queuing framework Message-ID: <20210212080933.GA11902@belenus.iks-jena.de> References: <202102120807.11C87uRh020767@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102120807.11C87uRh020767@gitrepo.freebsd.org> X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DcR492H26z4ZZ2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 08:09:45 -0000 On Fri, Feb 12, 2021 at 08:07:56AM +0000, Lutz Donnerhacke wrote: > commit dd8f4fcd270d1b7191591d040f54dcaa78a1d609 > Author: Lutz Donnerhacke > AuthorDate: 2021-01-29 11:03:17 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-12 08:05:19 +0000 > > netgraph/ng_source: Switch queuing framework > > Change the queuing framework from ifq to mbufq. > > Reported by: glebius > Reviewed by: glebius, kp > Differential Revision: https://reviews.freebsd.org/D28407 I missed "cherry-picked from commit ...", sorry. From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 09:54:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 049805498FE; Fri, 12 Feb 2021 09:54:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcTPZ6mwrz4gdQ; Fri, 12 Feb 2021 09:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB87321C36; Fri, 12 Feb 2021 09:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C9swJr064210; Fri, 12 Feb 2021 09:54:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C9sw0F064209; Fri, 12 Feb 2021 09:54:58 GMT (envelope-from git) Date: Fri, 12 Feb 2021 09:54:58 GMT Message-Id: <202102120954.11C9sw0F064209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 18097ee2fb7c - stable/13 - ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 18097ee2fb7c8cbb1591e969e11f494a96c4e019 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 09:54:59 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=18097ee2fb7c8cbb1591e969e11f494a96c4e019 commit 18097ee2fb7c8cbb1591e969e11f494a96c4e019 Author: Gordon Bergling AuthorDate: 2021-02-08 20:21:26 +0000 Commit: Gordon Bergling CommitDate: 2021-02-12 09:53:26 +0000 ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page Since we ship a ktls(4) enabled OpenSSL version, mention the src.conf(5) option WITH_OPENSSL_KTLS in the manual page. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28435 (cherry picked from commit 6c34d8ce11cb73e718fc23d85b6fbfab07ee15b4) --- share/man/man4/ktls.4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 9a8dccfb8afe..21e1a1bdb6ca 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2020 +.Dd February 8, 2021 .Dt KTLS 4 .Os .Sh NAME @@ -237,7 +237,9 @@ port may also be built with support for .Nm by enabling the .Dv KTLS -option . +option. +OpenSSL in the base system includes KTLS support when built with +.Dv WITH_OPENSSL_KTLS . .Pp Applications using a supported library should generally work with .Nm @@ -256,6 +258,7 @@ As a result, it is only supported on architectures with a direct map. .Xr cxgbe 4 , .Xr mlx5en 4 , .Xr tcp 4 , +.Xr src.conf 5 , .Xr ifconfig 8 , .Xr sysctl 8 , .Xr crypto 9 From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 20:55:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F01F530CC9; Fri, 12 Feb 2021 20:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcm3h3ddMz3vYR; Fri, 12 Feb 2021 20:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6529625C0; Fri, 12 Feb 2021 20:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CKtSTW028084; Fri, 12 Feb 2021 20:55:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CKtSiK028083; Fri, 12 Feb 2021 20:55:28 GMT (envelope-from git) Date: Fri, 12 Feb 2021 20:55:28 GMT Message-Id: <202102122055.11CKtSiK028083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 5bc11b95b87c - stable/13 - test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5bc11b95b87c931d45dee0e3f27ce1455f59a460 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 20:55:28 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=5bc11b95b87c931d45dee0e3f27ce1455f59a460 commit 5bc11b95b87c931d45dee0e3f27ce1455f59a460 Author: Dimitry Andric AuthorDate: 2021-02-12 20:45:33 +0000 Commit: Dimitry Andric CommitDate: 2021-02-12 20:48:03 +0000 test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28396 (cherry picked from commit 4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba) Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10 This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 (cherry picked from commit ac76bc1145dd7f4476e5d982ce8f355f71015713) --- lib/msun/src/s_ccoshf.c | 2 +- lib/msun/src/s_ctanh.c | 2 +- lib/msun/src/s_ctanhf.c | 2 +- lib/msun/tests/ctrig_test.c | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c index 5d7a09ba5f8d..e72395c277d5 100644 --- a/lib/msun/src/s_ccoshf.c +++ b/lib/msun/src/s_ccoshf.c @@ -43,7 +43,7 @@ static const float huge = 0x1p127; float complex ccoshf(float complex z) { - float x, y, h; + volatile float x, y, h; int32_t hx, hy, ix, iy; x = crealf(z); diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c index 88afeb50e26e..13eb9d40b678 100644 --- a/lib/msun/src/s_ctanh.c +++ b/lib/msun/src/s_ctanh.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); double complex ctanh(double complex z) { - double x, y; + volatile double x, y; double t, beta, s, rho, denom; uint32_t hx, ix, lx; diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index d2bd0b6786f0..7d375eafd2ae 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); float complex ctanhf(float complex z) { - float x, y; + volatile float x, y; float t, beta, s, rho, denom; uint32_t hx, ix; diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b47ad43fa199..45b2b78b0416 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -248,9 +248,6 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); - /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 20:56:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E9FA530C87; Fri, 12 Feb 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcm4d1xjTz3vqw; Fri, 12 Feb 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B42225C1; Fri, 12 Feb 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CKuHni028324; Fri, 12 Feb 2021 20:56:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CKuHZR028323; Fri, 12 Feb 2021 20:56:17 GMT (envelope-from git) Date: Fri, 12 Feb 2021 20:56:17 GMT Message-Id: <202102122056.11CKuHZR028323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f2a88e744701 - stable/12 - test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f2a88e744701de1b37d7463828f2147f96e39d58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 20:56:17 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a88e744701de1b37d7463828f2147f96e39d58 commit f2a88e744701de1b37d7463828f2147f96e39d58 Author: Alex Richardson AuthorDate: 2021-01-29 09:28:40 +0000 Commit: Dimitry Andric CommitDate: 2021-02-12 20:50:28 +0000 test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28396 (cherry picked from commit 4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba) Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10 This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 (cherry picked from commit ac76bc1145dd7f4476e5d982ce8f355f71015713) --- lib/msun/src/s_ccoshf.c | 2 +- lib/msun/src/s_ctanh.c | 2 +- lib/msun/src/s_ctanhf.c | 2 +- lib/msun/tests/ctrig_test.c | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c index 5d7a09ba5f8d..e72395c277d5 100644 --- a/lib/msun/src/s_ccoshf.c +++ b/lib/msun/src/s_ccoshf.c @@ -43,7 +43,7 @@ static const float huge = 0x1p127; float complex ccoshf(float complex z) { - float x, y, h; + volatile float x, y, h; int32_t hx, hy, ix, iy; x = crealf(z); diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c index 88afeb50e26e..13eb9d40b678 100644 --- a/lib/msun/src/s_ctanh.c +++ b/lib/msun/src/s_ctanh.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); double complex ctanh(double complex z) { - double x, y; + volatile double x, y; double t, beta, s, rho, denom; uint32_t hx, ix, lx; diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index d2bd0b6786f0..7d375eafd2ae 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); float complex ctanhf(float complex z) { - float x, y; + volatile float x, y; float t, beta, s, rho, denom; uint32_t hx, ix; diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b47ad43fa199..45b2b78b0416 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -248,9 +248,6 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); - /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-dev-commits-src-branches@freebsd.org Fri Feb 12 20:56:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3470530F20; Fri, 12 Feb 2021 20:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcm5C5frbz3w0P; Fri, 12 Feb 2021 20:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB8AC2368; Fri, 12 Feb 2021 20:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CKulLq028499; Fri, 12 Feb 2021 20:56:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CKulSq028498; Fri, 12 Feb 2021 20:56:47 GMT (envelope-from git) Date: Fri, 12 Feb 2021 20:56:47 GMT Message-Id: <202102122056.11CKulSq028498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: ca9df934a552 - stable/11 - test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: ca9df934a5520f9692eb6808b1d02c0d3f1b927a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 20:56:47 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ca9df934a5520f9692eb6808b1d02c0d3f1b927a commit ca9df934a5520f9692eb6808b1d02c0d3f1b927a Author: Alex Richardson AuthorDate: 2021-01-29 09:28:40 +0000 Commit: Dimitry Andric CommitDate: 2021-02-12 20:53:02 +0000 test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip() Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28396 (cherry picked from commit 4d2edf3af1dbd8a3e7cf1b22343a1ecfc2dd41ba) Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10 This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 (cherry picked from commit ac76bc1145dd7f4476e5d982ce8f355f71015713) --- lib/msun/src/s_ccoshf.c | 2 +- lib/msun/src/s_ctanh.c | 2 +- lib/msun/src/s_ctanhf.c | 2 +- lib/msun/tests/ctrig_test.c | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c index eeed92f8cf46..7fd61798c2f8 100644 --- a/lib/msun/src/s_ccoshf.c +++ b/lib/msun/src/s_ccoshf.c @@ -41,7 +41,7 @@ static const float huge = 0x1p127; float complex ccoshf(float complex z) { - float x, y, h; + volatile float x, y, h; int32_t hx, hy, ix, iy; x = crealf(z); diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c index f5b9bdd9d5f8..7d2391eaea79 100644 --- a/lib/msun/src/s_ctanh.c +++ b/lib/msun/src/s_ctanh.c @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); double complex ctanh(double complex z) { - double x, y; + volatile double x, y; double t, beta, s, rho, denom; uint32_t hx, ix, lx; diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index 520bf77d6d5c..c222c15f81ee 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); float complex ctanhf(float complex z) { - float x, y; + volatile float x, y; float t, beta, s, rho, denom; uint32_t hx, ix; diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b47ad43fa199..45b2b78b0416 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -248,9 +248,6 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); - /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-dev-commits-src-branches@freebsd.org Sat Feb 13 00:25:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4127353786E; Sat, 13 Feb 2021 00:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcrkV0ghKz4h3P; Sat, 13 Feb 2021 00:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05E1253EB; Sat, 13 Feb 2021 00:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D0PrWd004104; Sat, 13 Feb 2021 00:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D0PrG0004103; Sat, 13 Feb 2021 00:25:53 GMT (envelope-from git) Date: Sat, 13 Feb 2021 00:25:53 GMT Message-Id: <202102130025.11D0PrG0004103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a73aaaeb579b - stable/13 - vm: Honour the "noreuse" flag to vm_page_unwire_managed() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a73aaaeb579bc7454621c4389636a6d4a952d58c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 00:25:54 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a73aaaeb579bc7454621c4389636a6d4a952d58c commit a73aaaeb579bc7454621c4389636a6d4a952d58c Author: Mark Johnston AuthorDate: 2021-02-10 16:10:27 +0000 Commit: Mark Johnston CommitDate: 2021-02-13 00:25:05 +0000 vm: Honour the "noreuse" flag to vm_page_unwire_managed() This flag indicates that the page should be enqueued near the head of the inactive queue, skipping the LRU queue. It is used when unwiring pages from the buffer cache following direct I/O or after I/O when POSIX_FADV_NOREUSE or _DONTNEED advice was specified, or when sendfile(SF_NOCACHE) completes. For the direct I/O and sendfile cases we only enqueue the page if we decide not to free it, typically because it's mapped. Pass "noreuse" through to vm_page_release_toq() so that we actually honour the desired LRU policy for these scenarios. Reported by: bdrewery Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D28555 (cherry picked from commit 5c18744ea9b94cb6a9a091a900fa4999868736e1) --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index e668bbdc6178..c36b8cdc5762 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -3989,7 +3989,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse) * (i.e., the VPRC_OBJREF bit is clear), we only need to * clear leftover queue state. */ - vm_page_release_toq(m, nqueue, false); + vm_page_release_toq(m, nqueue, noreuse); } else if (old == 1) { vm_page_aflag_clear(m, PGA_DEQUEUE); } From owner-dev-commits-src-branches@freebsd.org Sat Feb 13 05:03:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B1F953F808; Sat, 13 Feb 2021 05:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcytw3y6cz3FdZ; Sat, 13 Feb 2021 05:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B16511660; Sat, 13 Feb 2021 05:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D53aZG071293; Sat, 13 Feb 2021 05:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D53aMB071292; Sat, 13 Feb 2021 05:03:36 GMT (envelope-from git) Date: Sat, 13 Feb 2021 05:03:36 GMT Message-Id: <202102130503.11D53aMB071292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8874f305d814 - stable/13 - ZFS: fix assertions with INVARIANTS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8874f305d81414e7b6ec0b3ecc2a0736389a8492 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 05:03:36 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8874f305d81414e7b6ec0b3ecc2a0736389a8492 commit 8874f305d81414e7b6ec0b3ecc2a0736389a8492 Author: Alan Somers AuthorDate: 2021-01-20 15:55:36 +0000 Commit: Alan Somers CommitDate: 2021-02-13 05:03:19 +0000 ZFS: fix assertions with INVARIANTS AFAICT, this was an oversight from 9e5787d2284e187abb5b654d924394a65772e004 (svn r364746). That revision inadvertently disabled assertions unconditionally. Reviewed by: freqlabs Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D28256 (cherry picked from commit 174a7e578a33c01401e33f9bfcc077fc3155251c) --- sys/modules/zfs/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index e4b92db764ef..49256609b549 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -282,6 +282,8 @@ SRCS+= zfs_zstd.c \ .include +CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CFLAGS.gcc+= -Wno-pointer-to-int-cast From owner-dev-commits-src-branches@freebsd.org Sun Feb 14 00:46:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA895542037; Sun, 14 Feb 2021 00:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdT7l5qVcz3ntw; Sun, 14 Feb 2021 00:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B69E620DC5; Sun, 14 Feb 2021 00:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11E0kRQD027784; Sun, 14 Feb 2021 00:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11E0kRMK027783; Sun, 14 Feb 2021 00:46:27 GMT (envelope-from git) Date: Sun, 14 Feb 2021 00:46:27 GMT Message-Id: <202102140046.11E0kRMK027783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f94e8beadbd8 - stable/13 - usleep(3): replace 'process' with 'calling thread' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f94e8beadbd82f758c7663cb7115aeec2fbed7fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 00:46:27 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f94e8beadbd82f758c7663cb7115aeec2fbed7fa commit f94e8beadbd82f758c7663cb7115aeec2fbed7fa Author: Konstantin Belousov AuthorDate: 2021-02-11 03:49:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-14 00:45:49 +0000 usleep(3): replace 'process' with 'calling thread' PR: 253395 (cherry picked from commit 4956af2a8f0d7723cb09c98e7f5295b156136f70) --- lib/libc/gen/usleep.3 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index b298380977ba..f6ed9e6bb52e 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -28,12 +28,12 @@ .\" @(#)usleep.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 13, 1998 +.Dd February 11, 2021 .Dt USLEEP 3 .Os .Sh NAME .Nm usleep -.Nd suspend process execution for an interval measured in microseconds +.Nd suspend thread execution for an interval measured in microseconds .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -43,9 +43,9 @@ .Sh DESCRIPTION The .Fn usleep -function suspends execution of the calling process until either +function suspends execution of the calling thread until either .Fa microseconds -microseconds have elapsed or a signal is delivered to the process and its +microseconds have elapsed or a signal is delivered to the thread and its action is to invoke a signal-catching function or to terminate the process. System activity may lengthen the sleep by an indeterminate amount. @@ -67,7 +67,7 @@ function will fail if: .Bl -tag -width Er .It Bq Er EINTR -A signal was delivered to the process and its +A signal was delivered to the calling thread and its action was to invoke a signal-catching function. .El .Sh SEE ALSO From owner-dev-commits-src-branches@freebsd.org Sun Feb 14 00:47:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B3A05422D4; Sun, 14 Feb 2021 00:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdT8V1gWsz3p7C; Sun, 14 Feb 2021 00:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C09120ECF; Sun, 14 Feb 2021 00:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11E0l6M0027992; Sun, 14 Feb 2021 00:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11E0l6YY027991; Sun, 14 Feb 2021 00:47:06 GMT (envelope-from git) Date: Sun, 14 Feb 2021 00:47:06 GMT Message-Id: <202102140047.11E0l6YY027991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5357bd228fca - stable/12 - usleep(3): replace 'process' with 'calling thread' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5357bd228fca092453c0970ccb54fc08f5deb939 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 00:47:06 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5357bd228fca092453c0970ccb54fc08f5deb939 commit 5357bd228fca092453c0970ccb54fc08f5deb939 Author: Konstantin Belousov AuthorDate: 2021-02-11 03:49:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-14 00:46:42 +0000 usleep(3): replace 'process' with 'calling thread' PR: 253395 (cherry picked from commit 4956af2a8f0d7723cb09c98e7f5295b156136f70) --- lib/libc/gen/usleep.3 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index b298380977ba..f6ed9e6bb52e 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -28,12 +28,12 @@ .\" @(#)usleep.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 13, 1998 +.Dd February 11, 2021 .Dt USLEEP 3 .Os .Sh NAME .Nm usleep -.Nd suspend process execution for an interval measured in microseconds +.Nd suspend thread execution for an interval measured in microseconds .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -43,9 +43,9 @@ .Sh DESCRIPTION The .Fn usleep -function suspends execution of the calling process until either +function suspends execution of the calling thread until either .Fa microseconds -microseconds have elapsed or a signal is delivered to the process and its +microseconds have elapsed or a signal is delivered to the thread and its action is to invoke a signal-catching function or to terminate the process. System activity may lengthen the sleep by an indeterminate amount. @@ -67,7 +67,7 @@ function will fail if: .Bl -tag -width Er .It Bq Er EINTR -A signal was delivered to the process and its +A signal was delivered to the calling thread and its action was to invoke a signal-catching function. .El .Sh SEE ALSO From owner-dev-commits-src-branches@freebsd.org Sun Feb 14 10:18:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 335B6529F2B; Sun, 14 Feb 2021 10:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ddjqb0x76z4r4l; Sun, 14 Feb 2021 10:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E753635; Sun, 14 Feb 2021 10:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EAIIci072294; Sun, 14 Feb 2021 10:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EAIIDR072293; Sun, 14 Feb 2021 10:18:18 GMT (envelope-from git) Date: Sun, 14 Feb 2021 10:18:18 GMT Message-Id: <202102141018.11EAIIDR072293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 11304949deb3 - stable/13 - Fix ifa refcount leak during route addition. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11304949deb36d2f9abbcda87d398496e892dcec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 10:18:19 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=11304949deb36d2f9abbcda87d398496e892dcec commit 11304949deb36d2f9abbcda87d398496e892dcec Author: Alexander V. Chernikov AuthorDate: 2021-02-12 20:56:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-14 10:16:51 +0000 Fix ifa refcount leak during route addition. Reported by: rstone Reviewed by: rstone (cherry picked from commit a375ec52a7b423133f66878ecf002efc3b6e9fca) --- sys/net/route/route_ctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 6b0869196d12..9aedfb9d5855 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -594,14 +594,12 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info, } error = nhop_create_from_info(rnh, info, &nh); - if (error != 0) { - ifa_free(info->rti_ifa); + ifa_free(info->rti_ifa); + if (error != 0) return (error); - } rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) { - ifa_free(info->rti_ifa); nhop_free(nh); return (ENOBUFS); } From owner-dev-commits-src-branches@freebsd.org Sun Feb 14 10:31:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FFE052A323; Sun, 14 Feb 2021 10:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ddk6G44jLz4rj1; Sun, 14 Feb 2021 10:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EC80C5F; Sun, 14 Feb 2021 10:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EAV2hk096952; Sun, 14 Feb 2021 10:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EAV2oZ096951; Sun, 14 Feb 2021 10:31:02 GMT (envelope-from git) Date: Sun, 14 Feb 2021 10:31:02 GMT Message-Id: <202102141031.11EAV2oZ096951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7ef1ebd8f1e5 - stable/13 - Fix interface route addition with net/bird. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ef1ebd8f1e5920456a89726ccfa4c14372c9310 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 10:31:02 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7ef1ebd8f1e5920456a89726ccfa4c14372c9310 commit 7ef1ebd8f1e5920456a89726ccfa4c14372c9310 Author: Alexander V. Chernikov AuthorDate: 2021-02-14 10:30:15 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-14 10:30:15 +0000 Fix interface route addition with net/bird. The case of adding interface route by specifying interface address as the gateway was missed during code refactoring. Re-add it back by copying non-AF_LINK gateway data when RTF_GATEWAY is not set. Reviewed by: donner (cherry picked from commit 8170a7d43835047f9c1548a081eea45116473995) --- sys/net/route/nhop_ctl.c | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 542380afd64b..7de553799fab 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -219,42 +219,44 @@ set_nhop_gw_from_info(struct nhop_object *nh, struct rt_addrinfo *info) gw = info->rti_info[RTAX_GATEWAY]; KASSERT(gw != NULL, ("gw is NULL")); - if (info->rti_flags & RTF_GATEWAY) { - if (gw->sa_len > sizeof(struct sockaddr_in6)) { - DPRINTF("nhop SA size too big: AF %d len %u", - gw->sa_family, gw->sa_len); - return (ENOMEM); - } - memcpy(&nh->gw_sa, gw, gw->sa_len); - } else { + if ((gw->sa_family == AF_LINK) && !(info->rti_flags & RTF_GATEWAY)) { /* - * Interface route. Currently the route.c code adds - * sa of type AF_LINK, which is 56 bytes long. The only - * meaningful data there is the interface index. It is used - * used is the IPv6 loopback output, where we need to preserve - * the original interface to maintain proper scoping. + * Interface route with interface specified by the interface + * index in sockadd_dl structure. It is used in the IPv6 loopback + * output code, where we need to preserve the original interface + * to maintain proper scoping. * Despite the fact that nexthop code stores original interface * in the separate field (nh_aifp, see below), write AF_LINK * compatible sa with shorter total length. */ - struct sockaddr_dl *sdl; - struct ifnet *ifp; - - /* Fetch and validate interface index */ - sdl = (struct sockaddr_dl *)gw; - if (sdl->sdl_family != AF_LINK) { - DPRINTF("unsupported AF: %d", sdl->sdl_family); - return (ENOTSUP); - } - ifp = ifnet_byindex(sdl->sdl_index); + struct sockaddr_dl *sdl = (struct sockaddr_dl *)gw; + struct ifnet *ifp = ifnet_byindex(sdl->sdl_index); if (ifp == NULL) { DPRINTF("invalid ifindex %d", sdl->sdl_index); return (EINVAL); } fill_sdl_from_ifp(&nh->gwl_sa, ifp); - } + } else { + /* + * Multiple options here: + * + * 1) RTF_GATEWAY with IPv4/IPv6 gateway data + * 2) Interface route with IPv4/IPv6 address of the + * matching interface. Some routing daemons do that + * instead of specifying ifindex in AF_LINK. + * + * In both cases, save the original nexthop to make the callers + * happy. + */ + if (gw->sa_len > sizeof(struct sockaddr_in6)) { + DPRINTF("nhop SA size too big: AF %d len %u", + gw->sa_family, gw->sa_len); + return (ENOMEM); + } + memcpy(&nh->gw_sa, gw, gw->sa_len); + } return (0); }