From owner-svn-src-head@freebsd.org Sun May 17 02:41:51 2020 Return-Path: Delivered-To: svn-src-head@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 88B5D13A8C0; Sun, 17 May 2020 02:41:51 +0000 (UTC) (envelope-from asomers@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pmcv35Bfz3XxF; Sun, 17 May 2020 02:41:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6547B9BF1; Sun, 17 May 2020 02:41:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04H2fp5S010554; Sun, 17 May 2020 02:41:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2fpvF010553; Sun, 17 May 2020 02:41:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170241.04H2fpvF010553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361129 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 361129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 02:41:51 -0000 Author: asomers Date: Sun May 17 02:41:50 2020 New Revision: 361129 URL: https://svnweb.freebsd.org/changeset/base/361129 Log: Reenable sys.geom.class.gate.ggate_test.ggated in CI Should be fixed by r360613 PR: 244737 Reported by: lwhsu Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:40:49 2020 (r361128) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:41:50 2020 (r361129) @@ -16,10 +16,6 @@ ggated_head() ggated_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/244737" - fi - load_ggate us=$(alloc_ggate_dev) From owner-svn-src-head@freebsd.org Sun May 17 14:00:55 2020 Return-Path: Delivered-To: svn-src-head@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 426C02DA816; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3hR155Tz4Nwf; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209BE11651; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HE0tu4029403; Sun, 17 May 2020 14:00:55 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HE0tjD029386; Sun, 17 May 2020 14:00:55 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171400.04HE0tjD029386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361133 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:00:55 -0000 Author: fsu Date: Sun May 17 14:00:54 2020 New Revision: 361133 URL: https://svnweb.freebsd.org/changeset/base/361133 Log: Add inode bitmap tail initialization. Make ext2fs compatible with changes introduced in e2fsprogs v1.45.2. Now the tail of inode bitmap is filled with 0xff pattern explicitly during bitmap initialization phase to avoid e2fsck error like: "Padding at end of inode bitmap is not set." Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 11:13:12 2020 (r361132) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:00:54 2020 (r361133) @@ -1287,6 +1287,16 @@ ext2_zero_inode_table(struct inode *ip, int cg) return (0); } +static void +ext2_fix_bitmap_tail(unsigned char *bitmap, int first, int last) +{ + int i; + + for (i = first; i <= last; i++) + bitmap[i] = 0xff; +} + + /* * Determine whether an inode can be allocated. * @@ -1299,7 +1309,7 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr struct m_ext2fs *fs; struct buf *bp; struct ext2mount *ump; - int error, start, len, ifree; + int error, start, len, ifree, ibytes; char *ibp, *loc; ipref--; /* to avoid a lot of (ipref -1) */ @@ -1320,7 +1330,10 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { - memset(bp->b_data, 0, fs->e2fs_bsize); + ibytes = fs->e2fs_ipg / 8; + memset(bp->b_data, 0, ibytes - 1); + ext2_fix_bitmap_tail(bp->b_data, ibytes, + fs->e2fs_bsize - 1); fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; } ext2_gd_i_bitmap_csum_set(fs, cg, bp); From owner-svn-src-head@freebsd.org Sun May 17 14:03:14 2020 Return-Path: Delivered-To: svn-src-head@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 0E6502DAA4E; Sun, 17 May 2020 14:03:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3l567CWz4P5p; Sun, 17 May 2020 14:03:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD350116CF; Sun, 17 May 2020 14:03:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HE3D6f032874; Sun, 17 May 2020 14:03:13 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HE3D1o032873; Sun, 17 May 2020 14:03:13 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171403.04HE3D1o032873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361134 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:03:14 -0000 Author: fsu Date: Sun May 17 14:03:13 2020 New Revision: 361134 URL: https://svnweb.freebsd.org/changeset/base/361134 Log: Fix incorrect inode link count check in case of rename. The check was incorrect because the directory inode link count have min value 2 after dir_nlink extfs feature introduction. Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun May 17 14:00:54 2020 (r361133) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun May 17 14:03:13 2020 (r361134) @@ -1018,10 +1018,11 @@ abortit: */ ext2_dec_nlink(xp); if (doingdirectory) { - if (--xp->i_nlink != 0) + if (xp->i_nlink > 2) panic("ext2_rename: linked directory"); error = ext2_truncate(tvp, (off_t)0, IO_SYNC, tcnp->cn_cred, tcnp->cn_thread); + xp->i_nlink = 0; } xp->i_flag |= IN_CHANGE; vput(tvp); From owner-svn-src-head@freebsd.org Sun May 17 14:10:47 2020 Return-Path: Delivered-To: svn-src-head@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 342622DA9EE; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3vq0ZXJz4PLr; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EF0A119AB; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HEAk5u036512; Sun, 17 May 2020 14:10:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HEAkXQ036511; Sun, 17 May 2020 14:10:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171410.04HEAkXQ036511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361135 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:10:47 -0000 Author: fsu Date: Sun May 17 14:10:46 2020 New Revision: 361135 URL: https://svnweb.freebsd.org/changeset/base/361135 Log: Restrict the max runp and runb return values in case of extents mapping. This restriction already present in case of indirect mapping, do the same in case of extents. PR: 246182 Reported by: Teran McKinney MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:03:13 2020 (r361134) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:10:46 2020 (r361135) @@ -94,21 +94,28 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn { struct inode *ip; struct m_ext2fs *fs; + struct mount *mp; + struct ext2mount *ump; struct ext4_extent_header *ehp; struct ext4_extent *ep; struct ext4_extent_path *path = NULL; daddr_t lbn; - int error, depth; + int error, depth, maxrun = 0, bsize; ip = VTOI(vp); fs = ip->i_e2fs; + mp = vp->v_mount; + ump = VFSTOEXT2(mp); lbn = bn; ehp = (struct ext4_extent_header *)ip->i_data; depth = ehp->eh_depth; + bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); *bnp = -1; - if (runp != NULL) + if (runp != NULL) { + maxrun = mp->mnt_iosize_max / bsize - 1; *runp = 0; + } if (runb != NULL) *runb = 0; @@ -119,18 +126,21 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ep = path[depth].ep_ext; if(ep) { if (lbn < ep->e_blk) { - if (runp != NULL) - *runp = ep->e_blk - lbn - 1; + if (runp != NULL) { + *runp = min(maxrun, ep->e_blk - lbn - 1); + } } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { *bnp = fsbtodb(fs, lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runp != NULL) { + *runp = min(maxrun, + ep->e_len - (lbn - ep->e_blk) - 1); + } if (runb != NULL) - *runb = lbn - ep->e_blk; + *runb = min(maxrun, lbn - ep->e_blk); } else { if (runb != NULL) - *runb = ep->e_blk + lbn - ep->e_len; + *runb = min(maxrun, ep->e_blk + lbn - ep->e_len); } } From owner-svn-src-head@freebsd.org Sun May 17 14:52:56 2020 Return-Path: Delivered-To: svn-src-head@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 0E6F32DBB96; Sun, 17 May 2020 14:52:56 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q4rR6v2Fz4RkT; Sun, 17 May 2020 14:52:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD407121FB; Sun, 17 May 2020 14:52:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HEqtrv063894; Sun, 17 May 2020 14:52:55 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HEqs7b063888; Sun, 17 May 2020 14:52:54 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171452.04HEqs7b063888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361136 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:52:56 -0000 Author: fsu Date: Sun May 17 14:52:54 2020 New Revision: 361136 URL: https://svnweb.freebsd.org/changeset/base/361136 Log: Add BE architectures support. Author of most initial version: pfg (https://reviews.freebsd.org/D23259) Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D24685 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:52:54 2020 (r361136) @@ -397,7 +397,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred ump = pip->i_ump; EXT2_LOCK(ump); - if (fs->e2fs->e2fs_ficount == 0) + if (fs->e2fs_ficount == 0) goto noinodes; /* * If it is a directory then obtain a cylinder group based on @@ -413,7 +413,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred if (fs->e2fs_contigdirs[cg] > 0) fs->e2fs_contigdirs[cg]--; } - ipref = cg * fs->e2fs->e2fs_ipg + 1; + ipref = cg * fs->e2fs_ipg + 1; ino = (ino_t)ext2_hashalloc(pip, cg, (long)ipref, mode, ext2_nodealloccg); if (ino == 0) goto noinodes; @@ -501,87 +501,87 @@ uint64_t e2fs_gd_get_b_bitmap(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_b_bitmap_hi) << 32) | - gd->ext2bgd_b_bitmap); + return (((uint64_t)(le32toh(gd->ext4bgd_b_bitmap_hi)) << 32) | + le32toh(gd->ext2bgd_b_bitmap)); } uint64_t e2fs_gd_get_i_bitmap(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_i_bitmap_hi) << 32) | - gd->ext2bgd_i_bitmap); + return (((uint64_t)(le32toh(gd->ext4bgd_i_bitmap_hi)) << 32) | + le32toh(gd->ext2bgd_i_bitmap)); } uint64_t e2fs_gd_get_i_tables(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_i_tables_hi) << 32) | - gd->ext2bgd_i_tables); + return (((uint64_t)(le32toh(gd->ext4bgd_i_tables_hi)) << 32) | + le32toh(gd->ext2bgd_i_tables)); } static uint32_t e2fs_gd_get_nbfree(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_nbfree_hi) << 16) | - gd->ext2bgd_nbfree); + return (((uint32_t)(le16toh(gd->ext4bgd_nbfree_hi)) << 16) | + le16toh(gd->ext2bgd_nbfree)); } static void e2fs_gd_set_nbfree(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_nbfree = val & 0xffff; - gd->ext4bgd_nbfree_hi = val >> 16; + gd->ext2bgd_nbfree = htole16(val & 0xffff); + gd->ext4bgd_nbfree_hi = htole16(val >> 16); } static uint32_t e2fs_gd_get_nifree(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_nifree_hi) << 16) | - gd->ext2bgd_nifree); + return (((uint32_t)(le16toh(gd->ext4bgd_nifree_hi)) << 16) | + le16toh(gd->ext2bgd_nifree)); } static void e2fs_gd_set_nifree(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_nifree = val & 0xffff; - gd->ext4bgd_nifree_hi = val >> 16; + gd->ext2bgd_nifree = htole16(val & 0xffff); + gd->ext4bgd_nifree_hi = htole16(val >> 16); } uint32_t e2fs_gd_get_ndirs(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_ndirs_hi) << 16) | - gd->ext2bgd_ndirs); + return (((uint32_t)(le16toh(gd->ext4bgd_ndirs_hi)) << 16) | + le16toh(gd->ext2bgd_ndirs)); } static void e2fs_gd_set_ndirs(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_ndirs = val & 0xffff; - gd->ext4bgd_ndirs_hi = val >> 16; + gd->ext2bgd_ndirs = htole16(val & 0xffff); + gd->ext4bgd_ndirs_hi = htole16(val >> 16); } static uint32_t e2fs_gd_get_i_unused(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_i_unused_hi) << 16) | - gd->ext4bgd_i_unused); + return ((uint32_t)(le16toh(gd->ext4bgd_i_unused_hi) << 16) | + le16toh(gd->ext4bgd_i_unused)); } static void e2fs_gd_set_i_unused(struct ext2_gd *gd, uint32_t val) { - gd->ext4bgd_i_unused = val & 0xffff; - gd->ext4bgd_i_unused_hi = val >> 16; + gd->ext4bgd_i_unused = htole16(val & 0xffff); + gd->ext4bgd_i_unused_hi = htole16(val >> 16); } /* @@ -612,7 +612,7 @@ ext2_dirpref(struct inode *pip) mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; - avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; + avgifree = fs->e2fs_ficount / fs->e2fs_gcount; avgbfree = fs->e2fs_fbcount / fs->e2fs_gcount; avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; @@ -653,7 +653,8 @@ ext2_dirpref(struct inode *pip) minbfree = 1; cgsize = fs->e2fs_fsize * fs->e2fs_fpg; dirsize = AVGDIRSIZE; - curdirsize = avgndir ? (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; + curdirsize = avgndir ? + (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; if (dirsize < curdirsize) dirsize = curdirsize; maxcontigdirs = min((avgbfree * fs->e2fs_bsize) / dirsize, 255); @@ -731,7 +732,7 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int ind if (bap) for (tmp = indx - 1; tmp >= 0; tmp--) if (bap[tmp]) - return bap[tmp]; + return (le32toh(bap[tmp])); /* * Else lets fall back to the blocknr or, if there is none, follow @@ -739,7 +740,7 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int ind */ return (blocknr ? blocknr : (e2fs_daddr_t)(ip->i_block_group * - EXT2_BLOCKS_PER_GROUP(fs)) + fs->e2fs->e2fs_first_dblock); + EXT2_BLOCKS_PER_GROUP(fs)) + le32toh(fs->e2fs->e2fs_first_dblock)); } /* @@ -802,7 +803,7 @@ ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg) return (0); if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG)) - return (fs->e2fs->e3fs_first_meta_bg); + return (le32toh(fs->e2fs->e3fs_first_meta_bg)); return ((fs->e2fs_gcount + EXT2_DESCS_PER_BLOCK(fs) - 1) / EXT2_DESCS_PER_BLOCK(fs)); @@ -829,7 +830,7 @@ ext2_cg_number_gdb(struct m_ext2fs *fs, int cg) { unsigned long first_meta_bg, metagroup; - first_meta_bg = fs->e2fs->e3fs_first_meta_bg; + first_meta_bg = le32toh(fs->e2fs->e3fs_first_meta_bg); metagroup = cg / EXT2_DESCS_PER_BLOCK(fs); if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG) || @@ -847,10 +848,11 @@ ext2_number_base_meta_blocks(struct m_ext2fs *fs, int number = ext2_cg_has_sb(fs, cg); if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG) || - cg < fs->e2fs->e3fs_first_meta_bg * EXT2_DESCS_PER_BLOCK(fs)) { + cg < le32toh(fs->e2fs->e3fs_first_meta_bg) * + EXT2_DESCS_PER_BLOCK(fs)) { if (number) { number += ext2_cg_number_gdb(fs, cg); - number += fs->e2fs->e2fs_reserved_ngdb; + number += le16toh(fs->e2fs->e2fs_reserved_ngdb); } } else { number += ext2_cg_number_gdb(fs, cg); @@ -877,7 +879,8 @@ static int ext2_get_group_number(struct m_ext2fs *fs, e4fs_daddr_t block) { - return ((block - fs->e2fs->e2fs_first_dblock) / fs->e2fs_bsize); + return ((block - le32toh(fs->e2fs->e2fs_first_dblock)) / + fs->e2fs_bsize); } static int @@ -893,7 +896,7 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, int bit, bit_max, inodes_per_block; uint64_t start, tmp; - if (!(fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_BLOCK_UNINIT)) + if (!(le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & EXT2_BG_BLOCK_UNINIT)) return (0); memset(bp->b_data, 0, fs->e2fs_bsize); @@ -905,7 +908,8 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, for (bit = 0; bit < bit_max; bit++) setbit(bp->b_data, bit); - start = (uint64_t)cg * fs->e2fs->e2fs_bpg + fs->e2fs->e2fs_first_dblock; + start = (uint64_t)cg * fs->e2fs_bpg + + le32toh(fs->e2fs->e2fs_first_dblock); /* Set bits for block and inode bitmaps, and inode table. */ tmp = e2fs_gd_get_b_bitmap(&fs->e2fs_gd[cg]); @@ -921,7 +925,7 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, tmp = e2fs_gd_get_i_tables(&fs->e2fs_gd[cg]); inodes_per_block = fs->e2fs_bsize/EXT2_INODE_SIZE(fs); while( tmp < e2fs_gd_get_i_tables(&fs->e2fs_gd[cg]) + - fs->e2fs->e2fs_ipg / inodes_per_block ) { + fs->e2fs_ipg / inodes_per_block ) { if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG) || ext2_block_in_group(fs, tmp, cg)) setbit(bp->b_data, tmp - start); @@ -933,11 +937,12 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, * the blocksize * 8 ( which is the size of bitmap ), set rest * of the block bitmap to 1 */ - ext2_mark_bitmap_end(fs->e2fs->e2fs_bpg, fs->e2fs_bsize * 8, + ext2_mark_bitmap_end(fs->e2fs_bpg, fs->e2fs_bsize * 8, bp->b_data); /* Clean the flag */ - fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_BLOCK_UNINIT; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) & ~EXT2_BG_BLOCK_UNINIT); return (0); } @@ -951,8 +956,8 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG)) { /* - * It is not possible to check block bitmap in case of this feature, - * because the inode and block bitmaps and inode table + * It is not possible to check block bitmap in case of this + * feature, because the inode and block bitmaps and inode table * blocks may not be in the group at all. * So, skip check in this case. */ @@ -961,8 +966,8 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf gd = &fs->e2fs_gd[cg]; max_bit = fs->e2fs_fpg; - group_first_block = ((uint64_t)cg) * fs->e2fs->e2fs_fpg + - fs->e2fs->e2fs_first_dblock; + group_first_block = ((uint64_t)cg) * fs->e2fs_fpg + + le32toh(fs->e2fs->e2fs_first_dblock); /* Check block bitmap block number */ offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; @@ -1036,8 +1041,8 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, goto fail; /* - * Check, that another thread did not not allocate the last block in this - * group while we were waiting for the buffer. + * Check, that another thread did not not allocate the last block in + * this group while we were waiting for the buffer. */ if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) goto fail; @@ -1066,7 +1071,7 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, start = dtogd(fs, bpref) / NBBY; else start = 0; - end = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + end = howmany(fs->e2fs_fpg, NBBY) - start; retry: runlen = 0; runstart = 0; @@ -1135,7 +1140,8 @@ gotit: EXT2_UNLOCK(ump); ext2_gd_b_bitmap_csum_set(fs, cg, bp); bdwrite(bp); - return (((uint64_t)cg) * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); + return (((uint64_t)cg) * fs->e2fs_fpg + + le32toh(fs->e2fs->e2fs_first_dblock) + bno); fail: brelse(bp); @@ -1203,7 +1209,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp bpref = dtogd(fs, bpref); loc = bpref / NBBY; bit = 1 << (bpref % NBBY); - for (run = 0, got = bpref; got < fs->e2fs->e2fs_fpg; got++) { + for (run = 0, got = bpref; got < fs->e2fs_fpg; got++) { if ((bbp[loc] & bit) != 0) run = 0; else { @@ -1219,7 +1225,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp } } - if (got >= fs->e2fs->e2fs_fpg) + if (got >= fs->e2fs_fpg) goto fail_lock; /* Allocate the cluster that we found. */ @@ -1228,7 +1234,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp panic("ext2_clusteralloc: map mismatch"); bno = got - run + 1; - if (bno >= fs->e2fs->e2fs_fpg) + if (bno >= fs->e2fs_fpg) panic("ext2_clusteralloc: allocated out of group"); EXT2_LOCK(ump); @@ -1243,7 +1249,8 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp EXT2_UNLOCK(ump); bdwrite(bp); - return (cg * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); + return (cg * fs->e2fs_fpg + le32toh(fs->e2fs->e2fs_first_dblock) + + bno); fail_lock: EXT2_LOCK(ump); @@ -1261,13 +1268,13 @@ ext2_zero_inode_table(struct inode *ip, int cg) fs = ip->i_e2fs; - if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_ZEROED) + if (le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & EXT2_BG_INODE_ZEROED) return (0); - all_blks = fs->e2fs->e2fs_inode_size * fs->e2fs->e2fs_ipg / + all_blks = le16toh(fs->e2fs->e2fs_inode_size) * fs->e2fs_ipg / fs->e2fs_bsize; - used_blks = howmany(fs->e2fs->e2fs_ipg - + used_blks = howmany(fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]), fs->e2fs_bsize / EXT2_INODE_SIZE(fs)); @@ -1282,7 +1289,8 @@ ext2_zero_inode_table(struct inode *ip, int cg) bawrite(bp); } - fs->e2fs_gd[cg].ext4bgd_flags |= EXT2_BG_INODE_ZEROED; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) | EXT2_BG_INODE_ZEROED); return (0); } @@ -1329,12 +1337,15 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr } if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { + if (le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & + EXT2_BG_INODE_UNINIT) { ibytes = fs->e2fs_ipg / 8; memset(bp->b_data, 0, ibytes - 1); ext2_fix_bitmap_tail(bp->b_data, ibytes, fs->e2fs_bsize - 1); - fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) & + ~EXT2_BG_INODE_UNINIT); } ext2_gd_i_bitmap_csum_set(fs, cg, bp); error = ext2_zero_inode_table(ip, cg); @@ -1361,20 +1372,21 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr } ibp = (char *)bp->b_data; if (ipref) { - ipref %= fs->e2fs->e2fs_ipg; + ipref %= fs->e2fs_ipg; if (isclr(ibp, ipref)) goto gotit; } start = ipref / NBBY; - len = howmany(fs->e2fs->e2fs_ipg - ipref, NBBY); + len = howmany(fs->e2fs_ipg - ipref, NBBY); loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { len = start + 1; start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - SDT_PROBE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, - cg, ipref, fs->e2fs_fsmnt); + SDT_PROBE3(ext2fs, , alloc, + ext2_nodealloccg_bmap_corrupted, cg, ipref, + fs->e2fs_fsmnt); brelse(bp); EXT2_LOCK(ump); return (0); @@ -1388,12 +1400,12 @@ gotit: e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) - 1); if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - ifree = fs->e2fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]); + ifree = fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]); if (ipref + 1 > ifree) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], - fs->e2fs->e2fs_ipg - (ipref + 1)); + fs->e2fs_ipg - (ipref + 1)); } - fs->e2fs->e2fs_ficount--; + fs->e2fs_ficount--; fs->e2fs_fmod = 1; if ((mode & IFMT) == IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], @@ -1423,7 +1435,8 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long ump = ip->i_ump; cg = dtog(fs, bno); if (bno >= fs->e2fs_bcount) { - SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, ip->i_number, bno); + SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, + ip->i_number, bno); return; } error = bread(ip->i_devvp, @@ -1479,7 +1492,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) return (0); } ibp = (char *)bp->b_data; - ino = (ino - 1) % fs->e2fs->e2fs_ipg; + ino = (ino - 1) % fs->e2fs_ipg; if (isclr(ibp, ino)) { SDT_PROBE2(ext2fs, , alloc, ext2_vfree_doublefree, fs->e2fs_fsmnt, ino); @@ -1488,7 +1501,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) } clrbit(ibp, ino); EXT2_LOCK(ump); - fs->e2fs->e2fs_ficount++; + fs->e2fs_ficount++; e2fs_gd_set_nifree(&fs->e2fs_gd[cg], e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) + 1); if ((mode & IFMT) == IFDIR) { @@ -1523,15 +1536,15 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t start = dtogd(fs, bpref) / NBBY; else start = 0; - len = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + len = howmany(fs->e2fs_fpg, NBBY) - start; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { len = start + 1; start = 0; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { - panic("ext2_mapsearch: map corrupted: start=%d, len=%d, fs=%s", - start, len, fs->e2fs_fsmnt); + panic("ext2_mapsearch: map corrupted: start=%d, len=%d," + "fs=%s", start, len, fs->e2fs_fsmnt); /* NOTREACHED */ } } @@ -1547,8 +1560,8 @@ ext2_cg_has_sb(struct m_ext2fs *fs, int cg) return (1); if (EXT2_HAS_COMPAT_FEATURE(fs, EXT2F_COMPAT_SPARSESUPER2)) { - if (cg == fs->e2fs->e4fs_backup_bgs[0] || - cg == fs->e2fs->e4fs_backup_bgs[1]) + if (cg == le32toh(fs->e2fs->e4fs_backup_bgs[0]) || + cg == le32toh(fs->e2fs->e4fs_backup_bgs[1])) return (1); return (0); } Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_balloc.c Sun May 17 14:52:54 2020 (r361136) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -220,7 +221,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size return (error); } bap = (e2fs_daddr_t *)bp->b_data; - nb = bap[indirs[i].in_off]; + nb = le32toh(bap[indirs[i].in_off]); if (i == num) break; i += 1; @@ -252,7 +253,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size brelse(bp); return (error); } - bap[indirs[i - 1].in_off] = nb; + bap[indirs[i - 1].in_off] = htole32(nb); /* * If required, write synchronously, otherwise use * delayed write. @@ -284,7 +285,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size nbp->b_blkno = fsbtodb(fs, nb); if (flags & BA_CLRBUF) vfs_bio_clrbuf(nbp); - bap[indirs[i].in_off] = nb; + bap[indirs[i].in_off] = htole32(nb); /* * If required, write synchronously, otherwise use * delayed write. Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:52:54 2020 (r361136) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -108,7 +109,7 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ump = VFSTOEXT2(mp); lbn = bn; ehp = (struct ext4_extent_header *)ip->i_data; - depth = ehp->eh_depth; + depth = le16toh(ehp->eh_depth); bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); *bnp = -1; @@ -125,22 +126,26 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ep = path[depth].ep_ext; if(ep) { - if (lbn < ep->e_blk) { + if (lbn < le32toh(ep->e_blk)) { if (runp != NULL) { - *runp = min(maxrun, ep->e_blk - lbn - 1); + *runp = min(maxrun, le32toh(ep->e_blk) - lbn - 1); } - } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + } else if (le32toh(ep->e_blk) <= lbn && + lbn < le32toh(ep->e_blk) + le16toh(ep->e_len)) { + *bnp = fsbtodb(fs, lbn - le32toh(ep->e_blk) + + (le32toh(ep->e_start_lo) | + (daddr_t)le16toh(ep->e_start_hi) << 32)); if (runp != NULL) { *runp = min(maxrun, - ep->e_len - (lbn - ep->e_blk) - 1); + le16toh(ep->e_len) - + (lbn - le32toh(ep->e_blk)) - 1); } if (runb != NULL) - *runb = min(maxrun, lbn - ep->e_blk); + *runb = min(maxrun, lbn - le32toh(ep->e_blk)); } else { if (runb != NULL) - *runb = min(maxrun, ep->e_blk + lbn - ep->e_len); + *runb = min(maxrun, le32toh(ep->e_blk) + lbn - + le16toh(ep->e_len)); } } @@ -283,7 +288,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t * if (error != 0) return (error); - daddr = ((e2fs_daddr_t *)bp->b_data)[ap->in_off]; + daddr = le32toh(((e2fs_daddr_t *)bp->b_data)[ap->in_off]); if (num == 1 && daddr && runp) { for (bn = ap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && @@ -395,7 +400,7 @@ ext2_bmap_seekdata(struct vnode *vp, off_t *offp) */ off = ap->in_off; do { - daddr = ((e2fs_daddr_t *)bp->b_data)[off]; + daddr = le32toh(((e2fs_daddr_t *)bp->b_data)[off]); } while (daddr == 0 && ++off < MNINDIR(ump)); nextbn += off * lbn_count(ump, num - 1); Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_csum.c Sun May 17 14:52:54 2020 (r361136) @@ -77,7 +77,7 @@ ext2_sb_csum_set_seed(struct m_ext2fs *fs) { if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_CSUM_SEED)) - fs->e2fs_csum_seed = fs->e2fs->e4fs_chksum_seed; + fs->e2fs_csum_seed = le32toh(fs->e2fs->e4fs_chksum_seed); else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { fs->e2fs_csum_seed = calculate_crc32c(~0, fs->e2fs->e2fs_uuid, sizeof(fs->e2fs->e2fs_uuid)); @@ -95,13 +95,14 @@ ext2_sb_csum_verify(struct m_ext2fs *fs) "WARNING: mount of %s denied due bad sb csum type\n", fs->e2fs_fsmnt); return (EINVAL); } - if (fs->e2fs->e4fs_sbchksum != + if (le32toh(fs->e2fs->e4fs_sbchksum) != calculate_crc32c(~0, (const char *)fs->e2fs, offsetof(struct ext2fs, e4fs_sbchksum))) { printf( "WARNING: mount of %s denied due bad sb csum=0x%x, expected=0x%x - run fsck\n", - fs->e2fs_fsmnt, fs->e2fs->e4fs_sbchksum, calculate_crc32c(~0, - (const char *)fs->e2fs, offsetof(struct ext2fs, e4fs_sbchksum))); + fs->e2fs_fsmnt, le32toh(fs->e2fs->e4fs_sbchksum), + calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum))); return (EINVAL); } @@ -112,8 +113,9 @@ void ext2_sb_csum_set(struct m_ext2fs *fs) { - fs->e2fs->e4fs_sbchksum = calculate_crc32c(~0, (const char *)fs->e2fs, - offsetof(struct ext2fs, e4fs_sbchksum)); + fs->e2fs->e4fs_sbchksum = + htole32(calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum))); } static uint32_t @@ -121,18 +123,22 @@ ext2_extattr_blk_csum(struct inode *ip, uint64_t facl, struct ext2fs_extattr_header *header) { struct m_ext2fs *fs; - uint32_t crc, old_crc; + uint32_t crc, dummy_crc = 0; + uint64_t facl_bn = htole64(facl); + int offset = offsetof(struct ext2fs_extattr_header, h_checksum); fs = ip->i_e2fs; - old_crc = header->h_checksum; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl_bn, + sizeof(facl_bn)); + crc = calculate_crc32c(crc, (uint8_t *)header, offset); + crc = calculate_crc32c(crc, (uint8_t *)&dummy_crc, + sizeof(dummy_crc)); + offset += sizeof(dummy_crc); + crc = calculate_crc32c(crc, (uint8_t *)header + offset, + fs->e2fs_bsize - offset); - header->h_checksum = 0; - crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl, sizeof(facl)); - crc = calculate_crc32c(crc, (uint8_t *)header, fs->e2fs_bsize); - header->h_checksum = old_crc; - - return (crc); + return (htole32(crc)); } int @@ -167,7 +173,7 @@ void ext2_init_dirent_tail(struct ext2fs_direct_tail *tp) { memset(tp, 0, sizeof(struct ext2fs_direct_tail)); - tp->e2dt_rec_len = sizeof(struct ext2fs_direct_tail); + tp->e2dt_rec_len = le16toh(sizeof(struct ext2fs_direct_tail)); tp->e2dt_reserved_ft = EXT2_FT_DIR_CSUM; } @@ -184,7 +190,7 @@ ext2_is_dirent_tail(struct inode *ip, struct ext2fs_di tp = (struct ext2fs_direct_tail *)ep; if (tp->e2dt_reserved_zero1 == 0 && - tp->e2dt_rec_len == sizeof(struct ext2fs_direct_tail) && + le16toh(tp->e2dt_rec_len) == sizeof(struct ext2fs_direct_tail) && tp->e2dt_reserved_zero2 == 0 && tp->e2dt_reserved_ft == EXT2_FT_DIR_CSUM) return (1); @@ -201,13 +207,13 @@ ext2_dirent_get_tail(struct inode *ip, struct ext2fs_d dep = ep; top = EXT2_DIRENT_TAIL(ep, ip->i_e2fs->e2fs_bsize); - rec_len = dep->e2d_reclen; + rec_len = le16toh(dep->e2d_reclen); while (rec_len && !(rec_len & 0x3)) { dep = (struct ext2fs_direct_2 *)(((char *)dep) + rec_len); if ((void *)dep >= top) break; - rec_len = dep->e2d_reclen; + rec_len = le16toh(dep->e2d_reclen); } if (dep != top) @@ -230,8 +236,8 @@ ext2_dirent_csum(struct inode *ip, struct ext2fs_direc buf = (char *)ep; - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)buf, size); @@ -250,7 +256,7 @@ ext2_dirent_csum_verify(struct inode *ip, struct ext2f return (0); calculated = ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); - if (calculated != tp->e2dt_checksum) + if (calculated != le32toh(tp->e2dt_checksum)) return (EIO); return (0); @@ -263,11 +269,11 @@ ext2_get_dx_count(struct inode *ip, struct ext2fs_dire struct ext2fs_htree_root_info *root; int count_offset; - if (ep->e2d_reclen == EXT2_BLOCK_SIZE(ip->i_e2fs)) + if (le16toh(ep->e2d_reclen) == EXT2_BLOCK_SIZE(ip->i_e2fs)) count_offset = 8; - else if (ep->e2d_reclen == 12) { + else if (le16toh(ep->e2d_reclen) == 12) { dp = (struct ext2fs_direct_2 *)(((char *)ep) + 12); - if (dp->e2d_reclen != EXT2_BLOCK_SIZE(ip->i_e2fs) - 12) + if (le16toh(dp->e2d_reclen) != EXT2_BLOCK_SIZE(ip->i_e2fs) - 12) return (NULL); root = (struct ext2fs_htree_root_info *)(((char *)dp + 12)); @@ -302,15 +308,15 @@ ext2_dx_csum(struct inode *ip, struct ext2fs_direct_2 old_csum = tp->ht_checksum; tp->ht_checksum = 0; - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)buf, size); crc = calculate_crc32c(crc, (uint8_t *)tp, sizeof(struct ext2fs_htree_tail)); tp->ht_checksum = old_csum; - return (crc); + return htole32(crc); } int @@ -325,8 +331,8 @@ ext2_dx_csum_verify(struct inode *ip, struct ext2fs_di if (cp == NULL) return (0); - limit = cp->h_entries_max; - count = cp->h_entries_num; + limit = le16toh(cp->h_entries_max); + count = le16toh(cp->h_entries_num); if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) return (EIO); @@ -381,7 +387,7 @@ ext2_dirent_csum_set(struct inode *ip, struct ext2fs_d return; tp->e2dt_checksum = - ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); + htole32(ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep)); } void @@ -401,8 +407,8 @@ ext2_dx_csum_set(struct inode *ip, struct ext2fs_direc if (cp == NULL) return; - limit = cp->h_entries_max; - count = cp->h_entries_num; + limit = le16toh(cp->h_entries_max); + count = le16toh(cp->h_entries_num); if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) return; @@ -423,8 +429,8 @@ ext2_extent_blk_csum(struct inode *ip, struct ext4_ext size = EXT4_EXTENT_TAIL_OFFSET(ehp) + offsetof(struct ext4_extent_tail, et_checksum); - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)ehp, size); @@ -449,7 +455,7 @@ ext2_extent_blk_csum_verify(struct inode *ip, void *da etp = (struct ext4_extent_tail *)(((char *)ehp) + EXT4_EXTENT_TAIL_OFFSET(ehp)); - provided = etp->et_checksum; + provided = le32toh(etp->et_checksum); calculated = ext2_extent_blk_csum(ip, ehp); if (provided != calculated) { @@ -476,8 +482,8 @@ ext2_extent_blk_csum_set(struct inode *ip, void *data) etp = (struct ext4_extent_tail *)(((char *)data) + EXT4_EXTENT_TAIL_OFFSET(ehp)); - etp->et_checksum = ext2_extent_blk_csum(ip, - (struct ext4_extent_header *)data); + etp->et_checksum = htole32(ext2_extent_blk_csum(ip, + (struct ext4_extent_header *)data)); } int @@ -488,11 +494,12 @@ ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) return (0); - provided = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum; + provided = le16toh(fs->e2fs_gd[cg].ext4bgd_i_bmap_csum); calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, - fs->e2fs->e2fs_ipg / 8); - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) { - hi = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi; + fs->e2fs_ipg / 8); + if (le16toh(fs->e2fs->e3fs_desc_size) >= + EXT2_BG_INODE_BITMAP_CSUM_HI_END) { + hi = le16toh(fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi); provided |= (hi << 16); } else calculated &= 0xFFFF; @@ -514,10 +521,10 @@ ext2_gd_i_bitmap_csum_set(struct m_ext2fs *fs, int cg, return; csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, - fs->e2fs->e2fs_ipg / 8); - fs->e2fs_gd[cg].ext4bgd_i_bmap_csum = csum & 0xFFFF; - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) - fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi = csum >> 16; + fs->e2fs_ipg / 8); + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum = htole16(csum & 0xFFFF); + if (le16toh(fs->e2fs->e3fs_desc_size) >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi = htole16(csum >> 16); } int @@ -529,10 +536,11 @@ ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int return (0); size = fs->e2fs_fpg / 8; - provided = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum; + provided = le16toh(fs->e2fs_gd[cg].ext4bgd_b_bmap_csum); calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) { - hi = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi; + if (le16toh(fs->e2fs->e3fs_desc_size) >= + EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) { + hi = le16toh(fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi); provided |= (hi << 16); } else calculated &= 0xFFFF; @@ -555,9 +563,9 @@ ext2_gd_b_bitmap_csum_set(struct m_ext2fs *fs, int cg, size = fs->e2fs_fpg / 8; csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); - fs->e2fs_gd[cg].ext4bgd_b_bmap_csum = csum & 0xFFFF; - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) - fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi = csum >> 16; + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum = htole16(csum & 0xFFFF); + if (le16toh(fs->e2fs->e3fs_desc_size) >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi = htole16(csum >> 16); } static uint32_t @@ -571,10 +579,10 @@ ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *e fs = ip->i_e2fs; offset = offsetof(struct ext2fs_dinode, e2di_chksum_lo); csum_size = sizeof(dummy_csum); - inum = ip->i_number; + inum = htole32(ip->i_number); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); - gen = ip->i_gen; + gen = htole32(ip->i_gen); inode_csum_seed = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); @@ -590,7 +598,8 @@ ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *e E2FS_REV0_INODE_SIZE, offset - E2FS_REV0_INODE_SIZE); if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + le16toh(ei->e2di_extra_isize) >= + EXT2_INODE_CSUM_HI_EXTRA_END)) { crc = calculate_crc32c(crc, (uint8_t *)&dummy_csum, csum_size); offset += csum_size; @@ -615,12 +624,12 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) return (0); - provided = ei->e2di_chksum_lo; + provided = le16toh(ei->e2di_chksum_lo); calculated = ext2_ei_csum(ip, ei); if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { - hi = ei->e2di_chksum_hi; + le16toh(ei->e2di_extra_isize) >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + hi = le16toh(ei->e2di_chksum_hi); provided |= hi << 16; } else calculated &= 0xFFFF; @@ -655,10 +664,10 @@ ext2_ei_csum_set(struct inode *ip, struct ext2fs_dinod crc = ext2_ei_csum(ip, ei); - ei->e2di_chksum_lo = crc & 0xFFFF; + ei->e2di_chksum_lo = htole16(crc & 0xFFFF); if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) - ei->e2di_chksum_hi = crc >> 16; + le16toh(ei->e2di_extra_isize) >= EXT2_INODE_CSUM_HI_EXTRA_END)) + ei->e2di_chksum_hi = htole16(crc >> 16); } static uint16_t @@ -716,6 +725,8 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group offset = offsetof(struct ext2_gd, ext4bgd_csum); + block_group = htole32(block_group); + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { csum32 = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&block_group, sizeof(block_group)); @@ -724,12 +735,12 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group csum32 = calculate_crc32c(csum32, (uint8_t *)&dummy_csum, sizeof(dummy_csum)); offset += sizeof(dummy_csum); - if (offset < fs->e2fs->e3fs_desc_size) + if (offset < le16toh(fs->e2fs->e3fs_desc_size)) csum32 = calculate_crc32c(csum32, (uint8_t *)gd + offset, - fs->e2fs->e3fs_desc_size - offset); + le16toh(fs->e2fs->e3fs_desc_size) - offset); crc = csum32 & 0xFFFF; - return (crc); + return (htole16(crc)); } else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { crc = ext2_crc16(~0, fs->e2fs->e2fs_uuid, sizeof(fs->e2fs->e2fs_uuid)); @@ -738,10 +749,10 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group crc = ext2_crc16(crc, (uint8_t *)gd, offset); offset += sizeof(gd->ext4bgd_csum); /* skip checksum */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && - offset < fs->e2fs->e3fs_desc_size) + offset < le16toh(fs->e2fs->e3fs_desc_size)) crc = ext2_crc16(crc, (uint8_t *)gd + offset, - fs->e2fs->e3fs_desc_size - offset); - return (crc); + le16toh(fs->e2fs->e3fs_desc_size) - offset); + return (htole16(crc)); } return (0); @@ -774,6 +785,5 @@ ext2_gd_csum_set(struct m_ext2fs *fs) unsigned int i; for (i = 0; i < fs->e2fs_gcount; i++) - fs->e2fs_gd[i].ext4bgd_csum = - ext2_gd_csum(fs, i, &fs->e2fs_gd[i]); + fs->e2fs_gd[i].ext4bgd_csum = ext2_gd_csum(fs, i, &fs->e2fs_gd[i]); } Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_extattr.c Sun May 17 14:52:54 2020 (r361136) @@ -216,9 +216,9 @@ ext2_extattr_inode_list(struct inode *ip, int attrname /* Check attributes magic value */ header = (struct ext2fs_extattr_dinode_header *)((char *)dinode + - E2FS_REV0_INODE_SIZE + dinode->e2di_extra_isize); + E2FS_REV0_INODE_SIZE + le16toh(dinode->e2di_extra_isize)); - if (header->h_magic != EXTATTR_MAGIC) { + if (le32toh(header->h_magic) != EXTATTR_MAGIC) { brelse(bp); return (0); } @@ -285,7 +285,8 @@ ext2_extattr_block_list(struct inode *ip, int attrname /* Check attributes magic value */ header = EXT2_HDR(bp); - if (header->h_magic != EXTATTR_MAGIC || header->h_blocks != 1) { + if (le32toh(header->h_magic) != EXTATTR_MAGIC || + le32toh(header->h_blocks) != 1) { brelse(bp); return (EINVAL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun May 17 15:32:36 2020 Return-Path: Delivered-To: svn-src-head@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 9024A2DC892; Sun, 17 May 2020 15:32:36 +0000 (UTC) (envelope-from melifaro@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q5kD3N2cz4TWm; Sun, 17 May 2020 15:32:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F0CA12B63; Sun, 17 May 2020 15:32:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HFWaVw089589; Sun, 17 May 2020 15:32:36 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HFWaDY089588; Sun, 17 May 2020 15:32:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005171532.04HFWaDY089588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 17 May 2020 15:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361137 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 15:32:36 -0000 Author: melifaro Date: Sun May 17 15:32:36 2020 New Revision: 361137 URL: https://svnweb.freebsd.org/changeset/base/361137 Log: Remove redundant checks for nhop validity. Currently NH_IS_VALID() simly aliases to RT_LINK_IS_UP(), so we're checking the same thing twice. In the near future the implementation of this check will be simpler, as there are plans to introduce control-plane interface status monitoring similar to ipfw interface tracker. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun May 17 14:52:54 2020 (r361136) +++ head/sys/netinet/ip_output.c Sun May 17 15:32:36 2020 (r361137) @@ -407,8 +407,7 @@ again: * Also check whether routing cache needs invalidation. */ if (ro != NULL && ro->ro_nh != NULL && - ((!NH_IS_VALID(ro->ro_nh)) || !RT_LINK_IS_UP(ro->ro_nh->nh_ifp) || - dst->sin_family != AF_INET || + ((!NH_IS_VALID(ro->ro_nh)) || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) RO_INVALIDATE_CACHE(ro); ia = NULL; @@ -480,8 +479,7 @@ again: ro->ro_nh = fib4_lookup(fibnum, dst->sin_addr, 0, NHR_REF, flowid); - if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh)) || - !RT_LINK_IS_UP(ro->ro_nh->nh_ifp)) { + if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh))) { #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * There is no route for this packet, but it is From owner-svn-src-head@freebsd.org Sun May 17 20:09:11 2020 Return-Path: Delivered-To: svn-src-head@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 B9AD12F2ADE; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCsM493Vz4qTS; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85C6915DA9; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HK9BZA064777; Sun, 17 May 2020 20:09:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HK9B68064776; Sun, 17 May 2020 20:09:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172009.04HK9B68064776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361138 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 20:09:11 -0000 Author: manu Date: Sun May 17 20:09:11 2020 New Revision: 361138 URL: https://svnweb.freebsd.org/changeset/base/361138 Log: linuxkpi: Add atomic_dec_and_mutex_lock This function decrement the counter and if the result is 0 it acquires the mutex and returns 1, if not it simply returns 0. Needed by DRM from Linux v5.3 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24847 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 15:32:36 2020 (r361137) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:09:11 2020 (r361138) @@ -37,6 +37,7 @@ #include #include +#include typedef struct mutex { struct sx sx; @@ -123,6 +124,16 @@ static inline bool mutex_is_owned(mutex_t *m) { return (sx_xlocked(&m->sx)); +} + +static inline int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *m) +{ + if (atomic_dec_and_test(cnt)) { + mutex_lock(m); + return (1); + } + + return (0); } #ifdef WITNESS_ALL From owner-svn-src-head@freebsd.org Sun May 17 20:12:17 2020 Return-Path: Delivered-To: svn-src-head@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 037C72F2B5F; Sun, 17 May 2020 20:12:17 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCww6LcMz4qfg; Sun, 17 May 2020 20:12:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D542715BCC; Sun, 17 May 2020 20:12:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HKCGUp070412; Sun, 17 May 2020 20:12:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HKCGax070411; Sun, 17 May 2020 20:12:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172012.04HKCGax070411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361139 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 20:12:17 -0000 Author: manu Date: Sun May 17 20:12:16 2020 New Revision: 361139 URL: https://svnweb.freebsd.org/changeset/base/361139 Log: linuxkpi: Add __mutex_init Same as mutex_init, the lock_class_key argument seems to be only used for debug in Linux, simply ignore it for now. Needed by DRM in Linux v5.3 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24848 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:09:11 2020 (r361138) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:12:16 2020 (r361139) @@ -108,6 +108,9 @@ mutex_trylock_recursive(struct mutex *lock) #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) +#define __mutex_init(_m, _n, _l) \ + linux_mutex_init(_m, _n, SX_NOWITNESS) + #define mutex_init_witness(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_DUPOK) From owner-svn-src-head@freebsd.org Sun May 17 20:14:50 2020 Return-Path: Delivered-To: svn-src-head@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 4CBFD2F2C5C; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCzt1Fb6z4r2F; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 260B715F34; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HKEoe0070579; Sun, 17 May 2020 20:14:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HKEnSc070578; Sun, 17 May 2020 20:14:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172014.04HKEnSc070578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361140 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 20:14:50 -0000 Author: manu Date: Sun May 17 20:14:49 2020 New Revision: 361140 URL: https://svnweb.freebsd.org/changeset/base/361140 Log: linuxkpi: Add offsetofend macro This calculate the offset of the end of the member in the given struct. Needed by DRM in Linux v5.3 Sponsored-by: The FreeBSD Foudation Differential Revision: https://reviews.freebsd.org/D24849 Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun May 17 20:12:16 2020 (r361139) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun May 17 20:14:49 2020 (r361140) @@ -462,6 +462,9 @@ kstrtobool_from_user(const char __user *s, size_t coun type __max2 = (y); \ __max1 > __max2 ? __max1 : __max2; }) +#define offsetofend(t, m) \ + (offsetof(t, m) + sizeof((((t *)0)->m))) + #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) #define clamp(x, lo, hi) min( max(x,lo), hi) #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) From owner-svn-src-head@freebsd.org Sun May 17 21:55:00 2020 Return-Path: Delivered-To: svn-src-head@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 8D4B22F7452; Sun, 17 May 2020 21:55:00 +0000 (UTC) (envelope-from cperciva@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QGCS1wJpz3Y1m; Sun, 17 May 2020 21:55:00 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D26A17338; Sun, 17 May 2020 21:55:00 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HLt0T9036231; Sun, 17 May 2020 21:55:00 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HLt07J036230; Sun, 17 May 2020 21:55:00 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005172155.04HLt07J036230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 17 May 2020 21:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361143 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 361143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 21:55:00 -0000 Author: cperciva Date: Sun May 17 21:54:59 2020 New Revision: 361143 URL: https://svnweb.freebsd.org/changeset/base/361143 Log: Add /etc/autofs/special_efs to EC2 AMIs Since Amazon Elastic File System is only available within AWS, it seems more appropriate to have this added only in EC2 AMIs rather than "polluting" non-EC2 images with it. Reviewed by: gjb MFC after: 7 days Relnotes: Amazon EFS filesystems can be automounted by enabling autofs and placing "/efs -efs" into /etc/auto_master. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D24791 Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Sun May 17 21:29:45 2020 (r361142) +++ head/release/tools/ec2.conf Sun May 17 21:54:59 2020 (r361143) @@ -113,6 +113,23 @@ vm_extra_pre_umount() { -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ ${DESTDIR}/etc/ntp.conf + # Provide a map for accessing Elastic File System mounts + cat > ${DESTDIR}/etc/autofs/special_efs <<'EOF' +#!/bin/sh + +if [ $# -eq 0 ]; then + # No way to know which EFS filesystems exist and are + # accessible to this EC2 instance. + exit 0 +fi + +# Provide instructions on how to mount the requested filesystem. +FS=$1 +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` +echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws.com:/" +EOF + chmod 755 ${DESTDIR}/etc/autofs/special_efs + # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) From owner-svn-src-head@freebsd.org Sun May 17 22:31:40 2020 Return-Path: Delivered-To: svn-src-head@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 2E5812F7EEE; Sun, 17 May 2020 22:31:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QH1m0WK2z3Ywm; Sun, 17 May 2020 22:31:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CE6E17B8C; Sun, 17 May 2020 22:31:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HMVdkm059071; Sun, 17 May 2020 22:31:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HMVdMU059067; Sun, 17 May 2020 22:31:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005172231.04HMVdMU059067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 May 2020 22:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361145 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 22:31:40 -0000 Author: tuexen Date: Sun May 17 22:31:38 2020 New Revision: 361145 URL: https://svnweb.freebsd.org/changeset/base/361145 Log: Non-functional changes, cleanups. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_asconf.c Sun May 17 22:31:38 2020 (r361145) @@ -2212,7 +2212,6 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru struct sctp_nets *net; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - /* delete this address if cached */ if (net->ro._s_addr == ifa) { sctp_free_ifa(net->ro._s_addr); Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_os_bsd.h Sun May 17 22:31:38 2020 (r361145) @@ -309,8 +309,6 @@ typedef struct callout sctp_os_timer_t; #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu #define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, nh) ((uint32_t)((nh != NULL) ? nh->nh_mtu : 0)) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) -/* XXX: Setting MTU from the protocol in this way is simply incorrect */ -#define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) /* (de-)register interface event notifications */ #define SCTP_REGISTER_INTERFACE(ifhandle, af) Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_output.c Sun May 17 22:31:38 2020 (r361145) @@ -6202,10 +6202,10 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { /* * Lower numbers equates to higher - * priority so if the one we are - * looking at has a larger - * priority we want to drop the data - * and NOT retransmit it. + * priority. So if the one we are + * looking at has a larger priority, + * we want to drop the data and NOT + * retransmit it. */ if (chk->data) { /* Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_pcb.c Sun May 17 22:31:38 2020 (r361145) @@ -5451,8 +5451,6 @@ sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->ro._s_addr == laddr->ifa) { /* Yep, purge src address selected */ - - /* delete this address if cached */ RO_NHFREE(&net->ro); sctp_free_ifa(net->ro._s_addr); net->ro._s_addr = NULL; From owner-svn-src-head@freebsd.org Sun May 17 23:48:53 2020 Return-Path: Delivered-To: svn-src-head@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 AAFA02F93A4; Sun, 17 May 2020 23:48:53 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QJkr5Ppyz3cw9; Sun, 17 May 2020 23:48:52 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-yb1-xb33.google.com with SMTP id g79so739348ybf.0; Sun, 17 May 2020 16:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lmwHmp4A8ZA/WR7e3VkwCHvsJk3lf3dh3G57oD/mRf8=; b=lPQpIlb85LLEQxOw8nxPrPdIWufFDQ+JIwjQdAso8/KdJdK7MdqCWXqrlZ090ucHs6 jziJW/K8yCUYLikQjD2mr7s44IxLa7Kh4s7gxjzL+EzJSmXNmb2OyAPTzBZeQopGAxrA N8wNxT8QRfoNQ5Bci7mNS5alSL7mAqcuNw273B9O80keJ0Oq5KxF0oo4tQbKzxiI2s6i 0kbld172RDcvvaQxWAJdlPmNiMVazXP9o8C/Ow1Xg/fbYXomcBNE32RK9dtZ+oR6cNjD ShDys3CZ+22RaiVcBtE+vElPVH/JUGLEHysIxwluL9/s0WYBdJn4wQtJZT0S2IssX0D2 uUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lmwHmp4A8ZA/WR7e3VkwCHvsJk3lf3dh3G57oD/mRf8=; b=HHEARf21CYGWjLuDX+vY1BL3L4BmrX9+UiE1kMU7zJ9nt04wFrHqFZ2E9wUAfPcBz8 B+TowAVQJlB9Vt5uEtq5ojDJHI9KMJ/TFJTaZJljmw5w6nBc5BYNo7QHqn1bUjT8Yzm7 nUy53ohzYofW5x2eF/qNkdtooNTWvAVk8xNYJxN+nR+RYb7ibDV1FuLEoQLNV/cCpsPl 9U3dTy+6gdnDUNSzTciI49/iRGzyU237L1EsDzfQhOQ32CKQxboUyDKisNuBuSGN0+8i +g6vSQ6kbtoMJHgP6y/tZC6uWpp+gITSXbi1hEro9TtzlKX7m417zdpGnVh0wtkDjjYK sl5A== X-Gm-Message-State: AOAM532Y5NlXSocp4EIJ2FR57BCDDYuk9QpFNej8+Z4ZWgoH5NVnRwPK tieM0Ogp0lZC9s9HPp9upAYtE2T8PM1Oq0O7qMF2nw== X-Google-Smtp-Source: ABdhPJwkh3kGaglGyXwt6DHJMDGFvrh+KGaHhZrO/w1NSjNmv0KU+eiBb/ranJNSFA84n8z1t2cGXYgIatGCeNtTstc= X-Received: by 2002:a5b:c41:: with SMTP id d1mr3489569ybr.67.1589759331112; Sun, 17 May 2020 16:48:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:2bc5:0:0:0:0:0 with HTTP; Sun, 17 May 2020 16:48:50 -0700 (PDT) In-Reply-To: <202005172155.04HLt07J036230@repo.freebsd.org> References: <202005172155.04HLt07J036230@repo.freebsd.org> From: Oliver Pinter Date: Mon, 18 May 2020 01:48:50 +0200 Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Colin Percival Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 49QJkr5Ppyz3cw9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 23:48:53 -0000 On Sunday, May 17, 2020, Colin Percival wrote: > Author: cperciva > Date: Sun May 17 21:54:59 2020 > New Revision: 361143 > URL: https://svnweb.freebsd.org/changeset/base/361143 > > Log: > Add /etc/autofs/special_efs to EC2 AMIs > > Since Amazon Elastic File System is only available within AWS, it seems > more appropriate to have this added only in EC2 AMIs rather than > "polluting" non-EC2 images with it. > > Reviewed by: gjb > MFC after: 7 days > Relnotes: Amazon EFS filesystems can be automounted by enabling > autofs > and placing "/efs -efs" into /etc/auto_master. > Sponsored by: https://www.patreon.com/cperciva > Differential Revision: https://reviews.freebsd.org/D24791 > > Modified: > head/release/tools/ec2.conf > > Modified: head/release/tools/ec2.conf > ============================================================ > ================== > --- head/release/tools/ec2.conf Sun May 17 21:29:45 2020 (r361142) > +++ head/release/tools/ec2.conf Sun May 17 21:54:59 2020 (r361143) > @@ -113,6 +113,23 @@ vm_extra_pre_umount() { > -e '1,/^#server/s/^#server.*/server 169.254.169.123 > iburst/' \ > ${DESTDIR}/etc/ntp.conf > > + # Provide a map for accessing Elastic File System mounts > + cat > ${DESTDIR}/etc/autofs/special_efs <<'EOF' > +#!/bin/sh > + > +if [ $# -eq 0 ]; then > + # No way to know which EFS filesystems exist and are > + # accessible to this EC2 instance. > + exit 0 > +fi > + > +# Provide instructions on how to mount the requested filesystem. > +FS=$1 > +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/ > availability-zone | sed -e 's/[a-z]$//'` What will be this hard-coded ip address without any verification or at least https? > +echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws. > com:/" > +EOF > + chmod 755 ${DESTDIR}/etc/autofs/special_efs > + > # The first time the AMI boots, the installed "first boot" scripts > # should be allowed to run: > # * ec2_configinit (download and process EC2 user-data) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Mon May 18 00:07:46 2020 Return-Path: Delivered-To: svn-src-head@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 BB59F2F994A; Mon, 18 May 2020 00:07:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QK8f4XSQz3djN; Mon, 18 May 2020 00:07:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9288B1885C; Mon, 18 May 2020 00:07:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I07k8B015937; Mon, 18 May 2020 00:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I07kUq015935; Mon, 18 May 2020 00:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202005180007.04I07kUq015935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 18 May 2020 00:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361146 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 361146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 00:07:46 -0000 Author: rmacklem Date: Mon May 18 00:07:45 2020 New Revision: 361146 URL: https://svnweb.freebsd.org/changeset/base/361146 Log: Add a function nfsm_set() to initialize "struct nfsrv_descript" for building mbuf lists. This function is currently trivial, but will that will change when support for building NFS messages in ext_pgs mbufs is added. Adding support for ext_pgs mbufs is needed for KERN_TLS, which will be used to implement nfs-over-tls. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfs/nfs_commonsubs.c Mon May 18 00:07:45 2020 (r361146) @@ -4778,3 +4778,14 @@ nfsv4_findmirror(struct nfsmount *nmp) return (ds); } +/* + * Fill in the fields of "struct nfsrv_descript". + */ +void +nfsm_set(struct nfsrv_descript *nd, u_int offs) +{ + struct mbuf *m; + + m = nd->nd_mb; + nd->nd_bpos = mtod(m, char *) + offs; +} Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfs/nfs_var.h Mon May 18 00:07:45 2020 (r361146) @@ -360,6 +360,7 @@ int nfsv4_sequencelookup(struct nfsmount *, struct nfs void nfsv4_freeslot(struct nfsclsession *, int); struct ucred *nfsrv_getgrpscred(struct ucred *); struct nfsdevice *nfsv4_findmirror(struct nfsmount *); +void nfsm_set(struct nfsrv_descript *, u_int); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon May 18 00:07:45 2020 (r361146) @@ -5080,7 +5080,7 @@ nfsrv_writedsdorpc(struct nfsmount *nmp, fhandle_t *fh while (m->m_next != NULL) m = m->m_next; nd->nd_mb = m; - nd->nd_bpos = mtod(m, char *) + m->m_len; + nfsm_set(nd, m->m_len); NFSD_DEBUG(4, "nfsrv_writedsdorpc: lastmb len=%d\n", m->m_len); /* Do a Getattr for the attributes that change upon writing. */ From owner-svn-src-head@freebsd.org Mon May 18 00:24:17 2020 Return-Path: Delivered-To: svn-src-head@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 E22F62FA0B1; Mon, 18 May 2020 00:24:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QKWh5qYsz3fnQ; Mon, 18 May 2020 00:24:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id o7so7646143oif.2; Sun, 17 May 2020 17:24:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=+LNLKa6awuzOj8F62GRTQxBYONBWWPaypxGzpVTwFNU=; b=czk9O6GRCg+hMdZaY9Pk/5lafzCkK9vODvWMoOcva6qCL8POUso4xmUhW4J87umQ4E 95sOGD+ssdArmOH3YKR0OIeqloIt0/Oq9MypNS1Z0RTwB48VmXYJNbxziqnslL8ZjYgn fuO2IY50Hou2ZfXeC3o6jEzFghf0wLx9528P2Mr9nU/ktZUDHyxH5QNJpB4xIVLpcbew XC0FICfavxisc8YU9qli2r++RVmp9b7X1ZnCJBBoatADZkLV0h5RlS/x+24tcR1XhjkQ xJLYQxEUgiYbLRZwX+uVfEeGxBQYgRbTrvazbDtfR9YDf1utjHBbQc3RPBYtC0ut6f8a TWww== X-Gm-Message-State: AOAM533MUdsaAIjvm5wUDZyi+NKAkx497YTpfpLoTJy4crcCfHyCJhMf wXJ1qTHpLbhYQhTMoaT17FH9Rp6G X-Google-Smtp-Source: ABdhPJwj1IREyc893Jr1eFppPTMsqj1K4CQr3n8TmCH5OPLsu9ZTopipOW3mrXekzMTIDIoQiSaDCA== X-Received: by 2002:a54:4004:: with SMTP id x4mr8914229oie.76.1589761455415; Sun, 17 May 2020 17:24:15 -0700 (PDT) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com. [209.85.167.182]) by smtp.gmail.com with ESMTPSA id q19sm2641526ooh.11.2020.05.17.17.24.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 May 2020 17:24:15 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id l6so1746131oic.9; Sun, 17 May 2020 17:24:15 -0700 (PDT) X-Received: by 2002:aca:eb96:: with SMTP id j144mr8670649oih.48.1589761454982; Sun, 17 May 2020 17:24:14 -0700 (PDT) MIME-Version: 1.0 References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 17 May 2020 17:24:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49QKWh5qYsz3fnQ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.171 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-0.06 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.06)[-0.061]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.171:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.171:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 00:24:17 -0000 On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > On Sunday, May 17, 2020, Colin Percival wrote: >> +# Provide instructions on how to mount the requested filesystem. >> +FS=$1 >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > What will be this hard-coded ip address without any verification or at least https? It's a special non-routable IP that is used in at least AWS and Azure to provide some VM services. Traffic to and from it never leaves the virtual overlay network, which by design VM instances already trust to provide privacy. It doesn't require functioning DNS to access the raw IP. Conrad From owner-svn-src-head@freebsd.org Mon May 18 00:38:08 2020 Return-Path: Delivered-To: svn-src-head@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 E30D82FA374; Mon, 18 May 2020 00:38:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QKqh2m7Nz3gvZ; Mon, 18 May 2020 00:38:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f181.google.com with SMTP id l20so8194715ilj.10; Sun, 17 May 2020 17:38:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3qQxVR2o1Zk0Au+G0RAgJCeMA3s4uMmFD8IPZtkVUuc=; b=qx97/0MYBRSEiXaoh8CDUttvBqvhD3aRe3JVw+V7squmf3+vhL1N+EKgMbuBbQP3zl tVSMDPAyvz4Ch2CCbZKBgzxKTyUqDoNyqsJoTi+igQSnY2NEDWocFWLEF7dMjGsYQkGT gIFflMRXhhNifC7a0k2kYEkwr45PpPVKfJZFHdq9DGQP1Era09DhpHN6WeZGnSRCW6a1 1jCSkbKJN+IAMmhyBhDRD/dIw4mj19JBGRzCm0FFqz9nUYXkbb+aM8ZzgeomN9OMnIyD H6scubUjjjjBWfNrX1owjRqY1VoJ4LjoD9EXe41jrMm3A/26b1JtgklS9EJ24VaQYUKZ owAw== X-Gm-Message-State: AOAM5332MddT1TxHfAckAiVwPw3sBf+rIi8GK3Ek4/2IucgkiaRD73jO lpqLXQZLGqg1M8EGsCZzf11V4/2RZnK03rxZZ0WMilWDcZ4= X-Google-Smtp-Source: ABdhPJwBAstkN2OKZInwLwHOo5sACpcXhzJlgQXjmpwx4R8WnDq6UelFZUugcNaURVPF2tJ/taKfnz4WaZUWDXfJHK8= X-Received: by 2002:a92:c952:: with SMTP id i18mr14677635ilq.100.1589762286203; Sun, 17 May 2020 17:38:06 -0700 (PDT) MIME-Version: 1.0 References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Sun, 17 May 2020 20:37:54 -0400 Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Conrad Meyer Cc: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49QKqh2m7Nz3gvZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 00:38:09 -0000 On Sun, 17 May 2020 at 20:24, Conrad Meyer wrote: > > On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > > On Sunday, May 17, 2020, Colin Percival wrote: > >> +# Provide instructions on how to mount the requested filesystem. > >> +FS=$1 > >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > > > > What will be this hard-coded ip address without any verification or at least https? > > It's a special non-routable IP that is used in at least AWS and Azure > to provide some VM services. Traffic to and from it never leaves the > virtual overlay network, which by design VM instances already trust to > provide privacy. It doesn't require functioning DNS to access the raw > IP. And, more information at https://en.wikipedia.org/wiki/Link-local_address From owner-svn-src-head@freebsd.org Mon May 18 01:30:14 2020 Return-Path: Delivered-To: svn-src-head@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 E32992FB8B0 for ; Mon, 18 May 2020 01:30:14 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 49QLzp45Shz415M for ; Mon, 18 May 2020 01:30:14 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 32195 invoked from network); 18 May 2020 01:30:08 -0000 Received: from unknown (HELO exbuntu.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 18 May 2020 01:30:08 -0000 Received: (qmail 99547 invoked from network); 18 May 2020 01:30:22 -0000 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by clamshell.daemonology.net with SMTP; 18 May 2020 01:30:22 -0000 Subject: Re: svn commit: r361143 - head/release/tools To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202005172155.04HLt07J036230@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@freebsd.org; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFARnJlZUJTRC5vcmc+iGEEExECACEFAklrAI4CGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6CdwCfQpS2a4bNO8/PX9hP1YnHE+M8BdwAoLwu CIxGuzK7pNBNUyVMWhy11hH+uQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: Date: Sun, 17 May 2020 18:30:22 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49QLzp45Shz415M X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:14618, ipnet:54.86.0.0/16, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 01:30:15 -0000 On 2020-05-17 16:48, Oliver Pinter wrote: > On Sunday, May 17, 2020, Colin Percival > wrote: > +REGION=`fetch -qo- > http://169.254.169.254/latest/meta-data/placement/availability-zone > | > sed -e 's/[a-z]$//'` > > What will be this hard-coded ip address without any verification or at least > https? That's a magic IP address which connects to the EC2 "instance metadata service". It doesn't actually go out over the network. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon May 18 01:34:27 2020 Return-Path: Delivered-To: svn-src-head@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 91FA62FB847; Mon, 18 May 2020 01:34:27 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QM4g3NTQz41ts; Mon, 18 May 2020 01:34:27 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 9EA1613E42; Mon, 18 May 2020 01:34:26 +0000 (UTC) Date: Mon, 18 May 2020 01:34:25 +0000 From: Mark Linimon To: Colin Percival Cc: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361143 - head/release/tools Message-ID: <20200518013425.GJ26937@lonesome.com> References: <202005172155.04HLt07J036230@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 49QM4g3NTQz41ts X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 01:34:27 -0000 Defining it to MAGIC_UNROUTED_IP_ADDRESS or something would have obviated our questions :-) mcl From owner-svn-src-head@freebsd.org Mon May 18 01:35:44 2020 Return-Path: Delivered-To: svn-src-head@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 C15932FBB89; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QM684gF4z41vl; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B80119E83; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I1Zi01071951; Mon, 18 May 2020 01:35:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I1ZiBn071950; Mon, 18 May 2020 01:35:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005180135.04I1ZiBn071950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 May 2020 01:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361148 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 01:35:44 -0000 Author: kevans Date: Mon May 18 01:35:44 2020 New Revision: 361148 URL: https://svnweb.freebsd.org/changeset/base/361148 Log: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Mon May 18 00:32:42 2020 (r361147) +++ head/usr.sbin/certctl/certctl.sh Mon May 18 01:35:44 2020 (r361148) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } From owner-svn-src-head@freebsd.org Mon May 18 01:48:55 2020 Return-Path: Delivered-To: svn-src-head@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 B5FB22FBCB6; Mon, 18 May 2020 01:48:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QMPM4JRjz42cw; Mon, 18 May 2020 01:48:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A36F19BB4; Mon, 18 May 2020 01:48:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I1mtuS078200; Mon, 18 May 2020 01:48:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I1mtbV078199; Mon, 18 May 2020 01:48:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005180148.04I1mtbV078199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 May 2020 01:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361149 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 01:48:55 -0000 Author: kevans Date: Mon May 18 01:48:55 2020 New Revision: 361149 URL: https://svnweb.freebsd.org/changeset/base/361149 Log: Revert r360833, r360882: certctl rehash in installworld This was solving the correct-ish problem in the wrong place. Noted by brooks; while he didn't request a prompt revert, doing so now will facilitate proper testing for the revised version of this. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 18 01:35:44 2020 (r361148) +++ head/Makefile.inc1 Mon May 18 01:48:55 2020 (r361149) @@ -1403,16 +1403,6 @@ distributeworld installworld stageworld: _installcheck ${DESTDIR}/${DISTDIR}/${dist}.debug.meta .endfor .endif -.elif make(installworld) && ${MK_CAROOT} != "no" - # We could make certctl a bootstrap tool, but it requires OpenSSL and - # friends, which we likely don't want. We'll rehash on a best-effort - # basis, otherwise we'll just mention that we're not doing it to raise - # awareness. - @if which certctl>/dev/null; then \ - certctl rehash; \ - else \ - echo "No certctl on the host, not rehashing target -- /etc/ssl may not be populated."; \ - fi .endif packageworld: .PHONY From owner-svn-src-head@freebsd.org Mon May 18 01:55:39 2020 Return-Path: Delivered-To: svn-src-head@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 88F092FC092; Mon, 18 May 2020 01:55:39 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49QMY70wQnz42qY; Mon, 18 May 2020 01:55:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04I1tUrI098552; Sun, 17 May 2020 18:55:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04I1tUtV098551; Sun, 17 May 2020 18:55:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005180155.04I1tUtV098551@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361143 - head/release/tools In-Reply-To: To: Ed Maste Date: Sun, 17 May 2020 18:55:30 -0700 (PDT) CC: Conrad Meyer , Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49QMY70wQnz42qY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 01:55:39 -0000 > On Sun, 17 May 2020 at 20:24, Conrad Meyer wrote: > > > > On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > > > On Sunday, May 17, 2020, Colin Percival wrote: > > >> +# Provide instructions on how to mount the requested filesystem. > > >> +FS=$1 > > >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > > > > > > > What will be this hard-coded ip address without any verification or at least https? > > > > It's a special non-routable IP that is used in at least AWS and Azure > > to provide some VM services. Traffic to and from it never leaves the > > virtual overlay network, which by design VM instances already trust to > > provide privacy. It doesn't require functioning DNS to access the raw > > IP. > > And, more information at > https://en.wikipedia.org/wiki/Link-local_address And the definative document(s) https://www.rfc-editor.org/rfc/rfc3927.txt https://who.is/whois-ip/ip-address/169.254.0.0 -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 18 02:14:26 2020 Return-Path: Delivered-To: svn-src-head@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 7CCA82FC655; Mon, 18 May 2020 02:14:26 +0000 (UTC) (envelope-from cperciva@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QMyp2lbZz43pY; Mon, 18 May 2020 02:14:26 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59AE219EE2; Mon, 18 May 2020 02:14:26 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I2EQJZ096341; Mon, 18 May 2020 02:14:26 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I2EQCW096340; Mon, 18 May 2020 02:14:26 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005180214.04I2EQCW096340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 18 May 2020 02:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361150 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 361150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 02:14:26 -0000 Author: cperciva Date: Mon May 18 02:14:25 2020 New Revision: 361150 URL: https://svnweb.freebsd.org/changeset/base/361150 Log: Add ebsnvme-id to EC2 AMIs and enable /dev/aws/disk The ebsnvme-id utility exposes information about EC2 disks -- for Elastic Block Store volumes, their volume IDs and "linux device names", and for Instance Store (aka "Ephemeral") disks, their serial numbers. The dev_aws_disk rc.d script and associated devd.conf rule maintains a tree under /dev/aws/disk: /dev/aws/disk/ebs/ /dev/aws/disk/linuxname/ /dev/aws/disk/ephemeral/ which are symlinks to the corresponding nda or nvd devices. MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Mon May 18 01:48:55 2020 (r361149) +++ head/release/tools/ec2.conf Mon May 18 02:14:25 2020 (r361150) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. @@ -17,7 +17,7 @@ if [ "${TARGET_ARCH}" = "amd64" ]; then fi # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd" +export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd dev_aws_disk" # Build with a 3.9 GB UFS partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. From owner-svn-src-head@freebsd.org Mon May 18 03:10:04 2020 Return-Path: Delivered-To: svn-src-head@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 446802FD70E; Mon, 18 May 2020 03:10:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QPC00pMdz46Dr; Mon, 18 May 2020 03:10:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 6BD691C0CB; Mon, 18 May 2020 03:10:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.37.20051002 Date: Sun, 17 May 2020 20:09:58 -0700 Subject: Re: svn commit: r361143 - head/release/tools From: Ravi Pokala To: Colin Percival , Oliver Pinter CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r361143 - head/release/tools References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 03:10:04 -0000 -----Original Message----- From: on behalf of Colin Percival Date: 2020-05-17, Sunday at 18:30 To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361143 - head/release/tools > On 2020-05-17 16:48, Oliver Pinter wrote: >> On Sunday, May 17, 2020, Colin Percival > > wrote: >> +REGION=`fetch -qo- >> http://169.254.169.254/latest/meta-data/placement/availability-zone >> | >> sed -e 's/[a-z]$//'` >> >> What will be this hard-coded ip address without any verification or at least >> https? > > That's a magic IP address which connects to the EC2 "instance metadata > service". It doesn't actually go out over the network. A comment would be appreciated, e.g. "Amazon uses this link-local address for the EC2 instance metadata service" Thanks, Ravi (rpokala@) > -- > Colin Percival > Security Officer Emeritus, FreeBSD | The power to serve > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon May 18 10:07:02 2020 Return-Path: Delivered-To: svn-src-head@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 8260213E021; Mon, 18 May 2020 10:07:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QZS631Szz4ZM7; Mon, 18 May 2020 10:07:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E53A1FE1B; Mon, 18 May 2020 10:07:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IA72Wq089941; Mon, 18 May 2020 10:07:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IA713t089936; Mon, 18 May 2020 10:07:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181007.04IA713t089936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 10:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361209 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 10:07:02 -0000 Author: tuexen Date: Mon May 18 10:07:01 2020 New Revision: 361209 URL: https://svnweb.freebsd.org/changeset/base/361209 Log: Handle failures of snprintf(). MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", - serial_num); + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, - chk->rec.data.fsn, chk->rec.data.mid); + chk->rec.data.fsn, chk->rec.data.mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, chk->rec.data.fsn, - (uint16_t)chk->rec.data.mid); + (uint16_t)chk->rec.data.mid) < 0) { + msg[0] = '\0'; + } } oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_m_freem(chk->data); @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, - control->sinfo_stream, control->mid); + control->sinfo_stream, control->mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, - (uint16_t)control->mid); + (uint16_t)control->mid) < 0) { + msg[0] = '\0'; + } } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", - control->mid); + if (snprintf(msg, sizeof(msg), + "Queue to str MID: %u duplicate", control->mid) < 0) { + msg[0] = '\0'; + } sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", - mid, chk_flags); + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { + msg[0] = '\0'; + } goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { + msg[0] = '\0'; + } err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn); + if (snprintf(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn) < 0) { + msg[0] = '\0'; + } goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn); + if (snprintf(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn) < 0) { + msg[0] = '\0'; + } goto err_out; } } @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { + msg[0] = '\0'; + } goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + if (snprintf(msg, sizeof(msg), + "Illegal message sequence, missing end for MID: %8.8x", + control->fsn_included) < 0) { + msg[0] = '\0'; + } goto err_out; } else { control = NULL; @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, - mid); + mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, - (uint16_t)mid); + (uint16_t)mid) < 0) { + msg[0] = '\0'; + } } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %u", + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", - chk_length); + chk_length) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", - ch->chunk_type); + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + ch->chunk_type) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %u", - chk_length); + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s); + if (snprintf(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", + cumack, send_s) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cum_ack, send_s); + if (snprintf(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", + cum_ack, send_s) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", - new_cum_tsn, asoc->highest_tsn_inside_map); + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) @@ -5581,7 +5581,9 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", - chk->rec.data.tsn, chk->snd_count); + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + chk->rec.data.tsn, chk->snd_count) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -13610,8 +13616,10 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); NET_EPOCH_ENTER(et); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { + sctp_ifnp->ifn_name[0] = '\0'; + } } else { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { + sctp_ifnp->ifn_name[0] = '\0'; + } } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Mon May 18 12:36:29 2020 Return-Path: Delivered-To: svn-src-head@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 500082CA119; Mon, 18 May 2020 12:36:29 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QdmY1PQqz3T4R; Mon, 18 May 2020 12:36:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B14B216B5; Mon, 18 May 2020 12:36:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ICaSlW081332; Mon, 18 May 2020 12:36:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ICaSxs081331; Mon, 18 May 2020 12:36:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005181236.04ICaSxs081331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 18 May 2020 12:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361210 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 361210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 12:36:29 -0000 Author: lwhsu Date: Mon May 18 12:36:28 2020 New Revision: 361210 URL: https://svnweb.freebsd.org/changeset/base/361210 Log: Temporarily disable failing case in CI of amd64: - lib.libexecinfo.backtrace_test.backtrace_fmt_basic PR: 246537 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon May 18 10:07:01 2020 (r361209) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon May 18 12:36:28 2020 (r361210) @@ -151,6 +151,11 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { +#if defined(__amd64__) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/246537"); +#endif + myfunc(12); if (prevent_inline) From owner-svn-src-head@freebsd.org Mon May 18 15:00:19 2020 Return-Path: Delivered-To: svn-src-head@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 907202CCF82; Mon, 18 May 2020 15:00:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QhyW3G4Tz3cMc; Mon, 18 May 2020 15:00:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B073234E1; Mon, 18 May 2020 15:00:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF0JGc067635; Mon, 18 May 2020 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF0Jmu067634; Mon, 18 May 2020 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181500.04IF0Jmu067634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 15:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361213 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:00:19 -0000 Author: tuexen Date: Mon May 18 15:00:18 2020 New Revision: 361213 URL: https://svnweb.freebsd.org/changeset/base/361213 Log: Whitespace change. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 14:38:27 2020 (r361212) +++ head/sys/netinet/sctputil.c Mon May 18 15:00:18 2020 (r361213) @@ -1560,8 +1560,8 @@ select_a_new_ep: iteration_count = 0; } KASSERT(it->inp == it->stcb->sctp_ep, - ("%s: stcb %p does not belong to inp %p, but inp %p", - __func__, it->stcb, it->inp, it->stcb->sctp_ep)); + ("%s: stcb %p does not belong to inp %p, but inp %p", + __func__, it->stcb, it->inp, it->stcb->sctp_ep)); /* run function on this one */ (*it->function_assoc) (it->inp, it->stcb, it->pointer, it->val); From owner-svn-src-head@freebsd.org Mon May 18 15:02:16 2020 Return-Path: Delivered-To: svn-src-head@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 013442CCFA5; Mon, 18 May 2020 15:02:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qj0l6HVmz3cJj; Mon, 18 May 2020 15:02:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D322A2360C; Mon, 18 May 2020 15:02:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF2FwC072443; Mon, 18 May 2020 15:02:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF2F7V072442; Mon, 18 May 2020 15:02:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181502.04IF2F7V072442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 15:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361214 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:02:16 -0000 Author: tuexen Date: Mon May 18 15:02:15 2020 New Revision: 361214 URL: https://svnweb.freebsd.org/changeset/base/361214 Log: Fix logical condition by looking at usecs. This issue was found by cpp-check running on the userland stack. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 15:00:18 2020 (r361213) +++ head/sys/netinet/sctputil.c Mon May 18 15:02:15 2020 (r361214) @@ -2933,7 +2933,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb, (void)SCTP_GETTIME_TIMEVAL(&now); } if ((old->tv_sec > now.tv_sec) || - ((old->tv_sec == now.tv_sec) && (old->tv_sec > now.tv_sec))) { + ((old->tv_sec == now.tv_sec) && (old->tv_usec > now.tv_usec))) { /* The starting point is in the future. */ return (0); } From owner-svn-src-head@freebsd.org Mon May 18 15:03:52 2020 Return-Path: Delivered-To: svn-src-head@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 E54EA2CD23C; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qj2c5mTQz3cbt; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C9023708; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF3qkj073320; Mon, 18 May 2020 15:03:52 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF3q8q073319; Mon, 18 May 2020 15:03:52 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005181503.04IF3q8q073319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Mon, 18 May 2020 15:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361215 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 361215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:03:53 -0000 Author: afedorov Date: Mon May 18 15:03:52 2020 New Revision: 361215 URL: https://svnweb.freebsd.org/changeset/base/361215 Log: bhyve(8): Add the netgraph network backend decription to the manpage. Reviewed by: vmaffione, bcr Approved by: vmaffione (mentor) Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D24846 Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon May 18 15:02:15 2020 (r361214) +++ head/usr.sbin/bhyve/bhyve.8 Mon May 18 15:03:52 2020 (r361215) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd May 18, 2020 .Dt BHYVE 8 .Os .Sh NAME @@ -291,10 +291,11 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network devices: +Network backends: .Bl -tag -width 10n .It Ar tapN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc .It Ar vmnetN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc +.It Ar netgraph,path=ADDRESS,peerhook=HOOK Ns Oo , Ns Ar socket=NAME Oc Ns Oo , Ns Ar hook=HOOK Oc Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc .Pp If .Ar mac @@ -310,6 +311,27 @@ With virtio-net devices, the .Ar mtu parameter can be specified to inform the guest about the largest MTU that should be allowed, expressed in bytes. +.Pp +With netgraph backend, the +.Ar path +and +.Ar peerhook +parameters must be specified to set the destination node and corresponding hook. +The optional parameters +.Ar socket +and +.Ar hook +may be used to set the +.Xr ng_socket 4 +node name and source hook. +The +.Ar ADDRESS , +.Ar HOOK +and +.Ar NAME +must comply with +.Xr netgraph 4 +addressing rules. .El .Pp Block storage devices: @@ -670,6 +692,8 @@ bhyve -c 2 -m 4G -w -H \\ .Ed .Sh SEE ALSO .Xr bhyve 4 , +.Xr netgraph 4 , +.Xr ng_socket 4 , .Xr nmdm 4 , .Xr vmm 4 , .Xr ethers 5 , From owner-svn-src-head@freebsd.org Mon May 18 15:06:00 2020 Return-Path: Delivered-To: svn-src-head@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 21D122CD38D; Mon, 18 May 2020 15:06:00 +0000 (UTC) (envelope-from andrew@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qj5406Vzz3d4H; Mon, 18 May 2020 15:06:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F332523616; Mon, 18 May 2020 15:05:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF5xM6073522; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF5x0U073521; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005181505.04IF5x0U073521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 18 May 2020 15:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361216 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 361216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:06:00 -0000 Author: andrew Date: Mon May 18 15:05:59 2020 New Revision: 361216 URL: https://svnweb.freebsd.org/changeset/base/361216 Log: Allow the FACS and XFACS to be zero in acpidump. These are allowed to be zero when the hardware reduced APCI flag is set Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D23207 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:03:52 2020 (r361215) +++ head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:05:59 2020 (r361216) @@ -245,6 +245,7 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) ACPI_TABLE_HEADER *dsdp; ACPI_TABLE_FACS *facs; ACPI_TABLE_FADT *fadt; + vm_offset_t addr; int fadt_revision; fadt = (ACPI_TABLE_FADT *)sdp; @@ -252,12 +253,17 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) fadt_revision = acpi_get_fadt_revision(fadt); if (fadt_revision == 1) - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->Facs); + addr = fadt->Facs; else - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->XFacs); - if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64) - errx(1, "FACS is corrupt"); - acpi_print_facs(facs); + addr = fadt->XFacs; + if (addr != 0) { + facs = (ACPI_TABLE_FACS *)acpi_map_sdt(addr); + + if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || + facs->Length < 64) + errx(1, "FACS is corrupt"); + acpi_print_facs(facs); + } if (fadt_revision == 1) dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt); From owner-svn-src-head@freebsd.org Mon May 18 15:39:01 2020 Return-Path: Delivered-To: svn-src-head@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 BB2132CDF29; Mon, 18 May 2020 15:39:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qjq93YY8z3fdZ; Mon, 18 May 2020 15:39:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f52.google.com with SMTP id a68so8379554otb.10; Mon, 18 May 2020 08:39:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=0LcTR2IyUtvqpuiuc1h/s5Tf2+kg7L56DEidAlFsuF0=; b=IR+K7Lmx8chNL/63lakbKE+yY4DVWHoNp6/q9Xex33kWGe2SEe2oDneqWTvS4g++GT gzTFYbQdNWN7yL5X96QYzeb5dtOPsVicwcdysLZGkqueXmCo7mGiUcdId8G2FUO8RoOJ ZokrK+0IN3rPQvHoly7U23ZlY7cskYeomr+k+THMSbU5OTFoVdsTfFYc5B0H0II2juuM IkFbmt1O+7w8hi4XRExh3fkS/mpWzTRYsl+potGXDxDJqXxjtk9pMqw0tHFYctNUmptn 3bmRX9wMjrcefJHoJEYmlGI5kmg177/CXRv7V2ZLoUh+Qi54Wdu3IZUGzTWJQiR5ImMR yGGw== X-Gm-Message-State: AOAM530NTnypDqWeKhDNj+HKP8tKdKnoAU76AcYtni4m9XAHbMB58ggw PkmD7r2ZoRwoJAmWVUrPNYWrs57R X-Google-Smtp-Source: ABdhPJxjXgjIn77zot3e2DwOksAIvG40M3hPSfdwN7KfXaNix1XV4UC19Nc2aTeK/lTBIStd6O93gw== X-Received: by 2002:a9d:20e7:: with SMTP id x94mr7767162ota.260.1589816339308; Mon, 18 May 2020 08:38:59 -0700 (PDT) Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com. [209.85.161.43]) by smtp.gmail.com with ESMTPSA id p18sm2888714oth.2.2020.05.18.08.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 08:38:59 -0700 (PDT) Received: by mail-oo1-f43.google.com with SMTP id a83so2119312oob.9; Mon, 18 May 2020 08:38:58 -0700 (PDT) X-Received: by 2002:a4a:9c09:: with SMTP id y9mr11834155ooj.43.1589816338243; Mon, 18 May 2020 08:38:58 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: <202005181007.04IA713t089936@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 08:38:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Qjq93YY8z3fdZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:39:01 -0000 Hi Michael, These changes are a bit odd. The only reason a standards-compliant snprintf() would fail to nul-terminate a buffer is if the provided buffer had length zero. Since this is not the case in any of these uses, I wonder why this revision was made? Does a SCTP downstream have a broken snprintf implementation, and if so, wouldn't it make more sense to create a standards-compliant portability shim for that platform instead of this more invasive change? FreeBSD's snprintf(9) does not have this bug, nor does its snprintf(3). Best regards, Conrad On Mon, May 18, 2020 at 3:07 AM Michael Tuexen wrote: > > Author: tuexen > Date: Mon May 18 10:07:01 2020 > New Revision: 361209 > URL: https://svnweb.freebsd.org/changeset/base/361209 > > Log: > Handle failures of snprintf(). > > MFC after: 3 days > > Modified: > head/sys/netinet/sctp_asconf.c > head/sys/netinet/sctp_indata.c > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_output.c > head/sys/netinet/sctp_pcb.c > > Modified: head/sys/netinet/sctp_asconf.c > ============================================================================== > --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) > @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, > char msg[SCTP_DIAG_INFO_LEN]; > > SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); > - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", > - serial_num); > + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > *abort_no_unlock = 1; > > Modified: head/sys/netinet/sctp_indata.c > ============================================================================== > --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) > @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, > struct mbuf *oper; > > if (stcb->asoc.idata_supported) { > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", > opspot, > control->fsn_included, > chk->rec.data.tsn, > chk->rec.data.sid, > - chk->rec.data.fsn, chk->rec.data.mid); > + chk->rec.data.fsn, chk->rec.data.mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", > opspot, > control->fsn_included, > chk->rec.data.tsn, > chk->rec.data.sid, > chk->rec.data.fsn, > - (uint16_t)chk->rec.data.mid); > + (uint16_t)chk->rec.data.mid) < 0) { > + msg[0] = '\0'; > + } > } > oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_m_freem(chk->data); > @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > */ > TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); > if (asoc->idata_supported) { > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > strm->last_mid_delivered, control->sinfo_tsn, > - control->sinfo_stream, control->mid); > + control->sinfo_stream, control->mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > (uint16_t)strm->last_mid_delivered, > control->sinfo_tsn, > control->sinfo_stream, > - (uint16_t)control->mid); > + (uint16_t)control->mid) < 0) { > + msg[0] = '\0'; > + } > } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; > @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > * to put it on the queue. > */ > if (sctp_place_control_in_stream(strm, asoc, control)) { > - snprintf(msg, sizeof(msg), > - "Queue to str MID: %u duplicate", > - control->mid); > + if (snprintf(msg, sizeof(msg), > + "Queue to str MID: %u duplicate", control->mid) < 0) { > + msg[0] = '\0'; > + } > sctp_clean_up_control(stcb, control); > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; > @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * can *not* be fsn 0. XXX: This can happen in case of a > * wrap around. Ignore is for now. > */ > - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", > - mid, chk_flags); > + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); > @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > if (control != NULL) { > /* We found something, does it belong? */ > if (ordered && (mid != control->mid)) { > - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); > + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { > + msg[0] = '\0'; > + } > err_out: > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; > @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * We can't have a switched order with an > * unordered chunk > */ > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > - tsn); > + if (snprintf(msg, sizeof(msg), > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > + tsn) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { > @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * We can't have a switched unordered with a > * ordered chunk > */ > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > - tsn); > + if (snprintf(msg, sizeof(msg), > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > + tsn) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > } > @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > if (ordered || asoc->idata_supported) { > SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", > chk_flags, mid); > - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); > + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } else { > if ((tsn == control->fsn_included + 1) && > (control->end_added == 0)) { > - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); > + if (snprintf(msg, sizeof(msg), > + "Illegal message sequence, missing end for MID: %8.8x", > + control->fsn_included) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } else { > control = NULL; > @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > mid, asoc->strmin[sid].last_mid_delivered); > > if (asoc->idata_supported) { > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > asoc->strmin[sid].last_mid_delivered, > tsn, > sid, > - mid); > + mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > (uint16_t)asoc->strmin[sid].last_mid_delivered, > tsn, > sid, > - (uint16_t)mid); > + (uint16_t)mid) < 0) { > + msg[0] = '\0'; > + } > } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; > @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); > + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); > + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s chunk of length %u", > + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", > ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", > - chk_length); > + chk_length) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > - ch->chunk_type); > + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > + ch->chunk_type) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > return (2); > @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "Chunk of length %u", > - chk_length); > + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 > > *abort_now = 1; > /* XXX */ > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > - cumack, send_s); > + if (snprintf(msg, sizeof(msg), > + "Cum ack %8.8x greater or equal than TSN %8.8x", > + cumack, send_s) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o > hopeless_peer: > *abort_now = 1; > /* XXX */ > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > - cum_ack, send_s); > + if (snprintf(msg, sizeof(msg), > + "Cum ack %8.8x greater or equal than TSN %8.8x", > + cum_ack, send_s) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, > * give out). This must be an attacker. > */ > *abort_flag = 1; > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "New cum ack %8.8x too high, highest TSN %8.8x", > - new_cum_tsn, asoc->highest_tsn_inside_map); > + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) > @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > } > } > if (stcb == NULL) { > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > /* no association, so it's out of the blue... */ > @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > if (stcb != NULL) { > SCTP_TCB_UNLOCK(stcb); > } > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, *offset, src, dst, > @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > SCTP_TCB_UNLOCK(stcb); > stcb = NULL; > SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > if (stcb == NULL) { > /* out of the blue DATA chunk */ > SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > /* > * We consider OOTB any data sent during asoc setup. > */ > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > Modified: head/sys/netinet/sctp_output.c > ============================================================================== > --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) > @@ -5581,7 +5581,9 @@ do_a_abort: > if (op_err == NULL) { > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > } > @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s > char msg[SCTP_DIAG_INFO_LEN]; > > abort_anyway: > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > atomic_add_int(&stcb->asoc.refcnt, 1); > @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > - chk->rec.data.tsn, chk->snd_count); > + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > + chk->rec.data.tsn, chk->snd_count) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > atomic_add_int(&stcb->asoc.refcnt, 1); > @@ -13610,8 +13616,10 @@ dataless_eof: > atomic_add_int(&stcb->asoc.refcnt, -1); > free_cnt_applied = 0; > } > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > NET_EPOCH_ENTER(et); > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) > @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 > atomic_add_int(&vrf->refcount, 1); > sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); > if (if_name != NULL) { > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { > + sctp_ifnp->ifn_name[0] = '\0'; > + } > } else { > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { > + sctp_ifnp->ifn_name[0] = '\0'; > + } > } > hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; > LIST_INIT(&sctp_ifnp->ifalist); > @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > * in setup state we > * abort this guy > */ > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_abort_an_association(stcb_tmp->sctp_ep, > @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > * in setup state we > * abort this guy > */ > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Mon May 18 15:48:48 2020 Return-Path: Delivered-To: svn-src-head@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 BD4512CDCBF; Mon, 18 May 2020 15:48:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qk2R7233z3g3q; Mon, 18 May 2020 15:48:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id j145so9380338oib.5; Mon, 18 May 2020 08:48:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=htTzkF+TJq7AQeybmcf2Rgzje+mu/+lwQh9Be6kiAtc=; b=PR49OVJO7no1UjU6vFwwJQAeimZgYxma5cXnpQdqZ3lQZbhuOGvmFfgVQwB0dXhEue ye4Ool+ENknIVijhToovbpIrQDWJOGN0Lvt5LI0GYINbUG/4urwxUuawj9HrX09sNm23 wMb/0EWiHKoo1lYHtQED2tWMHqgIUwMniCWk6UyGAVK8aEQ6Mg8K+FQASMbftIMC+ZPs DwOfKjI8/vN7k/iu5/W+t4lCGCyP/mGl/L0LlRRjr7si7sP+vdAY1pJ/zGH3TMvyUDpy PW4gMtGMoDt8Ggr49fo1xynqb/s9vDEiXxuWBauR4MMp/YQTE91/YD0yd/9/IvgMFn5y Mosg== X-Gm-Message-State: AOAM533RoP2lx2LyddqQ20wUkssac9+nnRzsl+pLxqPbrUd1nRKd5ozF J5BTOl+HoeWXtMFHXvJ2hochaMrr X-Google-Smtp-Source: ABdhPJxVCtdfutemh9Q/cLwXTlnipKRgcg/2b4WmVH7JMDVox4RySNNHSJb65fgbKgQvXHzXi3X3pQ== X-Received: by 2002:aca:af15:: with SMTP id y21mr15316oie.124.1589816926082; Mon, 18 May 2020 08:48:46 -0700 (PDT) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com. [209.85.167.170]) by smtp.gmail.com with ESMTPSA id 97sm3010224otm.78.2020.05.18.08.48.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 08:48:45 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id 19so9367850oiy.8; Mon, 18 May 2020 08:48:45 -0700 (PDT) X-Received: by 2002:aca:a854:: with SMTP id r81mr11573319oie.81.1589816924905; Mon, 18 May 2020 08:48:44 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 08:48:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Qk2R7233z3g3q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [0.35 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.179:from]; NEURAL_SPAM_SHORT(0.35)[0.352]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.179:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 15:48:48 -0000 (In fact, I don't believe snprintf(9) can return a negative value at all. And snprintf(3) will only do so in some special circumstances for features snprintf(9) does not support: buffer size or formatted result longer than INT_MAX; invalid *nn$ field width or precision specifiers. I don't think either case applies to these strings, although I did not read all of them thoroughly.) On Mon, May 18, 2020 at 8:38 AM Conrad Meyer wrote: > > Hi Michael, > > These changes are a bit odd. The only reason a standards-compliant > snprintf() would fail to nul-terminate a buffer is if the provided > buffer had length zero. Since this is not the case in any of these > uses, I wonder why this revision was made? Does a SCTP downstream > have a broken snprintf implementation, and if so, wouldn't it make > more sense to create a standards-compliant portability shim for that > platform instead of this more invasive change? > > FreeBSD's snprintf(9) does not have this bug, nor does its snprintf(3). > > Best regards, > Conrad > > On Mon, May 18, 2020 at 3:07 AM Michael Tuexen wrote: > > > > Author: tuexen > > Date: Mon May 18 10:07:01 2020 > > New Revision: 361209 > > URL: https://svnweb.freebsd.org/changeset/base/361209 > > > > Log: > > Handle failures of snprintf(). > > > > MFC after: 3 days > > > > Modified: > > head/sys/netinet/sctp_asconf.c > > head/sys/netinet/sctp_indata.c > > head/sys/netinet/sctp_input.c > > head/sys/netinet/sctp_output.c > > head/sys/netinet/sctp_pcb.c > > > > Modified: head/sys/netinet/sctp_asconf.c > > ============================================================================== > > --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) > > @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, > > char msg[SCTP_DIAG_INFO_LEN]; > > > > SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); > > - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", > > - serial_num); > > + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > *abort_no_unlock = 1; > > > > Modified: head/sys/netinet/sctp_indata.c > > ============================================================================== > > --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) > > @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, > > struct mbuf *oper; > > > > if (stcb->asoc.idata_supported) { > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", > > opspot, > > control->fsn_included, > > chk->rec.data.tsn, > > chk->rec.data.sid, > > - chk->rec.data.fsn, chk->rec.data.mid); > > + chk->rec.data.fsn, chk->rec.data.mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", > > opspot, > > control->fsn_included, > > chk->rec.data.tsn, > > chk->rec.data.sid, > > chk->rec.data.fsn, > > - (uint16_t)chk->rec.data.mid); > > + (uint16_t)chk->rec.data.mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_m_freem(chk->data); > > @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > > */ > > TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); > > if (asoc->idata_supported) { > > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > strm->last_mid_delivered, control->sinfo_tsn, > > - control->sinfo_stream, control->mid); > > + control->sinfo_stream, control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > (uint16_t)strm->last_mid_delivered, > > control->sinfo_tsn, > > control->sinfo_stream, > > - (uint16_t)control->mid); > > + (uint16_t)control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; > > @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > > * to put it on the queue. > > */ > > if (sctp_place_control_in_stream(strm, asoc, control)) { > > - snprintf(msg, sizeof(msg), > > - "Queue to str MID: %u duplicate", > > - control->mid); > > + if (snprintf(msg, sizeof(msg), > > + "Queue to str MID: %u duplicate", control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > sctp_clean_up_control(stcb, control); > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; > > @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * can *not* be fsn 0. XXX: This can happen in case of a > > * wrap around. Ignore is for now. > > */ > > - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", > > - mid, chk_flags); > > + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); > > @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > if (control != NULL) { > > /* We found something, does it belong? */ > > if (ordered && (mid != control->mid)) { > > - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); > > + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { > > + msg[0] = '\0'; > > + } > > err_out: > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; > > @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * We can't have a switched order with an > > * unordered chunk > > */ > > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > - tsn); > > + if (snprintf(msg, sizeof(msg), > > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > + tsn) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { > > @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * We can't have a switched unordered with a > > * ordered chunk > > */ > > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > - tsn); > > + if (snprintf(msg, sizeof(msg), > > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > + tsn) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > } > > @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > if (ordered || asoc->idata_supported) { > > SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", > > chk_flags, mid); > > - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); > > + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } else { > > if ((tsn == control->fsn_included + 1) && > > (control->end_added == 0)) { > > - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); > > + if (snprintf(msg, sizeof(msg), > > + "Illegal message sequence, missing end for MID: %8.8x", > > + control->fsn_included) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } else { > > control = NULL; > > @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > mid, asoc->strmin[sid].last_mid_delivered); > > > > if (asoc->idata_supported) { > > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > asoc->strmin[sid].last_mid_delivered, > > tsn, > > sid, > > - mid); > > + mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > (uint16_t)asoc->strmin[sid].last_mid_delivered, > > tsn, > > sid, > > - (uint16_t)mid); > > + (uint16_t)mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; > > @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); > > + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); > > + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s chunk of length %u", > > + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", > > ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", > > - chk_length); > > + chk_length) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > > - ch->chunk_type); > > + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > > + ch->chunk_type) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > return (2); > > @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "Chunk of length %u", > > - chk_length); > > + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 > > > > *abort_now = 1; > > /* XXX */ > > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > > - cumack, send_s); > > + if (snprintf(msg, sizeof(msg), > > + "Cum ack %8.8x greater or equal than TSN %8.8x", > > + cumack, send_s) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o > > hopeless_peer: > > *abort_now = 1; > > /* XXX */ > > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > > - cum_ack, send_s); > > + if (snprintf(msg, sizeof(msg), > > + "Cum ack %8.8x greater or equal than TSN %8.8x", > > + cum_ack, send_s) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, > > * give out). This must be an attacker. > > */ > > *abort_flag = 1; > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "New cum ack %8.8x too high, highest TSN %8.8x", > > - new_cum_tsn, asoc->highest_tsn_inside_map); > > + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > > > Modified: head/sys/netinet/sctp_input.c > > ============================================================================== > > --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) > > @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > > } > > } > > if (stcb == NULL) { > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > /* no association, so it's out of the blue... */ > > @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > > if (stcb != NULL) { > > SCTP_TCB_UNLOCK(stcb); > > } > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, *offset, src, dst, > > @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > SCTP_TCB_UNLOCK(stcb); > > stcb = NULL; > > SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > if (stcb == NULL) { > > /* out of the blue DATA chunk */ > > SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > /* > > * We consider OOTB any data sent during asoc setup. > > */ > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > > > Modified: head/sys/netinet/sctp_output.c > > ============================================================================== > > --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) > > @@ -5581,7 +5581,9 @@ do_a_abort: > > if (op_err == NULL) { > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > } > > @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s > > char msg[SCTP_DIAG_INFO_LEN]; > > > > abort_anyway: > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > atomic_add_int(&stcb->asoc.refcnt, 1); > > @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > > - chk->rec.data.tsn, chk->snd_count); > > + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > > + chk->rec.data.tsn, chk->snd_count) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > atomic_add_int(&stcb->asoc.refcnt, 1); > > @@ -13610,8 +13616,10 @@ dataless_eof: > > atomic_add_int(&stcb->asoc.refcnt, -1); > > free_cnt_applied = 0; > > } > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > NET_EPOCH_ENTER(et); > > > > Modified: head/sys/netinet/sctp_pcb.c > > ============================================================================== > > --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) > > @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 > > atomic_add_int(&vrf->refcount, 1); > > sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); > > if (if_name != NULL) { > > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); > > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { > > + sctp_ifnp->ifn_name[0] = '\0'; > > + } > > } else { > > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); > > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { > > + sctp_ifnp->ifn_name[0] = '\0'; > > + } > > } > > hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; > > LIST_INIT(&sctp_ifnp->ifalist); > > @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > > * in setup state we > > * abort this guy > > */ > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_abort_an_association(stcb_tmp->sctp_ep, > > @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > > * in setup state we > > * abort this guy > > */ > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Mon May 18 16:07:15 2020 Return-Path: Delivered-To: svn-src-head@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 58D352CE877; Mon, 18 May 2020 16:07:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QkRk4LZqz3yMb; Mon, 18 May 2020 16:07:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C1E024226; Mon, 18 May 2020 16:07:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IG7E21010714; Mon, 18 May 2020 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IG7EcM010713; Mon, 18 May 2020 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005181607.04IG7EcM010713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 May 2020 16:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361218 - head/contrib/binutils/gas X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/gas X-SVN-Commit-Revision: 361218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 16:07:15 -0000 Author: emaste Date: Mon May 18 16:07:14 2020 New Revision: 361218 URL: https://svnweb.freebsd.org/changeset/base/361218 Log: GNU as: move deprecation message after option parsing Some cmake test parses the output of the first line of as --version, and emits an error if it does not contain some expected strings: Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)" Emit the deprecation message later, after parsing argv and thus --version. PR: 246540 Reported by: dch Sponsored by: The FreeBSD Foundation Modified: head/contrib/binutils/gas/as.c Modified: head/contrib/binutils/gas/as.c ============================================================================== --- head/contrib/binutils/gas/as.c Mon May 18 15:59:17 2020 (r361217) +++ head/contrib/binutils/gas/as.c Mon May 18 16:07:14 2020 (r361218) @@ -1089,7 +1089,6 @@ main (int argc, char ** argv) expandargv (&argc, &argv); START_PROGRESS (myname, 0); - fprintf (stderr, _("warning: as 2.17.50 is deprecated in FreeBSD and will be removed\n")); #ifndef OBJ_DEFAULT_OUTPUT_FILE_NAME #define OBJ_DEFAULT_OUTPUT_FILE_NAME "a.out" @@ -1109,6 +1108,7 @@ main (int argc, char ** argv) /* Call parse_args before any of the init/begin functions so that switches like --hash-size can be honored. */ parse_args (&argc, &argv); + fprintf (stderr, _("warning: GNU as %s is deprecated and will be removed\n"), BFD_VERSION_STRING); symbol_begin (); frag_init (); subsegs_begin (); From owner-svn-src-head@freebsd.org Mon May 18 16:47:45 2020 Return-Path: Delivered-To: svn-src-head@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 8EE292CF5E5; Mon, 18 May 2020 16:47:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QlLT3Dzlz41nK; Mon, 18 May 2020 16:47:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A580248A1; Mon, 18 May 2020 16:47:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IGljG2035763; Mon, 18 May 2020 16:47:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IGljXf035762; Mon, 18 May 2020 16:47:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005181647.04IGljXf035762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 May 2020 16:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361220 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 16:47:45 -0000 Author: jhb Date: Mon May 18 16:47:44 2020 New Revision: 361220 URL: https://svnweb.freebsd.org/changeset/base/361220 Log: Correct the order of arguments to copyin() for Q_SETQUOTA. MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24656 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 18 16:33:32 2020 (r361219) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 18 16:47:44 2020 (r361220) @@ -267,7 +267,7 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *ar vfs_unbusy(vfsp); break; case Q_SETQUOTA: - error = copyin(&dqblk, arg, sizeof(dqblk)); + error = copyin(arg, &dqblk, sizeof(dqblk)); if (error == 0) error = zfs_set_userquota(zfsvfs, quota_type, "", id, dbtob(dqblk.dqb_bhardlimit)); From owner-svn-src-head@freebsd.org Mon May 18 17:35:20 2020 Return-Path: Delivered-To: svn-src-head@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 C02032D883C; Mon, 18 May 2020 17:35:20 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QmPN2Lbmz44Ss; Mon, 18 May 2020 17:35:19 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 078627220F406; Mon, 18 May 2020 19:35:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 19:35:13 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QmPN2Lbmz44Ss X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 17:35:20 -0000 > On 18. May 2020, at 17:38, Conrad Meyer wrote: >=20 > Hi Michael, >=20 > These changes are a bit odd. The only reason a standards-compliant > snprintf() would fail to nul-terminate a buffer is if the provided > buffer had length zero. Since this is not the case in any of these > uses, I wonder why this revision was made? Does a SCTP downstream Hi Conrad, when compiling the code in userland with gcc 10, it warns that the output might be truncated. That is true and intended. So checking that the call doesn't fail silences this warning and ensures the code works in case snprintf() returns an error. I don't see in the POSIX specification a statement limiting the case where it could fail. > have a broken snprintf implementation, and if so, wouldn't it make > more sense to create a standards-compliant portability shim for that > platform instead of this more invasive change? If you want, I can revert the change and use the code only on = non-FreeBSD platforms. Best regards Michael >=20 > FreeBSD's snprintf(9) does not have this bug, nor does its = snprintf(3). >=20 > Best regards, > Conrad >=20 > On Mon, May 18, 2020 at 3:07 AM Michael Tuexen = wrote: >>=20 >> Author: tuexen >> Date: Mon May 18 10:07:01 2020 >> New Revision: 361209 >> URL: https://svnweb.freebsd.org/changeset/base/361209 >>=20 >> Log: >> Handle failures of snprintf(). >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/netinet/sctp_asconf.c >> head/sys/netinet/sctp_indata.c >> head/sys/netinet/sctp_input.c >> head/sys/netinet/sctp_output.c >> head/sys/netinet/sctp_pcb.c >>=20 >> Modified: head/sys/netinet/sctp_asconf.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int = offset, >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got = unexpected next serial number! Aborting asoc!\n"); >> - snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", >> - serial_num); >> + if (snprintf(msg, sizeof(msg), "Never sent serial = number %8.8x", serial_num) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> *abort_no_unlock =3D 1; >>=20 >> Modified: head/sys/netinet/sctp_indata.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, >> struct mbuf *oper; >>=20 >> if (stcb->asoc.idata_supported) { >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "Reass = %x,CF:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%8.8x,MID:%8.8x", >> opspot, >> control->fsn_included, >> chk->rec.data.tsn, >> chk->rec.data.sid, >> - chk->rec.data.fsn, chk->rec.data.mid); >> + chk->rec.data.fsn, chk->rec.data.mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "Reass = %x,CI:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%4.4x,SSN:%4.4x", >> opspot, >> control->fsn_included, >> chk->rec.data.tsn, >> chk->rec.data.sid, >> chk->rec.data.fsn, >> - (uint16_t)chk->rec.data.mid); >> + (uint16_t)chk->rec.data.mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> oper =3D sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, = msg); >> sctp_m_freem(chk->data); >> @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >> */ >> TAILQ_INSERT_HEAD(&strm->inqueue, control, = next_instrm); >> if (asoc->idata_supported) { >> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> strm->last_mid_delivered, = control->sinfo_tsn, >> - control->sinfo_stream, control->mid); >> + control->sinfo_stream, control->mid) < 0) = { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> (uint16_t)strm->last_mid_delivered, >> control->sinfo_tsn, >> control->sinfo_stream, >> - (uint16_t)control->mid); >> + (uint16_t)control->mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; >> @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, >> * to put it on the queue. >> */ >> if (sctp_place_control_in_stream(strm, asoc, control)) = { >> - snprintf(msg, sizeof(msg), >> - "Queue to str MID: %u duplicate", >> - control->mid); >> + if (snprintf(msg, sizeof(msg), >> + "Queue to str MID: %u duplicate", = control->mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> sctp_clean_up_control(stcb, control); >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; >> @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * can *not* be fsn 0. XXX: This can happen in case of = a >> * wrap around. Ignore is for now. >> */ >> - snprintf(msg, sizeof(msg), "FSN zero for MID=3D%8.8x, = but flags=3D%2.2x", >> - mid, chk_flags); >> + if (snprintf(msg, sizeof(msg), "FSN zero for = MID=3D%8.8x, but flags=3D%2.2x", mid, chk_flags) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> control =3D sctp_find_reasm_entry(&asoc->strmin[sid], mid, = ordered, asoc->idata_supported); >> @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> if (control !=3D NULL) { >> /* We found something, does it belong? */ >> if (ordered && (mid !=3D control->mid)) { >> - snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid); >> + if (snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> err_out: >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; >> @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * We can't have a switched order with = an >> * unordered chunk >> */ >> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >> - tsn); >> + if (snprintf(msg, sizeof(msg), >> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >> + tsn) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> if (!ordered && (((control->sinfo_flags >> 8) = & SCTP_DATA_UNORDERED) =3D=3D 0)) { >> @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * We can't have a switched unordered = with a >> * ordered chunk >> */ >> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >> - tsn); >> + if (snprintf(msg, sizeof(msg), >> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >> + tsn) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> } >> @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> if (ordered || asoc->idata_supported) { >> SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: = 0x%x dup detected on MID: %u\n", >> chk_flags, mid); >> - snprintf(msg, sizeof(msg), "Duplicate = MID=3D%8.8x detected.", mid); >> + if (snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } else { >> if ((tsn =3D=3D control->fsn_included = + 1) && >> (control->end_added =3D=3D 0)) { >> - snprintf(msg, sizeof(msg), = "Illegal message sequence, missing end for MID: %8.8x", = control->fsn_included); >> + if (snprintf(msg, = sizeof(msg), >> + "Illegal message = sequence, missing end for MID: %8.8x", >> + control->fsn_included) < = 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } else { >> control =3D NULL; >> @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> mid, asoc->strmin[sid].last_mid_delivered); >>=20 >> if (asoc->idata_supported) { >> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> asoc->strmin[sid].last_mid_delivered, >> tsn, >> sid, >> - mid); >> + mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> = (uint16_t)asoc->strmin[sid].last_mid_delivered, >> tsn, >> sid, >> - (uint16_t)mid); >> + (uint16_t)mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; >> @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated"); >> + if (snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated") < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; >> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s", "DATA chunk = received when I-DATA was negotiated"); >> + if (snprintf(msg, sizeof(msg), "%s", "DATA = chunk received when I-DATA was negotiated") < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; >> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s chunk = of length %u", >> + if (snprintf(msg, sizeof(msg), "%s = chunk of length %u", >> ch->chunk_type =3D=3D SCTP_DATA ? = "DATA" : "I-DATA", >> - chk_length); >> + chk_length) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; >> sctp_abort_an_association(inp, stcb, = op_err, SCTP_SO_NOT_LOCKED); >> @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), = "DATA chunk followed by chunk of type %2.2x", >> - ch->chunk_type); >> + if (snprintf(msg, = sizeof(msg), "DATA chunk followed by chunk of type %2.2x", >> + ch->chunk_type) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> sctp_abort_an_association(inp, = stcb, op_err, SCTP_SO_NOT_LOCKED); >> return (2); >> @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), = "Chunk of length %u", >> - chk_length); >> + if (snprintf(msg, = sizeof(msg), "Chunk of length %u", chk_length) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code = =3D SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; >> sctp_abort_an_association(inp, = stcb, op_err, SCTP_SO_NOT_LOCKED); >> @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb = *stcb, uint32 >>=20 >> *abort_now =3D 1; >> /* XXX */ >> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >> - cumack, send_s); >> + if (snprintf(msg, sizeof(msg), >> + "Cum ack %8.8x greater or equal than TSN %8.8x", >> + cumack, send_s) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int = offset_seg, int o >> hopeless_peer: >> *abort_now =3D 1; >> /* XXX */ >> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >> - cum_ack, send_s); >> + if (snprintf(msg, sizeof(msg), >> + "Cum ack %8.8x greater or equal than TSN %8.8x", >> + cum_ack, send_s) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, >> * give out). This must be an attacker. >> */ >> *abort_flag =3D 1; >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "New cum ack %8.8x too high, highest TSN = %8.8x", >> - new_cum_tsn, = asoc->highest_tsn_inside_map); >> + new_cum_tsn, = asoc->highest_tsn_inside_map) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; >> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>=20 >> Modified: head/sys/netinet/sctp_input.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >> } >> } >> if (stcb =3D=3D NULL) { >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> /* no association, so it's out of the blue... = */ >> @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >> if (stcb !=3D NULL) { >> SCTP_TCB_UNLOCK(stcb); >> } >> - snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, *offset, = src, dst, >> @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> SCTP_TCB_UNLOCK(stcb); >> stcb =3D NULL; >> SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >> @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> if (stcb =3D=3D NULL) { >> /* out of the blue DATA chunk */ >> SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >> @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> /* >> * We consider OOTB any data sent during asoc = setup. >> */ >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>=20 >> Modified: head/sys/netinet/sctp_output.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -5581,7 +5581,9 @@ do_a_abort: >> if (op_err =3D=3D NULL) { >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> } >> @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, = struct s >> char = msg[SCTP_DIAG_INFO_LEN]; >>=20 >> abort_anyway: >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at %s", = __FILE__, __LINE__, __func__); >> + if (snprintf(msg, = sizeof(msg), >> + "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D = '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = atomic_add_int(&stcb->asoc.refcnt, 1); >> @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb = *inp, >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >> - chk->rec.data.tsn, chk->snd_count); >> + if (snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >> + chk->rec.data.tsn, chk->snd_count) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> atomic_add_int(&stcb->asoc.refcnt, 1); >> @@ -13610,8 +13616,10 @@ dataless_eof: >> = atomic_add_int(&stcb->asoc.refcnt, -1); >> free_cnt_applied =3D = 0; >> } >> - snprintf(msg, sizeof(msg), >> - "%s:%d at %s", __FILE__, = __LINE__, __func__); >> + if (snprintf(msg, = sizeof(msg), >> + "%s:%d at %s", __FILE__, = __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> NET_EPOCH_ENTER(et); >>=20 >> Modified: head/sys/netinet/sctp_pcb.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, = uint3 >> atomic_add_int(&vrf->refcount, 1); >> sctp_ifnp->ifn_mtu =3D = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); >> if (if_name !=3D NULL) { >> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", if_name); >> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", if_name) < 0) { >> + sctp_ifnp->ifn_name[0] =3D '\0'; >> + } >> } else { >> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", "unknown"); >> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", "unknown") < 0) { >> + sctp_ifnp->ifn_name[0] =3D '\0'; >> + } >> } >> hash_ifn_head =3D = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & = SCTP_BASE_INFO(vrf_ifn_hashmark))]; >> LIST_INIT(&sctp_ifnp->ifalist); >> @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >> * in setup = state we >> * abort this = guy >> */ >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at = %s", __FILE__, __LINE__, __func__); >> + if = (snprintf(msg, sizeof(msg), >> + "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >> + = msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = sctp_abort_an_association(stcb_tmp->sctp_ep, >> @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >> * in setup = state we >> * abort this = guy >> */ >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at = %s", __FILE__, __LINE__, __func__); >> + if = (snprintf(msg, sizeof(msg), >> + "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >> + = msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Mon May 18 17:39:04 2020 Return-Path: Delivered-To: svn-src-head@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 968F62D88F3; Mon, 18 May 2020 17:39:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QmTh2xgsz44vv; Mon, 18 May 2020 17:39:03 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id B466E7220F406; Mon, 18 May 2020 19:39:00 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 19:39:00 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <78E9B091-4873-4109-A136-D7479DB0C77C@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QmTh2xgsz44vv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 17:39:04 -0000 > On 18. May 2020, at 17:48, Conrad Meyer wrote: >=20 > (In fact, I don't believe snprintf(9) can return a negative value at > all. And snprintf(3) will only do so in some special circumstances > for features snprintf(9) does not support: buffer size or formatted > result longer than INT_MAX; invalid *nn$ field width or precision > specifiers. I don't think either case applies to these strings, > although I did not read all of them thoroughly.) I have no problem to revert this change for FreeBSD if it is there impossible (and hopefully gcc 10 knows about this in case someone builds the userland stack with gcc 10 on FreeBSD). In the posix specification I don't see this. For FreeBSD, it would be great to update the man page, which currently states RETURN VALUES These functions return the number of characters printed (not = including the trailing `\0' used to end output to strings), except for = snprintf() and vsnprintf(), which return the number of characters that would = have been printed if the size were unlimited (again, not including the = final `\0'). These functions return a negative value if an error occurs. So it would be great to be specific about when an error occurs in the last sentence. Best regards Michael >=20 > On Mon, May 18, 2020 at 8:38 AM Conrad Meyer wrote: >>=20 >> Hi Michael, >>=20 >> These changes are a bit odd. The only reason a standards-compliant >> snprintf() would fail to nul-terminate a buffer is if the provided >> buffer had length zero. Since this is not the case in any of these >> uses, I wonder why this revision was made? Does a SCTP downstream >> have a broken snprintf implementation, and if so, wouldn't it make >> more sense to create a standards-compliant portability shim for that >> platform instead of this more invasive change? >>=20 >> FreeBSD's snprintf(9) does not have this bug, nor does its = snprintf(3). >>=20 >> Best regards, >> Conrad >>=20 >> On Mon, May 18, 2020 at 3:07 AM Michael Tuexen = wrote: >>>=20 >>> Author: tuexen >>> Date: Mon May 18 10:07:01 2020 >>> New Revision: 361209 >>> URL: https://svnweb.freebsd.org/changeset/base/361209 >>>=20 >>> Log: >>> Handle failures of snprintf(). >>>=20 >>> MFC after: 3 days >>>=20 >>> Modified: >>> head/sys/netinet/sctp_asconf.c >>> head/sys/netinet/sctp_indata.c >>> head/sys/netinet/sctp_input.c >>> head/sys/netinet/sctp_output.c >>> head/sys/netinet/sctp_pcb.c >>>=20 >>> Modified: head/sys/netinet/sctp_asconf.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int = offset, >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got = unexpected next serial number! Aborting asoc!\n"); >>> - snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", >>> - serial_num); >>> + if (snprintf(msg, sizeof(msg), "Never sent serial = number %8.8x", serial_num) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> *abort_no_unlock =3D 1; >>>=20 >>> Modified: head/sys/netinet/sctp_indata.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, >>> struct mbuf *oper; >>>=20 >>> if (stcb->asoc.idata_supported) { >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "Reass = %x,CF:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%8.8x,MID:%8.8x", >>> opspot, >>> control->fsn_included, >>> chk->rec.data.tsn, >>> chk->rec.data.sid, >>> - chk->rec.data.fsn, chk->rec.data.mid); >>> + chk->rec.data.fsn, chk->rec.data.mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "Reass = %x,CI:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%4.4x,SSN:%4.4x", >>> opspot, >>> control->fsn_included, >>> chk->rec.data.tsn, >>> chk->rec.data.sid, >>> chk->rec.data.fsn, >>> - (uint16_t)chk->rec.data.mid); >>> + (uint16_t)chk->rec.data.mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> oper =3D sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, = msg); >>> sctp_m_freem(chk->data); >>> @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >>> */ >>> TAILQ_INSERT_HEAD(&strm->inqueue, control, = next_instrm); >>> if (asoc->idata_supported) { >>> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> strm->last_mid_delivered, = control->sinfo_tsn, >>> - control->sinfo_stream, control->mid); >>> + control->sinfo_stream, control->mid) < = 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> (uint16_t)strm->last_mid_delivered, >>> control->sinfo_tsn, >>> control->sinfo_stream, >>> - (uint16_t)control->mid); >>> + (uint16_t)control->mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; >>> @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >>> * to put it on the queue. >>> */ >>> if (sctp_place_control_in_stream(strm, asoc, = control)) { >>> - snprintf(msg, sizeof(msg), >>> - "Queue to str MID: %u duplicate", >>> - control->mid); >>> + if (snprintf(msg, sizeof(msg), >>> + "Queue to str MID: %u duplicate", = control->mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> sctp_clean_up_control(stcb, control); >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; >>> @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * can *not* be fsn 0. XXX: This can happen in case = of a >>> * wrap around. Ignore is for now. >>> */ >>> - snprintf(msg, sizeof(msg), "FSN zero for MID=3D%8.8x, = but flags=3D%2.2x", >>> - mid, chk_flags); >>> + if (snprintf(msg, sizeof(msg), "FSN zero for = MID=3D%8.8x, but flags=3D%2.2x", mid, chk_flags) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> control =3D sctp_find_reasm_entry(&asoc->strmin[sid], mid, = ordered, asoc->idata_supported); >>> @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> if (control !=3D NULL) { >>> /* We found something, does it belong? */ >>> if (ordered && (mid !=3D control->mid)) { >>> - snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid); >>> + if (snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> err_out: >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; >>> @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * We can't have a switched order = with an >>> * unordered chunk >>> */ >>> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >>> - tsn); >>> + if (snprintf(msg, sizeof(msg), >>> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >>> + tsn) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> if (!ordered && (((control->sinfo_flags >> 8) = & SCTP_DATA_UNORDERED) =3D=3D 0)) { >>> @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * We can't have a switched unordered = with a >>> * ordered chunk >>> */ >>> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >>> - tsn); >>> + if (snprintf(msg, sizeof(msg), >>> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >>> + tsn) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> } >>> @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> if (ordered || asoc->idata_supported) { >>> SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: = 0x%x dup detected on MID: %u\n", >>> chk_flags, mid); >>> - snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid); >>> + if (snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } else { >>> if ((tsn =3D=3D control->fsn_included = + 1) && >>> (control->end_added =3D=3D 0)) { >>> - snprintf(msg, sizeof(msg), = "Illegal message sequence, missing end for MID: %8.8x", = control->fsn_included); >>> + if (snprintf(msg, = sizeof(msg), >>> + "Illegal message = sequence, missing end for MID: %8.8x", >>> + control->fsn_included) < = 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } else { >>> control =3D NULL; >>> @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> mid, asoc->strmin[sid].last_mid_delivered); >>>=20 >>> if (asoc->idata_supported) { >>> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> asoc->strmin[sid].last_mid_delivered, >>> tsn, >>> sid, >>> - mid); >>> + mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> = (uint16_t)asoc->strmin[sid].last_mid_delivered, >>> tsn, >>> sid, >>> - (uint16_t)mid); >>> + (uint16_t)mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; >>> @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated"); >>> + if (snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated") < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; >>> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >>> @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s", "DATA chunk = received when I-DATA was negotiated"); >>> + if (snprintf(msg, sizeof(msg), "%s", "DATA = chunk received when I-DATA was negotiated") < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; >>> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >>> @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s chunk = of length %u", >>> + if (snprintf(msg, sizeof(msg), "%s = chunk of length %u", >>> ch->chunk_type =3D=3D SCTP_DATA ? = "DATA" : "I-DATA", >>> - chk_length); >>> + chk_length) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; >>> sctp_abort_an_association(inp, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), = "DATA chunk followed by chunk of type %2.2x", >>> - ch->chunk_type); >>> + if (snprintf(msg, = sizeof(msg), "DATA chunk followed by chunk of type %2.2x", >>> + ch->chunk_type) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> = sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); >>> return (2); >>> @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), = "Chunk of length %u", >>> - chk_length); >>> + if (snprintf(msg, = sizeof(msg), "Chunk of length %u", chk_length) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> = stcb->sctp_ep->last_abort_code =3D SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; >>> = sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); >>> @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb = *stcb, uint32 >>>=20 >>> *abort_now =3D 1; >>> /* XXX */ >>> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >>> - cumack, send_s); >>> + if (snprintf(msg, sizeof(msg), >>> + "Cum ack %8.8x greater or equal than TSN %8.8x", >>> + cumack, send_s) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int = offset_seg, int o >>> hopeless_peer: >>> *abort_now =3D 1; >>> /* XXX */ >>> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >>> - cum_ack, send_s); >>> + if (snprintf(msg, sizeof(msg), >>> + "Cum ack %8.8x greater or equal than TSN %8.8x", >>> + cum_ack, send_s) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb = *stcb, >>> * give out). This must be an attacker. >>> */ >>> *abort_flag =3D 1; >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "New cum ack %8.8x too high, highest TSN = %8.8x", >>> - new_cum_tsn, = asoc->highest_tsn_inside_map); >>> + new_cum_tsn, = asoc->highest_tsn_inside_map) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; >>> sctp_abort_an_association(stcb->sctp_ep, = stcb, op_err, SCTP_SO_NOT_LOCKED); >>>=20 >>> Modified: head/sys/netinet/sctp_input.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >>> } >>> } >>> if (stcb =3D=3D NULL) { >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> /* no association, so it's out of the blue... = */ >>> @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >>> if (stcb !=3D NULL) { >>> SCTP_TCB_UNLOCK(stcb); >>> } >>> - snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), = "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, *offset, = src, dst, >>> @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> SCTP_TCB_UNLOCK(stcb); >>> stcb =3D NULL; >>> SCTP_PROBE5(receive, NULL, stcb, m, stcb, = sh); >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>> @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> if (stcb =3D=3D NULL) { >>> /* out of the blue DATA chunk */ >>> SCTP_PROBE5(receive, NULL, NULL, m, NULL, = sh); >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>> @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> /* >>> * We consider OOTB any data sent during asoc = setup. >>> */ >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>>=20 >>> Modified: head/sys/netinet/sctp_output.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -5581,7 +5581,9 @@ do_a_abort: >>> if (op_err =3D=3D NULL) { >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> } >>> @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, = struct s >>> char = msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> abort_anyway: >>> - snprintf(msg, = sizeof(msg), >>> - "%s:%d at %s", = __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, = sizeof(msg), >>> + "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D = '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = atomic_add_int(&stcb->asoc.refcnt, 1); >>> @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb = *inp, >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >>> - chk->rec.data.tsn, chk->snd_count); >>> + if (snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >>> + chk->rec.data.tsn, chk->snd_count) < 0) = { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> atomic_add_int(&stcb->asoc.refcnt, 1); >>> @@ -13610,8 +13616,10 @@ dataless_eof: >>> = atomic_add_int(&stcb->asoc.refcnt, -1); >>> free_cnt_applied =3D = 0; >>> } >>> - snprintf(msg, sizeof(msg), >>> - "%s:%d at %s", __FILE__, = __LINE__, __func__); >>> + if (snprintf(msg, = sizeof(msg), >>> + "%s:%d at %s", __FILE__, = __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> NET_EPOCH_ENTER(et); >>>=20 >>> Modified: head/sys/netinet/sctp_pcb.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void = *ifn, uint3 >>> atomic_add_int(&vrf->refcount, 1); >>> sctp_ifnp->ifn_mtu =3D = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); >>> if (if_name !=3D NULL) { >>> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", if_name); >>> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", if_name) < 0) { >>> + sctp_ifnp->ifn_name[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", "unknown"); >>> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", "unknown") < 0) { >>> + sctp_ifnp->ifn_name[0] =3D '\0'; >>> + } >>> } >>> hash_ifn_head =3D = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & = SCTP_BASE_INFO(vrf_ifn_hashmark))]; >>> LIST_INIT(&sctp_ifnp->ifalist); >>> @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >>> * in setup = state we >>> * abort this = guy >>> */ >>> - = snprintf(msg, sizeof(msg), >>> - "%s:%d = at %s", __FILE__, __LINE__, __func__); >>> + if = (snprintf(msg, sizeof(msg), >>> + "%s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + = msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = sctp_abort_an_association(stcb_tmp->sctp_ep, >>> @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >>> * in setup = state we >>> * abort this = guy >>> */ >>> - = snprintf(msg, sizeof(msg), >>> - "%s:%d = at %s", __FILE__, __LINE__, __func__); >>> + if = (snprintf(msg, sizeof(msg), >>> + "%s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + = msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Mon May 18 18:23:31 2020 Return-Path: Delivered-To: svn-src-head@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 34EE32D9CD2; Mon, 18 May 2020 18:23:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QnSy6CBjz47wX; Mon, 18 May 2020 18:23:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f176.google.com with SMTP id l6so4004908oic.9; Mon, 18 May 2020 11:23:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=XJAmKW9HwsEuori9FroHRrGEb9ZBoppojCR3qtAOXiQ=; b=eTeZNe7FgZEjZEJRPsJdOeyBdx3tTgGw8BummbgEavyPoFF1zzkbnba9084cpJc0l4 F/NAYMZ/QFeOkekHRT/iZznoC5nc4tWGQYZS2m9/ZsZTIwh0ZNM1hKk6M+OhJ06Zcb6y KvCLaCtEapa4Zi2zUn3kqMh1z5mGpHG+1sQxN7pTOFMHRTVRs09hU2qQNuBhArO0i/TG gEqQzF//ZQCxbGGqzG+WzQsabCS9TeFveNu4cfQp4rE1ikjkMhWB3nTEEWJ37HBbP/LT +SOhGoub6GFCvTEdAQn0C3MeKx7OfusQ0JoXsMx9WGfr3fv9F3VouaD/Ueig5owjzCUx JIQQ== X-Gm-Message-State: AOAM532jjaliexO01nr5gW/csWrYFqmMjWlk9t/3lyLZCZqwInA1xvR7 1vRE0EZeYo9OQpxHJnTwivkCPDOt X-Google-Smtp-Source: ABdhPJx/JrbRyL7DD+KDr7z7WJKDmRBmrz1PURThCl9CYzlmgk+QZpd7gvbGcfYY+7cL1qC+sv8sXw== X-Received: by 2002:aca:fd14:: with SMTP id b20mr512039oii.14.1589826209357; Mon, 18 May 2020 11:23:29 -0700 (PDT) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com. [209.85.167.177]) by smtp.gmail.com with ESMTPSA id k69sm945706oib.26.2020.05.18.11.23.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 11:23:29 -0700 (PDT) Received: by mail-oi1-f177.google.com with SMTP id 19so9884796oiy.8; Mon, 18 May 2020 11:23:28 -0700 (PDT) X-Received: by 2002:aca:a854:: with SMTP id r81mr489211oie.81.1589826208690; Mon, 18 May 2020 11:23:28 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 11:23:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49QnSy6CBjz47wX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 18:23:31 -0000 On Mon, May 18, 2020 at 10:35 AM Michael Tuexen wrote: > > > On 18. May 2020, at 17:38, Conrad Meyer wrote: > > > > These changes are a bit odd. The only reason a standards-compliant > > snprintf() would fail to nul-terminate a buffer is if the provided > > buffer had length zero. Since this is not the case in any of these > > uses, I wonder why this revision was made? Does a SCTP downstream > > when compiling the code in userland with gcc 10, it warns that > the output might be truncated. That is true and intended. > So checking that the call doesn't fail silences this warning and > ensures the code works in case snprintf() returns an error. I don't > see in the POSIX specification a statement limiting the case where > it could fail. > > > have a broken snprintf implementation, and if so, wouldn't it make > > more sense to create a standards-compliant portability shim for that > > platform instead of this more invasive change? > > If you want, I can revert the change and use the code only on non-FreeBSD > platforms. Hi Michael, If truncation is intended, the GCC warning is spurious. Given how often snprintf is used in this way, I wonder if it would make sense to just disable it across the entire tree. Regardless, IMO it makes sense to disable the warning, rather than make these changes to check for errors that can't happen. It does not even "fix" the thing GCC is warning about, since we aren't testing for truncation at all; it's just a warning defeat mechanism. -Wno- is a better warning-defeat mechanism. Re: documentation of snprintf nul-termination, I would look at this part of the FreeBSD manual page: The snprintf() and vsnprintf() functions will write at most size-1 of = the characters printed into the output string (the size'th character then gets the terminating =E2=80=98\0=E2=80=99); if the return value is gre= ater than or equal to the size argument, the string was too short and some of the printed characters were discarded. The output is always null-terminated, unle= ss size is 0. Note the last sentence especially. As far as error conditions, those are canonically documented in the ERRORS section of the manual page rather than RETURN VALUES. For whatever reason, mdoc(7) standard puts EXAMPLES between the two sections, and additionally snprintf.3 has a non-standard COMPATIBILITY section between the two, so they are not directly adjacent. Here's that section, though: ERRORS In addition to the errors documented for the write(2) system call, the printf() family of functions may fail if: [EILSEQ] An invalid wide character code was encountered. [ENOMEM] Insufficient storage space is available. [EOVERFLOW] The size argument exceeds INT_MAX + 1, or the retur= n value would be too large to be represented by an in= t. The section is unfortunately generalized and non-specific; snprintf probably cannot fail with ENOMEM, for example, nor write(2) errors. But EOVERFLOW is well-documented. Re: POSIX definition, POSIX is not the canonical definition of snprintf; the C standard is. C (2018) reads: > If n is zero, nothing shall be written and s may be a null pointer. Other= wise, output bytes beyond the n-1st shall be discarded instead of being wri= tten to the array, and a null byte is written at the end of the bytes actua= lly written into the array. Emphasis on the last clause. (POSIX uses the exact same language.) As far as conditions where snprintf may fail, POSIX only defines a single case (covered in snprintf.3 above): > The snprintf() function shall fail if: [EOVERFLOW], The value of n is gre= ater than INT_MAX. That is not the case in any of these invocations. Probably snprintf(9) should be specifically documented; printf(9) does not cover it yet. This is a documentation gap. Additionally, the COMPATIBILITY section of snprintf.3 should probably be moved to STANDARDS (to help move ERRORS and RETURN VALUES closer together). Finally, it might be nice to have kernel snprintf(9) _Static_assert that the provided length is shorter than INT_MAX (when it is a compiler constant, and detect non-constant cases at runtime). Currently, snprintf(9) fails to detect buffers that would produce a result which overflows. Best regards, Conrad From owner-svn-src-head@freebsd.org Mon May 18 18:27:11 2020 Return-Path: Delivered-To: svn-src-head@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 2E78E2DA10A; Mon, 18 May 2020 18:27:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QnYC0VNHz48MQ; Mon, 18 May 2020 18:27:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C38125CB8; Mon, 18 May 2020 18:27:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IIRAeP098713; Mon, 18 May 2020 18:27:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIRAi6098712; Mon, 18 May 2020 18:27:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181827.04IIRAi6098712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361221 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 18:27:11 -0000 Author: tuexen Date: Mon May 18 18:27:10 2020 New Revision: 361221 URL: https://svnweb.freebsd.org/changeset/base/361221 Log: Remove redundant check. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 16:47:44 2020 (r361220) +++ head/sys/netinet/sctp_asconf.c Mon May 18 18:27:10 2020 (r361221) @@ -3026,10 +3026,6 @@ sctp_check_address_list_ep(struct sctp_tcb *stcb, stru "check_addr_list_ep: laddr->ifa is NULL"); continue; } - if (laddr->ifa == NULL) { - SCTPDBG(SCTP_DEBUG_ASCONF1, "check_addr_list_ep: laddr->ifa->ifa_addr is NULL"); - continue; - } /* do i have it implicitly? */ if (sctp_cmpaddr(&laddr->ifa->address.sa, init_addr)) { continue; From owner-svn-src-head@freebsd.org Mon May 18 18:32:59 2020 Return-Path: Delivered-To: svn-src-head@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 A95A32DA4A7; Mon, 18 May 2020 18:32:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qngv31T6z48v2; Mon, 18 May 2020 18:32:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62C8925CD8; Mon, 18 May 2020 18:32:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IIWxQC004696; Mon, 18 May 2020 18:32:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIWxcD004695; Mon, 18 May 2020 18:32:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181832.04IIWxcD004695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361222 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 18:32:59 -0000 Author: tuexen Date: Mon May 18 18:32:58 2020 New Revision: 361222 URL: https://svnweb.freebsd.org/changeset/base/361222 Log: Avoid an integer underflow. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 18:27:10 2020 (r361221) +++ head/sys/netinet/sctp_asconf.c Mon May 18 18:32:58 2020 (r361222) @@ -1797,9 +1797,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, } /* switch */ /* update remaining ASCONF-ACK message length to process */ - ack_length -= SCTP_SIZE32(param_length); - if (ack_length <= 0) { - /* no more data in the mbuf chain */ + if (ack_length > SCTP_SIZE32(param_length)) { + ack_length -= SCTP_SIZE32(param_length); + } else { break; } offset += SCTP_SIZE32(param_length); From owner-svn-src-head@freebsd.org Mon May 18 18:36:33 2020 Return-Path: Delivered-To: svn-src-head@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 8DAB92DA5BF; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qnm13GFbz49Yk; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B33325F6F; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IIaXJU005072; Mon, 18 May 2020 18:36:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIaWCJ005070; Mon, 18 May 2020 18:36:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005181836.04IIaWCJ005070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 May 2020 18:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361223 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 361223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 18:36:33 -0000 Author: asomers Date: Mon May 18 18:36:32 2020 New Revision: 361223 URL: https://svnweb.freebsd.org/changeset/base/361223 Log: fusefs: fix intermittency in some ENOENT tests When a FUSE operation other than LOOKUP returns ENOENT, the kernel will reclaim that vnode, resuling in a FUSE_FORGET being sent a short while later. Many of the ENOENT tests weren't expecting those FUSE_FORGET operations. They usually passed by luck since FUSE_FORGET is often delayed. This commit adds appropriate expectations. MFC after: 2 weeks Modified: head/tests/sys/fs/fusefs/getattr.cc head/tests/sys/fs/fusefs/open.cc head/tests/sys/fs/fusefs/opendir.cc Modified: head/tests/sys/fs/fusefs/getattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/getattr.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/getattr.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,6 +32,8 @@ extern "C" { #include + +#include } #include "mockfs.hh" @@ -172,7 +174,10 @@ TEST_F(Getattr, enoent) const char RELPATH[] = "some_file.txt"; struct stat sb; const uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { @@ -181,8 +186,15 @@ TEST_F(Getattr, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_GETATTR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + EXPECT_NE(0, stat(FULLPATH, &sb)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } TEST_F(Getattr, ok) Modified: head/tests/sys/fs/fusefs/open.cc ============================================================================== --- head/tests/sys/fs/fusefs/open.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/open.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -105,7 +107,10 @@ TEST_F(Open, enoent) const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -114,8 +119,15 @@ TEST_F(Open, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_OPEN returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + ASSERT_EQ(-1, open(FULLPATH, O_RDONLY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* Modified: head/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- head/tests/sys/fs/fusefs/opendir.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/opendir.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -82,12 +84,21 @@ TEST_F(Opendir, enoent) const char FULLPATH[] = "mountpoint/some_dir"; const char RELPATH[] = "some_dir"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(ENOENT)); + // Since FUSE_OPENDIR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); ASSERT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* From owner-svn-src-head@freebsd.org Mon May 18 18:42:43 2020 Return-Path: Delivered-To: svn-src-head@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 CB1572DA9A1; Mon, 18 May 2020 18:42:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qnv7572sz49wP; Mon, 18 May 2020 18:42:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB43725F8C; Mon, 18 May 2020 18:42:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IIghVY011030; Mon, 18 May 2020 18:42:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIghge011029; Mon, 18 May 2020 18:42:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181842.04IIghge011029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361224 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 18:42:43 -0000 Author: tuexen Date: Mon May 18 18:42:43 2020 New Revision: 361224 URL: https://svnweb.freebsd.org/changeset/base/361224 Log: Cleanup, no functional change intended. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon May 18 18:36:32 2020 (r361223) +++ head/sys/netinet/sctp_pcb.c Mon May 18 18:42:43 2020 (r361224) @@ -5203,16 +5203,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE, SCTP_CALLED_DIRECTLY_NOCMPSET); SCTP_INP_DECR_REF(inp); - goto out_of; } else { /* The socket is still open. */ SCTP_INP_DECR_REF(inp); + SCTP_INP_RUNLOCK(inp); } } - if (from_inpcbfree == SCTP_NORMAL_PROC) { - SCTP_INP_RUNLOCK(inp); - } -out_of: /* destroyed the asoc */ #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 11); From owner-svn-src-head@freebsd.org Mon May 18 19:05:43 2020 Return-Path: Delivered-To: svn-src-head@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 3DAE72DAD48; Mon, 18 May 2020 19:05:43 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QpPf660Zz4CJq; Mon, 18 May 2020 19:05:42 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id ED7477220F406; Mon, 18 May 2020 21:05:38 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 21:05:38 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QpPf660Zz4CJq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 19:05:43 -0000 > On 18. May 2020, at 20:23, Conrad Meyer wrote: >=20 > On Mon, May 18, 2020 at 10:35 AM Michael Tuexen = wrote: >>=20 >>> On 18. May 2020, at 17:38, Conrad Meyer wrote: >>>=20 >>> These changes are a bit odd. The only reason a standards-compliant >>> snprintf() would fail to nul-terminate a buffer is if the provided >>> buffer had length zero. Since this is not the case in any of these >>> uses, I wonder why this revision was made? Does a SCTP downstream >>=20 >> when compiling the code in userland with gcc 10, it warns that >> the output might be truncated. That is true and intended. >> So checking that the call doesn't fail silences this warning and >> ensures the code works in case snprintf() returns an error. I don't >> see in the POSIX specification a statement limiting the case where >> it could fail. >>=20 >>> have a broken snprintf implementation, and if so, wouldn't it make >>> more sense to create a standards-compliant portability shim for that >>> platform instead of this more invasive change? >>=20 >> If you want, I can revert the change and use the code only on = non-FreeBSD >> platforms. >=20 > Hi Michael, >=20 > If truncation is intended, the GCC warning is spurious. Given how > often snprintf is used in this way, I wonder if it would make sense to > just disable it across the entire tree. Regardless, IMO it makes The issue wasn't reported against the kernel code, but running the code in userland. I don't really control the flags people are using. > sense to disable the warning, rather than make these changes to check > for errors that can't happen. It does not even "fix" the thing GCC is OK. I'll revert this change and replace it upstream by something like #if defined(__FreeBSD_) snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) #else if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) < 0) { msg[0] =3D '\0'; } #endif I don't know if other platforms guarantee that snprintf() can't fail. If it fails, the stack would send out un-initialized stack memory on the network. > warning about, since we aren't testing for truncation at all; it's > just a warning defeat mechanism. -Wno- is a better warning-defeat > mechanism. >=20 > Re: documentation of snprintf nul-termination, I would look at this > part of the FreeBSD manual page: >=20 > The snprintf() and vsnprintf() functions will write at most size-1 = of the > characters printed into the output string (the size'th character = then > gets the terminating =E2=80=98\0=E2=80=99); if the return value is = greater than or equal > to the size argument, the string was too short and some of the = printed > characters were discarded. The output is always null-terminated, = unless > size is 0. >=20 > Note the last sentence especially. As far as error conditions, those > are canonically documented in the ERRORS section of the manual page > rather than RETURN VALUES. For whatever reason, mdoc(7) standard puts > EXAMPLES between the two sections, and additionally snprintf.3 has a > non-standard COMPATIBILITY section between the two, so they are not > directly adjacent. Here's that section, though: >=20 > ERRORS > In addition to the errors documented for the write(2) system call, = the > printf() family of functions may fail if: >=20 > [EILSEQ] An invalid wide character code was encountered. >=20 > [ENOMEM] Insufficient storage space is available. >=20 > [EOVERFLOW] The size argument exceeds INT_MAX + 1, or the = return > value would be too large to be represented by = an int. >=20 > The section is unfortunately generalized and non-specific; snprintf > probably cannot fail with ENOMEM, for example, nor write(2) errors. > But EOVERFLOW is well-documented. >=20 > Re: POSIX definition, POSIX is not the canonical definition of > snprintf; the C standard is. C (2018) reads: >=20 >> If n is zero, nothing shall be written and s may be a null pointer. = Otherwise, output bytes beyond the n-1st shall be discarded instead of = being written to the array, and a null byte is written at the end of the = bytes actually written into the array. >=20 > Emphasis on the last clause. (POSIX uses the exact same language.) > As far as conditions where snprintf may fail, POSIX only defines a > single case (covered in snprintf.3 above): >=20 >> The snprintf() function shall fail if: [EOVERFLOW], The value of n is = greater than INT_MAX. >=20 > That is not the case in any of these invocations. Just to be clear: My problem is NOT that the output is not zero = terminated. I use snprintf() in a way that it is, if it does not fail. I was just adding protection code for the case it fails and leaves the buffer uninitialized. since I don't want so sent out uninitialized stack = memory. I learnt that on FreeBSD this is not a problem and I'll remove that = protection code for this platform. Best regards Michael >=20 > Probably snprintf(9) should be specifically documented; printf(9) does > not cover it yet. This is a documentation gap. Additionally, the > COMPATIBILITY section of snprintf.3 should probably be moved to > STANDARDS (to help move ERRORS and RETURN VALUES closer together). > Finally, it might be nice to have kernel snprintf(9) _Static_assert > that the provided length is shorter than INT_MAX (when it is a > compiler constant, and detect non-constant cases at runtime). > Currently, snprintf(9) fails to detect buffers that would produce a > result which overflows. >=20 > Best regards, > Conrad From owner-svn-src-head@freebsd.org Mon May 18 19:23:02 2020 Return-Path: Delivered-To: svn-src-head@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 901572DB344; Mon, 18 May 2020 19:23:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qpnf2sxdz4D8X; Mon, 18 May 2020 19:23:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD8226880; Mon, 18 May 2020 19:23:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IJN2OU036352; Mon, 18 May 2020 19:23:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJN2uK036351; Mon, 18 May 2020 19:23:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181923.04IJN2uK036351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361225 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 19:23:02 -0000 Author: tuexen Date: Mon May 18 19:23:01 2020 New Revision: 361225 URL: https://svnweb.freebsd.org/changeset/base/361225 Log: Remove redundant assignment. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 18:42:43 2020 (r361224) +++ head/sys/netinet/sctputil.c Mon May 18 19:23:01 2020 (r361225) @@ -1144,7 +1144,6 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off; asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; - asoc->idata_supported = inp->idata_supported; asoc->auth_supported = inp->auth_supported; asoc->asconf_supported = inp->asconf_supported; asoc->reconfig_supported = inp->reconfig_supported; From owner-svn-src-head@freebsd.org Mon May 18 19:35:46 2020 Return-Path: Delivered-To: svn-src-head@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 E19192DBB9A; Mon, 18 May 2020 19:35:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qq4L5kpdz4F1s; Mon, 18 May 2020 19:35:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C004326667; Mon, 18 May 2020 19:35:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IJZkcb042934; Mon, 18 May 2020 19:35:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJZkWm042932; Mon, 18 May 2020 19:35:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181935.04IJZkWm042932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361226 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 19:35:46 -0000 Author: tuexen Date: Mon May 18 19:35:46 2020 New Revision: 361226 URL: https://svnweb.freebsd.org/changeset/base/361226 Log: Don't check an unsigned variable for being negative. MFC after: 3 days. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon May 18 19:23:01 2020 (r361225) +++ head/sys/netinet/sctp_usrreq.c Mon May 18 19:35:46 2020 (r361226) @@ -1042,7 +1042,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, struct sctp_vrf *vrf; actual = 0; - if (limit <= 0) + if (limit == 0) return (actual); if (stcb) { From owner-svn-src-head@freebsd.org Mon May 18 19:48:39 2020 Return-Path: Delivered-To: svn-src-head@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 1838F2DBF94; Mon, 18 May 2020 19:48:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QqMB70mwz4FRb; Mon, 18 May 2020 19:48:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E81BD26D2B; Mon, 18 May 2020 19:48:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IJmclp049128; Mon, 18 May 2020 19:48:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJmcpb049127; Mon, 18 May 2020 19:48:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181948.04IJmcpb049127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361227 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 19:48:39 -0000 Author: tuexen Date: Mon May 18 19:48:38 2020 New Revision: 361227 URL: https://svnweb.freebsd.org/changeset/base/361227 Log: Remove assignment without effect. MFC after: 3 days Modified: head/sys/netinet/sctp_auth.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Mon May 18 19:35:46 2020 (r361226) +++ head/sys/netinet/sctp_auth.c Mon May 18 19:48:38 2020 (r361227) @@ -658,7 +658,6 @@ sctp_free_hmaclist(sctp_hmaclist_t *list) { if (list != NULL) { SCTP_FREE(list, SCTP_M_AUTH_HL); - list = NULL; } } From owner-svn-src-head@freebsd.org Mon May 18 20:17:44 2020 Return-Path: Delivered-To: svn-src-head@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 834302DC27C; Mon, 18 May 2020 20:17:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qr0m2sVfz4Hs8; Mon, 18 May 2020 20:17:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f195.google.com with SMTP id y85so5436422oie.11; Mon, 18 May 2020 13:17:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=Ms4jPGP6m/mR1GU56bT9w5r+eAlcTC552LBh1ggWsOk=; b=ig2/7FoeXSDCijkbHrOFLjmETDnTwM3K75BsZFRahAAOHdS+ZB4OOOdpvbZNz6XT+o BycTi8k6WLm6MWWJtG1VELZB88PxWFuOWZ0pxhKiqksgjAXW0wOxKdvCohDjd8bVCmxX SvFauCWSf4tybEfmjUy3PQSI1VCEtcoh08PbwbSIdehfAJgP6rE3i7bBVBrzr7IA2roi TfUen+CY/lleWzJCfBfDgN82QwZZLm5rLNDD4dcqrRAhnroxMA53oTAjzbpyPsqo7+M8 M1bQ6Pe3zRD72PYAjm2HPo3LGPFs/GieoQ0P8JZ50kmwPYfmMnJnn9QKxlWahANGcnCt uCjw== X-Gm-Message-State: AOAM531gWJYrBX6vgqn6r5KMgBFgOk2nyeHyIX14lxI12bEI80OS0QrB E66Vd1ktIbnt8SrDtri80KV40j97 X-Google-Smtp-Source: ABdhPJz0yE74wa0vS9ghTLPsnV//NkKZE8iOcsEU/cQmgtzw+sqmU0oQsoSa6A7ZbDqGcjJ+Sph1MA== X-Received: by 2002:a05:6808:282:: with SMTP id z2mr745841oic.101.1589833062983; Mon, 18 May 2020 13:17:42 -0700 (PDT) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com. [209.85.210.45]) by smtp.gmail.com with ESMTPSA id l196sm3361018oih.25.2020.05.18.13.17.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 13:17:42 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id f18so5165457otq.11; Mon, 18 May 2020 13:17:42 -0700 (PDT) X-Received: by 2002:a9d:70ca:: with SMTP id w10mr4086878otj.216.1589833061839; Mon, 18 May 2020 13:17:41 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> In-Reply-To: <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 13:17:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49Qr0m2sVfz4Hs8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 20:17:44 -0000 Hi Michael, On Mon, May 18, 2020 at 12:05 PM Michael Tuexen wrote: > > > On 18. May 2020, at 20:23, Conrad Meyer wrote: > > > If truncation is intended, the GCC warning is spurious. Given how > > often snprintf is used in this way, I wonder if it would make sense to > > just disable it across the entire tree. Regardless, IMO it makes > > The issue wasn't reported against the kernel code, but running the code > in userland. I don't really control the flags people are using. Sure. You can certainly ignore user reports corresponding to bogus flags, though, and encourage use of various flags. > OK. I'll revert this change and replace it upstream by something like > > #if defined(__FreeBSD_) > snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", seri= al_num) > #else > if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) < 0) { > msg[0] =3D '\0'; > } > #endif This seems like a messy solution. I'd suggest either putting unconditional "msg[0] =3D '\0';" before snprintf() invocations, or defining an snprintf wrapper function for non-FreeBSD platforms and using it universally. > I don't know if other platforms guarantee that snprintf() can't fail. > If it fails, the stack would send out un-initialized stack memory on > the network. Sure, that's a good concern. That said, Glibc: https://github.com/bminor/glibc/blob/5f72f9800b250410cad3abfeeb09469= ef12b2438/libio/vsnprintf.c#L93-L114 (always nul terminates) MS: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprin= tf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=3Dvs-2019 ("The snprintf function always stores a terminating null character=E2=80=A6= ") OpenBSD: https://github.com/openbsd/src/blob/master/lib/libc/stdio/vsnprint= f.c#L60-L63 (always nul terminates) NetBSD: https://github.com/NetBSD/src/blob/trunk/lib/libc/stdio/vsnprintf.c= #L97-L101 (always nul terminates) Linux (kernel): https://elixir.bootlin.com/linux/latest/source/lib/vsprintf.c#L2645 (always nul terminates) None of these are conditional on error status. The only exception I found is musl libc, and in that it is a case you cannot encounter here (size > INT_MAX). Arguably this is a bug in musl libc. I did not dive deeper into musl and determine whether other errors were nul terminated or not. Conrad P.S., It seems dubious to be sending diagnostic formatted error messages out across the network. From owner-svn-src-head@freebsd.org Mon May 18 20:43:36 2020 Return-Path: Delivered-To: svn-src-head@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 2BEF62DD330; Mon, 18 May 2020 20:43:36 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QrZb2l5tz4Kfg; Mon, 18 May 2020 20:43:35 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id A373B7220F40F; Mon, 18 May 2020 22:43:27 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 22:43:27 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QrZb2l5tz4Kfg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 20:43:36 -0000 > On 18. May 2020, at 22:17, Conrad Meyer wrote: >=20 > Hi Michael, >=20 > On Mon, May 18, 2020 at 12:05 PM Michael Tuexen = wrote: >>=20 >>> On 18. May 2020, at 20:23, Conrad Meyer wrote: >>=20 >>> If truncation is intended, the GCC warning is spurious. Given how >>> often snprintf is used in this way, I wonder if it would make sense = to >>> just disable it across the entire tree. Regardless, IMO it makes >>=20 >> The issue wasn't reported against the kernel code, but running the = code >> in userland. I don't really control the flags people are using. >=20 > Sure. You can certainly ignore user reports corresponding to bogus > flags, though, and encourage use of various flags. I could, but decided to improve the situation for some people, but wasn't realising that I made it worse for others. Sorry about that. >=20 >> OK. I'll revert this change and replace it upstream by something like >>=20 >> #if defined(__FreeBSD_) >> snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) >> #else >> if (snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", serial_num) < 0) { >> msg[0] =3D '\0'; >> } >> #endif >=20 > This seems like a messy solution. I'd suggest either putting > unconditional "msg[0] =3D '\0';" before snprintf() invocations, or That would assume that in case of an error the first byte is overwitten. > defining an snprintf wrapper function for non-FreeBSD platforms and > using it universally. Yeah, one can use a Macro SCTP_SNPRINTF(). Let me see... >=20 >> I don't know if other platforms guarantee that snprintf() can't fail. >> If it fails, the stack would send out un-initialized stack memory on >> the network. >=20 > Sure, that's a good concern. That said, >=20 > Glibc: = https://github.com/bminor/glibc/blob/5f72f9800b250410cad3abfeeb09469ef12b2= 438/libio/vsnprintf.c#L93-L114 > (always nul terminates) > MS: = https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-= snprintf-snprintf-l-snwprintf-snwprintf-l?view=3Dvs-2019 > ("The snprintf function always stores a terminating null = character=E2=80=A6") > OpenBSD: = https://github.com/openbsd/src/blob/master/lib/libc/stdio/vsnprintf.c#L60-= L63 > (always nul terminates) > NetBSD: = https://github.com/NetBSD/src/blob/trunk/lib/libc/stdio/vsnprintf.c#L97-L1= 01 > (always nul terminates) > Linux (kernel): > https://elixir.bootlin.com/linux/latest/source/lib/vsprintf.c#L2645 > (always nul terminates) >=20 > None of these are conditional on error status. >=20 > The only exception I found is musl libc, and in that it is a case you > cannot encounter here (size > INT_MAX). Arguably this is a bug in > musl libc. I did not dive deeper into musl and determine whether > other errors were nul terminated or not. >=20 > Conrad >=20 > P.S., It seems dubious to be sending diagnostic formatted error > messages out across the network. It was and still is very helpful when debuging interop problems if you = only have access to a tracefile and can't change the running code. Like people asking you = why is your implementation sending back an ABORT when it sees this packet. Best regards Michael= From owner-svn-src-head@freebsd.org Mon May 18 20:48:18 2020 Return-Path: Delivered-To: svn-src-head@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 EFCA12DD34D for ; Mon, 18 May 2020 20:48:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.ore.mailhop.org [44.233.67.66]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49Qrh238LZz4L5h for ; Mon, 18 May 2020 20:48:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1589834891; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Dcyv6QRdKP1lhYHxuZ9ebei0B+2eZNgBvsQP+w7S1lD/Ur5a6F51zybC0fTREcLqrtFjz+P1YA/z6 CbcwTuB2uKPyPfAb5uqCcpmQQU4in/VgtN/l82v17G9SzgScaIm49KI595q2q1p76wGYdF8E8D96Ab WwUayx3wI7mys0ABj1MOjrNRaTQT4lTQcpapOZoAz8hp4+T94tPm/IBUuQ9hwBTLlHaa7Owmh96nrH fV51zmJ2vHwiGB3pXb4zatmVlRlCSyWQ4BDg1kC/X53ldLT1AgsxlNZHPx+BKbnPrFPt2ybmpLp4PS zlgoN0lBNVTfcDlaSrv1Da2Lo+XmWsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=JJeT2QWE78kcllOuHXm5k4PCPYPZc5qZfhiUEkKlYB0=; b=S+ajCtmts8upMBxXSunNiO+I56EirmX5y4kU8HEvfDET6llBI3VZ50+taVb30RS7GDoIpmEmlxBWn tXdnMbhTMvOOw2yD0ENc2kfY5NiXHsH4sOIHSe2dRL+F5EQNJaDaIHY3+OaVYygFIlqVY0dhBrHDNu 4uyp3KuSxH+4r7QWCTW3R+Ibe7LdEv1+j2rLejF4iFON/vhEqBeirFqN5JEoSsWVmiFwxX2tcEC0u/ zPTBamkbfALlYBAxPyKpxxti5YkxVtg9cYxjC+CuhPZWFgnSYDUdkhgJRmdUpCMLhPhtdZBO6BL2DN GRyAq9Jnb1LjdIm3uq2MfseEuMyoUkQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=JJeT2QWE78kcllOuHXm5k4PCPYPZc5qZfhiUEkKlYB0=; b=hmKuZSF7Y/WF5sXoqG2icxEMcUsC6iIuMMCSzo51qsegcNwCQxesPrOAQTlVU2s9yhh8P6hYnOdi6 W8ja/5o0ue7Wqw3CrWiFEiB/H1JMiRravFIWRWC9c95exUMYSb44KpN2WpOFE8KtVfA4HR3ATtRGnN Yq0i0raHO9JpG4Zie/8e8ykJvfFnTafJ0T1Bi2i+/w+QeBagD63HqxzUQZYLrQN/32efrEElgNNsMi hxb4IdAJVhVMBMKLPbDlim9t2UyFLBG1DAk32Lf93ax0S7pKWB0ny1eyynF9M3iW19KVZBFh163FA5 OpelbLPXnG+UTyBAkzmA8k0k3F0n1Hg== X-MHO-RoutePath: aGlwcGll X-MHO-User: e1d5a179-9948-11ea-b10c-b5956a7dd1a1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id e1d5a179-9948-11ea-b10c-b5956a7dd1a1; Mon, 18 May 2020 20:48:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04IKm9KK003227; Mon, 18 May 2020 14:48:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> Subject: Re: svn commit: r361209 - head/sys/netinet From: Ian Lepore To: Michael Tuexen , cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head Date: Mon, 18 May 2020 14:48:09 -0600 In-Reply-To: References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49Qrh238LZz4L5h X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 20:48:19 -0000 On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: > > Sure. You can certainly ignore user reports corresponding to bogus > > flags, though, and encourage use of various flags. > > I could, but decided to improve the situation for some people, but > wasn't realising that I made it worse for others. Sorry about that. I'm trying to figure out why your original commit was a problem. I understand why it was questioned, but once the answer came out, it's clear that the code you originally committed does what it's supposed to without any harmful side effects. Sure, freebsd doesn't strictly need it, but the code is shared among projects, so what's the harm in the extra check that helps other projects sharing the code? It's certainly a lot less confusion and code clutter than any of the "remedies" that have been discussed. -- Ian From owner-svn-src-head@freebsd.org Mon May 18 21:01:17 2020 Return-Path: Delivered-To: svn-src-head@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 2214D2DD3F0; Mon, 18 May 2020 21:01:17 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qrz05WYBz4MPy; Mon, 18 May 2020 21:01:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id E0E137220F411; Mon, 18 May 2020 23:01:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> Date: Mon, 18 May 2020 23:01:13 +0200 Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49Qrz05WYBz4MPy X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 21:01:17 -0000 > On 18. May 2020, at 22:48, Ian Lepore wrote: >=20 > On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: >>> Sure. You can certainly ignore user reports corresponding to bogus >>> flags, though, and encourage use of various flags. >>=20 >> I could, but decided to improve the situation for some people, but >> wasn't realising that I made it worse for others. Sorry about that. >=20 > I'm trying to figure out why your original commit was a problem. I > understand why it was questioned, but once the answer came out, it's > clear that the code you originally committed does what it's supposed = to > without any harmful side effects. Sure, freebsd doesn't strictly need I guess the point Conrad is making, that on FreeBSD the check is not needed, since the call can not fail. So the FreeBSD code base would not be consistent: within the SCTP related code the return code is checked, in the other code it is not. > it, but the code is shared among projects, so what's the harm in the > extra check that helps other projects sharing the code? It's = certainly > a lot less confusion and code clutter than any of the "remedies" that > have been discussed. Yepp, sharing code between platforms makes things harder. Running the = same code in kernel land and userland does not make it simpler. Different = groups have different opinions/styles/... I'll revert the commit tomorrow and a variadic macros SCTP_SNPRINTF(), = which will map on FreeBSD to snprintf() and on the other platforms will do the = check. If the build problem comes up on FreeBSD userland (and I have no idea if = that is the case, since I don't know how Firefox / Chrome are build on = FreeBSD), I leave it up to the port maintainer of the application to deal with it. Best regards Michael >=20 > -- Ian >=20 From owner-svn-src-head@freebsd.org Mon May 18 21:09:18 2020 Return-Path: Delivered-To: svn-src-head@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 89CBB2DD77D for ; Mon, 18 May 2020 21:09:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.ore.mailhop.org [44.233.67.66]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49Qs8G1vKdz4NGb for ; Mon, 18 May 2020 21:09:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1589836156; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=YfMhvxzSmLoaBBTG7lGKLC8auS36e7oZMavVtjGYz/KPzGorgEbQ1GCuzxUWTExUP72JPekSIsgUl kwj0rcW5R67HdJLn2hbcQh3gf9Asddo8pNyr859SlSMmXzpfvq9bFbkRirTdnupNn5fPkbS5q/sh5N eMWa+Byp5DxClvPv0Ig2lzOwOeguM7y8vM6WJ9HnYiF6RDr8jVaW/Zb4XP0tV+dTBkB3arbr2Iy7x2 karZu6RIHvK+H+lkWeRW/jlx1eKjLJDXQsDcTy5ESEz2rHfcKQu+x7XDZEIj3SM6McYEGzivbzErck s8q2ZSw9H4h7VwG203s7abXcVle4IjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=PNkeR7XS2C3IMBmZhFi0Uespe0wlYubfB/YpxfBNC34=; b=qCRkEtdi6xv6YUSBrug0QC4k99W4sUEWEL+ka0y9SuxB/+j9o4F7/VL8HfsOxKniJ3aGSfmMXmUQu kZNh6UgCqj+zNkP04+HpDsOcH6rBOjIwIf9Ce3BTxWtTOqGYn4yT5mLmFQMNiCZo8WVqih3WZzyi1Q RwVsrWtJgvM/f/xkHvfz5xCON5pTFzALmHNMCglyBaoDrX+QqfF1Jql1CF8wHOCRpdKHCYWjAjgDux T7Mq3CCpkIUJOym5sP3IgKfRzoFNmuUlHREoCXt6IgZk9MYFvX4Ky8AVfrIA88paqFgoAm/djPMZDh HBcA4shO8ua01xXxI0VSwnYN9BA93aQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=PNkeR7XS2C3IMBmZhFi0Uespe0wlYubfB/YpxfBNC34=; b=QSQYx7YPR9s/jD8x0lzwh/xmpwePwe64yjr8bngayPKLIIuho/VzJe2R/v4/YA+7+jHrtCg0ap/wx IdvR0G9Tk/VdxpWDu2Vrz2Hjzq1nbDU2H3VPh7pHchWBr5TvcoLMHjfh2q1thjqIs2+HY6qc5owoR9 jrcX19xr8aVydFNhfpLIBu/Vqr2A3WFXcEoPYQFe4XHUOECX5jL8H+TRbqQlvp1pMpLaHLgqlxqjM8 e8iPIeGYOuRBkBNhFu57r2s4vvd+zhEUMGGzLBXDVpo37DfU5QTirWlY2BH/O6gaVxmbX3GtU4r3oA kiBp2RTVh9BRCCsf37MicPt/fsFeu+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: d42aabc7-994b-11ea-b10c-b5956a7dd1a1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id d42aabc7-994b-11ea-b10c-b5956a7dd1a1; Mon, 18 May 2020 21:09:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04IL9EQH003283; Mon, 18 May 2020 15:09:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> Subject: Re: svn commit: r361209 - head/sys/netinet From: Ian Lepore To: Michael Tuexen Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Date: Mon, 18 May 2020 15:09:14 -0600 In-Reply-To: <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49Qs8G1vKdz4NGb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 21:09:18 -0000 On Mon, 2020-05-18 at 23:01 +0200, Michael Tuexen wrote: > > On 18. May 2020, at 22:48, Ian Lepore wrote: > > > > On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: > > > > Sure. You can certainly ignore user reports corresponding to > > > > bogus > > > > flags, though, and encourage use of various flags. > > > > > > I could, but decided to improve the situation for some people, > > > but > > > wasn't realising that I made it worse for others. Sorry about > > > that. > > > > I'm trying to figure out why your original commit was a problem. I > > understand why it was questioned, but once the answer came out, > > it's > > clear that the code you originally committed does what it's > > supposed to > > without any harmful side effects. Sure, freebsd doesn't strictly > > need > > I guess the point Conrad is making, that on FreeBSD the check is not > needed, since the call can not fail. So the FreeBSD code base would > not > be consistent: within the SCTP related code the return code is > checked, > in the other code it is not. > > it, but the code is shared among projects, so what's the harm in > > the > > extra check that helps other projects sharing the code? It's > > certainly > > a lot less confusion and code clutter than any of the "remedies" > > that > > have been discussed. > > Yepp, sharing code between platforms makes things harder. Running the > same > code in kernel land and userland does not make it simpler. Different > groups > have different opinions/styles/... > > I'll revert the commit tomorrow and a variadic macros > SCTP_SNPRINTF(), which > will map on FreeBSD to snprintf() and on the other platforms will do > the check. > > If the build problem comes up on FreeBSD userland (and I have no idea > if that > is the case, since I don't know how Firefox / Chrome are build on > FreeBSD), > I leave it up to the port maintainer of the application to deal with > it. > > Best regards > Michael > > > > -- Ian > > > > Well it seems to me you're being asked to do a lot of extra work that has the final result of making the code LESS clear and MORE complex, because of one person's opinion. I'm actually a bit tempted to complain about the change, because to me it reduces rather than improves code quality. -- Ian From owner-svn-src-head@freebsd.org Mon May 18 21:56:12 2020 Return-Path: Delivered-To: svn-src-head@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 437DF2DEADC; Mon, 18 May 2020 21:56:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QtBN0zf1z4RQN; Mon, 18 May 2020 21:56:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 99B7E24A62; Mon, 18 May 2020 21:56:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r361136 - head/sys/fs/ext2fs To: Fedor Uporov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005171452.04HEqs7b063888@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <370c8418-0f6e-398e-e32e-0a08b234182b@FreeBSD.org> Date: Mon, 18 May 2020 16:56:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005171452.04HEqs7b063888@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 21:56:12 -0000 ... On 17/05/2020 09:52, Fedor Uporov wrote: > Author: fsu > Date: Sun May 17 14:52:54 2020 > New Revision: 361136 > URL: https://svnweb.freebsd.org/changeset/base/361136 > > Log: > Add BE architectures support. > > Author of most initial version: pfg (https://reviews.freebsd.org/D23259) > > Reviewed by: pfg > MFC after: 3 months > > Differential Revision: https://reviews.freebsd.org/D24685 Thanks so much for finishing off my initial code and for testing in PPC! Pedro. From owner-svn-src-head@freebsd.org Mon May 18 21:57:04 2020 Return-Path: Delivered-To: svn-src-head@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 BAEA72DEB3E; Mon, 18 May 2020 21:57:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QtCN3BCNz4Rd0; Mon, 18 May 2020 21:57:03 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 1FBBE7220F40F; Mon, 18 May 2020 23:57:01 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> Date: Mon, 18 May 2020 23:57:00 +0200 Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: 7bit Message-Id: <99D6D374-B8C6-4D47-812A-6DA5740DDDE9@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QtCN3BCNz4Rd0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 21:57:04 -0000 > On 18. May 2020, at 23:09, Ian Lepore wrote: > > On Mon, 2020-05-18 at 23:01 +0200, Michael Tuexen wrote: >>> On 18. May 2020, at 22:48, Ian Lepore wrote: >>> >>> On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: >>>>> Sure. You can certainly ignore user reports corresponding to >>>>> bogus >>>>> flags, though, and encourage use of various flags. >>>> >>>> I could, but decided to improve the situation for some people, >>>> but >>>> wasn't realising that I made it worse for others. Sorry about >>>> that. >>> >>> I'm trying to figure out why your original commit was a problem. I >>> understand why it was questioned, but once the answer came out, >>> it's >>> clear that the code you originally committed does what it's >>> supposed to >>> without any harmful side effects. Sure, freebsd doesn't strictly >>> need >> >> I guess the point Conrad is making, that on FreeBSD the check is not >> needed, since the call can not fail. So the FreeBSD code base would >> not >> be consistent: within the SCTP related code the return code is >> checked, >> in the other code it is not. >>> it, but the code is shared among projects, so what's the harm in >>> the >>> extra check that helps other projects sharing the code? It's >>> certainly >>> a lot less confusion and code clutter than any of the "remedies" >>> that >>> have been discussed. >> >> Yepp, sharing code between platforms makes things harder. Running the >> same >> code in kernel land and userland does not make it simpler. Different >> groups >> have different opinions/styles/... >> >> I'll revert the commit tomorrow and a variadic macros >> SCTP_SNPRINTF(), which >> will map on FreeBSD to snprintf() and on the other platforms will do >> the check. >> >> If the build problem comes up on FreeBSD userland (and I have no idea >> if that >> is the case, since I don't know how Firefox / Chrome are build on >> FreeBSD), >> I leave it up to the port maintainer of the application to deal with >> it. >> >> Best regards >> Michael >>> >>> -- Ian >>> >> >> > > Well it seems to me you're being asked to do a lot of extra work that > has the final result of making the code LESS clear and MORE complex, > because of one person's opinion. I'm actually a bit tempted to Yes, it is one person. But it is one person who thinks the change is bad enough that he needs to speak up. So I think this has to be addressed. > complain about the change, because to me it reduces rather than > improves code quality. Well, we have abstracted from FreeBSD specifics by using macros in other cases as well. Adding another macro will make reading a bit harder and you have to lookup the platform specific implementation of the code to figure out what is going on, but that way, I guess, people will get a result they can live with. Best regards Michael > > -- Ian > > From owner-svn-src-head@freebsd.org Mon May 18 22:53:14 2020 Return-Path: Delivered-To: svn-src-head@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 1ABC72DF5F7; Mon, 18 May 2020 22:53:14 +0000 (UTC) (envelope-from karels@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QvS96c2qz4VKJ; Mon, 18 May 2020 22:53:13 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFAB28BDE; Mon, 18 May 2020 22:53:13 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IMrDEv066420; Mon, 18 May 2020 22:53:13 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IMrC5S066415; Mon, 18 May 2020 22:53:12 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202005182253.04IMrC5S066415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Mon, 18 May 2020 22:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361228 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 361228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 22:53:14 -0000 Author: karels Date: Mon May 18 22:53:12 2020 New Revision: 361228 URL: https://svnweb.freebsd.org/changeset/base/361228 Log: Allow TCP to reuse local port with different destinations Previously, tcp_connect() would bind a local port before connecting, forcing the local port to be unique across all outgoing TCP connections for the address family. Instead, choose a local port after selecting the destination and the local address, requiring only that the tuple is unique and does not match a wildcard binding. Reviewed by: tuexen (rscheff, rrs previous version) MFC after: 1 month Sponsored by: Forcepoint LLC Differential Revision: https://reviews.freebsd.org/D24781 Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_pcb.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/in_pcb.c Mon May 18 22:53:12 2020 (r361228) @@ -610,13 +610,15 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, st } #endif +#if defined(INET) || defined(INET6) /* - * Select a local port (number) to use. + * Assign a local port like in_pcb_lport(), but also used with connect() + * and a foreign address and port. If fsa is non-NULL, choose a local port + * that is unused with those, otherwise one that is completely unused. */ -#if defined(INET) || defined(INET6) int -in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, - struct ucred *cred, int lookupflags) +in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, + struct sockaddr *fsa, u_short fport, struct ucred *cred, int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -624,8 +626,11 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp int count, dorandom, error; u_short aux, first, last, lport; #ifdef INET - struct in_addr laddr; + struct in_addr laddr, faddr; #endif +#ifdef INET6 + struct in6_addr *laddr6, *faddr6; +#endif pcbinfo = inp->inp_pcbinfo; @@ -685,15 +690,22 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp } #ifdef INET - /* Make the compiler happy. */ - laddr.s_addr = 0; + laddr.s_addr = INADDR_ANY; if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { - KASSERT(laddrp != NULL, ("%s: laddrp NULL for v4 inp %p", - __func__, inp)); - laddr = *laddrp; + laddr = ((struct sockaddr_in *)lsa)->sin_addr; + if (fsa != NULL) + faddr = ((struct sockaddr_in *)fsa)->sin_addr; } #endif - tmpinp = NULL; /* Make compiler happy. */ +#ifdef INET6 + if (lsa->sa_family == AF_INET6) { + laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; + if (fsa != NULL) + faddr6 = &((struct sockaddr_in6 *)fsa)->sin6_addr; + } +#endif + + tmpinp = NULL; lport = *lportp; if (dorandom) @@ -709,30 +721,62 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp *lastport = first; lport = htons(*lastport); + if (fsa != NULL) { + +#ifdef INET + if (lsa->sa_family == AF_INET) { + tmpinp = in_pcblookup_hash_locked(pcbinfo, + faddr, fport, laddr, lport, lookupflags, + NULL); + } +#endif #ifdef INET6 - if ((inp->inp_vflag & INP_IPV6) != 0) - tmpinp = in6_pcblookup_local(pcbinfo, - &inp->in6p_laddr, lport, lookupflags, cred); + if (lsa->sa_family == AF_INET6) { + tmpinp = in6_pcblookup_hash_locked(pcbinfo, + faddr6, fport, laddr6, lport, lookupflags, + NULL); + } #endif + } else { +#ifdef INET6 + if ((inp->inp_vflag & INP_IPV6) != 0) + tmpinp = in6_pcblookup_local(pcbinfo, + &inp->in6p_laddr, lport, lookupflags, cred); +#endif #if defined(INET) && defined(INET6) - else + else #endif #ifdef INET - tmpinp = in_pcblookup_local(pcbinfo, laddr, - lport, lookupflags, cred); + tmpinp = in_pcblookup_local(pcbinfo, laddr, + lport, lookupflags, cred); #endif + } } while (tmpinp != NULL); -#ifdef INET - if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) - laddrp->s_addr = laddr.s_addr; -#endif *lportp = lport; return (0); } /* + * Select a local port (number) to use. + */ +int +in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, + struct ucred *cred, int lookupflags) +{ + struct sockaddr_in laddr; + + if (laddrp) { + bzero(&laddr, sizeof(laddr)); + laddr.sin_family = AF_INET; + laddr.sin_addr = *laddrp; + } + return (in_pcb_lport_dest(inp, laddrp ? (struct sockaddr *) &laddr : + NULL, lportp, NULL, 0, cred, lookupflags)); +} + +/* * Return cached socket options. */ int @@ -1344,16 +1388,26 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr if (error) return (error); } - oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, fport, - laddr, lport, 0, NULL); - if (oinp != NULL) { - if (oinpp != NULL) - *oinpp = oinp; - return (EADDRINUSE); - } - if (lport == 0) { - error = in_pcbbind_setup(inp, NULL, &laddr.s_addr, &lport, - cred); + if (lport != 0) { + oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, + fport, laddr, lport, 0, NULL); + if (oinp != NULL) { + if (oinpp != NULL) + *oinpp = oinp; + return (EADDRINUSE); + } + } else { + struct sockaddr_in lsin, fsin; + + bzero(&lsin, sizeof(lsin)); + bzero(&fsin, sizeof(fsin)); + lsin.sin_family = AF_INET; + lsin.sin_addr = laddr; + fsin.sin_family = AF_INET; + fsin.sin_addr = faddr; + error = in_pcb_lport_dest(inp, (struct sockaddr *) &lsin, + &lport, (struct sockaddr *)& fsin, fport, cred, + INPLOOKUP_WILDCARD); if (error) return (error); } Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/in_pcb.h Mon May 18 22:53:12 2020 (r361228) @@ -824,6 +824,9 @@ void in_pcbgroup_update_mbuf(struct inpcb *, struct mb void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); int in_pcballoc(struct socket *, struct inpcbinfo *); int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); +int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, + u_short *lportp, struct sockaddr *fsa, u_short fport, + struct ucred *cred, int lookupflags); int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, struct ucred *, int); int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/tcp_usrreq.c Mon May 18 22:53:12 2020 (r361228) @@ -147,6 +147,16 @@ static int tcp_pru_options_support(struct tcpcb *tp, i #endif /* + * tcp_require_unique port requires a globally-unique source port for each + * outgoing connection. The default is to require the 4-tuple to be unique. + */ +VNET_DEFINE(int, tcp_require_unique_port) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, require_unique_port, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_require_unique_port), 0, + "Require globally-unique ephemeral port for outgoing connections"); +#define V_tcp_require_unique_port VNET(tcp_require_unique_port) + +/* * TCP attaches to socket via pru_attach(), reserving space, * and an internet control block. */ @@ -1514,7 +1524,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; @@ -1535,6 +1545,15 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st error = EADDRINUSE; goto out; } + /* Handle initial bind if it hadn't been done in advance. */ + if (inp->inp_lport == 0) { + inp->inp_lport = lport; + if (in_pcbinshash(inp) != 0) { + inp->inp_lport = 0; + error = EAGAIN; + goto out; + } + } inp->inp_laddr = laddr; in_pcbrehash(inp); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -1574,7 +1593,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, s INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet6/in6_pcb.c Mon May 18 22:53:12 2020 (r361228) @@ -113,9 +113,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct inpcb *in6_pcblookup_hash_locked(struct inpcbinfo *, - struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *); - int in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) @@ -417,9 +414,12 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; - struct in6_addr addr6; + struct sockaddr_in6 laddr6; int error; + bzero(&laddr6, sizeof(laddr6)); + laddr6.sin6_family = AF_INET6; + INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -427,25 +427,36 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr * Call inner routine, to assign local interface address. * in6_pcbladdr() may automatically fill in sin6_scope_id. */ - if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0) + if ((error = in6_pcbladdr(inp, nam, &laddr6.sin6_addr)) != 0) return (error); if (in6_pcblookup_hash_locked(pcbinfo, &sin6->sin6_addr, sin6->sin6_port, IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) - ? &addr6 : &inp->in6p_laddr, + ? &laddr6.sin6_addr : &inp->in6p_laddr, inp->inp_lport, 0, NULL) != NULL) { return (EADDRINUSE); } if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { if (inp->inp_lport == 0) { + /* + * rehash was required to be true in the past for + * this case; retain that convention. However, + * we now call in_pcb_lport_dest rather than + * in6_pcbbind; the former does not insert into + * the hash table, the latter does. Change rehash + * to false to do the in_pcbinshash below. + */ KASSERT(rehash == true, ("Rehashing required for unbound inps")); - error = in6_pcbbind(inp, (struct sockaddr *)0, cred); + rehash = false; + error = in_pcb_lport_dest(inp, + (struct sockaddr *) &laddr6, &inp->inp_lport, + (struct sockaddr *) sin6, sin6->sin6_port, cred, 0); if (error) return (error); } - inp->in6p_laddr = addr6; + inp->in6p_laddr = laddr6.sin6_addr; } inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; @@ -1122,9 +1133,9 @@ found: #endif /* PCBGROUP */ /* - * Lookup PCB in hash list. + * Lookup PCB in hash list. Used in in_pcb.c as well as here. */ -static struct inpcb * +struct inpcb * in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, u_int lport_arg, int lookupflags, struct ifnet *ifp) Modified: head/sys/netinet6/in6_pcb.h ============================================================================== --- head/sys/netinet6/in6_pcb.h Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet6/in6_pcb.h Mon May 18 22:53:12 2020 (r361228) @@ -92,6 +92,10 @@ struct inpcb * in6_pcblookup_local(struct inpcbinfo *, struct in6_addr *, u_short, int, struct ucred *); +struct inpcb * + in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, + struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, + u_int lport_arg, int lookupflags, struct ifnet *ifp); struct inpcb * in6_pcblookup(struct inpcbinfo *, struct in6_addr *, u_int, struct in6_addr *, u_int, int, From owner-svn-src-head@freebsd.org Mon May 18 23:43:48 2020 Return-Path: Delivered-To: svn-src-head@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 D91402F0A8F; Mon, 18 May 2020 23:43:48 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QwZX5PKHz4X8s; Mon, 18 May 2020 23:43:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4BC0297C6; Mon, 18 May 2020 23:43:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04INhmW8096776; Mon, 18 May 2020 23:43:48 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04INhm77096775; Mon, 18 May 2020 23:43:48 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005182343.04INhm77096775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 18 May 2020 23:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361229 - head/tests/sys/geom/class/multipath X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 361229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 23:43:48 -0000 Author: lwhsu Date: Mon May 18 23:43:48 2020 New Revision: 361229 URL: https://svnweb.freebsd.org/changeset/base/361229 Log: Revert 357780, `dtrace -c` has been fixed in head` PR: 244053 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/multipath/failloop.sh Modified: head/tests/sys/geom/class/multipath/failloop.sh ============================================================================== --- head/tests/sys/geom/class/multipath/failloop.sh Mon May 18 22:53:12 2020 (r361228) +++ head/tests/sys/geom/class/multipath/failloop.sh Mon May 18 23:43:48 2020 (r361229) @@ -36,10 +36,6 @@ failloop_head() } failloop_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/244053" - fi - sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath From owner-svn-src-head@freebsd.org Tue May 19 00:15:19 2020 Return-Path: Delivered-To: svn-src-head@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 DDF6B2F0FFA; Tue, 19 May 2020 00:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QxGv5c4Rz4Yfr; Tue, 19 May 2020 00:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B750E29DDF; Tue, 19 May 2020 00:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J0FJ6b015358; Tue, 19 May 2020 00:15:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J0FJR7015357; Tue, 19 May 2020 00:15:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005190015.04J0FJR7015357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 May 2020 00:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361230 - head/contrib/blacklist/bin X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/blacklist/bin X-SVN-Commit-Revision: 361230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 00:15:19 -0000 Author: emaste Date: Tue May 19 00:15:19 2020 New Revision: 361230 URL: https://svnweb.freebsd.org/changeset/base/361230 Log: blacklistd.conf.5: typo/grammar fixes PR: 246467 Submitted by: Mike Lempriere Modified: head/contrib/blacklist/bin/blacklistd.conf.5 Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Mon May 18 23:43:48 2020 (r361229) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Tue May 19 00:15:19 2020 (r361230) @@ -125,18 +125,18 @@ The second field is the socket .Dv dgram , or numeric. The third field is the -.Va prococol : +.Va protocol : .Dv tcp , .Dv udp , .Dv tcp6 , .Dv udp6 , or numeric. -The fourth file is the effective user +The fourth field is the effective user .Va ( owner ) of the daemon process reporting the event, either as a username or a userid. .Pp -The rest of the fields are controlling the behavior of the filter. +The rest of the fields control the behavior of the filter. .Pp The .Va name From owner-svn-src-head@freebsd.org Tue May 19 01:05:14 2020 Return-Path: Delivered-To: svn-src-head@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 3F0172F2199; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QyNV112xz4ch6; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DCAF2A176; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J15DKt046192; Tue, 19 May 2020 01:05:13 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J15DCQ046191; Tue, 19 May 2020 01:05:13 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202005190105.04J15DCQ046191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Tue, 19 May 2020 01:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361231 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 01:05:14 -0000 Author: karels Date: Tue May 19 01:05:13 2020 New Revision: 361231 URL: https://svnweb.freebsd.org/changeset/base/361231 Log: Fix NULL-pointer bug from r361228. Note that in_pcb_lport and in_pcb_lport_dest can be called with a NULL local address for IPv6 sockets; handle it. Found by syzkaller. Reported by: cem MFC after: 1 month Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue May 19 00:15:19 2020 (r361230) +++ head/sys/netinet/in_pcb.c Tue May 19 01:05:13 2020 (r361231) @@ -615,6 +615,7 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, st * Assign a local port like in_pcb_lport(), but also used with connect() * and a foreign address and port. If fsa is non-NULL, choose a local port * that is unused with those, otherwise one that is completely unused. + * lsa can be NULL for IPv6. */ int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, @@ -692,14 +693,17 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr * #ifdef INET laddr.s_addr = INADDR_ANY; if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { - laddr = ((struct sockaddr_in *)lsa)->sin_addr; + if (lsa != NULL) + laddr = ((struct sockaddr_in *)lsa)->sin_addr; if (fsa != NULL) faddr = ((struct sockaddr_in *)fsa)->sin_addr; } #endif #ifdef INET6 - if (lsa->sa_family == AF_INET6) { - laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; + laddr6 = NULL; + if ((inp->inp_vflag & INP_IPV6) != 0) { + if (lsa != NULL) + laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; if (fsa != NULL) faddr6 = &((struct sockaddr_in6 *)fsa)->sin6_addr; } From owner-svn-src-head@freebsd.org Tue May 19 01:06:31 2020 Return-Path: Delivered-To: svn-src-head@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 BF6942F21AE; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QyPz4hFTz4cx0; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C08E2A57F; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J16VG3046289; Tue, 19 May 2020 01:06:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J16VRx046288; Tue, 19 May 2020 01:06:31 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005190106.04J16VRx046288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 19 May 2020 01:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361232 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 361232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 01:06:31 -0000 Author: jhibbits Date: Tue May 19 01:06:31 2020 New Revision: 361232 URL: https://svnweb.freebsd.org/changeset/base/361232 Log: powerpc/mmu: Don't use the cache instructions to zero pages A page (even physmem) can be marked as cache-inhibited. Attempting to use 'dcbz' to zero a page mapped cache-inhibited triggers an alignment exception, which is fatal in kernel. This was seen when testing hardware acceleration with X on POWER9. At some point in the future, this should be changed to a more straight forward zero loop instead of bzero(), and a similar change be made to the other pmaps. Reported by: pkubaj@ Modified: head/sys/powerpc/aim/mmu_radix.c Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Tue May 19 01:05:13 2020 (r361231) +++ head/sys/powerpc/aim/mmu_radix.c Tue May 19 01:06:31 2020 (r361232) @@ -909,10 +909,8 @@ static void pagezero(vm_offset_t va) { va = trunc_page(va); - int off; - for (off = 0; off < PAGE_SIZE; off += cacheline_size) - __asm __volatile("dcbz 0,%0" :: "r"(va + off)); + bzero((void *)va, PAGE_SIZE); } static uint64_t From owner-svn-src-head@freebsd.org Tue May 19 02:07:09 2020 Return-Path: Delivered-To: svn-src-head@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 29FAC2F4AB5; Tue, 19 May 2020 02:07:09 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qzlx0JSrz3TFq; Tue, 19 May 2020 02:07:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05BDE2B31D; Tue, 19 May 2020 02:07:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J278ju082725; Tue, 19 May 2020 02:07:08 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J278va082724; Tue, 19 May 2020 02:07:08 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005190207.04J278va082724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 May 2020 02:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361237 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 361237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 02:07:09 -0000 Author: lwhsu Date: Tue May 19 02:07:08 2020 New Revision: 361237 URL: https://svnweb.freebsd.org/changeset/base/361237 Log: Temporarily disable test case causes kernel panic in CI: - sys.netinet.so_reuseport_lb_test.basic_ipv6 PR: 246560 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/so_reuseport_lb_test.c Modified: head/tests/sys/netinet/so_reuseport_lb_test.c ============================================================================== --- head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 01:43:00 2020 (r361236) +++ head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 02:07:08 2020 (r361237) @@ -188,6 +188,9 @@ ATF_TC_BODY(basic_ipv6, tc) int error, sds[16]; uint16_t port; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/246560"); + sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); memset(&addr, 0, sizeof(addr)); From owner-svn-src-head@freebsd.org Tue May 19 02:41:05 2020 Return-Path: Delivered-To: svn-src-head@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 A20C42F83EC; Tue, 19 May 2020 02:41:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R0W53w4bz3YHJ; Tue, 19 May 2020 02:41:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8196A2BB15; Tue, 19 May 2020 02:41:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J2f5Se001348; Tue, 19 May 2020 02:41:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J2f54E001347; Tue, 19 May 2020 02:41:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005190241.04J2f54E001347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 02:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 02:41:05 -0000 Author: kevans Date: Tue May 19 02:41:05 2020 New Revision: 361238 URL: https://svnweb.freebsd.org/changeset/base/361238 Log: zfs: reject read(2) of a dirfd with EISDIR This is independent of the recently-discussed global change, which is still in review/discussion stage. This is effectively a measure for consistency in the ZFS world, where FreeBSD was the only platform (as far as I could find) that allowed this. What ZFS exposes is decidedly not useful for any real purposes, to paraphrase (hopefully faithfully) jhb's findings when exploring this: The size of a directory in ZFS is the number of directory entries within. When reading a directory, you would instead get the leading part of its raw contents; the amount you get being dictated by the "size," i.e. number of directory entries. There's decidedly (luckily) no stack disclosure happening here, though the behavior is bizarre and almost certainly a historical accident. This change has already been upstreamed to OpenZFS. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:07:08 2020 (r361237) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:41:05 2020 (r361238) @@ -646,6 +646,12 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); + /* We don't copy out anything useful for directories. */ + if (vp->v_type == VDIR) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EISDIR)); + } + if (zp->z_pflags & ZFS_AV_QUARANTINED) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EACCES)); From owner-svn-src-head@freebsd.org Tue May 19 03:19:02 2020 Return-Path: Delivered-To: svn-src-head@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 740EF2F91BF; Tue, 19 May 2020 03:19:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R1Lt2SqQz3bJL; Tue, 19 May 2020 03:19:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FEDF2C2B3; Tue, 19 May 2020 03:19:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J3J2MV026608; Tue, 19 May 2020 03:19:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J3J2LA026607; Tue, 19 May 2020 03:19:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005190319.04J3J2LA026607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 03:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361239 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 03:19:02 -0000 Author: kevans Date: Tue May 19 03:19:01 2020 New Revision: 361239 URL: https://svnweb.freebsd.org/changeset/base/361239 Log: Belated RELNOTES entry for r361238 This may get revised later if the larger change lands, but we should note this. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 02:41:05 2020 (r361238) +++ head/RELNOTES Tue May 19 03:19:01 2020 (r361239) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r361238: + ZFS will now reject read(2) of a dirfd with EISDIR. + r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from From owner-svn-src-head@freebsd.org Tue May 19 07:16:10 2020 Return-Path: Delivered-To: svn-src-head@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 8CA972FD2E8; Tue, 19 May 2020 07:16:10 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R6cV3Bcxz45rP; Tue, 19 May 2020 07:16:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68E012ECE4; Tue, 19 May 2020 07:16:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J7GAPj075676; Tue, 19 May 2020 07:16:10 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7GAK9075675; Tue, 19 May 2020 07:16:10 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005190716.04J7GAK9075675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 May 2020 07:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361241 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 361241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 07:16:10 -0000 Author: lwhsu Date: Tue May 19 07:16:09 2020 New Revision: 361241 URL: https://svnweb.freebsd.org/changeset/base/361241 Log: Revert r361237, it's fixed by r361231 PR: 246560 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/so_reuseport_lb_test.c Modified: head/tests/sys/netinet/so_reuseport_lb_test.c ============================================================================== --- head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 03:24:45 2020 (r361240) +++ head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 07:16:09 2020 (r361241) @@ -188,9 +188,6 @@ ATF_TC_BODY(basic_ipv6, tc) int error, sds[16]; uint16_t port; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/246560"); - sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); memset(&addr, 0, sizeof(addr)); From owner-svn-src-head@freebsd.org Tue May 19 07:21:12 2020 Return-Path: Delivered-To: svn-src-head@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 E39242FD576; Tue, 19 May 2020 07:21:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R6kJ685pz4698; Tue, 19 May 2020 07:21:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1582F0A3; Tue, 19 May 2020 07:21:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J7LCFa076843; Tue, 19 May 2020 07:21:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7LBNr076838; Tue, 19 May 2020 07:21:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005190721.04J7LBNr076838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 May 2020 07:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361242 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 07:21:13 -0000 Author: tuexen Date: Tue May 19 07:21:11 2020 New Revision: 361242 URL: https://svnweb.freebsd.org/changeset/base/361242 Log: Revert r361209: cem noted that on FreeBSD snprintf() can not fail and code should not check for that. A followup commit will replace the usage of snprintf() in the SCTP sources with a variadic macro SCTP_SNPRINTF, which will simply map to snprintf() on FreeBSD and do a checking similar to r361209 on other platforms. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_asconf.c Tue May 19 07:21:11 2020 (r361242) @@ -1706,9 +1706,8 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", + serial_num); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_indata.c Tue May 19 07:21:11 2020 (r361242) @@ -434,26 +434,22 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, - chk->rec.data.fsn, chk->rec.data.mid) < 0) { - msg[0] = '\0'; - } + chk->rec.data.fsn, chk->rec.data.mid); } else { - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, chk->rec.data.fsn, - (uint16_t)chk->rec.data.mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)chk->rec.data.mid); } oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_m_freem(chk->data); @@ -537,19 +533,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, - control->sinfo_stream, control->mid) < 0) { - msg[0] = '\0'; - } + control->sinfo_stream, control->mid); } else { - if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, - (uint16_t)control->mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)control->mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; @@ -656,10 +648,9 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - if (snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", control->mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "Queue to str MID: %u duplicate", + control->mid); sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1890,9 +1881,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", + mid, chk_flags); goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1903,9 +1893,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1918,11 +1906,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - if (snprintf(msg, sizeof(msg), - "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1930,11 +1915,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - if (snprintf(msg, sizeof(msg), - "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } } @@ -1948,18 +1930,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - if (snprintf(msg, sizeof(msg), - "Illegal message sequence, missing end for MID: %8.8x", - control->fsn_included) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); goto err_out; } else { control = NULL; @@ -2056,21 +2032,17 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, - mid) < 0) { - msg[0] = '\0'; - } + mid); } else { - if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, - (uint16_t)mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; @@ -2797,9 +2769,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2810,9 +2780,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2835,11 +2803,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s chunk of length %u", + snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", - chk_length) < 0) { - msg[0] = '\0'; - } + chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2908,10 +2874,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", - ch->chunk_type) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + ch->chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); @@ -2929,9 +2893,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Chunk of length %u", + chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4080,11 +4043,8 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - if (snprintf(msg, sizeof(msg), - "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4625,11 +4585,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - if (snprintf(msg, sizeof(msg), - "Cum ack %8.8x greater or equal than TSN %8.8x", - cum_ack, send_s) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -5672,11 +5629,9 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", - new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { - msg[0] = '\0'; - } + new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_input.c Tue May 19 07:21:11 2020 (r361242) @@ -4692,9 +4692,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4736,9 +4734,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5675,9 +5671,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5739,9 +5733,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5807,9 +5799,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_output.c Tue May 19 07:21:11 2020 (r361242) @@ -5581,9 +5581,7 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6760,10 +6758,8 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -9630,10 +9626,8 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", - chk->rec.data.tsn, chk->snd_count) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + chk->rec.data.tsn, chk->snd_count); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -13616,10 +13610,8 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); NET_EPOCH_ENTER(et); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_pcb.c Tue May 19 07:21:11 2020 (r361242) @@ -544,13 +544,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { - sctp_ifnp->ifn_name[0] = '\0'; - } + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { - sctp_ifnp->ifn_name[0] = '\0'; - } + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6221,10 +6217,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, @@ -6323,10 +6317,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-head@freebsd.org Tue May 19 07:23:37 2020 Return-Path: Delivered-To: svn-src-head@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 420A42FDD06; Tue, 19 May 2020 07:23:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R6n51RStz46nG; Tue, 19 May 2020 07:23:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C9082F27F; Tue, 19 May 2020 07:23:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J7NbSV082083; Tue, 19 May 2020 07:23:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7NabT082078; Tue, 19 May 2020 07:23:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005190723.04J7NabT082078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 May 2020 07:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361243 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 07:23:37 -0000 Author: tuexen Date: Tue May 19 07:23:35 2020 New Revision: 361243 URL: https://svnweb.freebsd.org/changeset/base/361243 Log: Replace snprintf() by SCTP_SNPRINTF() and let SCTP_SNPRINTF() map to snprintf() on FreeBSD. This allows to check for failures of snprintf() on platforms other than FreeBSD kernel. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_asconf.c Tue May 19 07:23:35 2020 (r361243) @@ -1706,8 +1706,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", - serial_num); + SCTP_SNPRINTF(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_indata.c Tue May 19 07:23:35 2020 (r361243) @@ -434,7 +434,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, @@ -442,7 +442,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, chk->rec.data.sid, chk->rec.data.fsn, chk->rec.data.mid); } else { - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, @@ -533,11 +533,11 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, control->mid); } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, @@ -648,9 +648,8 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", - control->mid); + SCTP_SNPRINTF(msg, sizeof(msg), + "Queue to str MID: %u duplicate", control->mid); sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1881,8 +1880,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", - mid, chk_flags); + SCTP_SNPRINTF(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags); goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1893,7 +1891,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); + SCTP_SNPRINTF(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1906,7 +1904,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + SCTP_SNPRINTF(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; } @@ -1915,7 +1914,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + SCTP_SNPRINTF(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; } @@ -1930,12 +1930,14 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); + SCTP_SNPRINTF(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + SCTP_SNPRINTF(msg, sizeof(msg), + "Illegal message sequence, missing end for MID: %8.8x", + control->fsn_included); goto err_out; } else { control = NULL; @@ -2032,13 +2034,13 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, mid); } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, @@ -2769,7 +2771,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2780,7 +2782,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2803,7 +2805,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %u", + SCTP_SNPRINTF(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); @@ -2874,7 +2876,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + SCTP_SNPRINTF(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", ch->chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2893,8 +2895,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %u", - chk_length); + SCTP_SNPRINTF(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4043,7 +4044,8 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; @@ -4585,7 +4587,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; @@ -5629,7 +5632,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_input.c Tue May 19 07:23:35 2020 (r361243) @@ -4692,7 +4692,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4734,7 +4734,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5671,7 +5671,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5733,7 +5733,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5799,7 +5799,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_os_bsd.h Tue May 19 07:23:35 2020 (r361243) @@ -295,6 +295,8 @@ typedef struct callout sctp_os_timer_t; #define SCTP_ALIGN_TO_END(m, len) M_ALIGN(m, len) +#define SCTP_SNPRINTF(...) snprintf(__VA_ARGS__) + /* We make it so if you have up to 4 threads * writing based on the default size of * the packet log 65 k, that would be Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_output.c Tue May 19 07:23:35 2020 (r361243) @@ -5581,7 +5581,7 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6758,7 +6758,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -9626,7 +9626,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + SCTP_SNPRINTF(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", chk->rec.data.tsn, chk->snd_count); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -13610,7 +13610,7 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_pcb.c Tue May 19 07:23:35 2020 (r361243) @@ -544,9 +544,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); + SCTP_SNPRINTF(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); + SCTP_SNPRINTF(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6217,7 +6217,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -6317,7 +6317,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); From owner-svn-src-head@freebsd.org Tue May 19 08:21:36 2020 Return-Path: Delivered-To: svn-src-head@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 30F6D2FEED0; Tue, 19 May 2020 08:21:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R8400XLPz4BGG; Tue, 19 May 2020 08:21:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id D8A1029239; Tue, 19 May 2020 08:21:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 830A8439A5; Tue, 19 May 2020 10:21:33 +0200 (CEST) From: "Kristof Provost" To: "Eric Joyner" , "Jacob Keller" , shurd@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347418 - head/sys/net Date: Tue, 19 May 2020 10:21:32 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> In-Reply-To: <201905100041.x4A0fhNT083122@repo.freebsd.org> References: <201905100041.x4A0fhNT083122@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 08:21:36 -0000 On 10 May 2019, at 2:41, Eric Joyner wrote: > Author: erj > Date: Fri May 10 00:41:42 2019 > New Revision: 347418 > URL: https://svnweb.freebsd.org/changeset/base/347418 > > Log: > iflib: use default ntxd and nrxd when user value is not power of 2 > > From Jake: > A user may set a sysctl to override the default number of Tx or Rx > descriptors. However, certain calculations in the iflib core expect > the > number of descriptors to be a power of 2. > > Update _iflib_assert to verify that all of the shared context > parameters > for the number of descriptors are powers of 2. > > Modify iflib_reset_qvalues to check that the provided isc_nrxd value > is > a power of 2. If it's not, print a warning message and then use the > default value. > > An alternative might be to try rounding the number down instead. > However, this creates problems in case the rounded down value is > below > the minimum value that the driver would support. > This commit appears to trigger a panic I see on a system with a Broadcom BCM57416 (if_bnxt) nic. It trips over the power of two assertion: panic: Assertion powerof2(sctx->isc_nrxd_max[i]) failed at /usr/src/sys/net/iflib.c:5320 Tracing pid 0 tid 100000 td 0xffffffff81c8c640 kdb_enter() at kdb_enter+0x37/frame 0xffffffff825be990 vpanic() at vpanic+0x19e/frame 0xffffffff825be9e0 panic() at panic+0x43/frame 0xffffffff825bea40 iflib_register() at iflib_register+0x340/frame 0xffffffff825bea80 iflib_device_register() at iflib_device_register+0x9f/frame 0xffffffff825bee10 iflib_device_attach() at iflib_device_attach+0xb5/frame 0xffffffff825bee40 device_attach() at device_attach+0x3ca/frame 0xffffffff825bee80 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825beeb0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825beed0 pci_attach() at pci_attach+0xe0/frame 0xffffffff825bef10 acpi_pci_attach() at acpi_pci_attach+0x19/frame 0xffffffff825bf150 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf190 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf1c0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf1e0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x431/frame 0xffffffff825bf250 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf290 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf2c0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf2e0 acpi_attach() at acpi_attach+0xbb7/frame 0xffffffff825bf370 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf3b0 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf3e0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf400 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf440 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf470 bus_generic_new_pass() at bus_generic_new_pass+0xed/frame 0xffffffff825bf4a0 bus_set_pass() at bus_set_pass+0x46/frame 0xffffffff825bf4d0 configure() at configure+0x9/frame 0xffffffff825bf4e0 mi_startup() at mi_startup+0xec/frame 0xffffffff825bf530 btext() at btext+0x2c The if_bnxt driver initialises `.isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX},`, so presumably that’s the cause. I don’t know what a sane value would be though. I’ve defaulted to 4096 (because that’s what some other iflib users seems to do) for now, and that seems to work. It doesn’t panic and I can get traffic through it at least: diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 50827106024..3958d95cab9 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {4096, 4096, 4096}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {4096, 4096, 4096}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, Best regards, Kristof From owner-svn-src-head@freebsd.org Tue May 19 08:43:18 2020 Return-Path: Delivered-To: svn-src-head@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 292922FFC07; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R8Y209fFz4CNH; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 011538420; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J8hHAP031773; Tue, 19 May 2020 08:43:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J8hHb1031772; Tue, 19 May 2020 08:43:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190843.04J8hHb1031772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 08:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361245 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 08:43:18 -0000 Author: manu Date: Tue May 19 08:43:17 2020 New Revision: 361245 URL: https://svnweb.freebsd.org/changeset/base/361245 Log: linuxkpi: Add __init_waitqueue_head The only difference with init_waitqueue_head is that the name and the lock class key are provided but we don't use those so use init_waitqueue_head directly. Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24861 Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Tue May 19 07:47:59 2020 (r361244) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Tue May 19 08:43:17 2020 (r361245) @@ -119,6 +119,8 @@ extern wait_queue_func_t default_wake_function; INIT_LIST_HEAD(&(wqh)->task_list); \ } while (0) +#define __init_waitqueue_head(wqh, name, lk) init_waitqueue_head(wqh) + void linux_init_wait_entry(wait_queue_t *, int); void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool); From owner-svn-src-head@freebsd.org Tue May 19 08:44:33 2020 Return-Path: Delivered-To: svn-src-head@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 DBC8C2FF6EE; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R8ZT5WG4z4CqH; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B88668318; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J8iXDw031894; Tue, 19 May 2020 08:44:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J8iXrB031893; Tue, 19 May 2020 08:44:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190844.04J8iXrB031893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 08:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361246 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 08:44:33 -0000 Author: manu Date: Tue May 19 08:44:33 2020 New Revision: 361246 URL: https://svnweb.freebsd.org/changeset/base/361246 Log: linuxkpi: add pci_dev_present pci_dev_present shows if a set of pci ids are present in the system. It just wraps pci_find_device. Needed by DRMv5.2 Submitted by: Austing Shafer (ashafer@badland.io) Differential Revision: https://reviews.freebsd.org/D24796 Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:43:17 2020 (r361245) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:44:33 2020 (r361246) @@ -1050,4 +1050,16 @@ extern int linux_pci_attach_device(device_t, struct pc const struct pci_device_id *, struct pci_dev *); extern int linux_pci_detach_device(struct pci_dev *); +static inline int +pci_dev_present(const struct pci_device_id *cur) +{ + while (cur != NULL && (cur->vendor || cur->device)) { + if (pci_find_device(cur->vendor, cur->device) != NULL) { + return (1); + } + cur++; + } + return (0); +} + #endif /* _LINUX_PCI_H_ */ From owner-svn-src-head@freebsd.org Tue May 19 09:04:35 2020 Return-Path: Delivered-To: svn-src-head@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 A193F2C81D3; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R91b3shHz4Dxp; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF378668; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J94ZDi044117; Tue, 19 May 2020 09:04:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J94ZqJ044116; Tue, 19 May 2020 09:04:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190904.04J94ZqJ044116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 09:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361247 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 09:04:35 -0000 Author: manu Date: Tue May 19 09:04:35 2020 New Revision: 361247 URL: https://svnweb.freebsd.org/changeset/base/361247 Log: linuxkpi: Add irq_work.h Since handlers are call in a thread context we can simply use a workqueue to emulate those functions. The DRM code was patched to do that already, having it in linuxkpi allows us to not patch the upstream code. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24859 Added: head/sys/compat/linuxkpi/common/include/linux/irq_work.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/irq_work.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/irq_work.h Tue May 19 09:04:35 2020 (r361247) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_IRQ_WORK_H__ +#define __LINUX_IRQ_WORK_H__ + +#include + +struct irq_work { + struct work_struct work; +}; + +static inline void +init_irq_work(struct irq_work *irqw, void (*func)(struct irq_work *)) +{ + INIT_WORK(&irqw->work, (work_func_t)func); +} + +static inline void +irq_work_queue(struct irq_work *irqw) +{ + schedule_work(&irqw->work); +} + +#endif /* __LINUX_IRQ_WORK_H__ */ From owner-svn-src-head@freebsd.org Tue May 19 09:17:21 2020 Return-Path: Delivered-To: svn-src-head@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 B0B272C85E4; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R9JK48bSz4Fx2; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8531F86C5; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J9HLFu050340; Tue, 19 May 2020 09:17:21 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J9HLZS050339; Tue, 19 May 2020 09:17:21 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005190917.04J9HLZS050339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 09:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361248 - head/usr.bin/sed X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/sed X-SVN-Commit-Revision: 361248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 09:17:21 -0000 Author: bcr (doc committer) Date: Tue May 19 09:17:20 2020 New Revision: 361248 URL: https://svnweb.freebsd.org/changeset/base/361248 Log: Update SYNOPSIS section to be consistent regarding -u, -i, and -I. Apparently, when the -u, -i and -I options where added to sed(1), it was forgotten to add them to both lines in the SYNOPSIS section. They were only added to the second line, although they apply to both. With the updated SYNOPSIS, it is now allowed (and consistent) to run: sed -i BAK s/foo/bar/g some_file PR: 240556 Submitted by: Oliver Fromme MFC after: 5 days Modified: head/usr.bin/sed/sed.1 Modified: head/usr.bin/sed/sed.1 ============================================================================== --- head/usr.bin/sed/sed.1 Tue May 19 09:04:35 2020 (r361247) +++ head/usr.bin/sed/sed.1 Tue May 19 09:17:20 2020 (r361248) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd March 27, 2017 +.Dd May 19, 2020 .Dt SED 1 .Os .Sh NAME @@ -41,9 +41,11 @@ .Nm .Op Fl Ealnru .Ar command +.Op Fl I Ar extension +.Op Fl i Ar extension .Op Ar .Nm -.Op Fl Ealnr +.Op Fl Ealnru .Op Fl e Ar command .Op Fl f Ar command_file .Op Fl I Ar extension @@ -197,7 +199,8 @@ option was specified); .It a context address that consists of a regular expression preceded and followed by a -delimiter. The closing delimiter can also optionally be followed by the +delimiter. +The closing delimiter can also optionally be followed by the .Dq I character, to indicate that the regular expression is to be matched in a case-insensitive way. From owner-svn-src-head@freebsd.org Tue May 19 11:05:28 2020 Return-Path: Delivered-To: svn-src-head@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 513952CB692; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RCj41Sthz4N8R; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D98E97DF; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JB5RwT018410; Tue, 19 May 2020 11:05:27 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JB5RIB018409; Tue, 19 May 2020 11:05:27 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005191105.04JB5RIB018409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 11:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361249 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 361249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 11:05:28 -0000 Author: bcr (doc committer) Date: Tue May 19 11:05:27 2020 New Revision: 361249 URL: https://svnweb.freebsd.org/changeset/base/361249 Log: Fix a typo: argments -> arguments PR: 243294 Submitted by: Igor Ostapenko MFC after: 5 days Modified: head/lib/libc/stdlib/getopt_long.3 Modified: head/lib/libc/stdlib/getopt_long.3 ============================================================================== --- head/lib/libc/stdlib/getopt_long.3 Tue May 19 09:17:20 2020 (r361248) +++ head/lib/libc/stdlib/getopt_long.3 Tue May 19 11:05:27 2020 (r361249) @@ -244,7 +244,7 @@ matching the default behavior of .Xr getopt 3 . The default behavior without .Ql \&+ -is to permute non-option argments to the end of +is to permute non-option arguments to the end of .Fa argv . .Pp A leading From owner-svn-src-head@freebsd.org Tue May 19 12:16:44 2020 Return-Path: Delivered-To: svn-src-head@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 9776A2CDC6D; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RFHJ3PHQz4Rky; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70061AC7E; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JCGiIE060774; Tue, 19 May 2020 12:16:44 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JCGiBi060773; Tue, 19 May 2020 12:16:44 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005191216.04JCGiBi060773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 12:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361250 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 361250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 12:16:44 -0000 Author: bcr (doc committer) Date: Tue May 19 12:16:44 2020 New Revision: 361250 URL: https://svnweb.freebsd.org/changeset/base/361250 Log: The -F flag of swapon(8) requires -a to work. Before this change, swapon(8) implied that -F works as a standalone option, which is not the case and would produce a usage message. This change extends the description of the -F option to mention that -a is required with it. PR: 238551 Submitted by: Christian Baltini MFC after: 5 days Modified: head/sbin/swapon/swapon.8 Modified: head/sbin/swapon/swapon.8 ============================================================================== --- head/sbin/swapon/swapon.8 Tue May 19 11:05:27 2020 (r361249) +++ head/sbin/swapon/swapon.8 Tue May 19 12:16:44 2020 (r361250) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 21, 2019 +.Dd May 19, 2020 .Dt SWAPON 8 .Os .Sh NAME @@ -98,7 +98,7 @@ To delay .Nm swapon for a device until after .Nm savecore -has copied the crash dump to another location, use the +has copied the crash dump to another location, use the .Dq late option. .Pp @@ -143,7 +143,8 @@ are as follows: .It Fl F Ar fstab Specify the .Pa fstab -file to use. +file to use (in conjunction with +.Fl a Ns ). .El .Pp The From owner-svn-src-head@freebsd.org Tue May 19 13:44:33 2020 Return-Path: Delivered-To: svn-src-head@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 469DB2CFD48; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHDd1F7bz4XK6; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25FB7BD06; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDiXAS015695; Tue, 19 May 2020 13:44:33 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDiWF2015694; Tue, 19 May 2020 13:44:32 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005191344.04JDiWF2015694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 19 May 2020 13:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361251 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 13:44:33 -0000 Author: takawata Date: Tue May 19 13:44:32 2020 New Revision: 361251 URL: https://svnweb.freebsd.org/changeset/base/361251 Log: Add LE Whitelist commands to hccontrol PR: 214555 Submitted by Marc Veldman Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue May 19 12:16:44 2020 (r361250) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue May 19 13:44:32 2020 (r361251) @@ -157,6 +157,10 @@ are: .It Cm LE_Read_Supported_States .It Cm LE_Read_Buffer_Size .It Cm LE Scan +.It Cm LE_Read_White_List_Size +.It Cm LE_Clear_White_List +.It Cm LE_Add_Device_To_White_List +.It Cm LE_Remove_Device_From_White_List .El .Pp The currently supported node commands in Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Tue May 19 12:16:44 2020 (r361250) +++ head/usr.sbin/bluetooth/hccontrol/le.c Tue May 19 13:44:32 2020 (r361251) @@ -63,6 +63,10 @@ static int le_set_advertising_param(int s, int argc, c static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); static int le_scan(int s, int argc, char *argv[]); static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose); +static int le_read_white_list_size(int s, int argc, char *argv[]); +static int le_clear_white_list(int s, int argc, char *argv[]); +static int le_add_device_to_white_list(int s, int argc, char *argv[]); +static int le_remove_device_from_white_list(int s, int argc, char *argv[]); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -762,6 +766,173 @@ static void handle_le_event(ng_hci_event_pkt_t* e, boo } } +static int +le_read_white_list_size(int s, int argc, char *argv[]) +{ + ng_hci_le_read_white_list_size_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_WHITE_LIST_SIZE), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "White list size: %d\n", + (uint8_t)rp.white_list_size); + + return (OK); +} + +static int +le_clear_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_clear_white_list_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_CLEAR_WHITE_LIST), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "White list cleared\n"); + + return (OK); +} + +static int +le_add_device_to_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_add_device_to_white_list_cp cp; + ng_hci_le_add_device_to_white_list_rp rp; + int n; + char ch; + optreset = 1; + optind = 0; + bool addr_set = false; + + n = sizeof(rp); + + cp.address_type = 0x00; + + while ((ch = getopt(argc, argv , "t:a:")) != -1) { + switch(ch) { + case 't': + if (strcmp(optarg, "public") == 0) + cp.address_type = 0x00; + else if (strcmp(optarg, "random") == 0) + cp.address_type = 0x01; + else + return (USAGE); + break; + case 'a': + addr_set = true; + if (!bt_aton(optarg, &cp.address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.address, he->h_addr, + sizeof(cp.address)); + } + break; + } + } + + if (addr_set == false) + return (USAGE); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Address added to white list\n"); + + return (OK); +} + +static int +le_remove_device_from_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_remove_device_from_white_list_cp cp; + ng_hci_le_remove_device_from_white_list_rp rp; + int n; + char ch; + optreset = 1; + optind = 0; + bool addr_set = false; + + n = sizeof(rp); + + cp.address_type = 0x00; + + while ((ch = getopt(argc, argv , "t:a:")) != -1) { + switch(ch) { + case 't': + if (strcmp(optarg, "public") == 0) + cp.address_type = 0x00; + else if (strcmp(optarg, "random") == 0) + cp.address_type = 0x01; + else + return (USAGE); + break; + case 'a': + addr_set = true; + if (!bt_aton(optarg, &cp.address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.address, he->h_addr, + sizeof(cp.address)); + } + break; + } + } + + if (addr_set == false) + return (USAGE); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Address removed from white list\n"); + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -839,5 +1010,31 @@ struct hci_command le_commands[] = { "le_scan [-a] [-v] [-n number_of_scans]\n" "Do an LE scan", &le_scan + }, + { + "le_read_white_list_size", + "le_read_white_list_size\n" + "Read total number of white list entries that can be stored", + &le_read_white_list_size + }, + { + "le_clear_white_list", + "le_clear_white_list\n" + "Clear the white list in the controller", + &le_clear_white_list + }, + { + "le_add_device_to_white_list", + "le_add_device_to_white_list\n" + "[-t public|random] -a address\n" + "Add device to the white list", + &le_add_device_to_white_list + }, + { + "le_remove_device_from_white_list", + "le_remove_device_from_white_list\n" + "[-t public|random] -a address\n" + "Remove device from the white list", + &le_remove_device_from_white_list }, }; From owner-svn-src-head@freebsd.org Tue May 19 13:54:34 2020 Return-Path: Delivered-To: svn-src-head@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 764652D87C1; Tue, 19 May 2020 13:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHSB2Sr3z4YHn; Tue, 19 May 2020 13:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FFEAB5F8; Tue, 19 May 2020 13:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDsYMs021947; Tue, 19 May 2020 13:54:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDsYC8021946; Tue, 19 May 2020 13:54:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191354.04JDsYC8021946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 13:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361253 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 13:54:34 -0000 Author: markj Date: Tue May 19 13:54:33 2020 New Revision: 361253 URL: https://svnweb.freebsd.org/changeset/base/361253 Log: Belatedly add a RELNOTES entry for r347532. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 13:52:34 2020 (r361252) +++ head/RELNOTES Tue May 19 13:54:33 2020 (r361253) @@ -174,4 +174,10 @@ r347908-r347923: ed(4), ep(4), ex(4), fe(4), pcn(4), sf(4), sn(4), tl(4), tx(4), txp(4), vx(4), wb(4), xe(4). +r347532: + Wired page accounting has been split into kernel wirings and user + wirings (e.g., by mlock(2)). Kernel wirings no long count towards + the global limit, which is renamed to vm.max_user_wired. bhyve -S + allocates user-wired memory and is now subject to that limit. + $FreeBSD$ From owner-svn-src-head@freebsd.org Tue May 19 13:58:53 2020 Return-Path: Delivered-To: svn-src-head@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 8816E2D88FB; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHY92Gyyz4Yd1; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49431B5FA; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDwr2A022202; Tue, 19 May 2020 13:58:53 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDwrhv022201; Tue, 19 May 2020 13:58:53 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005191358.04JDwrhv022201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 19 May 2020 13:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361254 - head/sys/netgraph/bluetooth/include X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/include X-SVN-Commit-Revision: 361254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 13:58:53 -0000 Author: takawata Date: Tue May 19 13:58:52 2020 New Revision: 361254 URL: https://svnweb.freebsd.org/changeset/base/361254 Log: Fix Typo in ng_hci_le_connection_complete_ep struct. PR: 246538 Submitted by: Marc Veldman Modified: head/sys/netgraph/bluetooth/include/ng_hci.h Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Tue May 19 13:54:33 2020 (r361253) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Tue May 19 13:58:52 2020 (r361254) @@ -1964,7 +1964,7 @@ typedef struct { u_int16_t interval; u_int8_t latency; u_int16_t supervision_timeout; - u_int8_t master_clock_accracy; + u_int8_t master_clock_accuracy; } __attribute__ ((packed)) ng_hci_le_connection_complete_ep; From owner-svn-src-head@freebsd.org Tue May 19 15:02:30 2020 Return-Path: Delivered-To: svn-src-head@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 E790E2DB216; Tue, 19 May 2020 15:02:30 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (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 49RJyY3QnGz4f1l; Tue, 19 May 2020 15:02:29 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.2] (pool-74-110-182-118.rcmdva.fios.verizon.net [74.110.182.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 2898C2700092; Tue, 19 May 2020 11:02:28 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 2898C2700092 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1589900548; bh=UCs2cCLpTnnmn/S+nmUrWIlRIRC/J+ss33J/43D3sqs=; h=Subject:To:From:Date:From; b=bjus9jygTBuK/tiFbnBrv+CR2h92pbhoBj1VyHIEeEenyR/pDOPr3b4fXik6B7W+r Qh8VEn2nrwuXzo4sH0wtTYDcl1tCEMoCuH6+2djg4jte/RDZyjOgJAA0daGwsAod4G HVOfBp0i/jSxhs8SeGm4FFi2WEkKJjCzGTbR4nF9GzxZvUNthIkPiILkJzYRE/0brp qfNGiQAf1hy9fVLMOwkk+t7PAn9+pMFRqZu4ezkhfYEB2z1YooGvAFoSa+/x4XA0ga /ZR0fFzkMhvKGnocdAeHziyw0dJbtU07xlaiGXN6gerSrdhhAjybVl4jx6fmJumlfb zc0m634YLma9A== Subject: Re: svn commit: r347418 - head/sys/net To: Kristof Provost , Eric Joyner , Jacob Keller , shurd@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905100041.x4A0fhNT083122@repo.freebsd.org> <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> From: Andrew Gallatin Message-ID: Date: Tue, 19 May 2020 11:02:27 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49RJyY3QnGz4f1l X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.duke.edu header.s=mail0816 header.b=bjus9jyg; dmarc=pass (policy=none) header.from=cs.duke.edu; spf=pass (mx1.freebsd.org: domain of gallatin@cs.duke.edu designates 152.3.140.1 as permitted sender) smtp.mailfrom=gallatin@cs.duke.edu X-Spamd-Result: default: False [-3.71 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cs.duke.edu:s=mail0816]; RCVD_IN_DNSWL_LOW(-0.10)[152.3.140.1:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:152.3.140.0/23]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_MEDIUM(-0.97)[-0.974]; DWL_DNSWL_LOW(-1.00)[duke.edu:dkim]; RECEIVED_SPAMHAUS_PBL(0.00)[74.110.182.118:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cs.duke.edu:+]; DMARC_POLICY_ALLOW(-0.50)[cs.duke.edu,none]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.63)[-0.633]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13371, ipnet:152.3.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:02:31 -0000 On 2020-05-19 04:21, Kristof Provost wrote: > The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, INT32_MAX, > INT32_MAX},|, so presumably that’s the cause. > I don’t know what a sane value would be though. I’ve defaulted to 4096 > (because that’s what some other iflib users seems to do) for now, and > that seems to work. It doesn’t panic and I can get traffic through it at > least: You seem to be setting the max, not the default, and 4K max descriptors on a 100g device is going to basically cripple it. How about setting to the next power of 2 below max int so as to keep with the authors intent? If we don't already have a macro, something like (INT32_MAX >> 1) + 1 Drew From owner-svn-src-head@freebsd.org Tue May 19 15:19:39 2020 Return-Path: Delivered-To: svn-src-head@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 C03BF2DB774; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKLM4gSRz4gCD; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B224CD12; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JFJdOo071106; Tue, 19 May 2020 15:19:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JFJd7f071105; Tue, 19 May 2020 15:19:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005191519.04JFJd7f071105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 15:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361257 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:19:39 -0000 Author: kevans Date: Tue May 19 15:19:39 2020 New Revision: 361257 URL: https://svnweb.freebsd.org/changeset/base/361257 Log: bsdinstall: do a `certctl rehash` upon installation of configuration If certctl is installed on the system we're configuring, do a certctl rehash. Note that certctl may not be present if the world we've installed was built either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't currently see if the host has a certctl as this may be an indication that the system *shouldn't* have certs installed into /etc/ssl. Reviewed by: allanjude, dteske MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24640 Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Tue May 19 14:42:09 2020 (r361256) +++ head/usr.sbin/bsdinstall/scripts/config Tue May 19 15:19:39 2020 (r361257) @@ -55,6 +55,9 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 +if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then + chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash +fi exit 0 From owner-svn-src-head@freebsd.org Tue May 19 15:23:39 2020 Return-Path: Delivered-To: svn-src-head@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 E52A12DB9D6; Tue, 19 May 2020 15:23:39 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKQz1l08z3RRY; Tue, 19 May 2020 15:23:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04JFNULQ006637; Tue, 19 May 2020 08:23:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFNTdn006636; Tue, 19 May 2020 08:23:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <202005190241.04J2f54E001347@repo.freebsd.org> To: Kyle Evans Date: Tue, 19 May 2020 08:23:29 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49RKQz1l08z3RRY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:23:40 -0000 > Author: kevans > Date: Tue May 19 02:41:05 2020 > New Revision: 361238 > URL: https://svnweb.freebsd.org/changeset/base/361238 > > Log: > zfs: reject read(2) of a dirfd with EISDIR > > This is independent of the recently-discussed global change, which is still > in review/discussion stage. > > This is effectively a measure for consistency in the ZFS world, where > FreeBSD was the only platform (as far as I could find) that allowed this. > What ZFS exposes is decidedly not useful for any real purposes, to > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > The size of a directory in ZFS is the number of directory entries within. > When reading a directory, you would instead get the leading part of its raw > contents; the amount you get being dictated by the "size," i.e. number of > directory entries. There's decidedly (luckily) no stack disclosure happening > here, though the behavior is bizarre and almost certainly a historical > accident. > > This change has already been upstreamed to OpenZFS. Until the grep -d skip issue is addressed I object to this change as it is going to cause people who do grep with wildcards to see lots of errors that before where pretty much either silent (no match occured) or spit out a "binary file foo matches." > > MFC after: 1 week Please no. > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:07:08 2020 (r361237) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:41:05 2020 (r361238) > @@ -646,6 +646,12 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * > ZFS_ENTER(zfsvfs); > ZFS_VERIFY_ZP(zp); > > + /* We don't copy out anything useful for directories. */ > + if (vp->v_type == VDIR) { > + ZFS_EXIT(zfsvfs); > + return (SET_ERROR(EISDIR)); > + } > + > if (zp->z_pflags & ZFS_AV_QUARANTINED) { > ZFS_EXIT(zfsvfs); > return (SET_ERROR(EACCES)); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue May 19 15:25:50 2020 Return-Path: Delivered-To: svn-src-head@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 78F3F2DBE2E; Tue, 19 May 2020 15:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKTV2fK9z3RnC; Tue, 19 May 2020 15:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 50C5B2B97E; Tue, 19 May 2020 15:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id i68so11465697qtb.5; Tue, 19 May 2020 08:25:50 -0700 (PDT) X-Gm-Message-State: AOAM531/ybg3eRoDE90pTnS3tcbkvO19inUFEsByxoCy2Rsx+TPLusrB 2EZ+mXw5taip0I8vtZ4cs/v1Gmwazg+rT/a1FCY= X-Google-Smtp-Source: ABdhPJxWMLHSez29Bx5kVv/HAOGGvuB3HJTGwaZyBHwz3FSdCfO9XMeUED/U660D24iaVHl6y6JQB0N3XOMlPb4VEFU= X-Received: by 2002:ac8:361b:: with SMTP id m27mr284075qtb.60.1589901949798; Tue, 19 May 2020 08:25:49 -0700 (PDT) MIME-Version: 1.0 References: <202005190241.04J2f54E001347@repo.freebsd.org> <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> In-Reply-To: <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:25:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:25:50 -0000 On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Tue May 19 02:41:05 2020 > > New Revision: 361238 > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > Log: > > zfs: reject read(2) of a dirfd with EISDIR > > > > This is independent of the recently-discussed global change, which is still > > in review/discussion stage. > > > > This is effectively a measure for consistency in the ZFS world, where > > FreeBSD was the only platform (as far as I could find) that allowed this. > > What ZFS exposes is decidedly not useful for any real purposes, to > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > The size of a directory in ZFS is the number of directory entries within. > > When reading a directory, you would instead get the leading part of its raw > > contents; the amount you get being dictated by the "size," i.e. number of > > directory entries. There's decidedly (luckily) no stack disclosure happening > > here, though the behavior is bizarre and almost certainly a historical > > accident. > > > > This change has already been upstreamed to OpenZFS. > > Until the grep -d skip issue is addressed I object to this change as > it is going to cause people who do grep with wildcards to see lots > of errors that before where pretty much either silent (no match occured) > or spit out a "binary file foo matches." > That seems preferable to grepping random bytes that don't particularly contain any strings? They'd never see "binary file foo matches" in this case. This isn't exactly divergent from the behavior they'd see with ZFS anywhere else. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Tue May 19 15:27:20 2020 Return-Path: Delivered-To: svn-src-head@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 F28232DBFD1; Tue, 19 May 2020 15:27:20 +0000 (UTC) (envelope-from andrew@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKWD67KGz3SCp; Tue, 19 May 2020 15:27:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD996D019; Tue, 19 May 2020 15:27:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JFRK5U077741; Tue, 19 May 2020 15:27:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JFRKjG077740; Tue, 19 May 2020 15:27:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005191527.04JFRKjG077740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 May 2020 15:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361258 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 361258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:27:21 -0000 Author: andrew Date: Tue May 19 15:27:20 2020 New Revision: 361258 URL: https://svnweb.freebsd.org/changeset/base/361258 Log: Create MSI/MSI-X isrcs as needed in the GICv3 ITS driver Previously we would create an isrc for each MSI/MSI-X interrupt. This causes issues for other interrupt sources in the system, e.g. a GPIO driver, as they may be unable to allocate interrupts. This works around this by allocating the isrc only when needed. Reported by: alisaidi@amazon.com Reviewed by: mmel Sponsored by: Innovaate UK Differential Revision: https://reviews.freebsd.org/D24876 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Tue May 19 15:19:39 2020 (r361257) +++ head/sys/arm64/arm64/gicv3_its.c Tue May 19 15:27:20 2020 (r361258) @@ -228,6 +228,7 @@ struct gicv3_its_irqsrc { u_int gi_id; u_int gi_lpi; struct its_dev *gi_its_dev; + TAILQ_ENTRY(gicv3_its_irqsrc) gi_link; }; struct gicv3_its_softc { @@ -254,12 +255,14 @@ struct gicv3_its_softc { size_t sc_its_cmd_next_idx; vmem_t *sc_irq_alloc; - struct gicv3_its_irqsrc *sc_irqs; + struct gicv3_its_irqsrc **sc_irqs; u_int sc_irq_base; u_int sc_irq_length; + u_int sc_irq_count; struct mtx sc_its_dev_lock; TAILQ_HEAD(its_dev_list, its_dev) sc_its_dev_list; + TAILQ_HEAD(free_irqs, gicv3_its_irqsrc) sc_free_irqs; #define ITS_FLAGS_CMDQ_FLUSH 0x00000001 #define ITS_FLAGS_LPI_CONF_FLUSH 0x00000002 @@ -800,7 +803,6 @@ static int gicv3_its_attach(device_t dev) { struct gicv3_its_softc *sc; - const char *name; uint32_t iidr; int domain, err, i, rid; @@ -875,6 +877,7 @@ gicv3_its_attach(device_t dev) its_init_cpu(dev, sc); TAILQ_INIT(&sc->sc_its_dev_list); + TAILQ_INIT(&sc->sc_free_irqs); /* * Create the vmem object to allocate INTRNG IRQs from. We try to @@ -887,13 +890,6 @@ gicv3_its_attach(device_t dev) sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * sc->sc_irq_length, M_GICV3_ITS, M_WAITOK | M_ZERO); - name = device_get_nameunit(dev); - for (i = 0; i < sc->sc_irq_length; i++) { - sc->sc_irqs[i].gi_id = -1; - sc->sc_irqs[i].gi_lpi = i + sc->sc_irq_base - GIC_FIRST_LPI; - err = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, 0, - "%s,%u", name, i); - } /* For GIC-500 install tracking sysctls. */ if ((iidr & (GITS_IIDR_PRODUCT_MASK | GITS_IIDR_IMPLEMENTOR_MASK)) == @@ -975,7 +971,7 @@ gicv3_its_intr(void *arg, uintptr_t irq) struct trapframe *tf; irq -= sc->sc_irq_base; - girq = &sc->sc_irqs[irq]; + girq = sc->sc_irqs[irq]; if (girq == NULL) panic("gicv3_its_intr: Invalid interrupt %ld", irq + sc->sc_irq_base); @@ -1201,6 +1197,53 @@ its_device_release(device_t dev, struct its_dev *its_d free(its_dev, M_GICV3_ITS); } +static struct gicv3_its_irqsrc * +gicv3_its_alloc_irqsrc(device_t dev, struct gicv3_its_softc *sc, u_int irq) +{ + struct gicv3_its_irqsrc *girq = NULL; + + KASSERT(sc->sc_irqs[irq] == NULL, + ("%s: Interrupt %u already allocated", __func__, irq)); + mtx_lock_spin(&sc->sc_its_dev_lock); + if (!TAILQ_EMPTY(&sc->sc_free_irqs)) { + girq = TAILQ_FIRST(&sc->sc_free_irqs); + TAILQ_REMOVE(&sc->sc_free_irqs, girq, gi_link); + } + mtx_unlock_spin(&sc->sc_its_dev_lock); + if (girq == NULL) { + girq = malloc(sizeof(*girq), M_GICV3_ITS, + M_NOWAIT | M_ZERO); + if (girq == NULL) + return (NULL); + girq->gi_id = -1; + if (intr_isrc_register(&girq->gi_isrc, dev, 0, + "%s,%u", device_get_nameunit(dev), irq) != 0) { + free(girq, M_GICV3_ITS); + return (NULL); + } + } + girq->gi_lpi = irq + sc->sc_irq_base - GIC_FIRST_LPI; + sc->sc_irqs[irq] = girq; + + return (girq); +} + +static void +gicv3_its_release_irqsrc(struct gicv3_its_softc *sc, + struct gicv3_its_irqsrc *girq) +{ + u_int irq; + + mtx_assert(&sc->sc_its_dev_lock, MA_OWNED); + + irq = girq->gi_lpi + GIC_FIRST_LPI - sc->sc_irq_base; + sc->sc_irqs[irq] = NULL; + + girq->gi_id = -1; + girq->gi_its_dev = NULL; + TAILQ_INSERT_TAIL(&sc->sc_free_irqs, girq, gi_link); +} + static int gicv3_its_alloc_msi(device_t dev, device_t child, int count, int maxcount, device_t *pic, struct intr_irqsrc **srcs) @@ -1220,12 +1263,35 @@ gicv3_its_alloc_msi(device_t dev, device_t child, int sc = device_get_softc(dev); irq = its_dev->lpis.lpi_base + its_dev->lpis.lpi_num - its_dev->lpis.lpi_free; + + /* Allocate the irqsrc for each MSI */ for (i = 0; i < count; i++, irq++) { its_dev->lpis.lpi_free--; - girq = &sc->sc_irqs[irq]; + srcs[i] = (struct intr_irqsrc *)gicv3_its_alloc_irqsrc(dev, + sc, irq); + if (srcs[i] == NULL) + break; + } + + /* The allocation failed, release them */ + if (i != count) { + mtx_lock_spin(&sc->sc_its_dev_lock); + for (i = 0; i < count; i++) { + girq = (struct gicv3_its_irqsrc *)srcs[i]; + if (girq == NULL) + break; + gicv3_its_release_irqsrc(sc, girq); + srcs[i] = NULL; + } + mtx_unlock_spin(&sc->sc_its_dev_lock); + return (ENXIO); + } + + /* Finish the allocation now we have all MSI irqsrcs */ + for (i = 0; i < count; i++) { + girq = (struct gicv3_its_irqsrc *)srcs[i]; girq->gi_id = i; girq->gi_its_dev = its_dev; - srcs[i] = (struct intr_irqsrc *)girq; /* Map the message to the given IRQ */ gicv3_its_select_cpu(dev, (struct intr_irqsrc *)girq); @@ -1241,6 +1307,7 @@ static int gicv3_its_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { + struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; int i; @@ -1254,11 +1321,14 @@ gicv3_its_release_msi(device_t dev, device_t child, in ("gicv3_its_release_msi: Releasing more interrupts than " "were allocated: releasing %d, allocated %d", count, its_dev->lpis.lpi_busy)); + + sc = device_get_softc(dev); + mtx_lock_spin(&sc->sc_its_dev_lock); for (i = 0; i < count; i++) { girq = (struct gicv3_its_irqsrc *)isrc[i]; - girq->gi_id = -1; - girq->gi_its_dev = NULL; + gicv3_its_release_irqsrc(sc, girq); } + mtx_unlock_spin(&sc->sc_its_dev_lock); its_dev->lpis.lpi_busy -= count; if (its_dev->lpis.lpi_busy == 0) @@ -1286,7 +1356,10 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev sc = device_get_softc(dev); irq = its_dev->lpis.lpi_base + its_dev->lpis.lpi_num - its_dev->lpis.lpi_free; - girq = &sc->sc_irqs[irq]; + + girq = gicv3_its_alloc_irqsrc(dev, sc, irq); + if (girq == NULL) + return (ENXIO); girq->gi_id = its_dev->lpis.lpi_busy; girq->gi_its_dev = its_dev; @@ -1306,6 +1379,7 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev static int gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { + struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; @@ -1317,9 +1391,10 @@ gicv3_its_release_msix(device_t dev, device_t child, s KASSERT(its_dev->lpis.lpi_busy > 0, ("gicv3_its_release_msix: Releasing more interrupts than " "were allocated: allocated %d", its_dev->lpis.lpi_busy)); + + sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - girq->gi_its_dev = NULL; - girq->gi_id = -1; + gicv3_its_release_irqsrc(sc, girq); its_dev->lpis.lpi_busy--; if (its_dev->lpis.lpi_busy == 0) From owner-svn-src-head@freebsd.org Tue May 19 15:27:46 2020 Return-Path: Delivered-To: svn-src-head@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 C4FEE2DC20B; Tue, 19 May 2020 15:27:46 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKWk36XYz3SGZ; Tue, 19 May 2020 15:27:46 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04JFRikf006684; Tue, 19 May 2020 08:27:44 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFRiMs006683; Tue, 19 May 2020 08:27:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: To: Kyle Evans Date: Tue, 19 May 2020 08:27:44 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49RKWk36XYz3SGZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:27:46 -0000 > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > wrote: > > > > > Author: kevans > > > Date: Tue May 19 02:41:05 2020 > > > New Revision: 361238 > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > Log: > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > This is independent of the recently-discussed global change, which is still > > > in review/discussion stage. > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > When reading a directory, you would instead get the leading part of its raw > > > contents; the amount you get being dictated by the "size," i.e. number of > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > here, though the behavior is bizarre and almost certainly a historical > > > accident. > > > > > > This change has already been upstreamed to OpenZFS. > > > > Until the grep -d skip issue is addressed I object to this change as > > it is going to cause people who do grep with wildcards to see lots > > of errors that before where pretty much either silent (no match occured) > > or spit out a "binary file foo matches." > > > > That seems preferable to grepping random bytes that don't particularly > contain any strings? They'd never see "binary file foo matches" in > this case. The difference is you rarely get a hit, and now your gauranteed to get a hit on every single directory making grep * very noisy, where it was often silent or nearly silent before. > > This isn't exactly divergent from the behavior they'd see with ZFS > anywhere else. It is extremly divergent from 42 years of behavior. > Thanks, > > Kyle Evans > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue May 19 15:31:01 2020 Return-Path: Delivered-To: svn-src-head@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 7B5742DC134; Tue, 19 May 2020 15:31:01 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKbT19pYz3ScY; Tue, 19 May 2020 15:31:00 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04JFUxHY006712; Tue, 19 May 2020 08:30:59 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFUxCC006711; Tue, 19 May 2020 08:30:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191530.04JFUxCC006711@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org Date: Tue, 19 May 2020 08:30:59 -0700 (PDT) CC: Kyle Evans , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49RKbT19pYz3ScY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:31:01 -0000 > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > wrote: > > > > > > > Author: kevans > > > > Date: Tue May 19 02:41:05 2020 > > > > New Revision: 361238 > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > Log: > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > in review/discussion stage. > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > When reading a directory, you would instead get the leading part of its raw > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > here, though the behavior is bizarre and almost certainly a historical > > > > accident. > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > it is going to cause people who do grep with wildcards to see lots > > > of errors that before where pretty much either silent (no match occured) > > > or spit out a "binary file foo matches." > > > > > > > That seems preferable to grepping random bytes that don't particularly > > contain any strings? They'd never see "binary file foo matches" in > > this case. > > The difference is you rarely get a hit, and now your gauranteed to > get a hit on every single directory making grep * very noisy, where > it was often silent or nearly silent before. Please, go try this and see if you can see why I am asserting what I am: (on one of your patched systems) cd /etc grep foo * grep -d skip foo * #This makes it closer to old behavior, not exact as binary matches shall be skipped. The first command isg going to return an error for every directory, the second command, closer to historical behavior, is going to be nearly silent. You could run the second command on a pre patched system, ufs or zfs wont matter much. > > This isn't exactly divergent from the behavior they'd see with ZFS > > anywhere else. > > It is extremly divergent from 42 years of behavior. > > > Thanks, > > > > Kyle Evans > > > > -- > Rod Grimes rgrimes@freebsd.org > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue May 19 15:31:42 2020 Return-Path: Delivered-To: svn-src-head@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 6D1882DC505; Tue, 19 May 2020 15:31:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKcG1w1Xz3T0v; Tue, 19 May 2020 15:31:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 970E12C61E; Tue, 19 May 2020 15:31:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id b6so15603395qkh.11; Tue, 19 May 2020 08:31:41 -0700 (PDT) X-Gm-Message-State: AOAM530mVNhlFvGbTZNtpnFrAU5jPanaHUXZSsbQhtt5Lq/tmzO2yzUe X+3a8MMRoExuKCA+7NKl/1OYq886wL2H8g6c8lc= X-Google-Smtp-Source: ABdhPJySxY22UQ2jLVIsYxGQ7gG5Mt48i6fQzRXuTExxuVvvuyOgPcPNv7AKmOlxb38jAXgyZkCRiwuRYDZDpLgm+tg= X-Received: by 2002:a37:5b47:: with SMTP id p68mr21800981qkb.120.1589902296704; Tue, 19 May 2020 08:31:36 -0700 (PDT) MIME-Version: 1.0 References: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> In-Reply-To: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:31:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:31:42 -0000 On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes wrote: > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > wrote: > > > > > > > Author: kevans > > > > Date: Tue May 19 02:41:05 2020 > > > > New Revision: 361238 > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > Log: > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > in review/discussion stage. > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > When reading a directory, you would instead get the leading part of its raw > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > here, though the behavior is bizarre and almost certainly a historical > > > > accident. > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > it is going to cause people who do grep with wildcards to see lots > > > of errors that before where pretty much either silent (no match occured) > > > or spit out a "binary file foo matches." > > > > > > > That seems preferable to grepping random bytes that don't particularly > > contain any strings? They'd never see "binary file foo matches" in > > this case. > > The difference is you rarely get a hit, and now your gauranteed to > get a hit on every single directory making grep * very noisy, where > it was often silent or nearly silent before. > As you noted in the review for the larger change, -d skip is a good option for the people that don't like this. It probably makes sense as a default, but then we'd be diverging from the other popular grep that defaults to -d read and spews out EISDIR more often than not. > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > anywhere else. > > It is extremly divergent from 42 years of behavior. > I don't think ZFS has been implemented on FreeBSD for 42 years, and I don't find this grep argument compelling enough to restore peoples' ability to read the raw znode of a directory. From owner-svn-src-head@freebsd.org Tue May 19 15:34:50 2020 Return-Path: Delivered-To: svn-src-head@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 28D082DC550; Tue, 19 May 2020 15:34:50 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKgs6Kntz3T6K; Tue, 19 May 2020 15:34:49 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04JFYlO6006760; Tue, 19 May 2020 08:34:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFYlSQ006759; Tue, 19 May 2020 08:34:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: To: Kyle Evans Date: Tue, 19 May 2020 08:34:47 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49RKgs6Kntz3T6K X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:34:50 -0000 > On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes > wrote: > > > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > > wrote: > > > > > > > > > Author: kevans > > > > > Date: Tue May 19 02:41:05 2020 > > > > > New Revision: 361238 > > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > > > Log: > > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > > in review/discussion stage. > > > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > > When reading a directory, you would instead get the leading part of its raw > > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > > here, though the behavior is bizarre and almost certainly a historical > > > > > accident. > > > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > > it is going to cause people who do grep with wildcards to see lots > > > > of errors that before where pretty much either silent (no match occured) > > > > or spit out a "binary file foo matches." > > > > > > > > > > That seems preferable to grepping random bytes that don't particularly > > > contain any strings? They'd never see "binary file foo matches" in > > > this case. > > > > The difference is you rarely get a hit, and now your gauranteed to > > get a hit on every single directory making grep * very noisy, where > > it was often silent or nearly silent before. > > > > As you noted in the review for the larger change, -d skip is a good > option for the people that don't like this. It probably makes sense as > a default, but then we'd be diverging from the other popular grep that > defaults to -d read and spews out EISDIR more often than not. Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-) > > > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > > anywhere else. > > > > It is extremly divergent from 42 years of behavior. > > > > I don't think ZFS has been implemented on FreeBSD for 42 years, and I > don't find this grep argument compelling enough to restore peoples' > ability to read the raw znode of a directory. The EISDIR behavior is what your changing, independent of file system(s) you have done so far. The fact the behavior is now different between UFS and ZFS is sic, IMHO. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue May 19 15:37:58 2020 Return-Path: Delivered-To: svn-src-head@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 EA1CB2DC905; Tue, 19 May 2020 15:37:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKlV5wZGz3TVt; Tue, 19 May 2020 15:37:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C13B82C85C; Tue, 19 May 2020 15:37:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f180.google.com with SMTP id v4so11504855qte.3; Tue, 19 May 2020 08:37:58 -0700 (PDT) X-Gm-Message-State: AOAM533T+1IrjoneEohoT9SRdZQ9i3IE89K/uIfRdfX95edV4/t12CIa sP2JmSGhrN1DGnLZb91GGZ00I7JAfl6PqjHm0U4= X-Google-Smtp-Source: ABdhPJzJtXBOd/bkLvjoZVjkzFvN10f5OeSXZpomG0JnEZ7IVERbFfyYnVyGJHLRJgvSTf9gmNwMebqJIWhMnaSW5Pc= X-Received: by 2002:ac8:37e6:: with SMTP id e35mr307742qtc.310.1589902678273; Tue, 19 May 2020 08:37:58 -0700 (PDT) MIME-Version: 1.0 References: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> In-Reply-To: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:37:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 15:37:59 -0000 On Tue, May 19, 2020 at 10:34 AM Rodney W. Grimes wrote: > > > On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes > > wrote: > > > > > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > > > wrote: > > > > > > > > > > > Author: kevans > > > > > > Date: Tue May 19 02:41:05 2020 > > > > > > New Revision: 361238 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > > > > > Log: > > > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > > > in review/discussion stage. > > > > > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > > > When reading a directory, you would instead get the leading part of its raw > > > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > > > here, though the behavior is bizarre and almost certainly a historical > > > > > > accident. > > > > > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > > > it is going to cause people who do grep with wildcards to see lots > > > > > of errors that before where pretty much either silent (no match occured) > > > > > or spit out a "binary file foo matches." > > > > > > > > > > > > > That seems preferable to grepping random bytes that don't particularly > > > > contain any strings? They'd never see "binary file foo matches" in > > > > this case. > > > > > > The difference is you rarely get a hit, and now your gauranteed to > > > get a hit on every single directory making grep * very noisy, where > > > it was often silent or nearly silent before. > > > > > > > As you noted in the review for the larger change, -d skip is a good > > option for the people that don't like this. It probably makes sense as > > a default, but then we'd be diverging from the other popular grep that > > defaults to -d read and spews out EISDIR more often than not. > > Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-) > > > > > > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > > > anywhere else. > > > > > > It is extremly divergent from 42 years of behavior. > > > > > > > I don't think ZFS has been implemented on FreeBSD for 42 years, and I > > don't find this grep argument compelling enough to restore peoples' > > ability to read the raw znode of a directory. > > The EISDIR behavior is what your changing, independent of file system(s) > you have done so far. The fact the behavior is now different between > UFS and ZFS is sic, IMHO. EISDIR in read(2) denotes that a filesystem does not support reading a directory, this isn't a new kind of error. In particular, ZFS traditionally does NOT support reading a directory like this. The behavior between UFS and ZFS should have always been different, this is correction of a historical *accident*. From owner-svn-src-head@freebsd.org Tue May 19 16:04:28 2020 Return-Path: Delivered-To: svn-src-head@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 325332DCE6C; Tue, 19 May 2020 16:04:28 +0000 (UTC) (envelope-from andrew@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RLL40bCfz3W94; Tue, 19 May 2020 16:04:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F7CDD905; Tue, 19 May 2020 16:04:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JG4RF7002453; Tue, 19 May 2020 16:04:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JG4RvR002450; Tue, 19 May 2020 16:04:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005191604.04JG4RvR002450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 May 2020 16:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361259 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 361259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 16:04:28 -0000 Author: andrew Date: Tue May 19 16:04:27 2020 New Revision: 361259 URL: https://svnweb.freebsd.org/changeset/base/361259 Log: Stop performing a full icache sync when the DIC and IDC flags are set The DIC and IDC bits in the CTR_EL0 register signal to the kernel when it can relax the instruction cache synchronisation operations. The IDC bit means we can relax cleaning the data cache to the point of unification while the DIC bit means we don't need to invalidate the instruction cache for data coherence. In both cases an appropriate barrier is still needed. For now only implement the case where both bits are set, as is the case on the Neoverse-N1 as used in the Amazon AWS Graviton 2 CPU. Note that this behaviour is a optional on the N1 so we may later need to implement only one or the other bit being set. There is a tunable to disable each flag on boot. Testing on a 4 core Graviton 2 instance found a significant improvement in sys and real time when running "make buildkernel -j4", with no significant difference in user time. Reviewed by: markj Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D24853 Modified: head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/arm64/cpufunc_asm.S Tue May 19 16:04:27 2020 (r361259) @@ -133,9 +133,20 @@ ENTRY(arm64_dcache_inv_range) END(arm64_dcache_inv_range) /* - * void arm64_icache_sync_range(vm_offset_t, vm_size_t) + * void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t) + * When the CTR_EL0.IDC bit is set cleaning to PoU becomes a dsb. + * When the CTR_EL0.DIC bit is set icache invalidation becomes an isb. */ -ENTRY(arm64_icache_sync_range) +ENTRY(arm64_dic_idc_icache_sync_range) + dsb ishst + isb + ret +END(arm64_dic_idc_icache_sync_range) + +/* + * void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t) + */ +ENTRY(arm64_aliasing_icache_sync_range) /* * XXX Temporary solution - I-cache flush should be range based for * PIPT cache or IALLUIS for VIVT or VIPT caches @@ -146,7 +157,7 @@ ENTRY(arm64_icache_sync_range) dsb ish isb ret -END(arm64_icache_sync_range) +END(arm64_aliasing_icache_sync_range) /* * int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t) Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/arm64/identcpu.c Tue May 19 16:04:27 2020 (r361259) @@ -56,6 +56,24 @@ char machine[] = "arm64"; extern int adaptive_machine_arch; #endif +static SYSCTL_NODE(_machdep, OID_AUTO, cache, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Cache management tuning"); + +static int allow_dic = 1; +SYSCTL_INT(_machdep_cache, OID_AUTO, allow_dic, CTLFLAG_RDTUN, &allow_dic, 0, + "Allow optimizations based on the DIC cache bit"); + +static int allow_idc = 1; +SYSCTL_INT(_machdep_cache, OID_AUTO, allow_idc, CTLFLAG_RDTUN, &allow_idc, 0, + "Allow optimizations based on the IDC cache bit"); + +/* + * The default implementation of I-cache sync assumes we have an + * aliasing cache until we know otherwise. + */ +void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t) = + &arm64_aliasing_icache_sync_range; + static int sysctl_hw_machine(SYSCTL_HANDLER_ARGS) { @@ -977,6 +995,7 @@ identify_cpu_sysinit(void *dummy __unused) { int cpu; u_long hwcap; + bool dic, idc; /* Create a user visible cpu description with safe values */ memset(&user_cpu_desc, 0, sizeof(user_cpu_desc)); @@ -985,6 +1004,8 @@ identify_cpu_sysinit(void *dummy __unused) ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64; user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; + dic = (allow_dic != 0); + idc = (allow_idc != 0); CPU_FOREACH(cpu) { print_cpu_features(cpu); hwcap = parse_cpu_features_hwcap(cpu); @@ -993,6 +1014,17 @@ identify_cpu_sysinit(void *dummy __unused) else elf_hwcap &= hwcap; update_user_regs(cpu); + + if (CTR_DIC_VAL(cpu_desc[cpu].ctr) == 0) + dic = false; + if (CTR_IDC_VAL(cpu_desc[cpu].ctr) == 0) + idc = false; + } + + if (dic && idc) { + arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; + if (bootverbose) + printf("Enabling DIC & IDC ICache sync\n"); } if ((elf_hwcap & HWCAP_ATOMICS) != 0) { Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/include/cpufunc.h Tue May 19 16:04:27 2020 (r361259) @@ -216,12 +216,15 @@ extern int64_t dczva_line_size; #define cpu_dcache_inv_range(a, s) arm64_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) arm64_dcache_wb_range((a), (s)) +extern void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t); + #define cpu_icache_sync_range(a, s) arm64_icache_sync_range((a), (s)) #define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) void arm64_nullop(void); void arm64_tlb_flushID(void); -void arm64_icache_sync_range(vm_offset_t, vm_size_t); +void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t); +void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); From owner-svn-src-head@freebsd.org Tue May 19 16:06:04 2020 Return-Path: Delivered-To: svn-src-head@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 1BD192DD508; Tue, 19 May 2020 16:06:04 +0000 (UTC) (envelope-from delphij@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RLMv75kGz3WDw; Tue, 19 May 2020 16:06:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE42D576; Tue, 19 May 2020 16:06:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JG63om002769; Tue, 19 May 2020 16:06:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JG63RU002768; Tue, 19 May 2020 16:06:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005191606.04JG63RU002768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 19 May 2020 16:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361260 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 361260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 16:06:04 -0000 Author: delphij Date: Tue May 19 16:06:03 2020 New Revision: 361260 URL: https://svnweb.freebsd.org/changeset/base/361260 Log: Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800 MFC after: 3 days Modified: head/usr.sbin/ntp/ntpd/leap-seconds Modified: head/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:04:27 2020 (r361259) +++ head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:06:03 2020 (r361260) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-head@freebsd.org Tue May 19 16:28:22 2020 Return-Path: Delivered-To: svn-src-head@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 203CE2DE344; Tue, 19 May 2020 16:28:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RLsd756nz3Xg9; Tue, 19 May 2020 16:28:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE204DD1C; Tue, 19 May 2020 16:28:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JGSLcw015033; Tue, 19 May 2020 16:28:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JGSKkM015028; Tue, 19 May 2020 16:28:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <202005191628.04JGSKkM015028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 19 May 2020 16:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361261 - in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Commit-Revision: 361261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 16:28:22 -0000 Author: np Date: Tue May 19 16:28:20 2020 New Revision: 361261 URL: https://svnweb.freebsd.org/changeset/base/361261 Log: cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a fatal error. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/device.c head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/adapter.h Tue May 19 16:28:20 2020 (r361261) @@ -830,6 +830,7 @@ struct adapter { int sc_do_rxcopy; struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ + struct task async_event_task; struct port_info *port[MAX_NPORTS]; uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue May 19 16:28:20 2020 (r361261) @@ -1085,7 +1085,7 @@ c4iw_so_upcall(struct socket *so, void *arg, int waitf * Wake up any threads waiting in rdma_init()/rdma_fini(), * with locks held. */ - if (so->so_error) + if (so->so_error || (ep->com.dev->rdev.flags & T4_FATAL_ERROR)) c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET); add_ep_to_req_list(ep, C4IW_EVENT_SOCKET); @@ -2700,6 +2700,11 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %s", __func__, cm_id, backlog); + if (c4iw_fatal_error(&dev->rdev)) { + CTR2(KTR_IW_CXGBE, "%s: cm_id %p, fatal error", __func__, + cm_id); + return -EIO; + } lep = alloc_ep(sizeof(*lep), GFP_KERNEL); lep->com.cm_id = cm_id; ref_cm_id(&lep->com); @@ -2800,7 +2805,6 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, { int ret = 0; int close = 0; - int fatal = 0; struct c4iw_rdev *rdev; @@ -2809,12 +2813,14 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, rdev = &ep->com.dev->rdev; if (c4iw_fatal_error(rdev)) { - - CTR2(KTR_IW_CXGBE, "%s:ced1 %p", __func__, ep); - fatal = 1; + CTR3(KTR_IW_CXGBE, "%s:ced1 fatal error %p %s", __func__, ep, + states[ep->com.state]); + if (ep->com.state != DEAD) { + send_abort(ep); + ep->com.state = DEAD; + } close_complete_upcall(ep, -ECONNRESET); - send_abort(ep); - ep->com.state = DEAD; + return ECONNRESET; } CTR3(KTR_IW_CXGBE, "%s:ced2 %p %s", __func__, ep, states[ep->com.state]); @@ -2877,9 +2883,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, CTR2(KTR_IW_CXGBE, "%s:ced4 %p", __func__, ep); set_bit(EP_DISC_ABORT, &ep->com.history); close_complete_upcall(ep, -ECONNRESET); - ret = send_abort(ep); - if (ret) - fatal = 1; + send_abort(ep); } else { CTR2(KTR_IW_CXGBE, "%s:ced5 %p", __func__, ep); @@ -2889,33 +2893,28 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, ep->com.state = MORIBUND; CURVNET_SET(ep->com.so->so_vnet); - sodisconnect(ep->com.so); + ret = sodisconnect(ep->com.so); CURVNET_RESTORE(); - } - - } - - if (fatal) { - set_bit(EP_DISC_FAIL, &ep->com.history); - if (!abrupt) { - STOP_EP_TIMER(ep); - close_complete_upcall(ep, -EIO); - } - if (ep->com.qp) { - struct c4iw_qp_attributes attrs = {0}; - - attrs.next_state = C4IW_QP_STATE_ERROR; - ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, - C4IW_QP_ATTR_NEXT_STATE, - &attrs, 1); if (ret) { - CTR2(KTR_IW_CXGBE, "%s:ced7 %p", __func__, ep); - printf("%s - qp <- error failed!\n", __func__); + CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); + STOP_EP_TIMER(ep); + send_abort(ep); + ep->com.state = DEAD; + close_complete_upcall(ep, -ECONNRESET); + set_bit(EP_DISC_FAIL, &ep->com.history); + if (ep->com.qp) { + struct c4iw_qp_attributes attrs = {0}; + + attrs.next_state = C4IW_QP_STATE_ERROR; + ret = c4iw_modify_qp( + ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, + &attrs, 1); + CTR3(KTR_IW_CXGBE, "%s:ced7 %p ret %d", + __func__, ep, ret); + } } } - release_ep_resources(ep); - ep->com.state = DEAD; - CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); } c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cedE %p", __func__, ep); Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/iw_cxgbe/device.c Tue May 19 16:28:20 2020 (r361261) @@ -261,11 +261,13 @@ static int c4iw_mod_load(void); static int c4iw_mod_unload(void); static int c4iw_activate(struct adapter *); static int c4iw_deactivate(struct adapter *); +static void c4iw_async_event(struct adapter *); static struct uld_info c4iw_uld_info = { .uld_id = ULD_IWARP, .activate = c4iw_activate, .deactivate = c4iw_deactivate, + .async_event = c4iw_async_event, }; static int @@ -324,6 +326,23 @@ c4iw_deactivate(struct adapter *sc) sc->iwarp_softc = NULL; return (0); +} + +static void +c4iw_async_event(struct adapter *sc) +{ + struct c4iw_dev *iwsc = sc->iwarp_softc; + + if (iwsc) { + struct ib_event event = {0}; + + device_printf(sc->dev, + "iWARP driver received FATAL ERROR event.\n"); + iwsc->rdev.flags |= T4_FATAL_ERROR; + event.event = IB_EVENT_DEVICE_FATAL; + event.device = &iwsc->ibdev; + ib_dispatch_event(&event); + } } static void Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/offload.h Tue May 19 16:28:20 2020 (r361261) @@ -228,6 +228,7 @@ struct uld_info { int uld_id; int (*activate)(struct adapter *); int (*deactivate)(struct adapter *); + void (*async_event)(struct adapter *); }; struct tom_tunables { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/t4_main.c Tue May 19 16:28:20 2020 (r361261) @@ -758,6 +758,7 @@ static int read_i2c(struct adapter *, struct t4_i2c_da static int clear_stats(struct adapter *, u_int); #ifdef TCP_OFFLOAD static int toe_capability(struct vi_info *, int); +static void t4_async_event(void *, int); #endif static int mod_event(module_t, int, void *); static int notify_siblings(device_t, int); @@ -1063,6 +1064,10 @@ t4_attach(device_t dev) callout_init(&sc->ktls_tick, 1); +#ifdef TCP_OFFLOAD + TASK_INIT(&sc->async_event_task, 0, t4_async_event, sc); +#endif + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1567,6 +1572,10 @@ t4_detach_common(device_t dev) } } +#ifdef TCP_OFFLOAD + taskqueue_drain(taskqueue_thread, &sc->async_event_task); +#endif + for (i = 0; i < sc->intr_count; i++) t4_free_irq(sc, &sc->irq[i]); @@ -2788,6 +2797,9 @@ t4_fatal_err(struct adapter *sc, bool fw_error) sc->flags |= ADAP_ERR; ADAPTER_UNLOCK(sc); } +#ifdef TCP_OFFLOAD + taskqueue_enqueue(taskqueue_thread, &sc->async_event_task); +#endif if (t4_panic_on_fatal_err) { log(LOG_ALERT, "%s: panic on fatal error after 30s", @@ -10857,6 +10869,25 @@ t4_deactivate_uld(struct adapter *sc, int id) sx_sunlock(&t4_uld_list_lock); return (rc); +} + +static void +t4_async_event(void *arg, int n) +{ + struct uld_info *ui; + struct adapter *sc = (struct adapter *)arg; + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4async") != 0) + return; + sx_slock(&t4_uld_list_lock); + SLIST_FOREACH(ui, &t4_uld_list, link) { + if (ui->uld_id == ULD_IWARP) { + ui->async_event(sc); + break; + } + } + sx_sunlock(&t4_uld_list_lock); + end_synchronized_op(sc, 0); } int From owner-svn-src-head@freebsd.org Tue May 19 17:58:37 2020 Return-Path: Delivered-To: svn-src-head@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 E8BF82F0862; Tue, 19 May 2020 17:58:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RNsn5pWHz3dsW; Tue, 19 May 2020 17:58:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-227.local (unknown [IPv6:2601:648:8203:2990:9412:53:a27d:47e8]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1F35B2D785; Tue, 19 May 2020 17:58:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: rgrimes@freebsd.org, Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 19 May 2020 10:58:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 17:58:38 -0000 On 5/19/20 8:34 AM, Rodney W. Grimes wrote: > The EISDIR behavior is what your changing, independent of file system(s) > you have done so far. The fact the behavior is now different between > UFS and ZFS is sic, IMHO. Oh please. NFS already fails with ESIDIR and has failed to read() directories for 30 years: https://svnweb.freebsd.org/csrg?view=revision&revision=41905 We haven't had riots in the streets over that. If you actually looked at what ZFS was returning for read(), it was useless. -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 19 18:34:50 2020 Return-Path: Delivered-To: svn-src-head@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 DCB6F2F1836; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPgZ5ZN0z3yK5; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA73EF68A; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIYoOb095794; Tue, 19 May 2020 18:34:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIYoS3095793; Tue, 19 May 2020 18:34:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191834.04JIYoS3095793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 18:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361262 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 18:34:50 -0000 Author: markj Date: Tue May 19 18:34:50 2020 New Revision: 361262 URL: https://svnweb.freebsd.org/changeset/base/361262 Log: Use the symbolic name for "modmetadata_set". MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue May 19 16:28:20 2020 (r361261) +++ head/sys/kern/kern_linker.c Tue May 19 18:34:50 2020 (r361262) @@ -369,8 +369,7 @@ linker_file_register_modules(linker_file_t lf) sx_assert(&kld_sx, SA_XLOCKED); - if (linker_file_lookup_set(lf, "modmetadata_set", &start, - &stop, NULL) != 0) { + if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL) != 0) { /* * This fallback should be unnecessary, but if we get booted * from boot2 instead of loader and we are missing our From owner-svn-src-head@freebsd.org Tue May 19 18:35:09 2020 Return-Path: Delivered-To: svn-src-head@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 64BBE2F189B; Tue, 19 May 2020 18:35:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPgx1z2fz3ygV; Tue, 19 May 2020 18:35:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EDD3F68B; Tue, 19 May 2020 18:35:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIZ9Bu095875; Tue, 19 May 2020 18:35:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIZ8uF095871; Tue, 19 May 2020 18:35:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191835.04JIZ8uF095871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 18:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361263 - in head/sys: netinet sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet sys X-SVN-Commit-Revision: 361263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 18:35:09 -0000 Author: markj Date: Tue May 19 18:35:08 2020 New Revision: 361263 URL: https://svnweb.freebsd.org/changeset/base/361263 Log: Define a module version for accept filter modules. Otherwise accept filters compiled into the kernel do not preempt preloaded accept filter modules. Then, the preloaded file registers its accept filter module before the kernel, and the kernel's attempt fails since duplicate accept filter list entries are not permitted. This causes the preloaded file's module to be released, since module_register_init() does a lookup by name, so the preloaded file is unloaded, and the accept filter's callback points to random memory since preload_delete_name() unmaps the file on x86 as of r336505. Add a new ACCEPT_FILTER_DEFINE macro which wraps the accept filter and module definitions, and ensures that a module version is defined. PR: 245870 Reported by: Thomas von Dein MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/accf_data.c head/sys/netinet/accf_dns.c head/sys/netinet/accf_http.c head/sys/sys/socketvar.h Modified: head/sys/netinet/accf_data.c ============================================================================== --- head/sys/netinet/accf_data.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_data.c Tue May 19 18:35:08 2020 (r361263) @@ -42,20 +42,7 @@ __FBSDID("$FreeBSD$"); static int sohasdata(struct socket *so, void *arg, int waitflag); -static struct accept_filter accf_data_filter = { - "dataready", - sohasdata, - NULL, - NULL -}; - -static moduledata_t accf_data_mod = { - "accf_data", - accept_filt_generic_mod_event, - &accf_data_filter -}; - -DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +ACCEPT_FILTER_DEFINE(accf_data, "dataready", sohasdata, NULL, NULL, 1); static int sohasdata(struct socket *so, void *arg, int waitflag) Modified: head/sys/netinet/accf_dns.c ============================================================================== --- head/sys/netinet/accf_dns.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_dns.c Tue May 19 18:35:08 2020 (r361263) @@ -41,6 +41,8 @@ /* check for full DNS request */ static int sohasdns(struct socket *so, void *arg, int waitflag); +ACCEPT_FILTER_DEFINE(accf_dns, "dnsready", sohasdns, NULL, NULL, 1); + struct packet { struct mbuf *m; /* Current mbuf. */ struct mbuf *n; /* nextpkt mbuf. */ @@ -55,21 +57,6 @@ struct packet { /* check we can skip over various parts of DNS request */ static int skippacket(struct sockbuf *sb); - -static struct accept_filter accf_dns_filter = { - "dnsready", - sohasdns, - NULL, - NULL -}; - -static moduledata_t accf_dns_mod = { - "accf_dns", - accept_filt_generic_mod_event, - &accf_dns_filter -}; - -DECLARE_MODULE(accf_dns, accf_dns_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); static int sohasdns(struct socket *so, void *arg, int waitflag) Modified: head/sys/netinet/accf_http.c ============================================================================== --- head/sys/netinet/accf_http.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_http.c Tue May 19 18:35:08 2020 (r361263) @@ -54,29 +54,16 @@ static int mbufstrncmp(struct mbuf *m, struct mbuf *np /* socketbuffer is full */ static int sbfull(struct sockbuf *sb); -static struct accept_filter accf_http_filter = { - "httpready", - sohashttpget, - NULL, - NULL -}; +ACCEPT_FILTER_DEFINE(accf_http, "httpready", sohashttpget, NULL, NULL, 1); -static moduledata_t accf_http_mod = { - "accf_http", - accept_filt_generic_mod_event, - &accf_http_filter -}; - -DECLARE_MODULE(accf_http, accf_http_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); - static int parse_http_version = 1; static SYSCTL_NODE(_net_inet_accf, OID_AUTO, http, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "HTTP accept filter"); SYSCTL_INT(_net_inet_accf_http, OID_AUTO, parsehttpversion, CTLFLAG_RW, -&parse_http_version, 1, -"Parse http version so that non 1.x requests work"); + &parse_http_version, 1, + "Parse http version so that non 1.x requests work"); #ifdef ACCF_HTTP_DEBUG #define DPRINT(fmt, args...) \ Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Tue May 19 18:34:50 2020 (r361262) +++ head/sys/sys/socketvar.h Tue May 19 18:35:08 2020 (r361263) @@ -335,6 +335,22 @@ struct accept_filter { SLIST_ENTRY(accept_filter) accf_next; }; +#define ACCEPT_FILTER_DEFINE(modname, filtname, cb, create, destroy, ver) \ + static struct accept_filter modname##_filter = { \ + .accf_name = filtname, \ + .accf_callback = cb, \ + .accf_create = create, \ + .accf_destroy = destroy, \ + }; \ + static moduledata_t modname##_mod = { \ + .name = __XSTRING(modname), \ + .evhand = accept_filt_generic_mod_event, \ + .priv = &modname##_filter, \ + }; \ + DECLARE_MODULE(modname, modname##_mod, SI_SUB_DRIVERS, \ + SI_ORDER_MIDDLE); \ + MODULE_VERSION(modname, 1) + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ACCF); MALLOC_DECLARE(M_PCB); From owner-svn-src-head@freebsd.org Tue May 19 18:38:47 2020 Return-Path: Delivered-To: svn-src-head@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 425792F1CB0; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPm708KMz3yjY; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00338F3BF; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIckWH096092; Tue, 19 May 2020 18:38:46 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIckHk096091; Tue, 19 May 2020 18:38:46 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005191838.04JIckHk096091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 18:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361264 - head X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 18:38:47 -0000 Author: freqlabs Date: Tue May 19 18:38:46 2020 New Revision: 361264 URL: https://svnweb.freebsd.org/changeset/base/361264 Log: Mention new dd flags in RELNOTES Approved by: mmacy (mentor) Sponsored by: iXsystems, Inc. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 18:35:08 2020 (r361263) +++ head/RELNOTES Tue May 19 18:38:46 2020 (r361264) @@ -87,6 +87,10 @@ r352304: ntpd is no longer by default locked in memory. rlimit memlock 32 or rlimit memlock 0 can be used to restore this behaviour. +r351770,r352920,r352922,r352923: + dd(1) now supports conv=fsync, conv=fdatasync, oflag=fsync, oflag=sync, + and iflag=fullblock flags, compatible with illumos and GNU. + r351522: Add kernel-side support for in-kernel Transport Layer Security (KTLS). KTLS permits using sendfile(2) over sockets using From owner-svn-src-head@freebsd.org Tue May 19 18:41:47 2020 Return-Path: Delivered-To: svn-src-head@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 0485F2F1CF7; Tue, 19 May 2020 18:41:47 +0000 (UTC) (envelope-from freqlabs@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPqZ6PLwz40Yb; Tue, 19 May 2020 18:41:46 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F26F61C; Tue, 19 May 2020 18:41:46 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIfks6097725; Tue, 19 May 2020 18:41:46 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIfkg7097724; Tue, 19 May 2020 18:41:46 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005191841.04JIfkg7097724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 18:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361265 - head X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 18:41:47 -0000 Author: freqlabs Date: Tue May 19 18:41:46 2020 New Revision: 361265 URL: https://svnweb.freebsd.org/changeset/base/361265 Log: Mention new jail(8) command hooks in RELNOTES Reported by: 0mp Approved by: mmacy (mentor) Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 18:38:46 2020 (r361264) +++ head/RELNOTES Tue May 19 18:41:46 2020 (r361265) @@ -13,6 +13,12 @@ Changes to this file should not be MFCed. r361238: ZFS will now reject read(2) of a dirfd with EISDIR. +r361066: + Add exec.prepare and exec.release hooks for jail(8) and jail.conf(5). + exec.prepare runs before mounts, so can be used to populate new jails. + exec.release runs after unmounts, so can be used to remove ephemeral + jails. + r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from From owner-svn-src-head@freebsd.org Tue May 19 19:53:13 2020 Return-Path: Delivered-To: svn-src-head@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 2F5BB2F39E2; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RRQ10XZBz44lx; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D61C1024F; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JJrCcS045656; Tue, 19 May 2020 19:53:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JJrCp2045655; Tue, 19 May 2020 19:53:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005191953.04JJrCp2045655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 19 May 2020 19:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361266 - head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Commit-Revision: 361266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 19:53:13 -0000 Author: tsoome Date: Tue May 19 19:53:12 2020 New Revision: 361266 URL: https://svnweb.freebsd.org/changeset/base/361266 Log: lz4 hash table does not start zeroed illumos issue: https://www.illumos.org/issues/12757 Submitted by: andyf Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue May 19 18:41:46 2020 (r361265) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue May 19 19:53:12 2020 (r361266) @@ -850,7 +850,7 @@ real_LZ4_compress(const char *source, char *dest, int #if defined(_KERNEL) || defined(_FAKE_KERNEL) void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); #else - void *ctx = malloc(sizeof(struct refTables)); + void *ctx = calloc(1, sizeof(struct refTables)); #endif int result; From owner-svn-src-head@freebsd.org Tue May 19 21:47:12 2020 Return-Path: Delivered-To: svn-src-head@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 6CF4E2F61E3; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RTxX2B2Xz4BC5; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 2CB372F1BC; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id A546D44D10; Tue, 19 May 2020 23:47:10 +0200 (CEST) From: "Kristof Provost" To: "Andrew Gallatin" Cc: "Eric Joyner" , "Jacob Keller" , shurd@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347418 - head/sys/net Date: Tue, 19 May 2020 23:47:10 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: In-Reply-To: References: <201905100041.x4A0fhNT083122@repo.freebsd.org> <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 21:47:12 -0000 On 19 May 2020, at 17:02, Andrew Gallatin wrote: > On 2020-05-19 04:21, Kristof Provost wrote: > >> The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, >> INT32_MAX, INT32_MAX},|, so presumably that’s the cause. >> I don’t know what a sane value would be though. I’ve defaulted to >> 4096 (because that’s what some other iflib users seems to do) for >> now, and that seems to work. It doesn’t panic and I can get traffic >> through it at least: > > You seem to be setting the max, not the default, and 4K max > descriptors on a 100g device is going to basically cripple it. > Yeah, I just grabbed whatever number other iflib users used. My immediate concern was to get it to stop panicking. > How about setting to the next power of 2 below max int so as to keep > with the authors intent? > Makes sense, yes. > If we don't already have a macro, something like (INT32_MAX >> 1) + 1 > https://reviews.freebsd.org/D24922 Best regards, Kristof From owner-svn-src-head@freebsd.org Tue May 19 21:48:46 2020 Return-Path: Delivered-To: svn-src-head@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 9B5F42F5FF6; Tue, 19 May 2020 21:48:46 +0000 (UTC) (envelope-from trasz@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RTzL3gmtz4BjK; Tue, 19 May 2020 21:48:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7976F11A14; Tue, 19 May 2020 21:48:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JLmkaF013665; Tue, 19 May 2020 21:48:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JLmkGn013663; Tue, 19 May 2020 21:48:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202005192148.04JLmkGn013663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 May 2020 21:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361267 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 361267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 21:48:46 -0000 Author: trasz Date: Tue May 19 21:48:45 2020 New Revision: 361267 URL: https://svnweb.freebsd.org/changeset/base/361267 Log: Make sys.netinet.output and sys.netinet6.output6 tests depend on python; they need to be able to run net_receiver.py. MFC after: 2 weeks Sponsored by: DARPA Modified: head/tests/sys/netinet/Makefile head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Tue May 19 19:53:12 2020 (r361266) +++ head/tests/sys/netinet/Makefile Tue May 19 21:48:45 2020 (r361267) @@ -10,6 +10,7 @@ ATF_TESTS_C= ip_reass_test \ socket_afinet ATF_TESTS_SH= carp fibs_test redirect divert forward output lpm +TEST_METADATA.output+= required_programs="python" PROGS= udp_dontroute tcp_user_cookie Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Tue May 19 19:53:12 2020 (r361266) +++ head/tests/sys/netinet6/Makefile Tue May 19 21:48:45 2020 (r361267) @@ -14,6 +14,7 @@ ATF_TESTS_SH= \ forward6 \ output6 \ lpm6 +TEST_METADATA.output6+= required_programs="python" ${PACKAGE}FILES+= exthdr.py ${PACKAGE}FILES+= mld.py From owner-svn-src-head@freebsd.org Tue May 19 21:55:29 2020 Return-Path: Delivered-To: svn-src-head@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 AB8932F649B; Tue, 19 May 2020 21:55:29 +0000 (UTC) (envelope-from trasz@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RV7548YBz4CFp; Tue, 19 May 2020 21:55:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E6911AA6; Tue, 19 May 2020 21:55:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JLtT4h019770; Tue, 19 May 2020 21:55:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JLtT1V019769; Tue, 19 May 2020 21:55:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202005192155.04JLtT1V019769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 May 2020 21:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361268 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 21:55:29 -0000 Author: trasz Date: Tue May 19 21:55:29 2020 New Revision: 361268 URL: https://svnweb.freebsd.org/changeset/base/361268 Log: Make sys.net.if_bridge_test depend on python; sys.net.if_bridge_test.span requires it. MFC after: 2 weeks Sponsored by: DARPA Modified: head/tests/sys/net/Makefile Modified: head/tests/sys/net/Makefile ============================================================================== --- head/tests/sys/net/Makefile Tue May 19 21:48:45 2020 (r361267) +++ head/tests/sys/net/Makefile Tue May 19 21:55:29 2020 (r361268) @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_bridge_test +TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test From owner-svn-src-head@freebsd.org Wed May 20 02:33:42 2020 Return-Path: Delivered-To: svn-src-head@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 5E8F82FCA0C; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RcJ61qRgz4XtJ; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D5B15043; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04K2Xg9E099151; Wed, 20 May 2020 02:33:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K2Xfds099148; Wed, 20 May 2020 02:33:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005200233.04K2Xfds099148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 20 May 2020 02:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361271 - in head/sys/powerpc: aim include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include X-SVN-Commit-Revision: 361271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 02:33:42 -0000 Author: jhibbits Date: Wed May 20 02:33:41 2020 New Revision: 361271 URL: https://svnweb.freebsd.org/changeset/base/361271 Log: powerpc/radix mmu: No need for delayed TLB invalidation x86 needs delayed TLB invalidation because invalidation requires an expensive IPI. PowerPC has had a TLB invalidation instruction since the POWER1 in 1990, so there's no need to delay anything. Modified: head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/include/proc.h Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Wed May 20 01:25:46 2020 (r361270) +++ head/sys/powerpc/aim/mmu_radix.c Wed May 20 02:33:41 2020 (r361271) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -406,7 +405,6 @@ static u_int64_t KPTphys; /* phys addr of kernel level static vm_offset_t qframe = 0; static struct mtx qframe_mtx; -static epoch_t pmap_epoch; void mmu_radix_activate(mmu_t mmu, struct thread *); void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); @@ -849,43 +847,6 @@ pa_cmp(const void *a, const void *b) PG_M | PG_A | RPTE_EAA_MASK | PG_V) -static void -pmap_epoch_init(void *arg __unused) -{ - pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); -} -SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); - -static bool -pmap_not_in_di(void) -{ - - return (curthread->td_md.md_invl_gen.gen == 0); -} - -#define PMAP_ASSERT_NOT_IN_DI() \ - KASSERT(pmap_not_in_di(), ("DI already started")) - -static void -pmap_delayed_invl_started(epoch_tracker_t et) -{ - epoch_enter_preempt(pmap_epoch, et); - curthread->td_md.md_invl_gen.gen = 1; -} - -static void -pmap_delayed_invl_finished(epoch_tracker_t et) -{ - curthread->td_md.md_invl_gen.gen = 0; - epoch_exit_preempt(pmap_epoch, et); -} - -static void -pmap_delayed_invl_wait(vm_page_t m __unused) -{ - epoch_wait_preempt(pmap_epoch); -} - static __inline void pmap_resident_count_inc(pmap_t pmap, int count) { @@ -1370,8 +1331,7 @@ out: } static void -reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap, bool start_di, - epoch_tracker_t et) +reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap) { if (pmap == NULL) @@ -1379,8 +1339,6 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked pmap_invalidate_all(pmap); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); - if (start_di) - pmap_delayed_invl_finished(et); } /* @@ -1410,8 +1368,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l struct spglist free; uint64_t inuse; int bit, field, freed; - bool start_di; - struct epoch_tracker et; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); @@ -1423,13 +1379,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l pc_marker = (struct pv_chunk *)&pc_marker_b; pc_marker_end = (struct pv_chunk *)&pc_marker_end_b; - /* - * A delayed invalidation block should already be active if - * pmap_advise() or pmap_remove() called this function by way - * of pmap_demote_l3e_locked(). - */ - start_di = pmap_not_in_di(); - mtx_lock(&pv_chunks_mutex); active_reclaims++; TAILQ_INSERT_HEAD(&pv_chunks, pc_marker, pc_lru); @@ -1454,21 +1403,16 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l * corresponding pmap is locked. */ if (pmap != next_pmap) { - reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, - start_di, &et); + reclaim_pv_chunk_leave_pmap(pmap, locked_pmap); pmap = next_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); - if (start_di) - pmap_delayed_invl_started(&et); mtx_lock(&pv_chunks_mutex); continue; } else if (pmap != locked_pmap) { if (PMAP_TRYLOCK(pmap)) { - if (start_di) - pmap_delayed_invl_started(&et); mtx_lock(&pv_chunks_mutex); continue; } else { @@ -1480,8 +1424,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l continue; goto next_chunk; } - } else if (start_di) - pmap_delayed_invl_started(&et); + } } /* @@ -1570,7 +1513,7 @@ next_chunk: TAILQ_REMOVE(&pv_chunks, pc_marker_end, pc_lru); active_reclaims--; mtx_unlock(&pv_chunks_mutex); - reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di, &et); + reclaim_pv_chunk_leave_pmap(pmap, locked_pmap); if (m_pc == NULL && !SLIST_EMPTY(&free)) { m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); @@ -2248,12 +2191,10 @@ mmu_radix_advise(mmu_t mmu, pmap_t pmap, vm_offset_t s vm_offset_t va, va_next; vm_page_t m; boolean_t anychanged; - struct epoch_tracker et; if (advice != MADV_DONTNEED && advice != MADV_FREE) return; anychanged = FALSE; - pmap_delayed_invl_started(&et); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); @@ -2347,7 +2288,6 @@ maybe_invlrng: if (anychanged) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(&et); } /* @@ -3176,7 +3116,6 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry struct spglist free; pml3_entry_t oldl3e, *l3e; vm_page_t mt, pdpg; - struct epoch_tracker et; KASSERT((newpde & (PG_M | PG_RW)) != PG_RW, ("pmap_enter_pde: newpde is missing PG_M")); @@ -3211,11 +3150,9 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry */ (void)pmap_remove_l3e(pmap, l3e, va, &free, lockp); } else { - pmap_delayed_invl_started(&et); if (pmap_remove_ptes(pmap, va, va + L3_PAGE_SIZE, l3e, &free, lockp)) pmap_invalidate_all(pmap); - pmap_delayed_invl_finished(&et); } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { @@ -4243,7 +4180,6 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); - PMAP_ASSERT_NOT_IN_DI(); vm_wait(NULL); PMAP_LOCK(pmap); } @@ -4513,26 +4449,6 @@ mmu_radix_protect(mmu_t mmu, pmap_t pmap, vm_offset_t #endif anychanged = FALSE; - /* - * Although this function delays and batches the invalidation - * of stale TLB entries, it does not need to call - * pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(), because it does not - * ordinarily destroy mappings. Stale TLB entries from - * protection-only changes need only be invalidated before the - * pmap lock is released, because protection-only changes do - * not destroy PV entries. Even operations that iterate over - * a physical page's PV list of mappings, like - * pmap_remove_write(), acquire the pmap lock for each - * mapping. Consequently, for protection-only changes, the - * pmap lock suffices to synchronize both page table and TLB - * updates. - * - * This function only destroys a mapping if pmap_demote_l3e() - * fails. In that case, stale TLB entries are immediately - * invalidated. - */ - PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); @@ -5194,7 +5110,6 @@ mmu_radix_remove(mmu_t mmu, pmap_t pmap, vm_offset_t s pml2_entry_t *l2e; pml3_entry_t ptpaddr, *l3e; struct spglist free; - struct epoch_tracker et; bool anyvalid; CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva); @@ -5212,7 +5127,6 @@ mmu_radix_remove(mmu_t mmu, pmap_t pmap, vm_offset_t s sva = (sva + PAGE_MASK) & ~PAGE_MASK; eva = (eva + PAGE_MASK) & ~PAGE_MASK; - pmap_delayed_invl_started(&et); PMAP_LOCK(pmap); /* @@ -5301,7 +5215,6 @@ out: if (anyvalid) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(&et); vm_page_free_pages_toq(&free, true); } @@ -5384,7 +5297,6 @@ retry: } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(lock); - pmap_delayed_invl_wait(m); vm_page_free_pages_toq(&free, true); } @@ -5661,7 +5573,6 @@ retry: } rw_wunlock(lock); vm_page_aflag_clear(m, PGA_WRITEABLE); - pmap_delayed_invl_wait(m); } /* Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Wed May 20 01:25:46 2020 (r361270) +++ head/sys/powerpc/include/proc.h Wed May 20 02:33:41 2020 (r361271) @@ -37,18 +37,12 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ -struct pmap_invl_gen { - u_long gen; /* (k) */ - LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ -}; - /* * Machine-dependent part of the proc structure */ struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_msr; /* (k) */ - struct pmap_invl_gen md_invl_gen; }; struct mdproc { From owner-svn-src-head@freebsd.org Wed May 20 04:16:14 2020 Return-Path: Delivered-To: svn-src-head@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 700EF2FDF1C; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RfZQ2KDjz4dHZ; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468C616685; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04K4GEet061362; Wed, 20 May 2020 04:16:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K4GEwK061361; Wed, 20 May 2020 04:16:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005200416.04K4GEwK061361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 20 May 2020 04:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361272 - head/contrib/wpa/src/drivers X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/wpa/src/drivers X-SVN-Commit-Revision: 361272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 04:16:14 -0000 Author: cy Date: Wed May 20 04:16:13 2020 New Revision: 361272 URL: https://svnweb.freebsd.org/changeset/base/361272 Log: Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi radio is disabled through the communication device toggle key (also known as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be issued. Submitted by: avg Reported by: avg MFC after: 1 week Modified: head/contrib/wpa/src/drivers/driver_bsd.c Modified: head/contrib/wpa/src/drivers/driver_bsd.c ============================================================================== --- head/contrib/wpa/src/drivers/driver_bsd.c Wed May 20 02:33:41 2020 (r361271) +++ head/contrib/wpa/src/drivers/driver_bsd.c Wed May 20 04:16:13 2020 (r361272) @@ -1358,14 +1358,18 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void drv = bsd_get_drvindex(global, ifm->ifm_index); if (drv == NULL) return; - if ((ifm->ifm_flags & IFF_UP) == 0 && - (drv->flags & IFF_UP) != 0) { + if (((ifm->ifm_flags & IFF_UP) == 0 || + (ifm->ifm_flags & IFF_RUNNING) == 0) && + (drv->flags & IFF_UP) != 0 && + (drv->flags & IFF_RUNNING) != 0) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED, NULL); } else if ((ifm->ifm_flags & IFF_UP) != 0 && - (drv->flags & IFF_UP) == 0) { + (ifm->ifm_flags & IFF_RUNNING) != 0 && + ((drv->flags & IFF_UP) == 0 || + (drv->flags & IFF_RUNNING) == 0)) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED, From owner-svn-src-head@freebsd.org Wed May 20 08:15:10 2020 Return-Path: Delivered-To: svn-src-head@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 5134D2CA504; Wed, 20 May 2020 08:15:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rlt61Qmgz3cmV; Wed, 20 May 2020 08:15:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27A881928B; Wed, 20 May 2020 08:15:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04K8F9pZ009856; Wed, 20 May 2020 08:15:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K8F95i009854; Wed, 20 May 2020 08:15:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005200815.04K8F95i009854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 May 2020 08:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361273 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 361273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 08:15:10 -0000 Author: avg Date: Wed May 20 08:15:09 2020 New Revision: 361273 URL: https://svnweb.freebsd.org/changeset/base/361273 Log: iwm: improve rfkill handling Previously the driver handled the bit within itself, but did not expose the state change to net80211 and interface layers. This change uses net80211 KPI for rfkill signaling. The code is modeled after similar code in iwn and wpi. Reviewed by: adrian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24923 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed May 20 04:16:13 2020 (r361272) +++ head/sys/dev/iwm/if_iwm.c Wed May 20 08:15:09 2020 (r361273) @@ -5064,20 +5064,48 @@ iwm_parent(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; int startall = 0; + int rfkill = 0; IWM_LOCK(sc); if (ic->ic_nrunning > 0) { if (!(sc->sc_flags & IWM_FLAG_HW_INITED)) { iwm_init(sc); - startall = 1; + rfkill = iwm_check_rfkill(sc); + if (!rfkill) + startall = 1; } } else if (sc->sc_flags & IWM_FLAG_HW_INITED) iwm_stop(sc); IWM_UNLOCK(sc); if (startall) ieee80211_start_all(ic); + else if (rfkill) + taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task); } +static void +iwm_rftoggle_task(void *arg, int npending __unused) +{ + struct iwm_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; + int rfkill; + + IWM_LOCK(sc); + rfkill = iwm_check_rfkill(sc); + IWM_UNLOCK(sc); + if (rfkill) { + device_printf(sc->sc_dev, + "%s: rfkill switch, disabling interface\n", __func__); + ieee80211_suspend_all(ic); + ieee80211_notify_radio(ic, 0); + } else { + device_printf(sc->sc_dev, + "%s: rfkill cleared, re-enabling interface\n", __func__); + ieee80211_resume_all(ic); + ieee80211_notify_radio(ic, 1); + } +} + /* * The interrupt side of things */ @@ -5814,12 +5842,7 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_RF_KILL) { handled |= IWM_CSR_INT_BIT_RF_KILL; - if (iwm_check_rfkill(sc)) { - device_printf(sc->sc_dev, - "%s: rfkill switch, disabling interface\n", - __func__); - iwm_stop(sc); - } + taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task); } /* @@ -6024,7 +6047,17 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + TASK_INIT(&sc->sc_rftoggle_task, 0, iwm_rftoggle_task, sc); + sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->sc_tq); + error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwm_taskq"); + if (error != 0) { + device_printf(dev, "can't start taskq thread, error %d\n", + error); + goto fail; + } + error = iwm_dev_check(dev); if (error != 0) goto fail; @@ -6590,6 +6623,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); } iwm_stop_device(sc); + taskqueue_drain_all(sc->sc_tq); + taskqueue_free(sc->sc_tq); if (do_net80211) { IWM_LOCK(sc); iwm_xmit_queue_drain(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Wed May 20 04:16:13 2020 (r361272) +++ head/sys/dev/iwm/if_iwmvar.h Wed May 20 08:15:09 2020 (r361273) @@ -499,7 +499,9 @@ struct iwm_softc { uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; int sc_wantresp; + struct taskqueue *sc_tq; struct task sc_es_task; + struct task sc_rftoggle_task; struct iwm_rx_phy_info sc_last_phy_info; int sc_ampdu_ref; From owner-svn-src-head@freebsd.org Wed May 20 11:01:10 2020 Return-Path: Delivered-To: svn-src-head@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 B7DE72CDC9E; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RqYf4VyMz43xb; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9621A1ADCD; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KB1Ak1009668; Wed, 20 May 2020 11:01:10 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KB1AP0009667; Wed, 20 May 2020 11:01:10 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202005201101.04KB1AP0009667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 20 May 2020 11:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361274 - head/sys/dev/xen/evtchn X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/evtchn X-SVN-Commit-Revision: 361274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 11:01:10 -0000 Author: royger Date: Wed May 20 11:01:10 2020 New Revision: 361274 URL: https://svnweb.freebsd.org/changeset/base/361274 Log: dev/xenstore: fix return with locks held Fix returning from xenstore device with locks held, which triggers the following panic: # cat /dev/xen/xenstore ^C userret: returning with the following locks held: exclusive sx evtchn_ringc_sx (evtchn_ringc_sx) r = 0 (0xfffff8000650be40) locked @ /usr/src/sys/dev/xen/evtchn/evtchn_dev.c:262 Note this is not a security issue since access to the device is limited to root by default. Sponsored by: Citrix Systems R&D MFC after: 1 week Modified: head/sys/dev/xen/evtchn/evtchn_dev.c Modified: head/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- head/sys/dev/xen/evtchn/evtchn_dev.c Wed May 20 08:15:09 2020 (r361273) +++ head/sys/dev/xen/evtchn/evtchn_dev.c Wed May 20 11:01:10 2020 (r361274) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(&u->ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(&u->ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, &u->ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ From owner-svn-src-head@freebsd.org Wed May 20 11:03:59 2020 Return-Path: Delivered-To: svn-src-head@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 F28392CDD13; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rqcv6MP6z44DN; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD651B036; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KB3xed013968; Wed, 20 May 2020 11:03:59 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KB3xTp013965; Wed, 20 May 2020 11:03:59 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Wed, 20 May 2020 11:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys X-SVN-Commit-Revision: 361275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 11:04:00 -0000 Author: whu Date: Wed May 20 11:03:59 2020 New Revision: 361275 URL: https://svnweb.freebsd.org/changeset/base/361275 Log: HyperV socket implementation for FreeBSD This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added. Submitted by: Wei Hu Reviewed by: Dexuan Cui Relnotes: yes Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D24061 Added: head/sys/dev/hyperv/hvsock/ head/sys/dev/hyperv/hvsock/hv_sock.c (contents, props changed) head/sys/dev/hyperv/hvsock/hv_sock.h (contents, props changed) head/sys/modules/hyperv/hvsock/ head/sys/modules/hyperv/hvsock/Makefile (contents, props changed) Modified: head/sys/conf/files.x86 head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_br.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/modules/hyperv/Makefile head/sys/sys/socket.h Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed May 20 11:01:10 2020 (r361274) +++ head/sys/conf/files.x86 Wed May 20 11:03:59 2020 (r361275) @@ -133,6 +133,7 @@ dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_uncore.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/hvsock/hv_sock.c optional hyperv dev/hyperv/input/hv_kbd.c optional hyperv dev/hyperv/input/hv_kbdc.c optional hyperv dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci Added: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 11:03:59 2020 (r361275) @@ -0,0 +1,1748 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hv_sock.h" + +#define HVSOCK_DBG_NONE 0x0 +#define HVSOCK_DBG_INFO 0x1 +#define HVSOCK_DBG_ERR 0x2 +#define HVSOCK_DBG_VERBOSE 0x3 + + +SYSCTL_NODE(_net, OID_AUTO, hvsock, CTLFLAG_RD, 0, "HyperV socket"); + +static int hvs_dbg_level; +SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, CTLFLAG_RWTUN, &hvs_dbg_level, + 0, "hyperv socket debug level: 0 = none, 1 = info, 2 = error, 3 = verbose"); + + +#define HVSOCK_DBG(level, ...) do { \ + if (hvs_dbg_level >= (level)) \ + printf(__VA_ARGS__); \ + } while (0) + +MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control structures"); + +/* The MTU is 16KB per host side's design */ +#define HVSOCK_MTU_SIZE (1024 * 16) +#define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct vmpipe_proto_header)) + +#define HVSOCK_HEADER_LEN (sizeof(struct hvs_pkt_header)) + +#define HVSOCK_PKT_LEN(payload_len) (HVSOCK_HEADER_LEN + \ + roundup2(payload_len, 8) + \ + sizeof(uint64_t)) + + +static struct domain hv_socket_domain; + +/* + * HyperV Transport sockets + */ +static struct pr_usrreqs hvs_trans_usrreqs = { + .pru_attach = hvs_trans_attach, + .pru_bind = hvs_trans_bind, + .pru_listen = hvs_trans_listen, + .pru_accept = hvs_trans_accept, + .pru_connect = hvs_trans_connect, + .pru_peeraddr = hvs_trans_peeraddr, + .pru_sockaddr = hvs_trans_sockaddr, + .pru_soreceive = hvs_trans_soreceive, + .pru_sosend = hvs_trans_sosend, + .pru_disconnect = hvs_trans_disconnect, + .pru_close = hvs_trans_close, + .pru_detach = hvs_trans_detach, + .pru_shutdown = hvs_trans_shutdown, + .pru_abort = hvs_trans_abort, +}; + +/* + * Definitions of protocols supported in HyperV socket domain + */ +static struct protosw hv_socket_protosw[] = { +{ + .pr_type = SOCK_STREAM, + .pr_domain = &hv_socket_domain, + .pr_protocol = HYPERV_SOCK_PROTO_TRANS, + .pr_flags = PR_CONNREQUIRED, + .pr_init = hvs_trans_init, + .pr_usrreqs = &hvs_trans_usrreqs, +}, +}; + +static struct domain hv_socket_domain = { + .dom_family = AF_HYPERV, + .dom_name = "hyperv", + .dom_protosw = hv_socket_protosw, + .dom_protoswNPROTOSW = &hv_socket_protosw[nitems(hv_socket_protosw)] +}; + +VNET_DOMAIN_SET(hv_socket_); + +#define MAX_PORT ((uint32_t)0xFFFFFFFF) +#define MIN_PORT ((uint32_t)0x0) + +/* 00000000-facb-11e6-bd58-64006a7986d3 */ +static const struct hyperv_guid srv_id_template = { + .hv_guid = { + 0x00, 0x00, 0x00, 0x00, 0xcb, 0xfa, 0xe6, 0x11, + 0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3 } +}; + +static int hvsock_br_callback(void *, int, void *); +static uint32_t hvsock_canread_check(struct hvs_pcb *); +static uint32_t hvsock_canwrite_check(struct hvs_pcb *); +static int hvsock_send_data(struct vmbus_channel *chan, + struct uio *uio, uint32_t to_write, struct sockbuf *sb); + + + +/* Globals */ +static struct sx hvs_trans_socks_sx; +static struct mtx hvs_trans_socks_mtx; +static LIST_HEAD(, hvs_pcb) hvs_trans_bound_socks; +static LIST_HEAD(, hvs_pcb) hvs_trans_connected_socks; +static uint32_t previous_auto_bound_port; + +static void +hvsock_print_guid(struct hyperv_guid *guid) +{ + unsigned char *p = (unsigned char *)guid; + + HVSOCK_DBG(HVSOCK_DBG_INFO, + "0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x\n", + *(unsigned int *)p, + *((unsigned short *) &p[4]), + *((unsigned short *) &p[6]), + p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); +} + +static bool +is_valid_srv_id(const struct hyperv_guid *id) +{ + return !memcmp(&id->hv_guid[4], + &srv_id_template.hv_guid[4], sizeof(struct hyperv_guid) - 4); +} + +static unsigned int +get_port_by_srv_id(const struct hyperv_guid *srv_id) +{ + return *((const unsigned int *)srv_id); +} + +static void +set_port_by_srv_id(struct hyperv_guid *srv_id, unsigned int port) +{ + *((unsigned int *)srv_id) = port; +} + + +static void +__hvs_remove_pcb_from_list(struct hvs_pcb *pcb, unsigned char list) +{ + struct hvs_pcb *p = NULL; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: pcb is %p\n", __func__, pcb); + + if (!pcb) + return; + + if (list & HVS_LIST_BOUND) { + LIST_FOREACH(p, &hvs_trans_bound_socks, bound_next) + if (p == pcb) + LIST_REMOVE(p, bound_next); + } + + if (list & HVS_LIST_CONNECTED) { + LIST_FOREACH(p, &hvs_trans_connected_socks, connected_next) + if (p == pcb) + LIST_REMOVE(pcb, connected_next); + } +} + +static void +__hvs_remove_socket_from_list(struct socket *so, unsigned char list) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: pcb is %p\n", __func__, pcb); + + __hvs_remove_pcb_from_list(pcb, list); +} + +static void +__hvs_insert_socket_on_list(struct socket *so, unsigned char list) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + if (list & HVS_LIST_BOUND) + LIST_INSERT_HEAD(&hvs_trans_bound_socks, + pcb, bound_next); + + if (list & HVS_LIST_CONNECTED) + LIST_INSERT_HEAD(&hvs_trans_connected_socks, + pcb, connected_next); +} + +void +hvs_remove_socket_from_list(struct socket *so, unsigned char list) +{ + if (!so || !so->so_pcb) { + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: socket or so_pcb is null\n", __func__); + return; + } + + mtx_lock(&hvs_trans_socks_mtx); + __hvs_remove_socket_from_list(so, list); + mtx_unlock(&hvs_trans_socks_mtx); +} + +static void +hvs_insert_socket_on_list(struct socket *so, unsigned char list) +{ + if (!so || !so->so_pcb) { + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: socket or so_pcb is null\n", __func__); + return; + } + + mtx_lock(&hvs_trans_socks_mtx); + __hvs_insert_socket_on_list(so, list); + mtx_unlock(&hvs_trans_socks_mtx); +} + +static struct socket * +__hvs_find_socket_on_list(struct sockaddr_hvs *addr, unsigned char list) +{ + struct hvs_pcb *p = NULL; + + if (list & HVS_LIST_BOUND) + LIST_FOREACH(p, &hvs_trans_bound_socks, bound_next) + if (p->so != NULL && + addr->hvs_port == p->local_addr.hvs_port) + return p->so; + + if (list & HVS_LIST_CONNECTED) + LIST_FOREACH(p, &hvs_trans_connected_socks, connected_next) + if (p->so != NULL && + addr->hvs_port == p->local_addr.hvs_port) + return p->so; + + return NULL; +} + +static struct socket * +hvs_find_socket_on_list(struct sockaddr_hvs *addr, unsigned char list) +{ + struct socket *s = NULL; + + mtx_lock(&hvs_trans_socks_mtx); + s = __hvs_find_socket_on_list(addr, list); + mtx_unlock(&hvs_trans_socks_mtx); + + return s; +} + +static inline void +hvs_addr_set(struct sockaddr_hvs *addr, unsigned int port) +{ + memset(addr, 0, sizeof(*addr)); + addr->sa_family = AF_HYPERV; + addr->hvs_port = port; +} + +void +hvs_addr_init(struct sockaddr_hvs *addr, const struct hyperv_guid *svr_id) +{ + hvs_addr_set(addr, get_port_by_srv_id(svr_id)); +} + +int +hvs_trans_lock(void) +{ + sx_xlock(&hvs_trans_socks_sx); + return (0); +} + +void +hvs_trans_unlock(void) +{ + sx_xunlock(&hvs_trans_socks_sx); +} + +void +hvs_trans_init(void) +{ + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + + if (vm_guest != VM_GUEST_HV) + return; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_init called\n", __func__); + + /* Initialize Globals */ + previous_auto_bound_port = MAX_PORT; + sx_init(&hvs_trans_socks_sx, "hvs_trans_sock_sx"); + mtx_init(&hvs_trans_socks_mtx, + "hvs_trans_socks_mtx", NULL, MTX_DEF); + LIST_INIT(&hvs_trans_bound_socks); + LIST_INIT(&hvs_trans_connected_socks); +} + +/* + * Called in two cases: + * 1) When user calls socket(); + * 2) When we accept new incoming conneciton and call sonewconn(). + */ +int +hvs_trans_attach(struct socket *so, int proto, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_attach called\n", __func__); + + if (so->so_type != SOCK_STREAM) + return (ESOCKTNOSUPPORT); + + if (proto != 0 && proto != HYPERV_SOCK_PROTO_TRANS) + return (EPROTONOSUPPORT); + + if (pcb != NULL) + return (EISCONN); + pcb = malloc(sizeof(struct hvs_pcb), M_HVSOCK, M_NOWAIT | M_ZERO); + if (pcb == NULL) + return (ENOMEM); + + pcb->so = so; + so->so_pcb = (void *)pcb; + + return (0); +} + +void +hvs_trans_detach(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_detach called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (pcb == NULL) { + hvs_trans_unlock(); + return; + } + + if (SOLISTENING(so)) { + bzero(pcb, sizeof(*pcb)); + free(pcb, M_HVSOCK); + } + + so->so_pcb = NULL; + + hvs_trans_unlock(); +} + +int +hvs_trans_bind(struct socket *so, struct sockaddr *addr, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockaddr_hvs *sa = (struct sockaddr_hvs *) addr; + int error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_bind called\n", __func__); + + if (sa == NULL) { + return (EINVAL); + } + + if (pcb == NULL) { + return (EINVAL); + } + + if (sa->sa_family != AF_HYPERV) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: Not supported, sa_family is %u\n", + __func__, sa->sa_family); + return (EAFNOSUPPORT); + } + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: binding port = 0x%x\n", __func__, sa->hvs_port); + + mtx_lock(&hvs_trans_socks_mtx); + if (__hvs_find_socket_on_list(sa, + HVS_LIST_BOUND | HVS_LIST_CONNECTED)) { + error = EADDRINUSE; + } else { + /* + * The address is available for us to bind. + * Add socket to the bound list. + */ + hvs_addr_set(&pcb->local_addr, sa->hvs_port); + hvs_addr_set(&pcb->remote_addr, HVADDR_PORT_ANY); + __hvs_insert_socket_on_list(so, HVS_LIST_BOUND); + } + mtx_unlock(&hvs_trans_socks_mtx); + + return (error); +} + +int +hvs_trans_listen(struct socket *so, int backlog, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct socket *bound_so; + int error; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_listen called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + /* Check if the address is already bound and it was by us. */ + bound_so = hvs_find_socket_on_list(&pcb->local_addr, HVS_LIST_BOUND); + if (bound_so == NULL || bound_so != so) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: Address not bound or not by us.\n", __func__); + return (EADDRNOTAVAIL); + } + + SOCK_LOCK(so); + error = solisten_proto_check(so); + if (error == 0) + solisten_proto(so, backlog); + SOCK_UNLOCK(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket listen error = %d\n", __func__, error); + return (error); +} + +int +hvs_trans_accept(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_accept called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->remote_addr, + M_NOWAIT); + + return ((*nam == NULL) ? ENOMEM : 0); +} + +int +hvs_trans_connect(struct socket *so, struct sockaddr *nam, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockaddr_hvs *raddr = (struct sockaddr_hvs *)nam; + bool found_auto_bound_port = false; + int i, error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_connect called, remote port is %x\n", + __func__, raddr->hvs_port); + + if (pcb == NULL) + return (EINVAL); + + /* Verify the remote address */ + if (raddr == NULL) + return (EINVAL); + if (raddr->sa_family != AF_HYPERV) + return (EAFNOSUPPORT); + + mtx_lock(&hvs_trans_socks_mtx); + if (so->so_state & + (SS_ISCONNECTED|SS_ISDISCONNECTING|SS_ISCONNECTING)) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: socket connect in progress\n", + __func__); + error = EINPROGRESS; + goto out; + } + + /* + * Find an available port for us to auto bind the local + * address. + */ + hvs_addr_set(&pcb->local_addr, 0); + + for (i = previous_auto_bound_port - 1; + i != previous_auto_bound_port; i --) { + if (i == MIN_PORT) + i = MAX_PORT; + + pcb->local_addr.hvs_port = i; + + if (__hvs_find_socket_on_list(&pcb->local_addr, + HVS_LIST_BOUND | HVS_LIST_CONNECTED) == NULL) { + found_auto_bound_port = true; + previous_auto_bound_port = i; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: found local bound port is %x\n", + __func__, pcb->local_addr.hvs_port); + break; + } + } + + if (found_auto_bound_port == true) { + /* Found available port for auto bound, put on list */ + __hvs_insert_socket_on_list(so, HVS_LIST_BOUND); + /* Set VM service ID */ + pcb->vm_srv_id = srv_id_template; + set_port_by_srv_id(&pcb->vm_srv_id, pcb->local_addr.hvs_port); + /* Set host service ID and remote port */ + pcb->host_srv_id = srv_id_template; + set_port_by_srv_id(&pcb->host_srv_id, raddr->hvs_port); + hvs_addr_set(&pcb->remote_addr, raddr->hvs_port); + + /* Change the socket state to SS_ISCONNECTING */ + soisconnecting(so); + } else { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: No local port available for auto bound\n", + __func__); + error = EADDRINUSE; + } + + HVSOCK_DBG(HVSOCK_DBG_INFO, "Connect vm_srv_id is "); + hvsock_print_guid(&pcb->vm_srv_id); + HVSOCK_DBG(HVSOCK_DBG_INFO, "Connect host_srv_id is "); + hvsock_print_guid(&pcb->host_srv_id); + +out: + mtx_unlock(&hvs_trans_socks_mtx); + + if (found_auto_bound_port == true) + vmbus_req_tl_connect(&pcb->vm_srv_id, &pcb->host_srv_id); + + return (error); +} + +int +hvs_trans_disconnect(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (pcb == NULL) { + hvs_trans_unlock(); + return (EINVAL); + } + + /* If socket is already disconnected, skip this */ + if ((so->so_state & SS_ISDISCONNECTED) == 0) + soisdisconnecting(so); + + hvs_trans_unlock(); + + return (0); +} + +#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) +struct hvs_callback_arg { + struct uio *uio; + struct sockbuf *sb; +}; + +int +hvs_trans_soreceive(struct socket *so, struct sockaddr **paddr, + struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockbuf *sb; + ssize_t orig_resid; + uint32_t canread, to_read; + int flags, error = 0; + struct hvs_callback_arg cbarg; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_soreceive called\n", __func__); + + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (pcb == NULL) + return (EINVAL); + + if (flagsp != NULL) + flags = *flagsp &~ MSG_EOR; + else + flags = 0; + + if (flags & MSG_PEEK) + return (EOPNOTSUPP); + + /* If no space to copy out anything */ + if (uio->uio_resid == 0 || uio->uio_rw != UIO_READ) + return (EINVAL); + + sb = &so->so_rcv; + + orig_resid = uio->uio_resid; + + /* Prevent other readers from entering the socket. */ + error = sblock(sb, SBLOCKWAIT(flags)); + if (error) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: sblock returned error = %d\n", __func__, error); + return (error); + } + + SOCKBUF_LOCK(sb); + + cbarg.uio = uio; + cbarg.sb = sb; + /* + * If the socket is closing, there might still be some data + * in rx br to read. However we need to make sure + * the channel is still open. + */ + if ((sb->sb_state & SBS_CANTRCVMORE) && + (so->so_state & SS_ISDISCONNECTED)) { + /* Other thread already closed the channel */ + error = EPIPE; + goto out; + } + + while (true) { + while (uio->uio_resid > 0 && + (canread = hvsock_canread_check(pcb)) > 0) { + to_read = MIN(canread, uio->uio_resid); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: to_read = %u, skip = %u\n", __func__, to_read, + (unsigned int)(sizeof(struct hvs_pkt_header) + + pcb->recv_data_off)); + + error = vmbus_chan_recv_peek_call(pcb->chan, to_read, + sizeof(struct hvs_pkt_header) + pcb->recv_data_off, + hvsock_br_callback, (void *)&cbarg); + /* + * It is possible socket is disconnected becasue + * we released lock in hvsock_br_callback. So we + * need to check the state to make sure it is not + * disconnected. + */ + if (error || so->so_state & SS_ISDISCONNECTED) { + break; + } + + pcb->recv_data_len -= to_read; + pcb->recv_data_off += to_read; + } + + if (error) + break; + + /* Abort if socket has reported problems. */ + if (so->so_error) { + if (so->so_error == ESHUTDOWN && + orig_resid > uio->uio_resid) { + /* + * Although we got a FIN, we also received + * some data in this round. Delivery it + * to user. + */ + error = 0; + } else { + if (so->so_error != ESHUTDOWN) + error = so->so_error; + } + + break; + } + + /* Cannot received more. */ + if (sb->sb_state & SBS_CANTRCVMORE) + break; + + /* We are done if buffer has been filled */ + if (uio->uio_resid == 0) + break; + + if (!(flags & MSG_WAITALL) && orig_resid > uio->uio_resid) + break; + + /* Buffer ring is empty and we shall not block */ + if ((so->so_state & SS_NBIO) || + (flags & (MSG_DONTWAIT|MSG_NBIO))) { + if (orig_resid == uio->uio_resid) { + /* We have not read anything */ + error = EAGAIN; + } + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: non blocked read return, error %d.\n", + __func__, error); + break; + } + + /* + * Wait and block until (more) data comes in. + * Note: Drops the sockbuf lock during wait. + */ + error = sbwait(sb); + + if (error) + break; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: wake up from sbwait, read available is %u\n", + __func__, vmbus_chan_read_available(pcb->chan)); + } + +out: + SOCKBUF_UNLOCK(sb); + + sbunlock(sb); + + /* We recieved a FIN in this call */ + if (so->so_error == ESHUTDOWN) { + if (so->so_snd.sb_state & SBS_CANTSENDMORE) { + /* Send has already closed */ + soisdisconnecting(so); + } else { + /* Just close the receive side */ + socantrcvmore(so); + } + } + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: returning error = %d, so_error = %d\n", + __func__, error, so->so_error); + + return (error); +} + +int +hvs_trans_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf *top, struct mbuf *controlp, int flags, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockbuf *sb; + ssize_t orig_resid; + uint32_t canwrite, to_write; + int error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %lu\n", + __func__, uio->uio_resid); + + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (pcb == NULL) + return (EINVAL); + + /* If nothing to send */ + if (uio->uio_resid == 0 || uio->uio_rw != UIO_WRITE) + return (EINVAL); + + sb = &so->so_snd; + + orig_resid = uio->uio_resid; + + /* Prevent other writers from entering the socket. */ + error = sblock(sb, SBLOCKWAIT(flags)); + if (error) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: sblock returned error = %d\n", __func__, error); + return (error); + } + + SOCKBUF_LOCK(sb); + + if ((sb->sb_state & SBS_CANTSENDMORE) || + so->so_error == ESHUTDOWN) { + error = EPIPE; + goto out; + } + + while (uio->uio_resid > 0) { + canwrite = hvsock_canwrite_check(pcb); + if (canwrite == 0) { + /* We have sent some data */ + if (orig_resid > uio->uio_resid) + break; + /* + * We have not sent any data and it is + * non-blocked io + */ + if (so->so_state & SS_NBIO || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { + error = EWOULDBLOCK; + break; + } else { + /* + * We are here because there is no space on + * send buffer ring. Signal the other side + * to read and free more space. + * Sleep wait until space avaiable to send + * Note: Drops the sockbuf lock during wait. + */ + error = sbwait(sb); + + if (error) + break; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: wake up from sbwait, space avail on " + "tx ring is %u\n", + __func__, + vmbus_chan_write_available(pcb->chan)); + + continue; + } + } + to_write = MIN(canwrite, uio->uio_resid); + to_write = MIN(to_write, HVSOCK_SEND_BUF_SZ); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: canwrite is %u, to_write = %u\n", __func__, + canwrite, to_write); + error = hvsock_send_data(pcb->chan, uio, to_write, sb); + + if (error) + break; + } + +out: + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + + return (error); +} + +int +hvs_trans_peeraddr(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_peeraddr called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->remote_addr, M_NOWAIT); + + return ((*nam == NULL)? ENOMEM : 0); +} + +int +hvs_trans_sockaddr(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_sockaddr called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->local_addr, M_NOWAIT); + + return ((*nam == NULL)? ENOMEM : 0); +} + +void +hvs_trans_close(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_close called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (!pcb) { + hvs_trans_unlock(); + return; + } + + if (so->so_state & SS_ISCONNECTED) { + /* Send a FIN to peer */ + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: hvs_trans_close sending a FIN to host\n", __func__); + (void) hvsock_send_data(pcb->chan, NULL, 0, NULL); + } + + if (so->so_state & + (SS_ISCONNECTED|SS_ISCONNECTING|SS_ISDISCONNECTING)) + soisdisconnected(so); + + pcb->chan = NULL; + pcb->so = NULL; + + if (SOLISTENING(so)) { + mtx_lock(&hvs_trans_socks_mtx); + /* Remove from bound list */ + __hvs_remove_socket_from_list(so, HVS_LIST_BOUND); + mtx_unlock(&hvs_trans_socks_mtx); + } + + hvs_trans_unlock(); + + return; +} + +void +hvs_trans_abort(struct socket *so) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_abort called\n", __func__); + + (void) hvs_trans_lock(); + if (pcb == NULL) { + hvs_trans_unlock(); + return; + } + + if (SOLISTENING(so)) { + mtx_lock(&hvs_trans_socks_mtx); + /* Remove from bound list */ + __hvs_remove_socket_from_list(so, HVS_LIST_BOUND); + mtx_unlock(&hvs_trans_socks_mtx); + } + + if (so->so_state & SS_ISCONNECTED) { + (void) sodisconnect(so); + } + hvs_trans_unlock(); + + return; +} + +int +hvs_trans_shutdown(struct socket *so) +{ + struct hvs_pcb *pcb = so2hvspcb(so); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 20 11:10:12 2020 Return-Path: Delivered-To: svn-src-head@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 3189E2CDEDE; Wed, 20 May 2020 11:10:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rqm36VHcz44LM; Wed, 20 May 2020 11:10:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2CC81B09D; Wed, 20 May 2020 11:10:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KBABtq014393; Wed, 20 May 2020 11:10:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KBABUt014389; Wed, 20 May 2020 11:10:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005201110.04KBABUt014389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 11:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361276 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 11:10:12 -0000 Author: kib Date: Wed May 20 11:10:10 2020 New Revision: 361276 URL: https://svnweb.freebsd.org/changeset/base/361276 Log: mlx5_core: add "PMD type not enabled" port module event type. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020 (r361276) @@ -564,6 +564,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) @@ -1303,7 +1303,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-head@freebsd.org Wed May 20 11:20:46 2020 Return-Path: Delivered-To: svn-src-head@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 151B12CE6C6; Wed, 20 May 2020 11:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rr0F6tZ9z45DD; Wed, 20 May 2020 11:20:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7A791B06B; Wed, 20 May 2020 11:20:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KBKjXI020597; Wed, 20 May 2020 11:20:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KBKjOv020592; Wed, 20 May 2020 11:20:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005201120.04KBKjOv020592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 11:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361277 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 11:20:46 -0000 Author: kib Date: Wed May 20 11:20:45 2020 New Revision: 361277 URL: https://svnweb.freebsd.org/changeset/base/361277 Log: mlx5_core: add more port module event types to decode. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/device.h Wed May 20 11:20:45 2020 (r361277) @@ -565,6 +565,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:20:45 2020 (r361277) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:20:45 2020 (r361277) @@ -1304,7 +1304,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-head@freebsd.org Wed May 20 13:51:28 2020 Return-Path: Delivered-To: svn-src-head@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 730142DA3FA; Wed, 20 May 2020 13:51:28 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RvL82SMTz4FCd; Wed, 20 May 2020 13:51:28 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 357BD1CF44; Wed, 20 May 2020 13:51:28 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KDpSv5013249; Wed, 20 May 2020 13:51:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KDpRPh013247; Wed, 20 May 2020 13:51:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005201351.04KDpRPh013247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 20 May 2020 13:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361278 - in head/sys/dev/hyperv: hvsock vmbus X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/dev/hyperv: hvsock vmbus X-SVN-Commit-Revision: 361278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 13:51:28 -0000 Author: lwhsu Date: Wed May 20 13:51:27 2020 New Revision: 361278 URL: https://svnweb.freebsd.org/changeset/base/361278 Log: Fix i386 build for r361275 kponsored by: The FreeBSD Foundation Modified: head/sys/dev/hyperv/hvsock/hv_sock.c head/sys/dev/hyperv/vmbus/vmbus_br.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 13:51:27 2020 (r361278) @@ -792,7 +792,7 @@ hvs_trans_sosend(struct socket *so, struct sockaddr *a int error = 0; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %lu\n", + "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %zd\n", __func__, uio->uio_resid); if (so->so_type != SOCK_STREAM) @@ -1154,7 +1154,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg return (EINVAL); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: called, uio_rw = %s, uio_resid = %lu, cplen = %u, " + "%s: called, uio_rw = %s, uio_resid = %zd, cplen = %u, " "datap = %p\n", __func__, (uio->uio_rw == UIO_READ) ? "read from br":"write to br", uio->uio_resid, cplen, datap); @@ -1168,7 +1168,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg SOCKBUF_LOCK(sb); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: after uiomove, uio_resid = %lu, error = %d\n", + "%s: after uiomove, uio_resid = %zd, error = %d\n", __func__, uio->uio_resid, error); return (error); @@ -1372,8 +1372,9 @@ hvsock_canwrite_check(struct hvs_pcb *pcb) * We must always reserve a 0-length-payload packet for the FIN. */ HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: writeable is %u, should be greater than %lu\n", - __func__, writeable, HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)); + "%s: writeable is %u, should be greater than %ju\n", + __func__, writeable, + (uintmax_t)(HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0))); if (writeable < HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)) { /* Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_br.c Wed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Wed May 20 13:51:27 2020 (r361278) @@ -66,9 +66,10 @@ vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) ravail = br->vbr_dsize - wavail; snprintf(state, sizeof(state), - "intrcnt:%lu rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " + "intrcnt:%ju rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " "ravail:%u wavail:%u", - intrcnt, rindex, windex, imask, psndsz, fvalue, ravail, wavail); + (uintmax_t)intrcnt, rindex, windex, imask, psndsz, fvalue, + ravail, wavail); return sysctl_handle_string(oidp, state, sizeof(state), req); } From owner-svn-src-head@freebsd.org Wed May 20 15:11:39 2020 Return-Path: Delivered-To: svn-src-head@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 AA4FD2DC8CD for ; Wed, 20 May 2020 15:11:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rx6g00bLz4KnG for ; Wed, 20 May 2020 15:11:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x830.google.com with SMTP id x12so2767024qts.9 for ; Wed, 20 May 2020 08:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=06zYfw5ua2V+P5wY+4b4FevSmsmu34MF8rGiBpedTzA=; b=AZIcKMCYEh93AwCXo7iVrUarGODqNV8WTz2CJj5C24MSNj9YZ5yOUd3404dot+H1Y1 9dD7ALYyEecNw/yLWdznJxSP6qw9ksJCfNf11hCi5n/wnwib32w9ZiO/+ii0HL8ieHe3 T2rgIzcHm8I3li/cminLQiZ/KDbmDHNL5yPWTDtDLDulZQq/7BLBukv2z9tMOn+8fGLB EG13WGepkkafT7rT+zYbWP79E+I4MvrZylPoSB7QdbVPuh7iJNuSIOzlRQbdy0Hb/Gza 3CD2NvnszWQlNL4MHMl5dFNFLj8xrvX137ufvHYUzR/dIGYfH4PhbvUZU2Y8aBTuR6+K QZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=06zYfw5ua2V+P5wY+4b4FevSmsmu34MF8rGiBpedTzA=; b=i42X5mbPZAQYdaBDVks76Gq55v2q6iTpm6iPe0/a6M/m/6iELnYCJ5z8gOm50I5ig9 REIDnX4s81GMnoJMF6IeoJMVKsmJ+QKL5PNR8bmeqP8uA8QvlO1t+wMRbLNqQRB3xAVC mo9N71ebY8KyC+0Ua1brKKuv+ykwovBdXdppZb0QpFToIojBNVwvrOmA4w9Ia4W4oEhL MomYY2fvQHZ0ujAuSetLpHVF4qOqigpoBKLnze2kfeeoUz53pmz2DEtV8vMErZKYcU7b 5B4tIefixdqfsHbQZTMwEMa+aV9ikRFN9h3u5QFjsg0KHR8wihQoGB1F2XM7QYuIYYxv qmbA== X-Gm-Message-State: AOAM5302+rKJ2/f1kIiUZL9l564EP22F+/WcO2prD30ml6rKR7y4LUEi BLaUlHr0H0Ydqxl7hYbIBENk1g== X-Google-Smtp-Source: ABdhPJwdn2Ox8rgrpazTBW9lpciqQE162zTxdG6QU8Ar40DyOJIa6xQvGayMr/OHE92Hi9aHuyPBiw== X-Received: by 2002:ac8:19ca:: with SMTP id s10mr5764780qtk.11.1589987498025; Wed, 20 May 2020 08:11:38 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-231-224.bltmmd.fios.verizon.net. [100.16.231.224]) by smtp.gmail.com with ESMTPSA id d207sm2345496qkc.49.2020.05.20.08.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 08:11:36 -0700 (PDT) Date: Wed, 20 May 2020 11:11:28 -0400 From: Shawn Webb To: Wei Hu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202005201103.04KB3xTp013965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vxcw4cnpqsdkwemn" Content-Disposition: inline In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Rspamd-Queue-Id: 49Rx6g00bLz4KnG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=AZIcKMCY; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::830 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-4.55 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; NEURAL_HAM_LONG(-1.02)[-1.024]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.43)[-0.427]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::830:from]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.231.224:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 15:11:39 -0000 --vxcw4cnpqsdkwemn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 >=20 > Log: > HyperV socket implementation for FreeBSD > =20 > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > =20 > Submitted by: Wei Hu > Reviewed by: Dexuan Cui > Relnotes: yes > Sponsored by: Microsoft > Differential Revision: https://reviews.freebsd.org/D24061 Hey Wei Hu, Would it be good to bump __FreeBSD_version after a change like this? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --vxcw4cnpqsdkwemn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl7FSJoACgkQ/y5nonf4 4frt7Q//R7RCo5qWcADlRsclOHJXs2GYP9C23fAqn+TYTF9+NocxzVmkcFNx78o3 OLtOK7oGhSBrIYtsQqzs/jTZHS1RLiXa+W9MYQJEHbP3zN7UwIOvnTW3OoYn/iDM JeTWygweLut9PugMeYHmwFoRMU/vFCDsUF44LLXz83LiAk9MO1RGBpA0NecSLIxA 5pax0MBOq1A4g2fzU32unhedNuo1KAXyP2ZL2sIAepqRegx9D8LKosbU3rAffinn m8pBdqtY+jjztmyGYH7VobO7VNu438S9H5z9wjzUhzaBxxQF5L9Lrn+mWggcI7ZN fbGJSQxWN7xcAgoQSD1d5Wm48tiaz3tyv8vvu72UV0C4X1hsh5ha+nyge8DxsKe8 18tJL6CNjMRMKpc/C2ft4sPCD87x/N0uTo6inYtyvWb5abZntG8d5EPLNfGoCGHG stFf+CW9TmZy+Av6jrEDBdmE2JtT5nGXCP+XUMSUQKtLG6xlCVWcUbaoKRxyaMht zwc1zm7DtcwwfmUCtNhF5enyMPOAaLH2BxbDy2cL2Z9pHHuI9N8ewTgtDkNUqSUQ 3OfnLcwSz972fKgPY8Fas+/abrDe/xtmhLhSttSjjWbNIXJ7Dwn4nAIq1xhfWZUb 6foP965pT9ZBNgfH9re12vpCKrR+AAjuZG3AidkAhthgQimjSaM= =FLH7 -----END PGP SIGNATURE----- --vxcw4cnpqsdkwemn-- From owner-svn-src-head@freebsd.org Wed May 20 15:54:58 2020 Return-Path: Delivered-To: svn-src-head@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 D34852DD4C4; Wed, 20 May 2020 15:54:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ry4d6lr7z4NCc; Wed, 20 May 2020 15:54:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x441.google.com with SMTP id y198so1760924pfb.4; Wed, 20 May 2020 08:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=3svMv0/CJSD8Uq9xJDfuvjKPcoiLoez5D8vQsDxYOLg=; b=T0mwRCLskDVE0ezEcauNzSA4tth4eUtTJ4UTRU6Yi74P+lI/weKelgnvImU/FldjxQ s7y52+J7q5GCR6ja45NcTZV36wuNpZBJR1t1zYOtY3GHZDHuCtpIMu+eYMYIu3RclHOs U9Cv6vmAuyGsemoO3V85q425oxBV6nCkvDdHZHiMp+duR229mbONG6Y959BYxyS3iJU2 IlZwQ+n1qGVSPekDpaB3p7UWcYBlkU01JdNduyS8AVWseZ/tkmsxGezMu3nHWHiDPTUg 1OHg9AzDyyP4T4KSLAPevJW7Q4TdIxDD/qYNxkhpDdNonfTaeGWsby/HPdXFFPLiBo/t lbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=3svMv0/CJSD8Uq9xJDfuvjKPcoiLoez5D8vQsDxYOLg=; b=YA9w7BsyDN9iVXSZxVxz6iN0VQPB9ij/BJPJxMGY83N8PfT5Es16bbvHq2eMsK/qyl D5hrcArKOTUfvCPmbqnToDghow7GSB4vVkiihFELJxc56dxeMntSuoYdK0GVxIyfRz6t 4WNfbEyT3Y2TYMd6N2hEphsp8TVumjz9ASNEFowBpx2K/wNMficxfg5hfRMAw5xEUzWw YL8QI6DcJVVmYV2eKE26qs6vOsmPoPlR4LuDJ9EG3U5dCZeTRSHDiz8DX8gFVaWGft2m s6wFs0t3abKaHKqAVBpM07mRjmoF0mnW3HITqken4tLBYDHggvjhPMEGfFRP9TWNXMil qA3A== X-Gm-Message-State: AOAM530Tt78S6rfRIGudi0i4/Hv5mGeZ0yTgITuiuK1elTSj5g5Zl+le ONOedu8bxcoL8aSPjdNibGIT24zbBfM= X-Google-Smtp-Source: ABdhPJwvv3UiRcl+P6kNjqdOf+qfb7tgksVjYCeDWnF7YTawCQRK24VOSrdEegwVpVKGMvlXRGkCnw== X-Received: by 2002:a63:da50:: with SMTP id l16mr4550845pgj.198.1589990096209; Wed, 20 May 2020 08:54:56 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k3sm2483275pjc.38.2020.05.20.08.54.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2020 08:54:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Date: Wed, 20 May 2020 08:54:54 -0700 Message-Id: References: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> Cc: Wei Hu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> To: Shawn Webb X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Ry4d6lr7z4NCc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=T0mwRCLs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::441 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.925]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.099]; NEURAL_HAM_LONG(-0.89)[-0.895]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::441:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 15:54:58 -0000 > On May 20, 2020, at 08:11, Shawn Webb wrote: >=20 > =EF=BB=BFOn Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: >> Author: whu >> Date: Wed May 20 11:03:59 2020 >> New Revision: 361275 >> URL: https://svnweb.freebsd.org/changeset/base/361275 >>=20 >> Log: >> HyperV socket implementation for FreeBSD >>=20 >> This change adds Hyper-V socket feature in FreeBSD. New socket address >> family AF_HYPERV and its kernel support are added. Hi Wei, Could you please further describe what this feature is/does? Thanks, -Enji= From owner-svn-src-head@freebsd.org Wed May 20 15:57:36 2020 Return-Path: Delivered-To: svn-src-head@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 6055A2DD4E5; Wed, 20 May 2020 15:57:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ry7g5mhwz4NVf; Wed, 20 May 2020 15:57:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x442.google.com with SMTP id b190so1757573pfg.6; Wed, 20 May 2020 08:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=B+yFMfsWzpvyk/mjgNzWJrfYfuGaG3edl6DHnm82/IA=; b=eeQZnxnW2oio3H9+cKEnYWDweX4do9wzsOqRC0jaS6ju17jt2aCoEyFi7fS8BknFfZ OZQ9+P52SQtGuAQuXuCCXI02YVME9RqAcFzicjQJpjIxzpZHwzthv6BF/Ukxfzj3WHMe K3xHt3ZfF+l/CvPPm6ULcgD2o+X60d/qqX82CPq7Jo3zEahGxe0XMqdBMlC/N0ICy5W/ mndIEGJD646flVX6R7ZQ4xCjdP+S3YpJwSmWFXy/4+r1dU00gVTRKO8rL6f2mLEYmGti 33OJXV4WQtkxaSxQ2qlgU0oSNJrRI9lf23Kwr7wYNGzj7ICDqo5YS3SoD8Yn7vCxn+kx KjqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=B+yFMfsWzpvyk/mjgNzWJrfYfuGaG3edl6DHnm82/IA=; b=ebRAe4ag8RYDlLqTObOCkiJeI7b84MlHics3WhJlQqSIP++Av+yecsXNBsfL9KFASM 46TrIIb+fWjHOBCD8x1ywxkpL6zPEl1aMtNIhMxr4cJrMksYI7ju9aW+hnLztbGYfxcI kABdpQYGLh5zutB6UVzU2KubvRtadeK3vDt0Cmnwk99W4QkhB39+ckpiWJ3C8c2Hpb/O QFtJBMGekzHdSw5WW5Fh4/AvD9cWIVfL5D+7PGxNjhw6m5rgWsoujpR4GxpxapnP6e/N 60q7zUGzvn0Dorg6MQIu74EHTxkkqpes4qKpQcmgB360FnWXF8B5wBH3IxxZYG8VURiC kbGw== X-Gm-Message-State: AOAM530g39TKoklhNY5WgdswMV3pKbkBbZ6NffmppK0Pa78Jg9cJ72tz t+UYQbZsbiRHKzXBv4458VIz9BsVDKE= X-Google-Smtp-Source: ABdhPJzR732x1FGVDzK8zaPe8pwxFPBzHzGSCVlpnIgV9gNHrMoLsv8yxS10J9thX7HDyxDnDn49cQ== X-Received: by 2002:a63:1854:: with SMTP id 20mr4850646pgy.257.1589990254391; Wed, 20 May 2020 08:57:34 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z190sm2436453pfb.1.2020.05.20.08.57.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2020 08:57:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Date: Wed, 20 May 2020 08:57:33 -0700 Message-Id: References: Cc: Wei Hu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: To: Shawn Webb X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Ry7g5mhwz4NVf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=eeQZnxnW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::442 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.921]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.097]; NEURAL_HAM_LONG(-0.90)[-0.897]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::442:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 15:57:36 -0000 > On May 20, 2020, at 08:54, Enji Cooper wrote: > =EF=BB=BF >>> On May 20, 2020, at 08:11, Shawn Webb wrote= : >>>=20 >>> =EF=BB=BFOn Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: >>> Author: whu >>> Date: Wed May 20 11:03:59 2020 >>> New Revision: 361275 >>> URL: https://svnweb.freebsd.org/changeset/base/361275 >>>=20 >>> Log: >>> HyperV socket implementation for FreeBSD >>>=20 >>> This change adds Hyper-V socket feature in FreeBSD. New socket address >>> family AF_HYPERV and its kernel support are added. >=20 > Hi Wei, > Could you please further describe what this feature is/does? I realize after looking at the review that it contains the content I was= hoping for. It would have been helpful to folks if this context had been in= cluded in the commit message. Thank you, -Enji= From owner-svn-src-head@freebsd.org Wed May 20 16:07:38 2020 Return-Path: Delivered-To: svn-src-head@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 920132DDA04; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RyMG36xpz4NrJ; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620251E763; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KG7cSB098342; Wed, 20 May 2020 16:07:38 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KG7cfr098341; Wed, 20 May 2020 16:07:38 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005201607.04KG7cfr098341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 20 May 2020 16:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361279 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 361279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 16:07:38 -0000 Author: kp Date: Wed May 20 16:07:37 2020 New Revision: 361279 URL: https://svnweb.freebsd.org/changeset/base/361279 Log: bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two Reviewed by: gallatin, rpokala MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24922 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Wed May 20 13:51:27 2020 (r361278) +++ head/sys/dev/bnxt/bnxt.h Wed May 20 16:07:37 2020 (r361279) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #define NETXTREME_E_VF2 0x16d3 #define NETXTREME_E_VF3 0x16dc +/* Maximum numbers of RX and TX descriptors. iflib requires this to be a power + * of two. The hardware has no particular limitation. */ +#define BNXT_MAX_RXD ((INT32_MAX >> 1) + 1) +#define BNXT_MAX_TXD ((INT32_MAX >> 1) + 1) + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Wed May 20 13:51:27 2020 (r361278) +++ head/sys/dev/bnxt/if_bnxt.c Wed May 20 16:07:37 2020 (r361279) @@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {BNXT_MAX_RXD, BNXT_MAX_RXD, BNXT_MAX_RXD}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {BNXT_MAX_TXD, BNXT_MAX_TXD, BNXT_MAX_TXD}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, From owner-svn-src-head@freebsd.org Wed May 20 17:20:49 2020 Return-Path: Delivered-To: svn-src-head@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 708412DF535; Wed, 20 May 2020 17:20:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rzzj2TpXz4T83; Wed, 20 May 2020 17:20:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50A361F660; Wed, 20 May 2020 17:20:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHKn0o041219; Wed, 20 May 2020 17:20:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHKmMM041217; Wed, 20 May 2020 17:20:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201720.04KHKmMM041217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 17:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361282 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 361282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 17:20:49 -0000 Author: emaste Date: Wed May 20 17:20:48 2020 New Revision: 361282 URL: https://svnweb.freebsd.org/changeset/base/361282 Log: Update GNU_DIFF knob descriptions After r317209 the WITH_/WITHOUT_GNU_DIFF knob controls only diff3; diff is always BSD diff. MFC after: 1 week Modified: head/tools/build/options/WITHOUT_GNU_DIFF head/tools/build/options/WITH_GNU_DIFF Modified: head/tools/build/options/WITHOUT_GNU_DIFF ============================================================================== --- head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . Modified: head/tools/build/options/WITH_GNU_DIFF ============================================================================== --- head/tools/build/options/WITH_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITH_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Build and install GNU -.Xr diff 1 -and .Xr diff3 1 . From owner-svn-src-head@freebsd.org Wed May 20 17:27:23 2020 Return-Path: Delivered-To: svn-src-head@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 02D852DF926; Wed, 20 May 2020 17:27:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S07G6L4tz4Tm9; Wed, 20 May 2020 17:27:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4BBA1FAB8; Wed, 20 May 2020 17:27:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHRMKj047000; Wed, 20 May 2020 17:27:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHRMGw046999; Wed, 20 May 2020 17:27:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201727.04KHRMGw046999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 17:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361283 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 361283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 17:27:23 -0000 Author: emaste Date: Wed May 20 17:27:22 2020 New Revision: 361283 URL: https://svnweb.freebsd.org/changeset/base/361283 Log: src.conf.5: regen after r361282, GNU_DIFF knob descriptions Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 20 17:20:48 2020 (r361282) +++ head/share/man/man5/src.conf.5 Wed May 20 17:27:22 2020 (r361283) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 8, 2020 +.Dd May 20, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -690,8 +690,6 @@ This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . .It Va WITHOUT_GNU_GREP Set to not build GNU From owner-svn-src-head@freebsd.org Wed May 20 17:27:54 2020 Return-Path: Delivered-To: svn-src-head@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 D8BC02DF9A9; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S07t5Sftz4V0p; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6D141F92E; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHRs6a047063; Wed, 20 May 2020 17:27:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHRsVL047061; Wed, 20 May 2020 17:27:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005201727.04KHRsVL047061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 May 2020 17:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361284 - in head/sys/amd64: include vmm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/amd64: include vmm X-SVN-Commit-Revision: 361284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 17:27:54 -0000 Author: cem Date: Wed May 20 17:27:54 2020 New Revision: 361284 URL: https://svnweb.freebsd.org/changeset/base/361284 Log: vmm(4): Add 12 user ABI compat after r349948 Reported by: kp Reviewed by: jhb, kp Tested by: kp Differential Revision: https://reviews.freebsd.org/D24929 Modified: head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Wed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/include/vmm_dev.h Wed May 20 17:27:54 2020 (r361284) @@ -56,6 +56,13 @@ struct vm_memseg { char name[VM_MAX_SUFFIXLEN + 1]; }; +struct vm_memseg_fbsd12 { + int segid; + size_t len; + char name[64]; +}; +_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); + struct vm_register { int cpuid; int regnum; /* enum vm_reg_name */ @@ -338,8 +345,12 @@ enum { _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_REINIT \ _IO('v', IOCNUM_REINIT) +#define VM_ALLOC_MEMSEG_FBSD12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) #define VM_ALLOC_MEMSEG \ _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg) +#define VM_GET_MEMSEG_FBSD12 \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) #define VM_GET_MEMSEG \ _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg) #define VM_MMAP_MEMSEG \ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/vmm/vmm_dev.c Wed May 20 17:27:54 2020 (r361284) @@ -252,7 +252,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag CTASSERT(sizeof(((struct vm_memseg *)0)->name) >= VM_MAX_SUFFIXLEN + 1); static int -get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { struct devmem_softc *dsc; int error; @@ -269,17 +269,16 @@ get_memseg(struct vmmdev_softc *sc, struct vm_memseg * } KASSERT(dsc != NULL, ("%s: devmem segment %d not found", __func__, mseg->segid)); - error = copystr(dsc->name, mseg->name, sizeof(mseg->name), - NULL); + error = copystr(dsc->name, mseg->name, len, NULL); } else { - bzero(mseg->name, sizeof(mseg->name)); + bzero(mseg->name, len); } return (error); } static int -alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { char *name; int error; @@ -295,8 +294,8 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg */ if (VM_MEMSEG_NAME(mseg)) { sysmem = false; - name = malloc(sizeof(mseg->name), M_VMMDEV, M_WAITOK); - error = copystr(mseg->name, name, sizeof(mseg->name), NULL); + name = malloc(len, M_VMMDEV, M_WAITOK); + error = copystr(mseg->name, name, len, NULL); if (error) goto done; } @@ -438,6 +437,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_MAP_PPTDEV_MMIO: case VM_BIND_PPTDEV: case VM_UNBIND_PPTDEV: +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: +#endif case VM_ALLOC_MEMSEG: case VM_MMAP_MEMSEG: case VM_REINIT: @@ -451,6 +453,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da state_changed = 2; break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: +#endif case VM_GET_MEMSEG: case VM_MMAP_GETNEXT: /* @@ -633,11 +638,25 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = vm_mmap_memseg(sc->vm, mm->gpa, mm->segid, mm->segoff, mm->len, mm->prot, mm->flags); break; +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + break; +#endif case VM_ALLOC_MEMSEG: - error = alloc_memseg(sc, (struct vm_memseg *)data); + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg *)0)->name)); break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: + error = get_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + break; +#endif case VM_GET_MEMSEG: - error = get_memseg(sc, (struct vm_memseg *)data); + error = get_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg *)0)->name)); break; case VM_GET_REGISTER: vmreg = (struct vm_register *)data; From owner-svn-src-head@freebsd.org Wed May 20 17:48:19 2020 Return-Path: Delivered-To: svn-src-head@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 9C4CD2F002D; Wed, 20 May 2020 17:48:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S0bR3lwTz4W5d; Wed, 20 May 2020 17:48:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C3B12000F; Wed, 20 May 2020 17:48:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHmJ6U059491; Wed, 20 May 2020 17:48:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHmJ8d059489; Wed, 20 May 2020 17:48:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005201748.04KHmJ8d059489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 May 2020 17:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361286 - in head/tests/sys: fifo kern/pipe X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/tests/sys: fifo kern/pipe X-SVN-Commit-Revision: 361286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 17:48:19 -0000 Author: markj Date: Wed May 20 17:48:18 2020 New Revision: 361286 URL: https://svnweb.freebsd.org/changeset/base/361286 Log: Avoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests. Fix some style issues in the modified tests while here. Reported by: Jenkins via lwhsu MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fifo/fifo_kqueue.c head/tests/sys/kern/pipe/pipe_kqueue_test.c Modified: head/tests/sys/fifo/fifo_kqueue.c ============================================================================== --- head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:48:18 2020 (r361286) @@ -219,10 +219,14 @@ ATF_TC_BODY(fifo_kqueue__connecting_reader, tc) ATF_REQUIRE(close(p[1]) == 0); } +/* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ ATF_TC_WITHOUT_HEAD(fifo_kqueue__reads); ATF_TC_BODY(fifo_kqueue__reads, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, i, n; + int kq, p[2]; + char c; ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); @@ -231,39 +235,38 @@ ATF_TC_BODY(fifo_kqueue__reads, tc) ATF_REQUIRE((p[1] = open("testfifo", O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); - /* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ - - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + ATF_REQUIRE(bytes > 1); - for (int i = 0; i < PIPE_BUF + 1; ++i) { + for (i = 0; i < bytes / 2; i++) ATF_REQUIRE(read(p[0], &c, 1) == 1); - } + bytes -= i; - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), - &(struct timespec) { 0, 0 }) == 1); + &(struct timespec){ 0, 0 }) == 1); ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == EV_CLEAR); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65023); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); - while ((r = read(p[0], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + while (bytes-- > 0) + ATF_REQUIRE(read(p[0], &c, 1) == 1); + n = read(p[0], &c, 1); + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), Modified: head/tests/sys/kern/pipe/pipe_kqueue_test.c ============================================================================== --- head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:48:18 2020 (r361286) @@ -243,28 +243,30 @@ ATF_TC_BODY(pipe_kqueue__closed_read_end_register_befo ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end); ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, n; + int kq, p[2]; + char c; ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); ATF_REQUIRE(p[0] >= 0); ATF_REQUIRE(p[1] >= 0); - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(close(p[1]) == 0); - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; - EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); - EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); /* @@ -284,7 +286,7 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65536); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); ATF_REQUIRE(close(kq) == 0); @@ -294,19 +296,21 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end_register_before_close); ATF_TC_BODY(pipe_kqueue__closed_write_end_register_before_close, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, n; + int kq, p[2]; + char c; ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); ATF_REQUIRE(p[0] >= 0); ATF_REQUIRE(p[1] >= 0); - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; - EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); - EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); /* @@ -320,35 +324,32 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end_register_bef ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); ATF_REQUIRE(kev[1].data == 0); - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(close(p[1]) == 0); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), - &(struct timespec) { 0, 0 }) == 2); - { - ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); - ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); - ATF_REQUIRE(kev[0].flags == - (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); - ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 4096 || - kev[0].data == 512 /* on FreeBSD 11.3 */); - ATF_REQUIRE(kev[0].udata == 0); - } - { - ATF_REQUIRE(kev[1].ident == (uintptr_t)p[0]); - ATF_REQUIRE(kev[1].filter == EVFILT_READ); - ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); - ATF_REQUIRE(kev[1].fflags == 0); - ATF_REQUIRE(kev[1].data == 65536); - ATF_REQUIRE(kev[1].udata == 0); - } + &(struct timespec){ 0, 0 }) == 2); + + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == + (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data > 0); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(kev[1].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[1].filter == EVFILT_READ); + ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[1].fflags == 0); + ATF_REQUIRE(kev[1].data == bytes); + ATF_REQUIRE(kev[1].udata == 0); ATF_REQUIRE(close(kq) == 0); ATF_REQUIRE(close(p[0]) == 0); From owner-svn-src-head@freebsd.org Wed May 20 18:29:24 2020 Return-Path: Delivered-To: svn-src-head@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 7CD162F1A12; Wed, 20 May 2020 18:29:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S1Vr2V6mz4ZZp; Wed, 20 May 2020 18:29:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C32A205E6; Wed, 20 May 2020 18:29:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KITOgx083938; Wed, 20 May 2020 18:29:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KITNRs083936; Wed, 20 May 2020 18:29:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005201829.04KITNRs083936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 May 2020 18:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 361287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 18:29:24 -0000 Author: markj Date: Wed May 20 18:29:23 2020 New Revision: 361287 URL: https://svnweb.freebsd.org/changeset/base/361287 Log: Don't block on the range lock in zfs_getpages(). After r358443 the vnode object lock no longer synchronizes concurrent zfs_getpages() and zfs_write() (which must update vnode pages to maintain coherence). This created a potential deadlock between ZFS range locks and VM page busy locks: a fault on a mapped file will cause the fault page to be busied, after which zfs_getpages() locks a range around the file offset in order to map adjacent, resident pages; zfs_write() locks the range first, and then must busy vnode pages when synchronizing. Solve this by adding a non-blocking mode for ZFS range locks, and using it in zfs_getpages(). If zfs_getpages() fails to acquire the range lock, only the fault page will be populated. Reported by: bdrewery Reviewed by: avg Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24839 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 18:29:23 2020 (r361287) @@ -78,6 +78,8 @@ void rangelock_fini(rangelock_t *); locked_range_t *rangelock_enter(rangelock_t *, uint64_t, uint64_t, rangelock_type_t); +locked_range_t *rangelock_tryenter(rangelock_t *, + uint64_t, uint64_t, rangelock_type_t); void rangelock_exit(locked_range_t *); void rangelock_reduce(locked_range_t *, uint64_t, uint64_t); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 18:29:23 2020 (r361287) @@ -136,10 +136,11 @@ rangelock_fini(rangelock_t *rl) } /* - * Check if a write lock can be grabbed, or wait and recheck until available. + * Check if a write lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_writer(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_writer(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = &rl->rl_tree; locked_range_t *lr; @@ -169,7 +170,7 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t */ if (avl_numnodes(tree) == 0) { avl_add(tree, new); - return; + return (B_TRUE); } /* @@ -190,8 +191,10 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t goto wait; avl_insert(tree, new, where); - return; + return (B_TRUE); wait: + if (nonblock) + return (B_FALSE); if (!lr->lr_write_wanted) { cv_init(&lr->lr_write_cv, NULL, CV_DEFAULT, NULL); lr->lr_write_wanted = B_TRUE; @@ -373,10 +376,11 @@ rangelock_add_reader(avl_tree_t *tree, locked_range_t } /* - * Check if a reader lock can be grabbed, or wait and recheck until available. + * Check if a reader lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_reader(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_reader(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = &rl->rl_tree; locked_range_t *prev, *next; @@ -397,6 +401,8 @@ retry: */ if (prev && (off < prev->lr_offset + prev->lr_length)) { if ((prev->lr_type == RL_WRITER) || (prev->lr_write_wanted)) { + if (nonblock) + return (B_FALSE); if (!prev->lr_read_wanted) { cv_init(&prev->lr_read_cv, NULL, CV_DEFAULT, NULL); @@ -421,6 +427,8 @@ retry: if (off + len <= next->lr_offset) goto got_lock; if ((next->lr_type == RL_WRITER) || (next->lr_write_wanted)) { + if (nonblock) + return (B_FALSE); if (!next->lr_read_wanted) { cv_init(&next->lr_read_cv, NULL, CV_DEFAULT, NULL); @@ -439,6 +447,7 @@ got_lock: * locks and bumping ref counts (r_count). */ rangelock_add_reader(tree, new, prev, where); + return (B_TRUE); } /* @@ -448,13 +457,13 @@ got_lock: * the range lock structure for later unlocking (or reduce range if the * entire file is locked as RL_WRITER). */ -locked_range_t * -rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, - rangelock_type_t type) +static locked_range_t * +_rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type, boolean_t nonblock) { ASSERT(type == RL_READER || type == RL_WRITER || type == RL_APPEND); - locked_range_t *new = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + locked_range_t *new = kmem_alloc(sizeof (*new), KM_SLEEP); new->lr_rangelock = rl; new->lr_offset = off; if (len + off < off) /* overflow */ @@ -471,14 +480,32 @@ rangelock_enter(rangelock_t *rl, uint64_t off, uint64_ /* * First check for the usual case of no locks */ - if (avl_numnodes(&rl->rl_tree) == 0) + if (avl_numnodes(&rl->rl_tree) == 0) { avl_add(&rl->rl_tree, new); - else - rangelock_enter_reader(rl, new); - } else - rangelock_enter_writer(rl, new); /* RL_WRITER or RL_APPEND */ + } else if (!rangelock_enter_reader(rl, new, nonblock)) { + kmem_free(new, sizeof (*new)); + new = NULL; + } + } else if (!rangelock_enter_writer(rl, new, nonblock)) { + kmem_free(new, sizeof (*new)); + new = NULL; + } mutex_exit(&rl->rl_lock); return (new); +} + +locked_range_t * +rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type) +{ + return (_rangelock_enter(rl, off, len, type, B_FALSE)); +} + +locked_range_t * +rangelock_tryenter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type) +{ + return (_rangelock_enter(rl, off, len, type, B_TRUE)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed May 20 18:29:23 2020 (r361287) @@ -4498,13 +4498,27 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun end = IDX_TO_OFF(ma[count - 1]->pindex + 1); /* - * Lock a range covering all required and optional pages. - * Note that we need to handle the case of the block size growing. + * Try to lock a range covering all required and optional pages, to + * handle the case of the block size growing. It is not safe to block + * on the range lock since the owner may be waiting for the fault page + * to be unbusied. */ for (;;) { blksz = zp->z_blksz; - lr = rangelock_enter(&zp->z_rangelock, rounddown(start, blksz), + lr = rangelock_tryenter(&zp->z_rangelock, + rounddown(start, blksz), roundup(end, blksz) - rounddown(start, blksz), RL_READER); + if (lr == NULL) { + if (rahead != NULL) { + *rahead = 0; + rahead = NULL; + } + if (rbehind != NULL) { + *rbehind = 0; + rbehind = NULL; + } + break; + } if (blksz == zp->z_blksz) break; rangelock_exit(lr); @@ -4515,7 +4529,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun obj_size = object->un_pager.vnp.vnp_size; zfs_vmobject_wunlock(object); if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { - rangelock_exit(lr); + if (lr != NULL) + rangelock_exit(lr); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } @@ -4543,7 +4558,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, MIN(end, obj_size) - (end - PAGE_SIZE)); - rangelock_exit(lr); + if (lr != NULL) + rangelock_exit(lr); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); From owner-svn-src-head@freebsd.org Wed May 20 18:30:53 2020 Return-Path: Delivered-To: svn-src-head@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 58F8A2F1A8D; Wed, 20 May 2020 18:30:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S1XX3Q9nz4Zhs; Wed, 20 May 2020 18:30:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2d.google.com with SMTP id dh1so1795698qvb.13; Wed, 20 May 2020 11:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7B6GEx2BckVLGrGh8hSI9pgjmNHASJLkwvct6IsDkyc=; b=X2Nw6cufjztZMwFzUTMVIQyXJrCtG8erwJO7znNszbod7nGbMV7P2hn7WZ9hIdAkqH 7XF3VJHQP/BR2v6dCy2ioUara73JYCjeUTr+v53eeeF70kKqcrj0jZU+QsDUZCSmGrZ1 lgVXENqC6KyVU5lWxBc6TEEBNeheedF5DP6dw3nV8gm9NFioVcgErzazojYhjMo9unEE L6nHcT8ER0WGB232oFgdmBFZgeOBqIX8YbfwnvaYC11c45FP4yF/fZ7UR5eza4toVFw4 p3BVjJ5CZpiPdpRCsfiyCe71lWRdLQa/3tCClcn/J3wIzqW4qtBLGBlQxu/yy4eWecMK fI3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=7B6GEx2BckVLGrGh8hSI9pgjmNHASJLkwvct6IsDkyc=; b=UK1FatnDTWBedJIfiXujb3Sx0kTU2JrOxXLNUfnSqvgovAyI2xJne0HfKlZ3qi0hK2 /b5GvqY+E2VlC7x/0nExuZPgQ5VkA5B5dwzE1QwLOPhRL8vtkMWmdIya1soOpZPzRWpe W1p9Y2Hw2/SC4Tc6vJGgrzn6DOlBGwp3qNzNIRnU2VNzbbX9pvdVGo94D21Ccq6ly+i1 4xI0oFY/nk6uQPU15fB8t+BRVuErGh7Upcc1BoO570kc1vZ1VbQBZXRtkX/9M2n/Vs1i GiulycBP6yq6GHi9k3L+JEF5/gzoM9UOt5HX5S4SNRPGcvV1BKUrj0cU6AsIcTOKizYm EyQQ== X-Gm-Message-State: AOAM531fKkxiiEiK1r1uO1mhk97b1IR7V04Jgu6PfQrPFIvzR1UWwZPR cuCgxwRpGv/p1JYpmSLZa2TJchJF X-Google-Smtp-Source: ABdhPJxE8DmxGuF3jAGK35cHpN/GFy26Zc+3N/jM2BvmTIkvaUnVvePbO1FXW1mcaSmPh90BMJciTA== X-Received: by 2002:ad4:5692:: with SMTP id bc18mr6115035qvb.233.1589999451111; Wed, 20 May 2020 11:30:51 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id s62sm2766873qke.36.2020.05.20.11.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 11:30:50 -0700 (PDT) Sender: Mark Johnston Date: Wed, 20 May 2020 14:30:48 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Message-ID: <20200520183048.GB59386@raichu> References: <202005201829.04KITNRs083936@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005201829.04KITNRs083936@repo.freebsd.org> X-Rspamd-Queue-Id: 49S1XX3Q9nz4Zhs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=X2Nw6cuf; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f2d as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.90)[-0.904]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.31)[-0.310]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_NOT_FQDN(0.50)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.31)[-0.315]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2d:from]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 18:30:53 -0000 On Wed, May 20, 2020 at 06:29:23PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed May 20 18:29:23 2020 > New Revision: 361287 > URL: https://svnweb.freebsd.org/changeset/base/361287 > > Log: > Don't block on the range lock in zfs_getpages(). > > After r358443 the vnode object lock no longer synchronizes concurrent > zfs_getpages() and zfs_write() (which must update vnode pages to > maintain coherence). This created a potential deadlock between ZFS > range locks and VM page busy locks: a fault on a mapped file will cause > the fault page to be busied, after which zfs_getpages() locks a range > around the file offset in order to map adjacent, resident pages; > zfs_write() locks the range first, and then must busy vnode pages when > synchronizing. > > Solve this by adding a non-blocking mode for ZFS range locks, and using > it in zfs_getpages(). If zfs_getpages() fails to acquire the range > lock, only the fault page will be populated. I will work on getting this submitted to OpenZFS. From owner-svn-src-head@freebsd.org Wed May 20 19:45:23 2020 Return-Path: Delivered-To: svn-src-head@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 F30562F32CE; Wed, 20 May 2020 19:45:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S3BW6BqGz3RxV; Wed, 20 May 2020 19:45:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFBD821786; Wed, 20 May 2020 19:45:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KJjN8q033845; Wed, 20 May 2020 19:45:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJjM0E033838; Wed, 20 May 2020 19:45:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201945.04KJjM0E033838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 19:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361290 - in head: . release/packages release/scripts share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . release/packages release/scripts share/mk sys/conf X-SVN-Commit-Revision: 361290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 19:45:24 -0000 Author: emaste Date: Wed May 20 19:45:22 2020 New Revision: 361290 URL: https://svnweb.freebsd.org/changeset/base/361290 Log: pkgbase: use -dev,-dbg instead of -development,-debug -development is long and awkward, and is also inconsistent with prior art from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow the Debian convention, and similarly for debug info packages. Also remove redundant pkgbase development tag from includes. We already tag include files with package=runtime,dev; there is no need to separately tag them as dev. Discussed with: bapt Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24139 Modified: head/Makefile.inc1 head/release/packages/generate-ucl.sh head/release/scripts/mtree-to-plist.awk head/share/mk/bsd.incs.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/sys/conf/kmod.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 20 19:35:38 2020 (r361289) +++ head/Makefile.inc1 Wed May 20 19:45:22 2020 (r361290) @@ -1889,7 +1889,7 @@ create-world-package-${pkgname}: .PHONY _default_flavor= -default .if make(*package*) && exists(${KSTAGEDIR}/kernel.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif create-kernel-packages: .PHONY . for flavor in "" ${_debug} @@ -1923,7 +1923,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul . for _kernel in ${BUILDKERNELS:[2..-1]} . if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif . for flavor in "" ${_debug} create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel} Modified: head/release/packages/generate-ucl.sh ============================================================================== --- head/release/packages/generate-ucl.sh Wed May 20 19:35:38 2020 (r361289) +++ head/release/packages/generate-ucl.sh Wed May 20 19:45:22 2020 (r361290) @@ -61,13 +61,13 @@ main() { pkgdeps="runtime" _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" ;; - *_lib32_development) - outname="${outname%%_lib32_development}" + *_lib32_dev) + outname="${outname%%_lib32_dev}" _descr="32-bit Libraries, Development Files" pkgdeps="${outname}" ;; - *_lib32_debug) - outname="${outname%%_lib32_debug}" + *_lib32_dbg) + outname="${outname%%_lib32_dbg}" _descr="32-bit Libraries, Debugging Symbols" pkgdeps="${outname}" ;; @@ -76,13 +76,13 @@ main() { _descr="32-bit Libraries" pkgdeps="${outname}" ;; - *_development) - outname="${outname%%_development}" + *_dev) + outname="${outname%%_dev}" _descr="Development Files" pkgdeps="${outname}" ;; - *_debug) - outname="${outname%%_debug}" + *_dbg) + outname="${outname%%_dbg}" _descr="Debugging Symbols" pkgdeps="${outname}" ;; Modified: head/release/scripts/mtree-to-plist.awk ============================================================================== --- head/release/scripts/mtree-to-plist.awk Wed May 20 19:35:38 2020 (r361289) +++ head/release/scripts/mtree-to-plist.awk Wed May 20 19:45:22 2020 (r361290) @@ -70,7 +70,7 @@ output=output"."_kernconf } if ($1 ~ /^\/usr\/lib\/debug\/boot/) { - output=output"-debug.plist" + output=output"-dbg.plist" } else { output=output".plist" } Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.incs.mk Wed May 20 19:45:22 2020 (r361290) @@ -60,7 +60,7 @@ stage_includes: stage_as.${header:T} installincludes: _${group}INS_${header:T} _${group}INS_${header:T}: ${header} - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN_${.ALLSRC:T}} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN_${.ALLSRC:T}} \ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ ${.ALLSRC} \ ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} @@ -75,10 +75,10 @@ stage_includes: stage_files.${group} installincludes: _${group}INS _${group}INS: ${_${group}INCS} .if defined(${group}NAME) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} .else - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ${.ALLSRC} ${DESTDIR}${${group}DIR}/ .endif .endif @@ -89,7 +89,7 @@ _${group}INS: ${_${group}INCS} .if defined(INCSLINKS) && !empty(INCSLINKS) installincludes: .for s t in ${INCSLINKS} - ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${s} ${DESTDIR}${t} + ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${s} ${DESTDIR}${t} .endfor .endif .endif # !target(installincludes) Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.lib.mk Wed May 20 19:45:22 2020 (r361290) @@ -316,7 +316,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no" - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} + @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ @@ -332,7 +332,7 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} + @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} @@ -428,11 +428,11 @@ realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) @@ -441,15 +441,15 @@ _libinstall: ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ .endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} @@ -458,14 +458,14 @@ _libinstall: .else .if ${_SHLIBDIR} == ${_LIBDIR} .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .else .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ @@ -480,7 +480,7 @@ _libinstall: .endif # SHLIB_LINK .endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif .endif # !defined(INTERNALLIB) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.prog.mk Wed May 20 19:45:22 2020 (r361290) @@ -270,9 +270,9 @@ _proginstall: ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug .endif .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed May 20 19:35:38 2020 (r361289) +++ head/sys/conf/kmod.mk Wed May 20 19:45:22 2020 (r361290) @@ -338,7 +338,7 @@ _kmodinstall: .PHONY ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/ .if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" - ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${INSTALL} -T dbg -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG}.debug ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/ .endif From owner-svn-src-head@freebsd.org Wed May 20 19:51:40 2020 Return-Path: Delivered-To: svn-src-head@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 95FD42F38B2; Wed, 20 May 2020 19:51:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S3Km3XwCz3RtH; Wed, 20 May 2020 19:51:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74F4621651; Wed, 20 May 2020 19:51:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KJpekP038660; Wed, 20 May 2020 19:51:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJpeYw038659; Wed, 20 May 2020 19:51:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005201951.04KJpeYw038659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 19:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361291 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 361291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 19:51:40 -0000 Author: jhb Date: Wed May 20 19:51:39 2020 New Revision: 361291 URL: https://svnweb.freebsd.org/changeset/base/361291 Log: Merge freebsd32_exec_setregs() into exec_setregs() on MIPS. The stack pointer was being decremented by 64k twice previously. Reviewed by: brooks Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24930 Modified: head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -68,8 +68,6 @@ #include #include -static void freebsd32_exec_setregs(struct thread *, struct image_params *, - uintptr_t); static int get_mcontext32(struct thread *, mcontext32_t *, int); static int set_mcontext32(struct thread *, mcontext32_t *); static void freebsd32_sendsig(sig_t, ksiginfo_t *, sigset_t *); @@ -97,7 +95,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), .sv_copyout_strings = freebsd32_copyout_strings, - .sv_setregs = freebsd32_exec_setregs, + .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32, @@ -125,26 +123,6 @@ static Elf32_Brandinfo freebsd_brand_info = { SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); - -static void -freebsd32_exec_setregs(struct thread *td, struct image_params *imgp, - uintptr_t stack) -{ - exec_setregs(td, imgp, stack); - - /* - * See comment in exec_setregs about running 32-bit binaries with 64-bit - * registers. - */ - td->td_frame->sp -= 65536; - - /* - * Clear extended address space bit for userland. - */ - td->td_frame->sr &= ~MIPS_SR_UX; - - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; -} int set_regs32(struct thread *td, struct reg32 *regs) Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/pm_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -441,11 +441,14 @@ exec_setregs(struct thread *td, struct image_params *i td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | (mips_rd_status() & MIPS_SR_INT_MASK); -#if defined(__mips_n32) +#if defined(__mips_n32) || defined(__mips_n64) td->td_frame->sr |= MIPS_SR_PX; -#elif defined(__mips_n64) - td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif +#if defined(__mips_n64) + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_frame->sr |= MIPS_SR_UX; + td->td_frame->sr |= MIPS_SR_KX; +#endif /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) @@ -470,7 +473,12 @@ exec_setregs(struct thread *td, struct image_params *i PCPU_SET(fpcurthread, (struct thread *)0); td->td_md.md_ss_addr = 0; - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; +#ifdef COMPAT_FREEBSD32 + if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; + else +#endif + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; } int From owner-svn-src-head@freebsd.org Wed May 20 20:24:38 2020 Return-Path: Delivered-To: svn-src-head@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 312472F3EAC; Wed, 20 May 2020 20:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S43p0RY9z3TlH; Wed, 20 May 2020 20:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A1EE21D1F; Wed, 20 May 2020 20:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KKObg8058318; Wed, 20 May 2020 20:24:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKObst058317; Wed, 20 May 2020 20:24:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005202024.04KKObst058317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 20:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361292 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 361292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 20:24:38 -0000 Author: emaste Date: Wed May 20 20:24:37 2020 New Revision: 361292 URL: https://svnweb.freebsd.org/changeset/base/361292 Log: vt: fix duplicate keymap descriptions PR: 246495 Submitted by: Jorge Maidana MFC after: 1 week Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Wed May 20 19:51:39 2020 (r361291) +++ head/share/vt/keymaps/INDEX.keymaps Wed May 20 20:24:37 2020 (r361292) @@ -309,10 +309,10 @@ kz.kst.kbd:da:Kasakhisk kz.kst.kbd:de:Kasachisch kz.kst.kbd:fr:Kazakh -kz.io.kbd:en:Kazakh -kz.io.kbd:da:Kasakhisk -kz.io.kbd:de:Kasachisch -kz.io.kbd:fr:Kazakh +kz.io.kbd:en:Kazakh (with IO) +kz.io.kbd:da:Kasakhisk (IO) +kz.io.kbd:de:Kasachisch (mit IO) +kz.io.kbd:fr:Kazakh (avec IO) latinamerican.kbd:en:Latin American latinamerican.kbd:da:Latinamerikansk @@ -412,19 +412,19 @@ es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak +es.kbd:en:Spanish +es.kbd:da:Spansk +es.kbd:de:Spanisch +es.kbd:fr:Espagnol +es.kbd:pt:Espanhol +es.kbd:es:Español + es.acc.kbd:en:Spanish (accent keys) es.acc.kbd:da:Spansk (accenttaster) es.acc.kbd:de:Spanisch (accent keys) es.acc.kbd:fr:Espagnol (avec accents) es.acc.kbd:pt:Espanhol (com acentos) es.acc.kbd:es:Español (con acentos) - -es.kbd:en:Spanish (accent keys) -es.kbd:da:Spansk (accenttaster) -es.kbd:de:Spanisch (accent keys) -es.kbd:fr:Espagnol (avec accents) -es.kbd:pt:Espanhol (com acentos) -es.kbd:es:Español (con acentos) si.kbd:en:Slovenian si.kbd:da:Slovensk From owner-svn-src-head@freebsd.org Wed May 20 20:39:57 2020 Return-Path: Delivered-To: svn-src-head@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 E81A12F47DE; Wed, 20 May 2020 20:39:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 49S4PT4Sw5z3VyD; Wed, 20 May 2020 20:39:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 005265C0135; Wed, 20 May 2020 16:39:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 20 May 2020 16:39:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=H LxZM9aM8SuxFZ2BW5a1dD66jreA0jF8MVS7cb5D0CU=; b=Y+NtOQxfOFKkBZA/l xSY4RLxgNMO+NUSnaJcAIFcVmknYmEnhVuWYbnsDP6/Y6X8BVG/4tZ1J2YF8ePNX OVP32zPTSgg+M7apDZJjphGCE43opMGmWmwqRMIAfAqyNhs8FrwB8XQjl4O62Nxq Z5DdHLY0a3k+HV6nCn0508WJFlY6cFMfRtQ89sbHxw5Z1JwiF/1hTLIxKGHnvGrc cq1o4IZA/X7xAaUgtLVbZqNHGNiRAnKAZiiMuklriOgQ3eH72S4QQuvSGlYO1LtL L9ArDhmgKN3N2XUUl6YK9WWN52e93b60ApU1XmdhM131lIG3PvsHecNZ6eFqEgoH CV2lg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=HLxZM9aM8SuxFZ2BW5a1dD66jreA0jF8MVS7cb5D0 CU=; b=VED8ar7quHU0C8yup0coMxkB8ImFA5G9hQ/qxZ1oxmkmL8+tdWBQPwNr7 zhpdEQP4WNtpAmwl/gKT2Ckh7d17tFYMuaiuzmGuWcWMFnsyBSDXvsDXTIUzM46H a78x3Miqma53qnh27BKQeTQESTODlGUnYVVNj94mcsliKm4esXznKrMN9XENaFXI PUxRNKeAiMfV7pKrfLZMBVHcQqz7vzQhS8khVvC0xSSDkm8h9NSN0VaYSoVsO1uQ VdUAKBFsDli4MAavFZrsE7EiTccJPFbr5KwSNqueHIfDwRcFVUw0KNAvErhLEYBR jINuYvmDKP7rbmUoiKkyWN6CAg3yg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddtledgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuggftrfgrthhtvghrnhepudduveekheehiedukeekleelvedufe evfeetudfgtdffteffleehheffueffgfehnecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgnecukfhppeekrdegiedrkeelrddvudefnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.206] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DAA8306645E; Wed, 20 May 2020 16:39:56 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361284 - in head/sys/amd64: include vmm From: Scott Long In-Reply-To: <202005201727.04KHRsVL047061@repo.freebsd.org> Date: Wed, 20 May 2020 14:39:55 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0790972B-65C1-4C88-A4F2-FEFE656F2E66@samsco.org> References: <202005201727.04KHRsVL047061@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49S4PT4Sw5z3VyD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 20:39:58 -0000 There=E2=80=99s a better way to do this. People have been wanting = larger names to be merged into 12.x and 11.x, and that was going to be hard with how I originally did this. Your compat shim doesn=E2=80=99t make it any = easier. What I was going to do was return the ioctl in HEAD to the original size, and = create a new ioctl for the larger size, That would fix the compatibility issue = (since we don=E2=80=99t support a newer userland on an older kernel) and make it possible to = merge to -stable branches. I=E2=80=99d like to revert this commit and go in = that direction. Scott > On May 20, 2020, at 11:27 AM, Conrad Meyer wrote: >=20 > Author: cem > Date: Wed May 20 17:27:54 2020 > New Revision: 361284 > URL: https://svnweb.freebsd.org/changeset/base/361284 >=20 > Log: > vmm(4): Add 12 user ABI compat after r349948 >=20 > Reported by: kp > Reviewed by: jhb, kp > Tested by: kp > Differential Revision: https://reviews.freebsd.org/D24929 >=20 > Modified: > head/sys/amd64/include/vmm_dev.h > head/sys/amd64/vmm/vmm_dev.c From owner-svn-src-head@freebsd.org Wed May 20 20:50:12 2020 Return-Path: Delivered-To: svn-src-head@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 E92302F4BD3; Wed, 20 May 2020 20:50:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 49S4dH5krVz3WhW; Wed, 20 May 2020 20:50:11 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E86173C0199; Wed, 20 May 2020 20:50:04 +0000 (UTC) Date: Wed, 20 May 2020 20:50:04 +0000 From: Brooks Davis To: Brooks Davis Cc: Kyle Evans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200520205004.GA83149@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20200512221603.GB60902@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49S4dH5krVz3WhW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-0.30 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.06)[-0.062]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.60)[0.595]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.07)[0.069]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 20:50:13 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2020 at 10:16:03PM +0000, Brooks Davis wrote: > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > Author: kevans > > > > Date: Sat May 9 02:01:29 2020 > > > > New Revision: 360833 > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > Log: > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > This can be run as root or normal user with no problem; if they h= adn't > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host ce= rtctl to > > > > rehash the DESTDIR. This would allow one to build systems WITHOUT= _OPENSSL + > > > > WITH_CAROOT with a populated /etc/ssl that they can then use with= an > > > > appropriate *ssl from somewhere else. > > > > > > > > Cross-builds are fine because this will always use the host certc= tl, or just > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > Modified: > > > > head/Makefile.inc1 > > > > > > > > Modified: head/Makefile.inc1 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360= 832) > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360= 833) > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _in= stallcheck > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > .endfor > > > > .endif > > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > > + # We could make certctl a bootstrap tool, but it requires Ope= nSSL and > > > > + # friends, which we likely don't want. We'll rehash on a bes= t-effort > > > > + # basis, otherwise we'll just mention that we're not doing it= to raise > > > > + # awareness. > > > > + @if which certctl>/dev/null; then \ > > > > + certctl rehash \ > > > > > > Does this update METALOG with the added links? > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > In general I'm not enthusiastic about additions to installworld that = do > > > anything other than copying files, creating links, etc in simple ways. > >=20 > > I will happily back this out if I can get some qualified eyes to > > review/improve it. It does not update METALOG, and it probably should. > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > `certctl rehash` all over the tree in various points that may need it; > > the release(7) scripts will need to be done if we don't do it here at > > a minimum, and I haven't put much thought into it beyond that. >=20 > I'm not in a rush to back this out given that it's solving a real > problem, but lets talk about improvements. >=20 > I kind of feel like this belongs in distribution (which I think would > deal with release scripts) or in etcupdate/mergemaster, but I'm not > sure either of those are correct. I'd be happy to review changes to > update the METALOG (I guess we'd extend certctl with an option to do > that?) I think that's the most important things because we really > should be routinely validating that DESTDIR only contains things in the > METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding > "env DESTDIR=3D${DESTDIR}" so it's explicit. I did discover that this is causing me a minor hassle downstream in CheriBSD. Our crossbuild tool (cheribuild) checks for files not in the METALOG and prompts to ask if they should be included when run interactively. This means all my disk image builds now stall unless I remember to wait until I'm past that stage. Without addressing the question of which stage (if any) the certctl rehash should take place in, I have a potential fix for the failure to handle METALOG files in https://reviews.freebsd.org/D24932. It needs some documentation updates before it can land, but I think it's complete. -- Brooks --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJexZf8AAoJEKzQXbSebgfArJ8H/3pFKvS6OAhW4TTlhW7kMg9/ iqKBiTdwuXo54xWANz/Sgk6JTwZnPs4o3Ftb17CGRKm/OQ5TPR4NttGTYx2mzjUM XvmvqtuIPlDOnv8xPhrPREoB7pJunXDtK+7K/TKfGtoVQXOSXbaIFHH3d8QDySDd tAg3Rmz10gFVd461vYXUvt2zDi9n2jOYftTcv4qeeGDVH5FeBSMDfzbXzSpHJzUO mBHGWZD06i+Iw7HBHSfzQLCljD3N99qCmLu0YuT+sftF6BE+JrEizSyk7gyq6xnp QdRs+BQVa70UmuRbUdfnBpeH23yfOIEYmG+l8HMv04cdub4DUT/6JR1wtlGPeDY= =Zua5 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-head@freebsd.org Wed May 20 20:58:18 2020 Return-Path: Delivered-To: svn-src-head@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 C56BC2F5112; Wed, 20 May 2020 20:58:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4pf4srvz3XQ3; Wed, 20 May 2020 20:58:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8823722262; Wed, 20 May 2020 20:58:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KKwIve077036; Wed, 20 May 2020 20:58:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKwIqW077034; Wed, 20 May 2020 20:58:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202058.04KKwIqW077034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 20:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361293 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 361293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 20:58:18 -0000 Author: jhb Date: Wed May 20 20:58:17 2020 New Revision: 361293 URL: https://svnweb.freebsd.org/changeset/base/361293 Log: Remove copyinfrom() and copyinstrfrom(). These functions were added in 2001 and are currently unused. copyinfrom() looks to have never been used. copyinstrfrom() was used for two weeks before the code was refactored to remove it's sole use. Reviewed by: brooks, kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24928 Modified: head/sys/kern/subr_uio.c head/sys/sys/uio.h Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Wed May 20 20:24:37 2020 (r361292) +++ head/sys/kern/subr_uio.c Wed May 20 20:58:17 2020 (r361293) @@ -346,44 +346,6 @@ again: } int -copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, - int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyin(src, dst, len); - break; - case UIO_SYSSPACE: - bcopy(src, dst, len); - break; - default: - panic("copyinfrom: bad seg %d\n", seg); - } - return (error); -} - -int -copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, - size_t * __restrict copied, int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyinstr(src, dst, len, copied); - break; - case UIO_SYSSPACE: - error = copystr(src, dst, len, copied); - break; - default: - panic("copyinstrfrom: bad seg %d\n", seg); - } - return (error); -} - -int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) { u_int iovlen; Modified: head/sys/sys/uio.h ============================================================================== --- head/sys/sys/uio.h Wed May 20 20:24:37 2020 (r361292) +++ head/sys/sys/uio.h Wed May 20 20:58:17 2020 (r361293) @@ -80,12 +80,8 @@ struct vm_page; struct bus_dma_segment; struct uio *cloneuio(struct uio *uiop); -int copyinfrom(const void * __restrict src, void * __restrict dst, - size_t len, int seg); int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error); -int copyinstrfrom(const void * __restrict src, void * __restrict dst, - size_t len, size_t * __restrict copied, int seg); int copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop); int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz); int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz); From owner-svn-src-head@freebsd.org Wed May 20 20:58:49 2020 Return-Path: Delivered-To: svn-src-head@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 6AEB62F528B; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4qF2VBnz3Xkq; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5071922396; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KKwnfc077109; Wed, 20 May 2020 20:58:49 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKwmMP077102; Wed, 20 May 2020 20:58:48 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202005202058.04KKwmMP077102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 20 May 2020 20:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361294 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 361294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 20:58:49 -0000 Author: mm Date: Wed May 20 20:58:48 2020 New Revision: 361294 URL: https://svnweb.freebsd.org/changeset/base/361294 Log: MFV r361280: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_compat_zstd_2.tar.zst.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/README.md head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_filter_program.c head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/filter_fork.h head/contrib/libarchive/libarchive/filter_fork_posix.c head/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c head/contrib/libarchive/libarchive/test/test_compat_zstd.c head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c head/contrib/libarchive/tar/bsdtar.1 head/lib/libarchive/tests/Makefile head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/NEWS Wed May 20 20:58:48 2020 (r361294) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: head/contrib/libarchive/README.md ============================================================================== --- head/contrib/libarchive/README.md Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/README.md Wed May 20 20:58:48 2020 (r361294) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/libarchive/archive.h Wed May 20 20:58:48 2020 (r361294) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004002 +#define ARCHIVE_VERSION_NUMBER 3004003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: head/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_digest.c Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/libarchive/archive_digest.c Wed May 20 20:58:48 2020 (r361294) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { sha256_update(ctx, insize, indata); @@ -874,7 +874,7 @@ __archive_nettle_sha256update(archive_sha256_ctx *ctx, } static int -__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { sha256_digest(ctx, SHA256_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -883,7 +883,7 @@ __archive_nettle_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) static int -__archive_openssl_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -892,7 +892,7 @@ __archive_openssl_sha256init(archive_sha256_ctx *ctx) } static int -__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -900,7 +900,7 @@ __archive_openssl_sha256update(archive_sha256_ctx *ctx } static int -__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -913,20 +913,20 @@ __archive_openssl_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) static int -__archive_windowsapi_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA_256)); } static int -__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { return (win_crypto_Final(md, 32, ctx)); } @@ -934,14 +934,14 @@ __archive_windowsapi_sha256final(archive_sha256_ctx *c #else static int -__archive_stub_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -951,7 +951,7 @@ __archive_stub_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -964,14 +964,14 @@ __archive_stub_sha256final(archive_sha256_ctx *ctx, vo #if defined(ARCHIVE_CRYPTO_SHA384_LIBC) static int -__archive_libc_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384_Update(ctx, indata, insize); @@ -979,7 +979,7 @@ __archive_libc_sha384update(archive_sha384_ctx *ctx, c } static int -__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -988,14 +988,14 @@ __archive_libc_sha384final(archive_sha384_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2) static int -__archive_libc2_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1003,7 +1003,7 @@ __archive_libc2_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1012,14 +1012,14 @@ __archive_libc2_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3) static int -__archive_libc3_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1027,7 +1027,7 @@ __archive_libc3_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1036,14 +1036,14 @@ __archive_libc3_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) static int -__archive_libsystem_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { CC_SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { CC_SHA384_Update(ctx, indata, insize); @@ -1051,7 +1051,7 @@ __archive_libsystem_sha384update(archive_sha384_ctx *c } static int -__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { CC_SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -1060,7 +1060,7 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) static int -__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { mbedtls_sha512_init(ctx); if (mbedtls_sha512_starts_ret(ctx, 1) == 0) @@ -1070,7 +1070,7 @@ __archive_mbedtls_sha384init(archive_sha384_ctx *ctx) } static int -__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 20 21:02:09 2020 Return-Path: Delivered-To: svn-src-head@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 10B8A2F513E; Wed, 20 May 2020 21:02:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4v46l7Sz3Xwy; Wed, 20 May 2020 21:02:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E23FA225D3; Wed, 20 May 2020 21:02:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KL28LG082693; Wed, 20 May 2020 21:02:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KL28th082692; Wed, 20 May 2020 21:02:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005202102.04KL28th082692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 May 2020 21:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361295 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 361295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:02:09 -0000 Author: kevans Date: Wed May 20 21:02:08 2020 New Revision: 361295 URL: https://svnweb.freebsd.org/changeset/base/361295 Log: loader: fix userboot's ability to detect a guest's interpreter Some time after r338418, I believe with -Os/-Oz -ffunction-sections -fdata-sections, the bootprog_interp variable that held our "$Interpreter:" marker started getting strip from all loaders, with exception to userboot since it used bootprog_interp to determine what flavor of userboot it was. At some point, it had been brought to my attention that this was no longer working and I had worked up some potential solutions to use the variable that involved printing it out. My vague recollection is that this was rejected, and I forgot to explore the alternatives; I cannot find records of this discussion anymore. Fast forward to present day, Andrew reported that it was non-functional and offered (effectively) this patch (sans comment) to stop the compiler from optimizing it out by assigning it to a volatile variable. This removes concerns about user-facing change while retaining the interpreter marker. Furthermore, it could certainly be uglier. Reported and tested by: Andrew Gierth MFC after: 3 days Modified: head/stand/common/interp.c Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed May 20 20:58:48 2020 (r361294) +++ head/stand/common/interp.c Wed May 20 21:02:08 2020 (r361295) @@ -45,8 +45,17 @@ __FBSDID("$FreeBSD$"); void interact(void) { - static char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ + const char * volatile interp_identifier; + /* + * Because interp_identifier is volatile, it cannot be optimized out by + * the compiler as it's considered an externally observable event. This + * prevents the compiler from optimizing out our carefully placed + * $Interpreter:4th string that userboot may use to determine that + * we need to switch interpreters. + */ + interp_identifier = bootprog_interp; interp_init(); printf("\n"); From owner-svn-src-head@freebsd.org Wed May 20 21:15:44 2020 Return-Path: Delivered-To: svn-src-head@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 DB7D62F5628; Wed, 20 May 2020 21:15:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5Bm5W3Dz3Yrw; Wed, 20 May 2020 21:15:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EFC2263E; Wed, 20 May 2020 21:15:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLFiBo089583; Wed, 20 May 2020 21:15:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLFiig089580; Wed, 20 May 2020 21:15:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202115.04KLFiig089580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361296 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 361296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:15:44 -0000 Author: jhb Date: Wed May 20 21:15:43 2020 New Revision: 361296 URL: https://svnweb.freebsd.org/changeset/base/361296 Log: Simplify hot-patching cpu_switch() for lack of UserLocal register. Rather than walking all of cpu_switch looking for the sequence of instructions to patch, add a global label at the location that needs the patch applied. Reviewed by: brooks, Alfredo Mazzinghi Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24931 Modified: head/sys/mips/include/md_var.h head/sys/mips/mips/cpu.c head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) @@ -75,6 +75,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; void busdma_swi(void); Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/mips/cpu.c Wed May 20 21:15:43 2020 (r361296) @@ -68,44 +68,6 @@ struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ ((uint32_t)(((a) << 26)|((b) << 21)|((c) << 16)|((d) << 11)|(e))) -#if defined(__mips_n64) - -# define _LOAD_T0_MDTLS_A1 \ - _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ - _ENCODE_INSN(OP_LD, A1, T1, 0, \ - offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ - _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) - -#else /* mips 32 */ - -# define _LOAD_T0_MDTLS_A1 \ - _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ - _ENCODE_INSN(OP_LW, A1, T1, 0, \ - offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ - _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) - -#endif /* ! __mips_n64 */ - -#if defined(__mips_n64) || defined(__mips_n32) - -# define _MTC0_V0_USERLOCAL \ - _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) - -#else /* mips o32 */ - -# define _MTC0_V0_USERLOCAL \ - _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) - -#endif /* ! (__mips_n64 || __mipsn32) */ - #define _JR_RA _ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR) #define _NOP 0 @@ -120,18 +82,9 @@ remove_userlocal_code(uint32_t *cpu_switch_code) { uint32_t *instructp; - for (instructp = cpu_switch_code;; instructp++) { - if (instructp[0] == _JR_RA) - panic("%s: Unable to patch cpu_switch().", __func__); - if (instructp[0] == _LOAD_T0_MDTLS_A1 && - instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && - instructp[2] == _ADDU_V0_T0_T1 && - instructp[3] == _MTC0_V0_USERLOCAL) { - instructp[0] = _JR_RA; - instructp[1] = _NOP; - break; - } - } + instructp = cpu_switch_code; + instructp[0] = _JR_RA; + instructp[1] = _NOP; } /* @@ -202,7 +155,7 @@ mips_get_identity(struct mips_cpuinfo *cpuinfo) * cpu_switch() and remove unsupported code. */ cpuinfo->userlocal_reg = false; - remove_userlocal_code((uint32_t *)cpu_switch); + remove_userlocal_code((uint32_t *)cpu_switch_set_userlocal); } Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/mips/swtch.S Wed May 20 21:15:43 2020 (r361296) @@ -383,6 +383,8 @@ sw2: * Note that this code is removed if the CPU doesn't support ULRI by * remove_userlocal_code() in cpu.c. */ + .globl cpu_switch_set_userlocal +cpu_switch_set_userlocal: PTR_L t0, TD_MDTLS(a1) # Get TLS pointer PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset PTR_ADDU v0, t0, t1 From owner-svn-src-head@freebsd.org Wed May 20 21:16:56 2020 Return-Path: Delivered-To: svn-src-head@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 588392F55E1; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5D81mjxz3Yt5; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 380FB22903; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLGtaC089683; Wed, 20 May 2020 21:16:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLGsdC089676; Wed, 20 May 2020 21:16:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202116.04KLGsdC089676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361297 - in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Commit-Revision: 361297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:16:56 -0000 Author: jhb Date: Wed May 20 21:16:54 2020 New Revision: 361297 URL: https://svnweb.freebsd.org/changeset/base/361297 Log: Print CPU informtion later in boot. Match other architectures and print CPU information during cpu_startup(). In particular, this prints the information after the message buffer is initialized which allows it to be retrieved after boot via dmesg(8). While here, add some extern declarations to in place of duplicated declarations in various source files. Reviewed by: brooks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24936 Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/include/md_var.h head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mips/cpu.c head/sys/mips/mips/machdep.c Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -148,8 +148,6 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_ "Board revision"); #endif -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -275,8 +275,6 @@ ar71xx_platform_check_mac_hints(void) return (0); } -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -97,8 +97,6 @@ struct octeon_feature_description { }; extern int *end; -extern char cpu_model[]; -extern char cpu_board[]; static char octeon_kenv[0x2000]; static const struct octeon_feature_description octeon_feature_descriptions[] = { Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/include/md_var.h Wed May 20 21:16:54 2020 (r361297) @@ -42,6 +42,8 @@ * Miscellaneous machine-dependent declarations. */ extern long Maxmem; +extern char cpu_board[]; +extern char cpu_model[]; extern char sigcode[]; extern int szsigcode; #if defined(__mips_n32) || defined(__mips_n64) @@ -75,6 +77,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_identify(void); void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:16:54 2020 (r361297) @@ -396,8 +396,6 @@ mtk_soc_try_early_detect(void) bus_space_unmap(bst, bsh, MTK_DEFAULT_SIZE); } -extern char cpu_model[]; - void mtk_soc_set_cpu_model(void) { Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/cpu.c Wed May 20 21:16:54 2020 (r361297) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static void cpu_identify(void); - struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ @@ -294,18 +292,16 @@ mips_cpu_init(void) mips_icache_sync_all(); mips_dcache_wbinv_all(); - /* Print some info about CPU */ - cpu_identify(); } -static void +void cpu_identify(void) { uint32_t cfg0, cfg1, cfg2, cfg3; #if defined(CPU_MIPS1004K) || defined (CPU_MIPS74K) || defined (CPU_MIPS24K) uint32_t cfg7; #endif - printf("cpu%d: ", 0); /* XXX per-cpu */ + printf("CPU: "); switch (cpuinfo.cpu_vendor) { case MIPS_PRID_CID_MTI: printf("MIPS Technologies"); @@ -347,6 +343,8 @@ cpu_identify(void) printf("Unknown cid %#x", cpuinfo.cpu_vendor); break; } + if (cpu_model[0] != '\0') + printf(" (%s)", cpu_model); printf(" processor v%d.%d\n", cpuinfo.cpu_rev, cpuinfo.cpu_impl); printf(" MMU: "); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -185,7 +185,7 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; - printf("CPU model: %s\n", cpu_model); + cpu_identify(); printf("real memory = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem), ptoa((uintmax_t)realmem) / 1024); From owner-svn-src-head@freebsd.org Wed May 20 21:21:04 2020 Return-Path: Delivered-To: svn-src-head@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 6EE6D2F58F8; Wed, 20 May 2020 21:21:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5Jw2XWPz3ZYN; Wed, 20 May 2020 21:21:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37A9E2264C; Wed, 20 May 2020 21:21:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLL4Yg091685; Wed, 20 May 2020 21:21:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLL25E091670; Wed, 20 May 2020 21:21:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202121.04KLL25E091670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361298 - in head/sys: crypto/chacha20 dev/cxgbe/crypto opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/chacha20 dev/cxgbe/crypto opencrypto X-SVN-Commit-Revision: 361298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:21:04 -0000 Author: jhb Date: Wed May 20 21:21:01 2020 New Revision: 361298 URL: https://svnweb.freebsd.org/changeset/base/361298 Log: Various cleanups to the software encryption transform interface. - Consistently use 'void *' for key schedules / key contexts instead of a mix of 'caddr_t', 'uint8_t *', and 'void *'. - Add a ctxsize member to enc_xform similar to what auth transforms use and require callers to malloc/zfree the context. The setkey callback now supplies the caller-allocated context pointer and the zerokey callback is removed. Callers now always use zfree() to ensure key contexts are zeroed. - Consistently use C99 initializers for all statically-initialized instances of 'struct enc_xform'. - Change the encrypt and decrypt functions to accept separate in and out buffer pointers. Almost all of the backend crypto functions already supported separate input and output buffers and this makes it simpler to support separate buffers in OCF. - Remove xform_userland.h shim to permit transforms to be compiled in userland. Transforms no longer call malloc/free directly. Reviewed by: cem (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24855 Deleted: head/sys/opencrypto/xform_userland.h Modified: head/sys/crypto/chacha20/chacha-sw.c head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_aes_icm.c head/sys/opencrypto/xform_aes_xts.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_cml.c head/sys/opencrypto/xform_comp.h head/sys/opencrypto/xform_enc.h head/sys/opencrypto/xform_gmac.c head/sys/opencrypto/xform_null.c head/sys/opencrypto/xform_rijndael.c Modified: head/sys/crypto/chacha20/chacha-sw.c ============================================================================== --- head/sys/crypto/chacha20/chacha-sw.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/crypto/chacha20/chacha-sw.c Wed May 20 21:21:01 2020 (r361298) @@ -7,63 +7,42 @@ __FBSDID("$FreeBSD$"); #include static int -chacha20_xform_setkey(u_int8_t **sched, const u_int8_t *key, int len) +chacha20_xform_setkey(void *ctx, const uint8_t *key, int len) { - struct chacha_ctx *ctx; if (len != CHACHA_MINKEYLEN && len != 32) return (EINVAL); - ctx = malloc(sizeof(*ctx), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); - *sched = (void *)ctx; - if (ctx == NULL) - return (ENOMEM); - chacha_keysetup(ctx, key, len * 8); return (0); } static void -chacha20_xform_reinit(caddr_t key, const u_int8_t *iv) +chacha20_xform_reinit(void *ctx, const u_int8_t *iv) { - struct chacha_ctx *ctx; - ctx = (void *)key; chacha_ivsetup(ctx, iv + 8, iv); } static void -chacha20_xform_zerokey(u_int8_t **sched) +chacha20_xform_crypt(void *ctx, const uint8_t *in, uint8_t *out) { - struct chacha_ctx *ctx; - ctx = (void *)*sched; - explicit_bzero(ctx, sizeof(*ctx)); - free(ctx, M_CRYPTO_DATA); - *sched = NULL; + chacha_encrypt_bytes(ctx, in, out, 1); } static void -chacha20_xform_crypt(caddr_t cctx, u_int8_t *bytes) +chacha20_xform_crypt_multi(void *ctx, const uint8_t *in, uint8_t *out, + size_t len) { - struct chacha_ctx *ctx; - ctx = (void *)cctx; - chacha_encrypt_bytes(ctx, bytes, bytes, 1); + chacha_encrypt_bytes(ctx, in, out, len); } -static void -chacha20_xform_crypt_multi(void *vctx, uint8_t *bytes, size_t len) -{ - struct chacha_ctx *ctx; - - ctx = vctx; - chacha_encrypt_bytes(ctx, bytes, bytes, len); -} - struct enc_xform enc_xform_chacha20 = { .type = CRYPTO_CHACHA20, .name = "chacha20", + .ctxsize = sizeof(struct chacha_ctx), .blocksize = 1, .ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN, .minkey = CHACHA_MINKEYLEN, @@ -71,7 +50,6 @@ struct enc_xform enc_xform_chacha20 = { .encrypt = chacha20_xform_crypt, .decrypt = chacha20_xform_crypt, .setkey = chacha20_xform_setkey, - .zerokey = chacha20_xform_zerokey, .reinit = chacha20_xform_reinit, .encrypt_multi = chacha20_xform_crypt_multi, .decrypt_multi = chacha20_xform_crypt_multi, Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:21:01 2020 (r361298) @@ -1354,8 +1354,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr { struct auth_hash *axf; struct enc_xform *exf; - void *auth_ctx; - uint8_t *kschedule; + void *auth_ctx, *kschedule; char block[GMAC_BLOCK_LEN]; char digest[GMAC_DIGEST_LEN]; char iv[AES_BLOCK_LEN]; @@ -1389,7 +1388,12 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr /* Initialize the cipher. */ exf = &enc_xform_aes_nist_gcm; - error = exf->setkey(&kschedule, s->blkcipher.enckey, + kschedule = malloc(exf->ctxsize, M_CCR, M_NOWAIT); + if (kschedule == NULL) { + error = ENOMEM; + goto out; + } + error = exf->setkey(kschedule, s->blkcipher.enckey, s->blkcipher.key_len); if (error) goto out; @@ -1423,7 +1427,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - exf->encrypt(kschedule, block); + exf->encrypt(kschedule, block, block); axf->Update(auth_ctx, block, len); crypto_copyback(crp, crp->crp_payload_start + i, len, block); @@ -1462,7 +1466,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } @@ -1470,12 +1474,9 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr error = EBADMSG; } - exf->zerokey(&kschedule); out: - if (auth_ctx != NULL) { - memset(auth_ctx, 0, axf->ctxsize); - free(auth_ctx, M_CCR); - } + zfree(kschedule, M_CCR); + zfree(auth_ctx, M_CCR); crp->crp_etype = error; crypto_done(crp); } @@ -1810,7 +1811,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr struct auth_hash *axf; struct enc_xform *exf; union authctx *auth_ctx; - uint8_t *kschedule; + void *kschedule; char block[CCM_CBC_BLOCK_LEN]; char digest[AES_CBC_MAC_HASH_LEN]; char iv[AES_CCM_IV_LEN]; @@ -1844,7 +1845,12 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr /* Initialize the cipher. */ exf = &enc_xform_ccm; - error = exf->setkey(&kschedule, s->blkcipher.enckey, + kschedule = malloc(exf->ctxsize, M_CCR, M_NOWAIT); + if (kschedule == NULL) { + error = ENOMEM; + goto out; + } + error = exf->setkey(kschedule, s->blkcipher.enckey, s->blkcipher.key_len); if (error) goto out; @@ -1876,11 +1882,11 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr bzero(block + len, sizeof(block) - len); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { axf->Update(auth_ctx, block, len); - exf->encrypt(kschedule, block); + exf->encrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } else { - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); axf->Update(auth_ctx, block, len); } } @@ -1910,7 +1916,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } @@ -1918,12 +1924,9 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr error = EBADMSG; } - exf->zerokey(&kschedule); out: - if (auth_ctx != NULL) { - memset(auth_ctx, 0, axf->ctxsize); - free(auth_ctx, M_CCR); - } + zfree(kschedule, M_CCR); + zfree(auth_ctx, M_CCR); crp->crp_etype = error; crypto_done(crp); } Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/cryptosoft.c Wed May 20 21:21:01 2020 (r361298) @@ -65,7 +65,7 @@ struct swcr_auth { }; struct swcr_encdec { - uint8_t *sw_kschedule; + void *sw_kschedule; struct enc_xform *sw_exf; }; @@ -131,11 +131,8 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * crypto_read_iv(crp, iv); if (crp->crp_cipher_key != NULL) { - if (sw->sw_kschedule) - exf->zerokey(&(sw->sw_kschedule)); - csp = crypto_get_params(crp->crp_session); - error = exf->setkey(&sw->sw_kschedule, + error = exf->setkey(sw->sw_kschedule, crp->crp_cipher_key, csp->csp_cipher_klen); if (error) return (error); @@ -197,10 +194,10 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * /* Actual encryption/decryption */ if (exf->reinit) { if (encrypting) { - exf->encrypt(sw->sw_kschedule, + exf->encrypt(sw->sw_kschedule, blk, blk); } else { - exf->decrypt(sw->sw_kschedule, + exf->decrypt(sw->sw_kschedule, blk, blk); } } else if (encrypting) { @@ -208,7 +205,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * for (j = 0; j < blks; j++) blk[j] ^= ivp[j]; - exf->encrypt(sw->sw_kschedule, blk); + exf->encrypt(sw->sw_kschedule, blk, blk); /* * Keep encrypted block for XOR'ing @@ -224,7 +221,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * nivp = (ivp == iv) ? iv2 : iv; bcopy(blk, nivp, blks); - exf->decrypt(sw->sw_kschedule, blk); + exf->decrypt(sw->sw_kschedule, blk, blk); /* XOR with previous block */ for (j = 0; j < blks; j++) @@ -264,25 +261,25 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * if (exf->reinit) { if (encrypting && exf->encrypt_multi == NULL) exf->encrypt(sw->sw_kschedule, - idat); + idat, idat); else if (encrypting) { nb = rounddown(rem, blks); exf->encrypt_multi(sw->sw_kschedule, - idat, nb); + idat, idat, nb); } else if (exf->decrypt_multi == NULL) exf->decrypt(sw->sw_kschedule, - idat); + idat, idat); else { nb = rounddown(rem, blks); exf->decrypt_multi(sw->sw_kschedule, - idat, nb); + idat, idat, nb); } } else if (encrypting) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) idat[j] ^= ivp[j]; - exf->encrypt(sw->sw_kschedule, idat); + exf->encrypt(sw->sw_kschedule, idat, idat); ivp = idat; } else { /* decrypt */ /* @@ -292,7 +289,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * nivp = (ivp == iv) ? iv2 : iv; bcopy(idat, nivp, blks); - exf->decrypt(sw->sw_kschedule, idat); + exf->decrypt(sw->sw_kschedule, idat, idat); /* XOR with previous block/IV */ for (j = 0; j < blks; j++) @@ -543,7 +540,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - exf->encrypt(swe->sw_kschedule, blk); + exf->encrypt(swe->sw_kschedule, blk, blk); axf->Update(&ctx, blk, len); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); @@ -579,7 +576,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } @@ -704,7 +701,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp crypto_copydata(crp, crp->crp_payload_start + i, len, blk); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { axf->Update(&ctx, blk, len); - exf->encrypt(swe->sw_kschedule, blk); + exf->encrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } else { @@ -716,7 +713,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp * the tag and a second time after the tag is * verified. */ - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); axf->Update(&ctx, blk, len); } } @@ -741,7 +738,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } @@ -854,7 +851,7 @@ swcr_compdec(struct swcr_session *ses, struct cryptop } static int -swcr_setup_encdec(struct swcr_session *ses, +swcr_setup_cipher(struct swcr_session *ses, const struct crypto_session_params *csp) { struct swcr_encdec *swe; @@ -864,8 +861,14 @@ swcr_setup_encdec(struct swcr_session *ses, swe = &ses->swcr_encdec; txf = crypto_cipher(csp); MPASS(txf->ivsize == csp->csp_ivlen); + if (txf->ctxsize != 0) { + swe->sw_kschedule = malloc(txf->ctxsize, M_CRYPTO_DATA, + M_NOWAIT); + if (swe->sw_kschedule == NULL) + return (ENOMEM); + } if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, + error = txf->setkey(swe->sw_kschedule, csp->csp_cipher_key, csp->csp_cipher_klen); if (error) return (error); @@ -962,11 +965,8 @@ static int swcr_setup_gcm(struct swcr_session *ses, const struct crypto_session_params *csp) { - struct swcr_encdec *swe; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; - int error; if (csp->csp_ivlen != AES_GCM_IV_LEN) return (EINVAL); @@ -1002,28 +1002,15 @@ swcr_setup_gcm(struct swcr_session *ses, csp->csp_cipher_klen); /* Second, setup the cipher side. */ - swe = &ses->swcr_encdec; - txf = &enc_xform_aes_nist_gcm; - if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, - csp->csp_cipher_key, csp->csp_cipher_klen); - if (error) - return (error); - } - swe->sw_exf = txf; - - return (0); + return (swcr_setup_cipher(ses, csp)); } static int swcr_setup_ccm(struct swcr_session *ses, const struct crypto_session_params *csp) { - struct swcr_encdec *swe; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; - int error; if (csp->csp_ivlen != AES_CCM_IV_LEN) return (EINVAL); @@ -1059,17 +1046,7 @@ swcr_setup_ccm(struct swcr_session *ses, csp->csp_cipher_klen); /* Second, setup the cipher side. */ - swe = &ses->swcr_encdec; - txf = &enc_xform_ccm; - if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, - csp->csp_cipher_key, csp->csp_cipher_klen); - if (error) - return (error); - } - swe->sw_exf = txf; - - return (0); + return (swcr_setup_cipher(ses, csp)); } static bool @@ -1246,7 +1223,7 @@ swcr_newsession(device_t dev, crypto_session_t cses, panic("bad cipher algo"); #endif default: - error = swcr_setup_encdec(ses, csp); + error = swcr_setup_cipher(ses, csp); if (error == 0) ses->swcr_process = swcr_encdec; } @@ -1295,7 +1272,7 @@ swcr_newsession(device_t dev, crypto_session_t cses, break; } - error = swcr_setup_encdec(ses, csp); + error = swcr_setup_cipher(ses, csp); if (error == 0) ses->swcr_process = swcr_eta; break; @@ -1313,18 +1290,13 @@ swcr_freesession(device_t dev, crypto_session_t cses) { struct swcr_session *ses; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; ses = crypto_get_driver_session(cses); mtx_destroy(&ses->swcr_lock); - txf = ses->swcr_encdec.sw_exf; - if (txf != NULL) { - if (ses->swcr_encdec.sw_kschedule != NULL) - txf->zerokey(&(ses->swcr_encdec.sw_kschedule)); - } + zfree(ses->swcr_encdec.sw_kschedule, M_CRYPTO_DATA); axf = ses->swcr_auth.sw_axf; if (axf != NULL) { Modified: head/sys/opencrypto/xform_aes_icm.c ============================================================================== --- head/sys/opencrypto/xform_aes_icm.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_aes_icm.c Wed May 20 21:21:01 2020 (r361298) @@ -52,43 +52,50 @@ __FBSDID("$FreeBSD$"); #include -static int aes_icm_setkey(u_int8_t **, const u_int8_t *, int); -static void aes_icm_crypt(caddr_t, u_int8_t *); -static void aes_icm_zerokey(u_int8_t **); -static void aes_icm_reinit(caddr_t, const u_int8_t *); -static void aes_gcm_reinit(caddr_t, const u_int8_t *); -static void aes_ccm_reinit(caddr_t, const u_int8_t *); +static int aes_icm_setkey(void *, const uint8_t *, int); +static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); +static void aes_icm_reinit(void *, const uint8_t *); +static void aes_gcm_reinit(void *, const uint8_t *); +static void aes_ccm_reinit(void *, const uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_aes_icm = { - CRYPTO_AES_ICM, "AES-ICM", - AES_BLOCK_LEN, AES_BLOCK_LEN, AES_MIN_KEY, AES_MAX_KEY, - aes_icm_crypt, - aes_icm_crypt, - aes_icm_setkey, - aes_icm_zerokey, - aes_icm_reinit, + .type = CRYPTO_AES_ICM, + .name = "AES-ICM", + .ctxsize = sizeof(struct aes_icm_ctx), + .blocksize = AES_BLOCK_LEN, + .ivsize = AES_BLOCK_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, + .encrypt = aes_icm_crypt, + .decrypt = aes_icm_crypt, + .setkey = aes_icm_setkey, + .reinit = aes_icm_reinit, }; struct enc_xform enc_xform_aes_nist_gcm = { - CRYPTO_AES_NIST_GCM_16, "AES-GCM", - AES_ICM_BLOCK_LEN, AES_GCM_IV_LEN, AES_MIN_KEY, AES_MAX_KEY, - aes_icm_crypt, - aes_icm_crypt, - aes_icm_setkey, - aes_icm_zerokey, - aes_gcm_reinit, + .type = CRYPTO_AES_NIST_GCM_16, + .name = "AES-GCM", + .ctxsize = sizeof(struct aes_icm_ctx), + .blocksize = AES_ICM_BLOCK_LEN, + .ivsize = AES_GCM_IV_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, + .encrypt = aes_icm_crypt, + .decrypt = aes_icm_crypt, + .setkey = aes_icm_setkey, + .reinit = aes_gcm_reinit, }; struct enc_xform enc_xform_ccm = { .type = CRYPTO_AES_CCM_16, .name = "AES-CCM", + .ctxsize = sizeof(struct aes_icm_ctx), .blocksize = AES_ICM_BLOCK_LEN, .ivsize = AES_CCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, .encrypt = aes_icm_crypt, .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, - .zerokey = aes_icm_zerokey, .reinit = aes_ccm_reinit, }; @@ -96,33 +103,33 @@ struct enc_xform enc_xform_ccm = { * Encryption wrapper routines. */ static void -aes_icm_reinit(caddr_t key, const u_int8_t *iv) +aes_icm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; - ctx = (struct aes_icm_ctx *)key; + ctx = key; bcopy(iv, ctx->ac_block, AESICM_BLOCKSIZE); } static void -aes_gcm_reinit(caddr_t key, const u_int8_t *iv) +aes_gcm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; aes_icm_reinit(key, iv); - ctx = (struct aes_icm_ctx *)key; + ctx = key; /* GCM starts with 2 as counter 1 is used for final xor of tag. */ bzero(&ctx->ac_block[AESICM_BLOCKSIZE - 4], 4); ctx->ac_block[AESICM_BLOCKSIZE - 1] = 2; } static void -aes_ccm_reinit(caddr_t key, const u_int8_t *iv) +aes_ccm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; - ctx = (struct aes_icm_ctx*)key; + ctx = key; /* CCM has flags, then the IV, then the counter, which starts at 1 */ bzero(ctx->ac_block, sizeof(ctx->ac_block)); @@ -133,16 +140,16 @@ aes_ccm_reinit(caddr_t key, const u_int8_t *iv) } static void -aes_icm_crypt(caddr_t key, u_int8_t *data) +aes_icm_crypt(void *key, const uint8_t *in, uint8_t *out) { struct aes_icm_ctx *ctx; - u_int8_t keystream[AESICM_BLOCKSIZE]; + uint8_t keystream[AESICM_BLOCKSIZE]; int i; - ctx = (struct aes_icm_ctx *)key; + ctx = key; rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); for (i = 0; i < AESICM_BLOCKSIZE; i++) - data[i] ^= keystream[i]; + out[i] = in[i] ^ keystream[i]; explicit_bzero(keystream, sizeof(keystream)); /* increment counter */ @@ -153,28 +160,14 @@ aes_icm_crypt(caddr_t key, u_int8_t *data) } static int -aes_icm_setkey(u_int8_t **sched, const u_int8_t *key, int len) +aes_icm_setkey(void *sched, const uint8_t *key, int len) { struct aes_icm_ctx *ctx; if (len != 16 && len != 24 && len != 32) - return EINVAL; + return (EINVAL); - *sched = KMALLOC(sizeof(struct aes_icm_ctx), M_CRYPTO_DATA, - M_NOWAIT | M_ZERO); - if (*sched == NULL) - return ENOMEM; - - ctx = (struct aes_icm_ctx *)*sched; + ctx = sched; ctx->ac_nr = rijndaelKeySetupEnc(ctx->ac_ek, key, len * 8); - return 0; -} - -static void -aes_icm_zerokey(u_int8_t **sched) -{ - - bzero(*sched, sizeof(struct aes_icm_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + return (0); } Modified: head/sys/opencrypto/xform_aes_xts.c ============================================================================== --- head/sys/opencrypto/xform_aes_xts.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_aes_xts.c Wed May 20 21:21:01 2020 (r361298) @@ -52,31 +52,34 @@ __FBSDID("$FreeBSD$"); #include -static int aes_xts_setkey(u_int8_t **, const u_int8_t *, int); -static void aes_xts_encrypt(caddr_t, u_int8_t *); -static void aes_xts_decrypt(caddr_t, u_int8_t *); -static void aes_xts_zerokey(u_int8_t **); -static void aes_xts_reinit(caddr_t, const u_int8_t *); +static int aes_xts_setkey(void *, const uint8_t *, int); +static void aes_xts_encrypt(void *, const uint8_t *, uint8_t *); +static void aes_xts_decrypt(void *, const uint8_t *, uint8_t *); +static void aes_xts_reinit(void *, const uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_aes_xts = { - CRYPTO_AES_XTS, "AES-XTS", - AES_BLOCK_LEN, AES_XTS_IV_LEN, AES_XTS_MIN_KEY, AES_XTS_MAX_KEY, - aes_xts_encrypt, - aes_xts_decrypt, - aes_xts_setkey, - aes_xts_zerokey, - aes_xts_reinit + .type = CRYPTO_AES_XTS, + .name = "AES-XTS", + .ctxsize = sizeof(struct aes_xts_ctx), + .blocksize = AES_BLOCK_LEN, + .ivsize = AES_XTS_IV_LEN, + .minkey = AES_XTS_MIN_KEY, + .maxkey = AES_XTS_MAX_KEY, + .encrypt = aes_xts_encrypt, + .decrypt = aes_xts_decrypt, + .setkey = aes_xts_setkey, + .reinit = aes_xts_reinit }; /* * Encryption wrapper routines. */ static void -aes_xts_reinit(caddr_t key, const u_int8_t *iv) +aes_xts_reinit(void *key, const uint8_t *iv) { - struct aes_xts_ctx *ctx = (struct aes_xts_ctx *)key; - u_int64_t blocknum; + struct aes_xts_ctx *ctx = key; + uint64_t blocknum; u_int i; /* @@ -95,21 +98,22 @@ aes_xts_reinit(caddr_t key, const u_int8_t *iv) } static void -aes_xts_crypt(struct aes_xts_ctx *ctx, u_int8_t *data, u_int do_encrypt) +aes_xts_crypt(struct aes_xts_ctx *ctx, const uint8_t *in, uint8_t *out, + u_int do_encrypt) { - u_int8_t block[AES_XTS_BLOCKSIZE]; + uint8_t block[AES_XTS_BLOCKSIZE]; u_int i, carry_in, carry_out; for (i = 0; i < AES_XTS_BLOCKSIZE; i++) - block[i] = data[i] ^ ctx->tweak[i]; + block[i] = in[i] ^ ctx->tweak[i]; if (do_encrypt) - rijndael_encrypt(&ctx->key1, block, data); + rijndael_encrypt(&ctx->key1, block, out); else - rijndael_decrypt(&ctx->key1, block, data); + rijndael_decrypt(&ctx->key1, block, out); for (i = 0; i < AES_XTS_BLOCKSIZE; i++) - data[i] ^= ctx->tweak[i]; + out[i] ^= ctx->tweak[i]; /* Exponentiate tweak */ carry_in = 0; @@ -120,45 +124,33 @@ aes_xts_crypt(struct aes_xts_ctx *ctx, u_int8_t *data, } if (carry_in) ctx->tweak[0] ^= AES_XTS_ALPHA; - bzero(block, sizeof(block)); + explicit_bzero(block, sizeof(block)); } static void -aes_xts_encrypt(caddr_t key, u_int8_t *data) +aes_xts_encrypt(void *key, const uint8_t *in, uint8_t *out) { - aes_xts_crypt((struct aes_xts_ctx *)key, data, 1); + aes_xts_crypt(key, in, out, 1); } static void -aes_xts_decrypt(caddr_t key, u_int8_t *data) +aes_xts_decrypt(void *key, const uint8_t *in, uint8_t *out) { - aes_xts_crypt((struct aes_xts_ctx *)key, data, 0); + aes_xts_crypt(key, in, out, 0); } static int -aes_xts_setkey(u_int8_t **sched, const u_int8_t *key, int len) +aes_xts_setkey(void *sched, const uint8_t *key, int len) { struct aes_xts_ctx *ctx; if (len != 32 && len != 64) - return EINVAL; + return (EINVAL); - *sched = KMALLOC(sizeof(struct aes_xts_ctx), M_CRYPTO_DATA, - M_NOWAIT | M_ZERO); - if (*sched == NULL) - return ENOMEM; - ctx = (struct aes_xts_ctx *)*sched; + ctx = sched; rijndael_set_key(&ctx->key1, key, len * 4); rijndael_set_key(&ctx->key2, key + (len / 2), len * 4); - return 0; -} - -static void -aes_xts_zerokey(u_int8_t **sched) -{ - bzero(*sched, sizeof(struct aes_xts_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + return (0); } Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_auth.h Wed May 20 21:21:01 2020 (r361298) @@ -44,7 +44,6 @@ #include #include -#include /* XXX use a define common with other hash stuff ! */ #define AH_ALEN_MAX 64 /* max authenticator hash length */ Modified: head/sys/opencrypto/xform_cml.c ============================================================================== --- head/sys/opencrypto/xform_cml.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_cml.c Wed May 20 21:21:01 2020 (r361298) @@ -53,61 +53,46 @@ __FBSDID("$FreeBSD$"); #include #include -static int cml_setkey(u_int8_t **, const u_int8_t *, int); -static void cml_encrypt(caddr_t, u_int8_t *); -static void cml_decrypt(caddr_t, u_int8_t *); -static void cml_zerokey(u_int8_t **); +static int cml_setkey(void *, const uint8_t *, int); +static void cml_encrypt(void *, const uint8_t *, uint8_t *); +static void cml_decrypt(void *, const uint8_t *, uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_camellia = { - CRYPTO_CAMELLIA_CBC, "Camellia", - CAMELLIA_BLOCK_LEN, CAMELLIA_BLOCK_LEN, CAMELLIA_MIN_KEY, - CAMELLIA_MAX_KEY, - cml_encrypt, - cml_decrypt, - cml_setkey, - cml_zerokey, - NULL, + .type = CRYPTO_CAMELLIA_CBC, + .name = "Camellia-CBC", + .ctxsize = sizeof(camellia_ctx), + .blocksize = CAMELLIA_BLOCK_LEN, + .ivsize = CAMELLIA_BLOCK_LEN, + .minkey = CAMELLIA_MIN_KEY, + .maxkey = CAMELLIA_MAX_KEY, + .encrypt = cml_encrypt, + .decrypt = cml_decrypt, + .setkey = cml_setkey, }; /* * Encryption wrapper routines. */ static void -cml_encrypt(caddr_t key, u_int8_t *blk) +cml_encrypt(void *ctx, const uint8_t *in, uint8_t *out) { - camellia_encrypt((camellia_ctx *) key, (u_char *) blk, (u_char *) blk); + camellia_encrypt(ctx, in, out); } static void -cml_decrypt(caddr_t key, u_int8_t *blk) +cml_decrypt(void *ctx, const uint8_t *in, uint8_t *out) { - camellia_decrypt(((camellia_ctx *) key), (u_char *) blk, - (u_char *) blk); + camellia_decrypt(ctx, in, out); } static int -cml_setkey(u_int8_t **sched, const u_int8_t *key, int len) +cml_setkey(void *ctx, const uint8_t *key, int len) { - int err; if (len != 16 && len != 24 && len != 32) return (EINVAL); - *sched = KMALLOC(sizeof(camellia_ctx), M_CRYPTO_DATA, - M_NOWAIT|M_ZERO); - if (*sched != NULL) { - camellia_set_key((camellia_ctx *) *sched, key, - len * 8); - err = 0; - } else - err = ENOMEM; - return err; -} -static void -cml_zerokey(u_int8_t **sched) -{ - bzero(*sched, sizeof(camellia_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + camellia_set_key(ctx, key, len * 8); + return (0); } Modified: head/sys/opencrypto/xform_comp.h ============================================================================== --- head/sys/opencrypto/xform_comp.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_comp.h Wed May 20 21:21:01 2020 (r361298) @@ -36,7 +36,6 @@ #include #include -#include /* Declarations */ struct comp_algo { Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_enc.h Wed May 20 21:21:01 2020 (r361298) @@ -36,7 +36,6 @@ #include #include #include -#include #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16 @@ -47,22 +46,22 @@ struct enc_xform { int type; char *name; + size_t ctxsize; u_int16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ u_int16_t ivsize; u_int16_t minkey, maxkey; - void (*encrypt) (caddr_t, u_int8_t *); - void (*decrypt) (caddr_t, u_int8_t *); - int (*setkey) (u_int8_t **, const u_int8_t *, int len); - void (*zerokey) (u_int8_t **); - void (*reinit) (caddr_t, const u_int8_t *); + void (*encrypt) (void *, const uint8_t *, uint8_t *); + void (*decrypt) (void *, const uint8_t *, uint8_t *); + int (*setkey) (void *, const uint8_t *, int len); + void (*reinit) (void *, const u_int8_t *); /* * Encrypt/decrypt 1+ blocks of input -- total size is 'len' bytes. * Len is guaranteed to be a multiple of the defined 'blocksize'. * Optional interface -- most useful for stream ciphers with a small * blocksize (1). */ - void (*encrypt_multi) (void *, uint8_t *, size_t len); - void (*decrypt_multi) (void *, uint8_t *, size_t len); + void (*encrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); + void (*decrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); }; Modified: head/sys/opencrypto/xform_gmac.c ============================================================================== --- head/sys/opencrypto/xform_gmac.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_gmac.c Wed May 20 21:21:01 2020 (r361298) @@ -55,13 +55,12 @@ __FBSDID("$FreeBSD$"); /* Encryption instances */ struct enc_xform enc_xform_aes_nist_gmac = { - CRYPTO_AES_NIST_GMAC, "AES-GMAC", - AES_ICM_BLOCK_LEN, AES_GCM_IV_LEN, AES_MIN_KEY, AES_MAX_KEY, - NULL, - NULL, - NULL, - NULL, - NULL, + .type = CRYPTO_AES_NIST_GMAC, + .name = "AES-GMAC", + .blocksize = AES_ICM_BLOCK_LEN, + .ivsize = AES_GCM_IV_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, }; /* Authentication instances */ Modified: head/sys/opencrypto/xform_null.c ============================================================================== --- head/sys/opencrypto/xform_null.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_null.c Wed May 20 21:21:01 2020 (r361298) @@ -53,10 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -static int null_setkey(u_int8_t **, const u_int8_t *, int); -static void null_encrypt(caddr_t, u_int8_t *); -static void null_decrypt(caddr_t, u_int8_t *); -static void null_zerokey(u_int8_t **); +static int null_setkey(void *, const u_int8_t *, int); +static void null_crypt(void *, const uint8_t *, uint8_t *); static void null_init(void *); static void null_reinit(void *ctx, const u_int8_t *buf, u_int16_t len); @@ -65,14 +63,16 @@ static void null_final(u_int8_t *, void *); /* Encryption instances */ struct enc_xform enc_xform_null = { - CRYPTO_NULL_CBC, "NULL", + .type = CRYPTO_NULL_CBC, + .name = "NULL", /* NB: blocksize of 4 is to generate a properly aligned ESP header */ - NULL_BLOCK_LEN, 0, NULL_MIN_KEY, NULL_MAX_KEY, - null_encrypt, - null_decrypt, - null_setkey, - null_zerokey, - NULL, + .blocksize = NULL_BLOCK_LEN, + .ivsize = 0, + .minkey = NULL_MIN_KEY, + .maxkey = NULL_MAX_KEY, + .encrypt = null_crypt, + .decrypt = null_crypt, + .setkey = null_setkey, }; /* Authentication instances */ @@ -94,26 +94,14 @@ struct auth_hash auth_hash_null = { * Encryption wrapper routines. */ static void -null_encrypt(caddr_t key, u_int8_t *blk) +null_crypt(void *key, const uint8_t *in, uint8_t *out) { } -static void -null_decrypt(caddr_t key, u_int8_t *blk) -{ -} - static int -null_setkey(u_int8_t **sched, const u_int8_t *key, int len) +null_setkey(void *sched, const uint8_t *key, int len) { - *sched = NULL; - return 0; -} - -static void -null_zerokey(u_int8_t **sched) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 20 21:22:26 2020 Return-Path: Delivered-To: svn-src-head@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 383F12F5C3A; Wed, 20 May 2020 21:22:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5LV0q1Xz3Zh2; Wed, 20 May 2020 21:22:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 174DB22660; Wed, 20 May 2020 21:22:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLMPZS095662; Wed, 20 May 2020 21:22:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLMPFK095661; Wed, 20 May 2020 21:22:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202122.04KLMPFK095661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 21:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361299 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 361299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:22:26 -0000 Author: kib Date: Wed May 20 21:22:25 2020 New Revision: 361299 URL: https://svnweb.freebsd.org/changeset/base/361299 Log: Do not consider CAP_RDCL_NO as an indicator for all MDS vulnerabilities handled by hardware. Reported by: Anthony Steinhauser admbugs: 962 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed May 20 21:21:01 2020 (r361298) +++ head/sys/x86/x86/cpu_machdep.c Wed May 20 21:22:25 2020 (r361299) @@ -1078,11 +1078,11 @@ hw_mds_recalculate(void) * reported. For instance, hypervisor might unknowingly * filter the cap out. * For the similar reasons, and for testing, allow to enable - * mitigation even for RDCL_NO or MDS_NO caps. + * mitigation even when MDS_NO cap is set. */ if (cpu_vendor_id != CPU_VENDOR_INTEL || hw_mds_disable == 0 || - ((cpu_ia32_arch_caps & (IA32_ARCH_CAP_RDCL_NO | - IA32_ARCH_CAP_MDS_NO)) != 0 && hw_mds_disable == 3)) { + ((cpu_ia32_arch_caps & IA32_ARCH_CAP_MDS_NO) != 0 && + hw_mds_disable == 3)) { mds_handler = mds_handler_void; } else if (((cpu_stdext_feature3 & CPUID_STDEXT3_MD_CLEAR) != 0 && hw_mds_disable == 3) || hw_mds_disable == 1) { From owner-svn-src-head@freebsd.org Wed May 20 21:39:20 2020 Return-Path: Delivered-To: svn-src-head@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 B09682F5C68; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5k040pSz3bD3; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80685227BB; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLdKm8001938; Wed, 20 May 2020 21:39:20 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLdKS0001937; Wed, 20 May 2020 21:39:20 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202139.04KLdKS0001937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 21:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361300 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:39:20 -0000 Author: dteske Date: Wed May 20 21:39:19 2020 New Revision: 361300 URL: https://svnweb.freebsd.org/changeset/base/361300 Log: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude MFC after: 0 days X-MFC-to: stable/11 Differential Revision: https://reviews.freebsd.org/D23641 Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:22:25 2020 (r361299) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:39:19 2020 (r361300) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-head@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 506972F60EC; Wed, 20 May 2020 22:00:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6BT1T35z3cZ7; Wed, 20 May 2020 22:00:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC6222DF3; Wed, 20 May 2020 22:00:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KM0XTu014999; Wed, 20 May 2020 22:00:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KM0VbJ014990; Wed, 20 May 2020 22:00:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202200.04KM0VbJ014990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 22:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 361302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:00:33 -0000 Author: kib Date: Wed May 20 22:00:31 2020 New Revision: 361302 URL: https://svnweb.freebsd.org/changeset/base/361302 Log: amd64: Add a knob to flush RSB on context switches if machine has SMEP. The flush is needed to prevent cross-process ret2spec, which is not handled on kernel entry if IBPB is enabled but SMEP is present. While there, add i386 RSB flush. Reported by: Anthony Steinhauser Reviewed by: markj, Anthony Steinhauser Discussed with: philip admbugs: 961 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/share/man/man7/security.7 head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Wed May 20 21:41:36 2020 (r361301) +++ head/share/man/man7/security.7 Wed May 20 22:00:31 2020 (r361302) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2020 +.Dd May 16, 2020 .Dt SECURITY 7 .Os .Sh NAME @@ -992,6 +992,13 @@ See also .Xr proccontrol 1 mode .Dv kpti . +.It Dv machdep.mitigations.flush_rsb_ctxsw +amd64. +Controls Return Stack Buffer flush on context switch, to prevent +cross-process ret2spec attacks. +Only needed, and only enabled by default, if the machine +supports SMEP, otherwise IBRS would do necessary flushing on kernel +entry anyway. .It Dv hw.mds_disable amd64 and i386. Controls Microarchitectural Data Sampling hardware information leak Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/cpu_switch.S Wed May 20 22:00:31 2020 (r361302) @@ -221,6 +221,8 @@ done_load_dr: movq %rax,(%rsp) movq PCPU(CURTHREAD),%rdi call fpu_activate_sw + cmpb $0,cpu_flush_rsb_ctxsw(%rip) + jne rsb_flush ret /* Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/initcpu.c Wed May 20 22:00:31 2020 (r361302) @@ -238,12 +238,24 @@ initializecpu(void) cr4 |= CR4_PKE; /* + * If SMEP is present, we only need to flush RSB (by default) + * on context switches, to prevent cross-process ret2spec + * attacks. Do it automatically if ibrs_disable is set, to + * complete the mitigation. + * * Postpone enabling the SMEP on the boot CPU until the page * tables are switched from the boot loader identity mapping * to the kernel tables. The boot loader enables the U bit in * its tables. */ - if (!IS_BSP()) { + if (IS_BSP()) { + if (cpu_stdext_feature & CPUID_STDEXT_SMEP && + !TUNABLE_INT_FETCH( + "machdep.mitigations.cpu_flush_rsb_ctxsw", + &cpu_flush_rsb_ctxsw) && + hw_ibrs_disable) + cpu_flush_rsb_ctxsw = 1; + } else { if (cpu_stdext_feature & CPUID_STDEXT_SMEP) cr4 |= CR4_SMEP; if (cpu_stdext_feature & CPUID_STDEXT_SMAP) Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/support.S Wed May 20 22:00:31 2020 (r361302) @@ -1613,23 +1613,27 @@ ENTRY(pmap_pti_pcid_invlrng) retq .altmacro - .macro ibrs_seq_label l -handle_ibrs_\l: + .macro rsb_seq_label l +rsb_seq_\l: .endm - .macro ibrs_call_label l - call handle_ibrs_\l + .macro rsb_call_label l + call rsb_seq_\l .endm - .macro ibrs_seq count + .macro rsb_seq count ll=1 .rept \count - ibrs_call_label %(ll) + rsb_call_label %(ll) nop - ibrs_seq_label %(ll) + rsb_seq_label %(ll) addq $8,%rsp ll=ll+1 .endr .endm +ENTRY(rsb_flush) + rsb_seq 32 + ret + /* all callers already saved %rax, %rdx, and %rcx */ ENTRY(handle_ibrs_entry) cmpb $0,hw_ibrs_ibpb_active(%rip) @@ -1641,8 +1645,7 @@ ENTRY(handle_ibrs_entry) wrmsr movb $1,PCPU(IBPB_SET) testl $CPUID_STDEXT_SMEP,cpu_stdext_feature(%rip) - jne 1f - ibrs_seq 32 + je rsb_flush 1: ret END(handle_ibrs_entry) Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed May 20 21:41:36 2020 (r361301) +++ head/sys/i386/i386/support.s Wed May 20 22:00:31 2020 (r361302) @@ -445,6 +445,28 @@ msr_onfault: movl $EFAULT,%eax ret + .altmacro + .macro rsb_seq_label l +rsb_seq_\l: + .endm + .macro rsb_call_label l + call rsb_seq_\l + .endm + .macro rsb_seq count + ll=1 + .rept \count + rsb_call_label %(ll) + nop + rsb_seq_label %(ll) + addl $4,%esp + ll=ll+1 + .endr + .endm + +ENTRY(rsb_flush) + rsb_seq 32 + ret + ENTRY(handle_ibrs_entry) cmpb $0,hw_ibrs_ibpb_active je 1f @@ -455,10 +477,9 @@ ENTRY(handle_ibrs_entry) wrmsr movb $1,PCPU(IBPB_SET) /* - * i386 does not implement SMEP, but the 4/4 split makes this not - * that important. + * i386 does not implement SMEP. */ -1: ret +1: jmp rsb_flush END(handle_ibrs_entry) ENTRY(handle_ibrs_exit) Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Wed May 20 21:41:36 2020 (r361301) +++ head/sys/x86/include/x86_var.h Wed May 20 22:00:31 2020 (r361302) @@ -94,6 +94,7 @@ extern int hw_ibrs_ibpb_active; extern int hw_mds_disable; extern int hw_ssb_active; extern int x86_taa_enable; +extern int cpu_flush_rsb_ctxsw; struct pcb; struct thread; Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed May 20 21:41:36 2020 (r361301) +++ head/sys/x86/x86/cpu_machdep.c Wed May 20 22:00:31 2020 (r361302) @@ -1397,6 +1397,11 @@ SYSCTL_PROC(_machdep_mitigations_taa, OID_AUTO, state, sysctl_taa_state_handler, "A", "TAA Mitigation state"); +int __read_frequently cpu_flush_rsb_ctxsw; +SYSCTL_INT(_machdep_mitigations, OID_AUTO, flush_rsb_ctxsw, + CTLFLAG_RW | CTLFLAG_NOFETCH, &cpu_flush_rsb_ctxsw, 0, + "Flush Return Stack Buffer on context switch"); + /* * Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed From owner-svn-src-head@freebsd.org Wed May 20 22:05:25 2020 Return-Path: Delivered-To: svn-src-head@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 29B1C2F6899; Wed, 20 May 2020 22:05:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49S6J41N1Zz3d16; Wed, 20 May 2020 22:05:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04KM59th038381 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 01:05:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04KM59th038381 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04KM593T038379; Thu, 21 May 2020 01:05:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 01:05:09 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 Message-ID: <20200520220509.GA64045@kib.kiev.ua> References: <202005202200.04KM0VbJ014990@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005202200.04KM0VbJ014990@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49S6J41N1Zz3d16 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [2.75 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.96)[0.959]; NEURAL_SPAM_SHORT(0.85)[0.849]; NEURAL_SPAM_LONG(0.94)[0.939]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:05:25 -0000 On Wed, May 20, 2020 at 10:00:31PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:00:31 2020 > New Revision: 361302 > URL: https://svnweb.freebsd.org/changeset/base/361302 > > Log: > amd64: Add a knob to flush RSB on context switches if machine has SMEP. > > The flush is needed to prevent cross-process ret2spec, which is not handled > on kernel entry if IBPB is enabled but SMEP is present. > While there, add i386 RSB flush. > > Reported by: Anthony Steinhauser > Reviewed by: markj, Anthony Steinhauser > Discussed with: philip > admbugs: 961 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week https://reviews.freebsd.org/D24868 From owner-svn-src-head@freebsd.org Wed May 20 22:08:27 2020 Return-Path: Delivered-To: svn-src-head@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 4F6052F67B7; Wed, 20 May 2020 22:08:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6Mb1S76z3dCV; Wed, 20 May 2020 22:08:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0A223285; Wed, 20 May 2020 22:08:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KM8RVd020710; Wed, 20 May 2020 22:08:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KM8QPA020707; Wed, 20 May 2020 22:08:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202208.04KM8QPA020707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 22:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:08:27 -0000 Author: kib Date: Wed May 20 22:08:26 2020 New Revision: 361303 URL: https://svnweb.freebsd.org/changeset/base/361303 Log: Change the samantic of struct link_map l_addr member. It previously returned the object map base address, while all other ELF operating systems return load offset, i.e. the difference between map base and the link base. Explain the meaning of the field in the man page. Stop filling the mips-only l_offs member, which is apparently unused. PR: 246561 Requested by: Damjan Jovanovic Reviewed by: emaste, jhb, cem (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24918 Modified: head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Wed May 20 22:00:31 2020 (r361302) +++ head/lib/libc/gen/dlinfo.3 Wed May 20 22:08:26 2020 (r361303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2003 +.Dd May 19, 2020 .Dt DLINFO 3 .Os .Sh NAME @@ -105,7 +105,7 @@ structure is defined in .In link.h and has the following members: .Bd -literal -offset indent -caddr_t l_addr; /* Base Address of library */ +caddr_t l_addr; /* Load Offset of library */ const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, /* linked list of mapped libs */ @@ -113,7 +113,9 @@ struct link_map *l_next, /* linked list of mapped li .Ed .Bl -tag -width ".Va l_addr" .It Va l_addr -The base address of the object loaded into memory. +The load offset of the object, that is, the difference between +the actual load address and the base virtual address the object +was linked at. .It Va l_name The full name of the loaded shared object. .It Va l_ld Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 20 22:00:31 2020 (r361302) +++ head/libexec/rtld-elf/rtld.c Wed May 20 22:08:26 2020 (r361303) @@ -4032,12 +4032,8 @@ linkmap_add(Obj_Entry *obj) struct link_map *prev; obj->linkmap.l_name = obj->path; - obj->linkmap.l_addr = obj->mapbase; + obj->linkmap.l_addr = obj->relocbase; obj->linkmap.l_ld = obj->dynamic; -#ifdef __mips__ - /* GDB needs load offset on MIPS to use the symbols */ - obj->linkmap.l_offs = obj->relocbase; -#endif if (r_debug.r_map == NULL) { r_debug.r_map = l; Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Wed May 20 22:00:31 2020 (r361302) +++ head/sys/sys/link_elf.h Wed May 20 22:08:26 2020 (r361303) @@ -57,9 +57,9 @@ #define LA_SER_SECURE 0x80 /* default (secure) path prepended */ typedef struct link_map { - caddr_t l_addr; /* Base Address of library */ + caddr_t l_addr; /* Load Offset of library */ #ifdef __mips__ - caddr_t l_offs; /* Load Offset of library */ + caddr_t l_xxx; /* unused */ #endif const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ From owner-svn-src-head@freebsd.org Wed May 20 22:22:58 2020 Return-Path: Delivered-To: svn-src-head@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 7036A2F6D54; Wed, 20 May 2020 22:22:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6hL2LlMz3fBL; Wed, 20 May 2020 22:22:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:c7d:9a4b:586:998a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D615312427; Wed, 20 May 2020 22:22:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 20 May 2020 15:22:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005202208.04KM8QPA020707@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:22:58 -0000 On 5/20/20 3:08 PM, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:08:26 2020 > New Revision: 361303 > URL: https://svnweb.freebsd.org/changeset/base/361303 > > Log: > Change the samantic of struct link_map l_addr member. > > It previously returned the object map base address, while all other > ELF operating systems return load offset, i.e. the difference between > map base and the link base. > > Explain the meaning of the field in the man page. > > Stop filling the mips-only l_offs member, which is apparently unused. Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Wed May 20 22:25:41 2020 Return-Path: Delivered-To: svn-src-head@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 DC9992F6DC6; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6lT5Mbqz3fNh; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC382304B; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMPfP6033287; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMPfoF033285; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202225.04KMPfoF033285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 22:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361306 - in head: stand/libsa/geli sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/libsa/geli sys/opencrypto X-SVN-Commit-Revision: 361306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:25:41 -0000 Author: jhb Date: Wed May 20 22:25:41 2020 New Revision: 361306 URL: https://svnweb.freebsd.org/changeset/base/361306 Log: Fix libstand build breakage after r361298. - Use enc_xform_aes_xts.setkey() directly instead of duplicating the code now that it no longer calls malloc(). - Rather than bringing back all of xform_userland.h, add a conditional #include of to xform_enc.h. - Update calls to encrypt/decrypt callbacks in enc_xform_aes_xts for separate input/output pointers. Pointy hat to: jhb Modified: head/stand/libsa/geli/geliboot_crypto.c head/sys/opencrypto/xform_enc.h Modified: head/stand/libsa/geli/geliboot_crypto.c ============================================================================== --- head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:20:53 2020 (r361305) +++ head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:25:41 2020 (r361306) @@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size xts_len = keysize << 1; ctxp = &xtsctx; - rijndael_set_key(&ctxp->key1, key, xts_len / 2); - rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2); + enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); + enc_xform_aes_xts.reinit(ctxp, iv); - enc_xform_aes_xts.reinit((caddr_t)ctxp, iv); - switch (enc) { case 0: /* decrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.decrypt(ctxp, data + i, + data + i); } break; case 1: /* encrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.encrypt(ctxp, data + i, + data + 1); } break; } Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 20 22:20:53 2020 (r361305) +++ head/sys/opencrypto/xform_enc.h Wed May 20 22:25:41 2020 (r361306) @@ -36,6 +36,9 @@ #include #include #include +#ifdef _STANDALONE +#include +#endif #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16 From owner-svn-src-head@freebsd.org Wed May 20 22:25:51 2020 Return-Path: Delivered-To: svn-src-head@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 5DD272F6EBB; Wed, 20 May 2020 22:25:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6lf2b7Xz3fGJ; Wed, 20 May 2020 22:25:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D57AE232CB; Wed, 20 May 2020 22:25:49 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMPnu3033356; Wed, 20 May 2020 22:25:49 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMPkUp033338; Wed, 20 May 2020 22:25:46 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202005202225.04KMPkUp033338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 20 May 2020 22:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361307 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 361307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:25:51 -0000 Author: sjg Date: Wed May 20 22:25:46 2020 New Revision: 361307 URL: https://svnweb.freebsd.org/changeset/base/361307 Log: Merge bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests Added: head/contrib/bmake/filemon/ - copied from r361291, vendor/NetBSD/bmake/dist/filemon/ head/contrib/bmake/mk/compiler.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/compiler.mk head/contrib/bmake/mk/dirdeps-targets.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk head/contrib/bmake/unit-tests/Makefile - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile head/contrib/bmake/unit-tests/Makefile.config.in - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile.config.in head/contrib/bmake/unit-tests/cond-late.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp head/contrib/bmake/unit-tests/cond-late.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk head/contrib/bmake/unit-tests/dollar.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.exp head/contrib/bmake/unit-tests/dollar.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.mk head/contrib/bmake/unit-tests/include-main.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.exp head/contrib/bmake/unit-tests/include-main.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.mk head/contrib/bmake/unit-tests/include-sub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-sub.mk head/contrib/bmake/unit-tests/include-subsub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-subsub.mk head/contrib/bmake/unit-tests/varmod-edge.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp head/contrib/bmake/unit-tests/varmod-edge.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk Deleted: head/contrib/bmake/unit-tests/Makefile.in Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/Makefile head/contrib/bmake/Makefile.config.in head/contrib/bmake/VERSION head/contrib/bmake/arch.c head/contrib/bmake/boot-strap head/contrib/bmake/bsd.after-import.mk head/contrib/bmake/compat.c head/contrib/bmake/config.h.in head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/job.c head/contrib/bmake/make-bootstrap.sh.in head/contrib/bmake/make.1 head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/meta.h head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/autodep.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/doc.mk head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/init.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta.sys.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/options.mk head/contrib/bmake/mk/sys.mk head/contrib/bmake/mk/sys.vars.mk head/contrib/bmake/mk/sys/AIX.mk head/contrib/bmake/mk/sys/Darwin.mk head/contrib/bmake/mk/sys/Generic.mk head/contrib/bmake/mk/sys/HP-UX.mk head/contrib/bmake/mk/sys/IRIX.mk head/contrib/bmake/mk/sys/Linux.mk head/contrib/bmake/mk/sys/NetBSD.mk head/contrib/bmake/mk/sys/OSF1.mk head/contrib/bmake/mk/sys/OpenBSD.mk head/contrib/bmake/mk/sys/SunOS.mk head/contrib/bmake/mk/sys/UnixWare.mk head/contrib/bmake/mk/whats.mk head/contrib/bmake/nonints.h head/contrib/bmake/parse.c head/contrib/bmake/str.c head/contrib/bmake/unit-tests/escape.mk head/contrib/bmake/unit-tests/forloop.exp head/contrib/bmake/unit-tests/forloop.mk head/contrib/bmake/unit-tests/modorder.mk head/contrib/bmake/unit-tests/sysv.exp head/contrib/bmake/unit-tests/sysv.mk head/contrib/bmake/util.c head/contrib/bmake/var.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/Makefile.config head/usr.bin/bmake/Makefile.depend head/usr.bin/bmake/config.h Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/ChangeLog Wed May 20 22:25:46 2020 (r361307) @@ -1,3 +1,138 @@ +2020-05-17 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200517 + Merge with NetBSD make, pick up + o modified dollar tests to avoid shell dependencies + o new tests for .INCLUDEFROM + +2020-05-16 Simon J Gerraty + + * unit-tests/dollar.mk: tweak '1 dollar literal' test + to not depend so much on shell behavior + +2020-05-10 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200510 + Merge with NetBSD make, pick up + o unit test for dollar handling + +2020-05-06 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200506 + Merge with NetBSD make, pick up + o str.c: empty string does not match % pattern + plus unit-test changes + +2020-05-04 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200504 + May the 4th be with you + Merge with NetBSD make, pick up + o var.c: import handling of old sysV style modifier using '%' + o str.c: refactor brk_string + o unit-tests: add test case for lazy conditions + +2020-04-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200418 + + * configure.in: use_makefile=no for cygwin et al. + case insensitive filesystems just don't work if both + makefile and Makefile exist. + NOTE: bmake does not support cygwin and likely never will, + but if brave souls want to try it - help them out. + +2020-04-02 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200402 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD + a blank command is perfectly valid. + +2020-03-30 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200330 + Merge with NetBSD make, pick up + o make.h: extern debug_file + +2020-03-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200318 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, check for corrupted meta file + earlier and more often. + +2020-02-20 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200220 + +2020-02-19 Simon J Gerraty + + * boot-strap: unset MAKEFLAGS + +2020-02-12 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200212 + * meta.c: meta_compat_parent check for USE_FILEMON + patch from Soeren Tempel + +2020-02-05 Simon J Gerraty + + * VERSION: 20200205 + Merge with NetBSD make, pick up + o meta.c: fix compat mode, need to call meta_job_output() + o job.c: extra fds for meta mode not needed if using filemon_dev + +2020-01-22 Simon J Gerraty + + * VERSION: 20200122 + Merge with NetBSD make, pick up + o meta.c: avoid passing NULL to filemon_*() when meta_needed() + returns FALSE. + +2020-01-21 Simon J Gerraty + + * VERSION: 20200121 + Merge with NetBSD make, pick up + o filemon/filemon_{dev,ktrace}.c: allow selection of + filemon implementation. filemon_dev.c uses the kernel module + while filemon_ktrace.c leverages the fktrace api available in + NetBSD. filemon_ktrace.c can hopefully form the basis for + adding support for other tracing mechanisms such as strace on + Linux. + o meta.c: when target is out-of-date per normal make rules + record value of .OODATE in meta file. + +2019-09-26 Simon J Gerraty + + * VERSION: 20190926 + Merge with NetBSD make, pick up + o parse.c: don't pass NULL to realpath(3) + some versions cannot handle it. + +2019-04-09 Simon J Gerraty + + * VERSION: 20190409 + Merge with NetBSD make, pick up + o parse.c: ParseDoDependency: free paths rather than assert + +2018-12-22 Simon J Gerraty + + * VERSION: 20181222 + + * configure.in: add --without-makefile to avoid generating + makefile and make-bootstrap.sh + + * include Makefile.inc if it exists + + * Use Makefile and Makefile.config.in in unit-tests + so we can use just: make obj && make && make test + when bmake is already available. + We add --without-makefile to CONFIGURE_ARGS in this case. + + * tweak bsd.after-import.mk (captures Makefile.config etc + after import to FreeBSD for example) to cope with all the above. + 2018-12-21 Simon J Gerraty * VERSION: 20181221 Modified: head/contrib/bmake/FILES ============================================================================== --- head/contrib/bmake/FILES Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/FILES Wed May 20 22:25:46 2020 (r361307) @@ -22,6 +22,9 @@ configure.in dir.c dir.h dirname.c +filemon/filemon.h +filemon/filemon_dev.c +filemon/filemon_ktrace.c find_lib.sh for.c getopt.c @@ -94,13 +97,18 @@ suff.c targ.c trace.c trace.h -unit-tests/Makefile.in +unit-tests/Makefile +unit-tests/Makefile.config.in unit-tests/comment.exp unit-tests/comment.mk unit-tests/cond1.exp unit-tests/cond1.mk unit-tests/cond2.exp unit-tests/cond2.mk +unit-tests/cond-late.mk +unit-tests/cond-late.exp +unit-tests/dollar.exp +unit-tests/dollar.mk unit-tests/doterror.exp unit-tests/doterror.mk unit-tests/dotwait.exp @@ -123,6 +131,10 @@ unit-tests/hash.exp unit-tests/hash.mk unit-tests/impsrc.exp unit-tests/impsrc.mk +unit-tests/include-main.exp +unit-tests/include-main.mk +unit-tests/include-sub.mk +unit-tests/include-subsub.mk unit-tests/misc.exp unit-tests/misc.mk unit-tests/moderrs.exp @@ -163,6 +175,8 @@ unit-tests/varcmd.exp unit-tests/varcmd.mk unit-tests/varmisc.exp unit-tests/varmisc.mk +unit-tests/varmod-edge.exp +unit-tests/varmod-edge.mk unit-tests/varquote.exp unit-tests/varquote.mk unit-tests/varshell.exp Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/Makefile Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.99 2017/08/13 20:12:53 sjg Exp $ +# $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $ PROG= bmake @@ -56,6 +56,7 @@ SRCS+= \ lstSucc.c .-include "VERSION" +.-include "Makefile.inc" # this file gets generated by configure .-include "Makefile.config" @@ -77,12 +78,24 @@ CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" -# meta mode can be useful even without filemon +# meta mode can be useful even without filemon +# should be set by now +USE_FILEMON ?= no +.if ${USE_FILEMON:tl} != "no" +.PATH: ${.CURDIR}/filemon +SRCS+= filemon_${USE_FILEMON}.c +COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} +COPTS.job.c+= ${COPTS.meta.c} + +.if ${USE_FILEMON} == "dev" FILEMON_H ?= /usr/include/dev/filemon/filemon.h .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" -COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} .endif +.endif # USE_FILEMON == dev +.endif # USE_FILEMON + .PATH: ${srcdir} .PATH: ${srcdir}/lst.lib @@ -198,6 +211,8 @@ main.o: ${SRCS} ${.CURDIR}/VERSION .if ${MK_AUTOCONF_MK} == "yes" CONFIGURE_DEPS += ${.CURDIR}/VERSION +# we do not need or want the generated makefile +CONFIGURE_ARGS += --without-makefile .include .endif SHARE_MK?=${SHAREDIR}/mk Modified: head/contrib/bmake/Makefile.config.in ============================================================================== --- head/contrib/bmake/Makefile.config.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/Makefile.config.in Wed May 20 22:25:46 2020 (r361307) @@ -14,7 +14,8 @@ CFLAGS+= ${CPPFLAGS} @DEFS@ LDFLAGS+= @LDFLAGS@ LIBOBJS+= @LIBOBJS@ LDADD+= @LIBS@ -USE_META= @use_meta@ +USE_META?= @use_meta@ +USE_FILEMON?= @use_filemon@ FILEMON_H?= @filemon_h@ BMAKE_PATH_MAX?= @bmake_path_max@ # used if MAXPATHLEN not defined Modified: head/contrib/bmake/VERSION ============================================================================== --- head/contrib/bmake/VERSION Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/VERSION Wed May 20 22:25:46 2020 (r361307) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20181221 +_MAKE_VERSION=20200517 Modified: head/contrib/bmake/arch.c ============================================================================== --- head/contrib/bmake/arch.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/arch.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ +/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); +__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"); #endif #endif /* not lint */ #endif @@ -682,7 +682,7 @@ ArchStatMember(char *archive, char *member, Boolean ha arh.AR_SIZE[sizeof(arh.AR_SIZE)-1] = '\0'; size = (int)strtol(arh.AR_SIZE, NULL, 10); - (void)strncpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); + memcpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) { continue; } Modified: head/contrib/bmake/boot-strap ============================================================================== --- head/contrib/bmake/boot-strap Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/boot-strap Wed May 20 22:25:46 2020 (r361307) @@ -89,6 +89,10 @@ # disable use of filemon(9) which is currently only # available for NetBSD and FreeBSD. # +# --with-filemon=ktrace +# on NetBSD or others with fktrace(2), use ktrace +# version of filemon. +# # --with-filemon="path/to/filemon.h" # enables use of filemon(9) by meta mode. # @@ -111,7 +115,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.49 2016/05/29 00:09:14 sjg Exp $ +# $Id: boot-strap,v 1.51 2020/02/19 16:46:23 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -161,6 +165,8 @@ cmd_args="$@" # clear some things from the environment that we care about unset MAKEOBJDIR MAKEOBJDIRPREFIX +# or that might be incompatible +unset MAKE MAKEFLAGS # --install[-host-target] will set this INSTALL_PREFIX= Modified: head/contrib/bmake/bsd.after-import.mk ============================================================================== --- head/contrib/bmake/bsd.after-import.mk Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/bsd.after-import.mk Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.13 2017/08/13 00:56:10 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.15 2018/12/30 17:14:24 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -63,7 +63,7 @@ MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e 's,${SRCTOP},$${SRCTOP},g' # These are the simple files we want to capture -configured_files= config.h Makefile.config unit-tests/Makefile +configured_files= config.h Makefile.config unit-tests/Makefile.config after-import: bootstrap ${MAKEFILE} .for f in ${configured_files:M*.[ch]} @@ -87,7 +87,6 @@ _makefile: bootstrap ${MAKEFILE} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ echo '#'; echo '# $$${HOST_OS}$$'; \ - echo; echo '.sinclude "Makefile.inc"'; \ echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ Modified: head/contrib/bmake/compat.c ============================================================================== --- head/contrib/bmake/compat.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/compat.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -407,7 +407,7 @@ again: #ifdef USE_META if (useMeta) { - meta_compat_parent(); + meta_compat_parent(cpid); } #endif Modified: head/contrib/bmake/config.h.in ============================================================================== --- head/contrib/bmake/config.h.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/config.h.in Wed May 20 22:25:46 2020 (r361307) @@ -143,7 +143,7 @@ /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if `struct stat' is a member of `st_rdev'. */ +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use Modified: head/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bmake/configure.in ============================================================================== --- head/contrib/bmake/configure.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/configure.in Wed May 20 22:25:46 2020 (r361307) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.59 2017/11/26 22:39:20 sjg Exp $ +dnl $Id: configure.in,v 1.63 2020/04/19 05:17:57 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20171126], [sjg@NetBSD.org]) +AC_INIT([bmake], [20200418], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -16,6 +16,7 @@ esac dnl get _MAKE_VERSION . $srcdir/VERSION +OS=`uname -s` dnl AC_ARG_WITH(defshell, @@ -32,6 +33,17 @@ no) ;; ;; esac]) dnl +case "$OS" in +CYGWIN*|MINGW*) use_makefile=no;; +*) use_makefile=yes;; +esac +AC_ARG_WITH(makefile, +[ --without-makefile dissable use of generated makefile], +[case "${withval}" in +yes|no) use_makefile=${withval};; +*) AC_MSG_ERROR(bad value ${withval} given for makefile) ;; +esac]) +dnl use_meta=yes AC_ARG_WITH(meta, [ --without-meta dissable use of meta-mode], @@ -41,30 +53,41 @@ yes|no) use_meta=${withval};; esac]) dnl AC_ARG_WITH(filemon, -[ --with-filemon=path/filemon.h indicate path to filemon.h for meta-mode], +[ --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev], [ case "/${withval}" in -/no|*/filemon.h) filemon_h="${withval}";; +/no) use_filemon=no;; +/*trace) filemon_h=no use_filemon="${withval}";; +*/filemon.h) filemon_h="${withval}";; */filemon*) filemon_h="${withval}/filemon.h";; *) AC_MSG_ERROR(bad value ${withval} given for filemon) ;; esac], [ -OS=`uname -s` -for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon" -do - for x in "/$OS" "" - do - filemon_h="$d$x/filemon.h" - test -s "$filemon_h" && break - done - test -s "$filemon_h" && break -done -test -s "${filemon_h:-/dev/null}" || filemon_h=no +case "$OS" in +NetBSD) filemon_h=no use_filemon=ktrace;; +*) + for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon" + do + for x in "/$OS" "" + do + filemon_h="$d$x/filemon.h" + test -s "$filemon_h" && break + done + test -s "$filemon_h" && { use_filemon=dev; break; } + done + ;; +esac +use_filemon=${use_filemon:-no} +case "$use_filemon" in +dev) ;; +*) filemon_h=no;; +esac ]) -dnl echo "Note: use_meta=$use_meta filemon_h=$filemon_h" >&6 +dnl echo "Note: use_meta=$use_meta use_filemon=$use_filemon filemon_h=$filemon_h" >&6 case "$use_meta" in yes) - case "$filemon_h" in - *.h) echo "Using: filemon=$filemon_h" >&6;; + case "$use_filemon" in + no) ;; + *) echo "Using: filemon_${use_filemon}.c" >&6;; esac ;; esac @@ -388,10 +411,14 @@ AC_SUBST(INSTALL) AC_SUBST(GCC) AC_SUBST(diff_u) AC_SUBST(use_meta) +AC_SUBST(use_filemon) AC_SUBST(filemon_h) AC_SUBST(_MAKE_VERSION) -AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile) - +bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh" +if test $use_makefile = yes; then + bm_outfiles="makefile $bm_outfiles" +fi +AC_OUTPUT($bm_outfiles) cat < #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.197 2020/02/06 01:13:19 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -358,6 +358,8 @@ static Job childExitJob; /* child exit pseudo-job */ #define CHILD_EXIT "." #define DO_JOB_RESUME "R" +static const int npseudojobs = 2; /* number of pseudo-jobs */ + #define TARG_FMT "%s %s ---\n" /* Default format */ #define MESSAGE(fp, gn) \ if (maxJobs != 1 && targPrefix && *targPrefix) \ @@ -389,6 +391,16 @@ static void JobSigReset(void); #endif const char *malloc_options= MALLOC_OPTIONS; +static unsigned +nfds_per_job(void) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) + return 2; +#endif + return 1; +} + static void job_table_dump(const char *where) { @@ -1475,6 +1487,12 @@ JobExec(Job *job, char **argv) Trace_Log(JOBSTART, job); +#ifdef USE_META + if (useMeta) { + meta_job_parent(job, cpid); + } +#endif + /* * Set the current position in the buffer to the beginning * and mark another stream to watch in the outputs mask @@ -2157,12 +2175,24 @@ Job_CatchOutput(void) if (nready == 0) return; - for (i = 2; i < nfds; i++) { + for (i = npseudojobs*nfds_per_job(); i < nfds; i++) { if (!fds[i].revents) continue; job = jobfds[i]; if (job->job_state == JOB_ST_RUNNING) JobDoOutput(job, FALSE); +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + /* + * With meta mode, we may have activity on the job's filemon + * descriptor too, which at the moment is any pollfd other than + * job->inPollfd. + */ + if (useMeta && job->inPollfd != &fds[i]) { + if (meta_job_event(job) <= 0) { + fds[i].events = 0; /* never mind */ + } + } +#endif if (--nready == 0) return; } @@ -2313,9 +2343,11 @@ Job_Init(void) JobCreatePipe(&childExitJob, 3); - /* We can only need to wait for tokens, children and output from each job */ - fds = bmake_malloc(sizeof (*fds) * (2 + maxJobs)); - jobfds = bmake_malloc(sizeof (*jobfds) * (2 + maxJobs)); + /* Preallocate enough for the maximum number of jobs. */ + fds = bmake_malloc(sizeof(*fds) * + (npseudojobs + maxJobs) * nfds_per_job()); + jobfds = bmake_malloc(sizeof(*jobfds) * + (npseudojobs + maxJobs) * nfds_per_job()); /* These are permanent entries and take slots 0 and 1 */ watchfd(&tokenWaitJob); @@ -2834,6 +2866,14 @@ watchfd(Job *job) jobfds[nfds] = job; job->inPollfd = &fds[nfds]; nfds++; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[nfds].fd = meta_job_fd(job); + fds[nfds].events = fds[nfds].fd == -1 ? 0 : POLLIN; + jobfds[nfds] = job; + nfds++; + } +#endif } static void @@ -2844,6 +2884,18 @@ clearfd(Job *job) Punt("Unwatching unwatched job"); i = job->inPollfd - fds; nfds--; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + /* + * Sanity check: there should be two fds per job, so the job's + * pollfd number should be even. + */ + assert(nfds_per_job() == 2); + if (i % 2) + Punt("odd-numbered fd with meta"); + nfds--; + } +#endif /* * Move last job in table into hole made by dead job. */ @@ -2851,6 +2903,12 @@ clearfd(Job *job) fds[i] = fds[nfds]; jobfds[i] = jobfds[nfds]; jobfds[i]->inPollfd = &fds[i]; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[i + 1] = fds[nfds + 1]; + jobfds[i + 1] = jobfds[nfds + 1]; + } +#endif } job->inPollfd = NULL; } Modified: head/contrib/bmake/make-bootstrap.sh.in ============================================================================== --- head/contrib/bmake/make-bootstrap.sh.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make-bootstrap.sh.in Wed May 20 22:25:46 2020 (r361307) @@ -23,6 +23,10 @@ MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ LDFLAGS="@LDFLAGS@" LIBS="@LIBS@" +toUpper() { + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ +} + do_compile2() { obj="$1"; shift src="$1"; shift @@ -32,7 +36,10 @@ do_compile2() { do_compile() { obj="$1"; shift - src=`basename "$obj" .o`.c + case "$1" in + *.c) src=$1; shift;; + *) src=`basename "$obj" .o`.c;; + esac for d in "$srcdir" "$srcdir/lst.lib" do @@ -52,7 +59,7 @@ do_link() { } BASE_OBJECTS="arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o \ -job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o \ +make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o \ suff.o targ.o trace.o var.o util.o" LST_OBJECTS="lstAppend.o lstDupl.o lstInit.o lstOpen.o \ @@ -73,12 +80,22 @@ done case "@use_meta@" in yes) - case "@filemon_h@" in - */filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";; + case "@use_filemon@" in + no) MDEFS=;; + *) + MDEFS="-DUSE_FILEMON -DUSE_FILEMON_`echo @use_filemon@ | toUpper`" + case "@use_filemon@,@filemon_h@" in + dev,*/filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";; + *) FDEFS=;; + esac + do_compile filemon_@use_filemon@.o filemon/filemon_@use_filemon@.c ${FDEFS} + BASE_OBJECTS="filemon_@use_filemon@.o $BASE_OBJECTS" + ;; esac - do_compile meta.o ${FDEFS} - BASE_OBJECTS="meta.o ${BASE_OBJECTS}" - ;; + do_compile meta.o ${MDEFS} + BASE_OBJECTS="meta.o ${BASE_OBJECTS}" + ;; esac +do_compile job.o ${MDEFS} -do_link bmake main.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS} +do_link bmake main.o job.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS} Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make.1 Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $ +.\" $NetBSD: make.1,v 1.280 2020/04/27 20:03:08 christos Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd December 5, 2018 +.Dd April 27, 2020 .Dt MAKE 1 .Os .Sh NAME @@ -272,7 +272,7 @@ that do not depend on the target whose creation caused .It Fl m Ar directory Specify a directory in which to search for sys.mk and makefiles included via the -.Ao Ar file Ac Ns -style +.Li \&< Ns Ar file Ns Li \&> Ns -style include statement. The .Fl m @@ -280,7 +280,7 @@ option can be used multiple times to form a search pat This path will override the default system include path: /usr/share/mk. Furthermore the system include path will be appended to the search path used for -.Qo Ar file Qc Ns -style +.Li \*q Ns Ar file Ns Li \*q Ns -style include statements (see the .Fl I option). @@ -1245,7 +1245,7 @@ Quotes every shell meta-character in the variable, and characters so that it can be passed safely through recursive invocations of .Nm . -This is equivalent to: +This is equivalent to: .Sq \&:S/\e\&$/&&/g:Q . .It Cm \&:R Replaces each word in the variable with everything but its suffix. @@ -1440,6 +1440,29 @@ is the substring of .Ar old_string to be replaced in .Ar new_string . +If only +.Ar old_string +contains the pattern matching character +.Ar % , +and +.Ar old_string +matches, then the result is the +.Ar new_string . +If only the +.Ar new_string +contains the pattern matching character +.Ar % , +then it is not treated specially and it is printed as a literal +.Ar % +on match. +If there is more than one pattern matching character +.Ar ( % ) +in either the +.Ar new_string +or +.Ar old_string , +only the first instance is treated specially (as the pattern character); +all subsequent instances are treated as regular characters .Pp Variable expansion occurs in the normal fashion inside both .Ar old_string @@ -1634,9 +1657,9 @@ dot .Pq Ql \&. character. Files are included with either -.Cm \&.include Aq Ar file +.Cm \&.include \&< Ns Ar file Ns Cm \&> or -.Cm \&.include Pf \*q Ar file Ns \*q . +.Cm \&.include \&\*q Ns Ar file Ns Cm \&\*q . Variables between the angle brackets or double quotes are expanded to form the file name. If angle brackets are used, the included makefile is expected to be in @@ -2416,9 +2439,9 @@ file). .Sh BUGS The .Nm -syntax is difficult to parse without actually acting of the data. -For instance finding the end of a variable use should involve scanning each -the modifiers using the correct terminator for each field. +syntax is difficult to parse without actually acting on the data. +For instance, finding the end of a variable's use should involve scanning +each of the modifiers, using the correct terminator for each field. In many places .Nm just counts {} and () in order to find the end of a variable expansion. Modified: head/contrib/bmake/make.h ============================================================================== --- head/contrib/bmake/make.h Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make.h Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.105 2020/03/30 02:41:06 sjg Exp $ */ +/* $NetBSD: make.h,v 1.107 2020/04/03 03:35:16 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/meta.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.70 2018/02/13 19:37:30 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.81 2020/04/03 03:32:28 sjg Exp $ */ /* * Implement 'meta' mode. @@ -36,7 +36,6 @@ # include "config.h" #endif #include -#include #ifdef HAVE_LIBGEN_H #include #elif !defined(HAVE_DIRNAME) @@ -50,12 +49,9 @@ char * dirname(char *); #include "make.h" #include "job.h" -#ifdef HAVE_FILEMON_H -# include +#ifdef USE_FILEMON +#include "filemon/filemon.h" #endif -#if !defined(USE_FILEMON) && defined(FILEMON_SET_FD) -# define USE_FILEMON -#endif static BuildMon Mybm; /* for compat */ static Lst metaBailiwick; /* our scope of control */ @@ -121,30 +117,24 @@ extern char **environ; * the benefits are more limited. */ #ifdef USE_FILEMON -# ifndef _PATH_FILEMON -# define _PATH_FILEMON "/dev/filemon" -# endif /* * Open the filemon device. */ static void -filemon_open(BuildMon *pbm) +meta_open_filemon(BuildMon *pbm) { - int retry; - - pbm->mon_fd = pbm->filemon_fd = -1; - if (!useFilemon) + int dupfd; + + pbm->mon_fd = -1; + pbm->filemon = NULL; + if (!useFilemon || !pbm->mfp) return; - for (retry = 5; retry >= 0; retry--) { - if ((pbm->filemon_fd = open(_PATH_FILEMON, O_RDWR)) >= 0) - break; - } - - if (pbm->filemon_fd < 0) { + pbm->filemon = filemon_open(); + if (pbm->filemon == NULL) { useFilemon = FALSE; - warn("Could not open %s", _PATH_FILEMON); + warn("Could not open filemon %s", filemon_path()); return; } @@ -155,12 +145,15 @@ filemon_open(BuildMon *pbm) * We only care about the descriptor. */ pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL); - if (ioctl(pbm->filemon_fd, FILEMON_SET_FD, &pbm->mon_fd) < 0) { + if ((dupfd = dup(pbm->mon_fd)) == -1) { + err(1, "Could not dup filemon output!"); + } + (void)fcntl(dupfd, F_SETFD, FD_CLOEXEC); + if (filemon_setfd(pbm->filemon, dupfd) == -1) { err(1, "Could not set filemon file descriptor!"); } /* we don't need these once we exec */ (void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC); - (void)fcntl(pbm->filemon_fd, F_SETFD, FD_CLOEXEC); } /* @@ -473,7 +466,7 @@ meta_create(BuildMon *pbm, GNode *gn) const char *tname; char *fname; const char *cp; - char *p[4]; /* >= possible uses */ + char *p[5]; /* >= possible uses */ int i; mf.fp = NULL; @@ -528,7 +521,10 @@ meta_create(BuildMon *pbm, GNode *gn) fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf))); fprintf(mf.fp, "TARGET %s\n", tname); - + cp = Var_Value(".OODATE", gn, &p[i++]); + if (cp && *cp) { + fprintf(mf.fp, "OODATE %s\n", cp); + } if (metaEnv) { for (ptr = environ; *ptr != NULL; ptr++) fprintf(mf.fp, "ENV %s\n", *ptr); @@ -574,7 +570,7 @@ meta_init(void) { #ifdef USE_FILEMON /* this allows makefiles to test if we have filemon support */ - Var_Set(".MAKE.PATH_FILEMON", _PATH_FILEMON, VAR_GLOBAL, 0); + Var_Set(".MAKE.PATH_FILEMON", filemon_path(), VAR_GLOBAL, 0); #endif } @@ -684,9 +680,10 @@ meta_job_start(Job *job, GNode *gn) #endif #ifdef USE_FILEMON if (pbm->mfp != NULL && useFilemon) { - filemon_open(pbm); + meta_open_filemon(pbm); } else { - pbm->mon_fd = pbm->filemon_fd = -1; + pbm->mon_fd = -1; + pbm->filemon = NULL; } #endif } @@ -708,11 +705,11 @@ meta_job_child(Job *job) } if (pbm->mfp != NULL) { close(fileno(pbm->mfp)); - if (useFilemon) { + if (useFilemon && pbm->filemon) { pid_t pid; pid = getpid(); - if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) { + if (filemon_setpid_child(pbm->filemon, pid) == -1) { err(1, "Could not set filemon pid!"); } } @@ -721,6 +718,59 @@ meta_job_child(Job *job) } void +meta_job_parent(Job *job, pid_t pid) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + BuildMon *pbm; + + if (job != NULL) { + pbm = &job->bm; + } else { + pbm = &Mybm; + } + if (useFilemon && pbm->filemon) { + filemon_setpid_parent(pbm->filemon, pid); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 21 01:50:43 2020 Return-Path: Delivered-To: svn-src-head@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 6D2682FBE87; Thu, 21 May 2020 01:50:43 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-eopbgr1310104.outbound.protection.outlook.com [40.107.131.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCJ21JR0z47fW; Thu, 21 May 2020 01:50:41 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G5UeO2wrq8U/8t0T0RoeRg7f4aMFb1iQZEONDT3S/dbxSHK8XRI61xP8j8ZKrWADMmtRhq1dm1zJdluTDlPbpiy5TDOanNRpmQz6nCqxuj+YeRG6UKIw+VSmU4N9OHr4FrZ1BTHw/4whHll7b0T+1ahunf2d/+ZbXbhz0EKoIjfjFNf7d1PcGajM7GSZh7GiMA+S71dwAidyqeEJKlN2MVWJa2UnDILfepIFUdZ/5X+ZTNuiW8XDmgDQHFHUaxLeu7aBX4eVZvx7z0SQc9YrJDUcM6JWeJWySv7oGYkLBNdiRHnOodt9uxN4OQuPzTt6ILZBh12fvZDOVHUZ+FwPxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NajyPzDQreuHeidRnp8j4kvjh3b5yh8rk4Uj7xsDdVg=; b=VSZhfQCfD1r5jHL/wROLsig5hfLXB0L+uDJlzUDMvgmsYUbPGFmfpvK0vvr3P94KGOblS6NkMlwe/YDM3uXxZruhugkdO3JAkIPmcWqJILl9lnKf+YRkFZpyZ1RC4clH7EKWJJjwDkC+6fASIDuaS3Vkd9zqppjalbA65A9w0DSoOadHhNXaT8mIkAXipYAyK4Fb6qahQi3rMxFhDXmwqRp0Dk+V0v2o8+mlKu6ww4FK5mm09K6LihAcKmR0N16wx0kBrIPpycVg/dNm6IwYsRow7qqeEztLqj0+ExUsx59cnQUeD4C8HJrwn536oKFpgXUeCueZec9oGTYuFWrtTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.5; Thu, 21 May 2020 01:50:38 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 01:50:38 +0000 From: Wei Hu To: Shawn Webb , Wei Hu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qixFLIAgACwD1A= Date: Thu, 21 May 2020 01:50:38 +0000 Message-ID: References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> In-Reply-To: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T01:50:36Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=049815fc-3d30-4ede-b1f4-1561d3ec723f; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dce3ea74-bd4b-4113-69cb-08d7fd295c99 x-ms-traffictypediagnostic: SG2P153MB0377: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:425; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: co90fs6n3rs/ViA3WEYRG3NjVUSS11X/J1AhhneRUCh06kk4XJVy1rAF5zwYfZrHUyUc08XJSz1R+YbWR9Tr8uHBdBiGLkuzJ8Hj1jBMxhNh+eGTZ3gzOnGIpIT04OqfBYP3K95f6jDLkorAAeaOaOhTCc2Vj3ecpYDjjmNaQ3eH3lQSZSdr5LaFvkRx9S284mi2geDzL+tuGmKLHx+7hiqk+/CZmUwQa69s4DgK8MfLIsfYuBpBUrTHXtwqV8wL3x8/V0hdvu2Nt1wW9QSrFzOxyEm/YdL0tPsGNULOOgK1WGzM0EXcgJU/0SEBFd7qRm+PfGb27sT89jxLYrEzf82osVzZtyQSvOP1LGgCzW3xe6mOLrxn847MNwt2bvKLeoKvGgpRN90PSdN8BGUuEg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(346002)(39860400002)(366004)(396003)(7696005)(33656002)(6506007)(53546011)(8990500004)(966005)(478600001)(66946007)(5660300002)(55016002)(64756008)(76116006)(52536014)(110136005)(316002)(66446008)(9686003)(66476007)(66556008)(54906003)(186003)(82950400001)(82960400001)(4326008)(10290500003)(71200400001)(86362001)(8676002)(8936002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: kErVyqtf395D0k7v32fOotMjuS6KIP4P1fLke6/Iq1sdfTVg7qOK2x/INtPeOyTfJU7ZvXx0XxdVw8t8ISzKlZYtzF4c3TY0GpGEB4w21nzYpEbH3a3nG3DSvsiyK38Y4oVKBSy8H0cORO3fWhj4tGWgSdHZl6TiBr9TLLCchhuabL9/F0rlC4apBd2CepZUEel6aw5XlcKpVI0tlkvragmrFZSB+U6UK/jnKAWcLSqFs6mlZMwbxvdevWd6SwD1lVyp1bzEwWuBaGB4IQmGDGnFBJLjRC1VmSUHC+cBRq2SPJ58o95o2yiDQqqSh8Oy0rWmJ7mzBcoR9Eko5WvWQU3hxFar9aqYofzNwP7huuZ6aODvkhhJSGjbV2DoBIQBZO9P1cveXDbST8cDARmv11ul9w8QLwIIcFxNBI6evKGSc0XBRkCw+n3Ai/ftm4TETTUZ7+ZO6dn2OjPUcS6abyk/DVe8tyO+BxO9egLrBB3RAOEIVrfGC5lkj0UCzGV8Uli7OA45frCUOrGBArjxMA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: dce3ea74-bd4b-4113-69cb-08d7fd295c99 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 01:50:38.0539 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Txv7acLjWx1S48TgLC5N9+gWyS7egxKnJX42zp/wgtuvnDHStngN3qSB5EK1EF7J4Ps/3mz2oC7TDxTlqDsZpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0377 X-Rspamd-Queue-Id: 49SCJ21JR0z47fW X-Spamd-Bar: ---------- X-Spamd-Result: default: False [-10.19 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; NEURAL_HAM_LONG(-1.03)[-1.026]; MIME_GOOD(-0.10)[text/plain]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; NEURAL_HAM_SHORT(-1.08)[-1.083]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.131.104:from]; RCVD_IN_DNSWL_LOW(-0.10)[40.107.131.104:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:50:43 -0000 > -----Original Message----- > From: Shawn Webb > Sent: Wednesday, May 20, 2020 11:11 PM > To: Wei Hu > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys >=20 > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: https://svnweb.freebsd.org/changeset/base/361275 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket addres= s > > family AF_HYPERV and its kernel support are added. > > > > Submitted by: Wei Hu > > Reviewed by: Dexuan Cui > > Relnotes: yes > > Sponsored by: Microsoft > > Differential Revision: https://reviews.freebsd.org/D24061 >=20 > Hey Wei Hu, >=20 > Would it be good to bump __FreeBSD_version after a change like this? >=20 Hi Shawn, I was not familiar to the mechanism of __FreeBSD_version. But it looks like a good idea. However I am not sure if I have the right to update the chapter.xml file. Can you help on what I need to do the update this=20 version number? Thanks, Wei From owner-svn-src-head@freebsd.org Thu May 21 01:53:09 2020 Return-Path: Delivered-To: svn-src-head@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 A1D892FBEA5; Thu, 21 May 2020 01:53:09 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on070c.outbound.protection.outlook.com [IPv6:2a01:111:f400:febe::70c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCLn6Qfdz47kY; Thu, 21 May 2020 01:53:05 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3wmK9BnoYJWq6mANDr3CefEjurZ0AhjJb1ptPz4wqZTziBnVtuIXut8RGxYkeWDYgc6aEywTH79MDtp72+P7eDriMLn3TcCyKGaWZ4sg0I2PV1mSkB6i7h8PRU0vyzZi5H1RZPItVmTvkXNLzKG8YQiT0W2yiEuCQlbliK7m3mVZBWz7/VsapLMzhqXN06s7+liB0JQHCS1lao6PDuNCUG8oIw0eHPRsJyOEeg7tmXPR4Xs2WsAtLnO5Z5b0kjuo0EVGIf7r6yidkHL4gvsYU2w/hG7XMzg8u3AWYPAWcy8e6rhHyIQ1EOTh8vSlCV28CZLjxu30ppOmWybxAKdbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6U4iVDV7xusrQbHjmfISlQUqrL3wP8OplwdQ9BVGhkI=; b=LPcHneJd2NF7t1/a2Yium2yj/juE0f9sCYBkzSnrYsnDhi2u/WvSLm+FWKAvw7aVzRT+1I2Bm+B7U2nrya0LAX+yDHhSwRacB16jJeXHmixji28S1diMOcsmcq4msXdRm8ARUakas9jnMGyh4f8immHvpQjzjPzOz/81LHvaxxUtdxV/BxVmnTDHXK99lLODBQKPBnLjB76qh1W5fi9FH9dhpPfLqYG/OKyFvxXM2AA6Jddbds37RgH7ImR+kG7VL7NVe7oZUWFZpPBN8fhSFsSN/L8cazigUi7CpqgSBOwi1VxDwqYU/QY9HoO0Vpupxx3xPXNKmGtLhxYC0r2y2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.5; Thu, 21 May 2020 01:53:01 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 01:53:01 +0000 From: Wei Hu To: Enji Cooper , Shawn Webb CC: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qixFLIAgAAMIgCAAAC+gIAApboA Date: Thu, 21 May 2020 01:53:00 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T01:52:59Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=2019a919-b4b1-40af-ae99-c0bc2b909b87; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 974285eb-76e8-4d00-a6d1-08d7fd29b1c2 x-ms-traffictypediagnostic: SG2P153MB0377: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WunR6rBpgr17ptBU/b04ZA5xkrICyZzkGZ4Zkl5sUOKnlmo32qLxryhLYGnLk6ysmi5W6SAA4/kLdk6Pb52jC0oHl+kap6s10Mwt11l6K6/C0WFGCM61XJRZOBL5R7Wqc2Y0jzSsxV3egm8yBDdbwsVI+s+J+cC2GJH+COLKL4kVjOGYdsOAsLweOo77GqsCRJs0U/pHZ2hI9ef2mJ2uWK5ipTO/VpqpaTbbeme2jkkVZiFStJr5hhgOI2OgigIDZWBCFaCTWtnT/U3KN6PO3dD64cUUQGS8NnOxmhww2HNp2bzlKQiC2vgcaXOELGQxrlszcv/8Icsa2o1IemwPLTKTXJUKoHZ45flmr3VAoeGNpLva2BJuS+tELhmDmLObUrNk3mg/C6XXi5R8r5sWPg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(346002)(39860400002)(366004)(396003)(7696005)(33656002)(6506007)(53546011)(8990500004)(966005)(478600001)(66946007)(5660300002)(55016002)(64756008)(76116006)(52536014)(110136005)(316002)(66446008)(9686003)(66476007)(66556008)(54906003)(186003)(82950400001)(82960400001)(4326008)(10290500003)(83080400001)(71200400001)(86362001)(8676002)(8936002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: YOhrCVbrlR/LGBMyO0CuDP3+c+fSKj6GlROz6Ur959FyiqfTw6BlSLChY5V10U9MQVFCfk8MADn1Eh41jhoCi+WHw9hXrPoo5SArhNWa7XbJXJd0tMf+zw+ZsszeTpulfW4gJhljxrJvoPXxnaxM1fG/KXNZNi6JhhEoUeAn41po9iLIEpq3jS3CxsapV7ULA2ktChpgPcTDgZnF0L4QIw/0DSh6F/YGZsYbUWpk3A/T0MAalZ1t9WLUhs7gBwM2sKvc1juHuOIb2KbIXOmgA7aPM64OLap8UxTkPAqVuWF9AUo5Jtvc0S6UMHHKwByxmB1zDc6zQXWqVF+ZKYOUGqc+2P9/JybfzUFqtfuz+8/ItV6iP59znrZlMShzFGQJRDbfVvWMkCe6n8LG+hBeJSX51djXr654tNbdaSV44bqqUtga1FSvDDbdmIzFCpmJsTBlbiCZrQ0qIM4gkIUpwdPB5l5x/dYZRL0iVQtgLuxOxdjzZjELthJz8k5QJE3fksoUIHaHWOd6H/SrEbQX6Q== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 974285eb-76e8-4d00-a6d1-08d7fd29b1c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 01:53:00.9265 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Dt8H720QdFE6jbnwQHV7WPF6eD7qwPsatBZ4T0ov2bwgR2MjLh1CFh+ZgmSGD1VX3N8eIbnszNTuoA082gnNVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0377 X-Rspamd-Queue-Id: 49SCLn6Qfdz47kY X-Spamd-Bar: --------- X-Spamd-Result: default: False [-9.88 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48:c]; NEURAL_HAM_LONG(-1.03)[-1.030]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; NEURAL_HAM_SHORT(-0.96)[-0.959]; FREEMAIL_TO(0.00)[gmail.com,hardenedbsd.org]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:53:11 -0000 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRW5qaSBDb29wZXIgPHlh bmV1cmFiZXlhQGdtYWlsLmNvbT4NCj4gU2VudDogV2VkbmVzZGF5LCBNYXkgMjAsIDIwMjAgMTE6 NTggUE0NCj4gVG86IFNoYXduIFdlYmIgPHNoYXduLndlYmJAaGFyZGVuZWRic2Qub3JnPg0KPiBD YzogV2VpIEh1IDx3aHVAZnJlZWJzZC5vcmc+OyBzcmMtY29tbWl0dGVyc0BmcmVlYnNkLm9yZzsg c3ZuLXNyYy0NCj4gYWxsQGZyZWVic2Qub3JnOyBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcNCj4g U3ViamVjdDogUmU6IHN2biBjb21taXQ6IHIzNjEyNzUgLSBpbiBoZWFkL3N5czogY29uZiBkZXYv aHlwZXJ2L2h2c29jaw0KPiBkZXYvaHlwZXJ2L2luY2x1ZGUgZGV2L2h5cGVydi92bWJ1cyBtb2R1 bGVzL2h5cGVydg0KPiBtb2R1bGVzL2h5cGVydi9odnNvY2sgc3lzDQo+IA0KPiANCj4gPiBPbiBN YXkgMjAsIDIwMjAsIGF0IDA4OjU0LCBFbmppIENvb3BlciA8eWFuZXVyYWJleWFAZ21haWwuY29t PiB3cm90ZToNCj4gPiANCj4gPj4+IE9uIE1heSAyMCwgMjAyMCwgYXQgMDg6MTEsIFNoYXduIFdl YmIgPHNoYXduLndlYmJAaGFyZGVuZWRic2Qub3JnPg0KPiB3cm90ZToNCj4gPj4+DQo+ID4+PiDv u79PbiBXZWQsIE1heSAyMCwgMjAyMCBhdCAxMTowMzo1OUFNICswMDAwLCBXZWkgSHUgd3JvdGU6 DQo+ID4+PiBBdXRob3I6IHdodQ0KPiA+Pj4gRGF0ZTogV2VkIE1heSAyMCAxMTowMzo1OSAyMDIw DQo+ID4+PiBOZXcgUmV2aXNpb246IDM2MTI3NQ0KPiA+Pj4gVVJMOg0KPiA+Pj4gaHR0cHM6Ly9u YW0wNi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8/dXJsPWh0dHBzJTNBJTJGJTJG c3YNCj4gPj4+DQo+IG53ZWIuZnJlZWJzZC5vcmclMkZjaGFuZ2VzZXQlMkZiYXNlJTJGMzYxMjc1 JmFtcDtkYXRhPTAyJTdDMDElN0MNCj4gd2VoJQ0KPiA+Pj4NCj4gNDBtaWNyb3NvZnQuY29tJTdD ZDZmZjM2MTdiZmZhNDNkMTBhNzcwOGQ3ZmNkNjg0NzAlN0M3MmY5ODhiZjg2ZjE0MQ0KPiBhDQo+ ID4+Pg0KPiBmOTFhYjJkN2NkMDExZGI0NyU3QzElN0MwJTdDNjM3MjU1ODcwNTgxMTEwODg4JmFt cDtzZGF0YT1teno2Ug0KPiBJTENWQmsNCj4gPj4+IHEwNlJJMVBBZlZOS1daTzJ5N2pCTzBDMUUl MkYlMkZFSndVWSUzRCZhbXA7cmVzZXJ2ZWQ9MA0KPiA+Pj4NCj4gPj4+IExvZzoNCj4gPj4+IEh5 cGVyViBzb2NrZXQgaW1wbGVtZW50YXRpb24gZm9yIEZyZWVCU0QNCj4gPj4+DQo+ID4+PiBUaGlz IGNoYW5nZSBhZGRzIEh5cGVyLVYgc29ja2V0IGZlYXR1cmUgaW4gRnJlZUJTRC4gTmV3IHNvY2tl dA0KPiA+Pj4gYWRkcmVzcyBmYW1pbHkgQUZfSFlQRVJWIGFuZCBpdHMga2VybmVsIHN1cHBvcnQg YXJlIGFkZGVkLg0KPiA+DQo+ID4gSGkgV2VpLA0KPiA+ICAgIENvdWxkIHlvdSBwbGVhc2UgZnVy dGhlciBkZXNjcmliZSB3aGF0IHRoaXMgZmVhdHVyZSBpcy9kb2VzPw0KPiANCj4gICAgIEkgcmVh bGl6ZSBhZnRlciBsb29raW5nIGF0IHRoZSByZXZpZXcgdGhhdCBpdCBjb250YWlucyB0aGUgY29u dGVudCBJIHdhcyBob3BpbmcNCj4gZm9yLiBJdCB3b3VsZCBoYXZlIGJlZW4gaGVscGZ1bCB0byBm b2xrcyBpZiB0aGlzIGNvbnRleHQgaGFkIGJlZW4gaW5jbHVkZWQgaW4gdGhlDQo+IGNvbW1pdCBt ZXNzYWdlLg0KDQpIaSBFbmppLA0KDQpJIHRob3VnaHQgSSBqdXN0IGtlZXAgaXQgc2ltcGxlIGZv ciB0aGUgY29tbWl0IGxvZyBtZXNzYWdlIHdoaWxlIHBlb3BsZSBjYW4NCnJlZmVyIHRvIHRoZSBy ZXZpZXcgc2l0ZSBmb3IgZGV0YWlscy4gU29ycnkgYWJvdXQgdGhhdC4gTGV0IG1lIGtub3cgaWYg dGhlcmUgaXMNCmFueXdheSB0byBtYWtlIHVwIGZvciBpdC4NCg0KV2VpDQo= From owner-svn-src-head@freebsd.org Thu May 21 01:55:38 2020 Return-Path: Delivered-To: svn-src-head@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 3A5B72FBFE3; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCPk14X0z48MG; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FE0D259D8; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L1tclb062040; Thu, 21 May 2020 01:55:38 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1tZlU062027; Thu, 21 May 2020 01:55:35 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005210155.04L1tZlU062027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 21 May 2020 01:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361313 - in head: lib/libugidfw sbin/mksnap_ffs sbin/umount sys/fs/nfs sys/fs/nfsserver sys/kern sys/security/mac_bsdextended sys/sys usr.sbin/autofs usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: lib/libugidfw sbin/mksnap_ffs sbin/umount sys/fs/nfs sys/fs/nfsserver sys/kern sys/security/mac_bsdextended sys/sys usr.sbin/autofs usr.sbin/mountd X-SVN-Commit-Revision: 361313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:55:38 -0000 Author: freqlabs Date: Thu May 21 01:55:35 2020 New Revision: 361313 URL: https://svnweb.freebsd.org/changeset/base/361313 Log: Deduplicate fsid comparisons Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24749 Modified: head/lib/libugidfw/ugidfw.c head/sbin/mksnap_ffs/mksnap_ffs.c head/sbin/umount/umount.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/kern/vfs_subr.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_bsdextended/mac_bsdextended.h head/sys/sys/mount.h head/usr.sbin/autofs/autounmountd.c head/usr.sbin/mountd/mountd.c Modified: head/lib/libugidfw/ugidfw.c ============================================================================== --- head/lib/libugidfw/ugidfw.c Thu May 21 01:55:10 2020 (r361312) +++ head/lib/libugidfw/ugidfw.c Thu May 21 01:55:35 2020 (r361313) @@ -334,9 +334,8 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { numfs = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = 0; i < numfs; i++) - if (memcmp(&(rule->mbr_object.mbo_fsid), - &(mntbuf[i].f_fsid), - sizeof(mntbuf[i].f_fsid)) == 0) + if (fsidcmp(&rule->mbr_object.mbo_fsid, + &mntbuf[i].f_fsid) == 0) break; len = snprintf(cur, left, "filesys %s ", i == numfs ? "???" : mntbuf[i].f_mntonname); Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:10 2020 (r361312) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:35 2020 (r361313) @@ -81,8 +81,7 @@ issamefs(const char *path, struct statfs *stfsp) return (-1); if (statfs(path, &stfsbuf) < 0) return (-1); - if ((stfsbuf.f_fsid.val[0] != stfsp->f_fsid.val[0]) || - (stfsbuf.f_fsid.val[1] != stfsp->f_fsid.val[1])) + if (fsidcmp(&stfsbuf.f_fsid, &stfsp->f_fsid) != 0) return (0); return (1); } Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Thu May 21 01:55:10 2020 (r361312) +++ head/sbin/umount/umount.c Thu May 21 01:55:35 2020 (r361313) @@ -505,8 +505,7 @@ getmntentry(const char *fromname, const char *onname, continue; if (onname != NULL && strcmp(sfs->f_mntonname, onname) != 0) continue; - if (fsid != NULL && bcmp(&sfs->f_fsid, fsid, - sizeof(*fsid)) != 0) + if (fsid != NULL && fsidcmp(&sfs->f_fsid, fsid) != 0) continue; switch (what) { Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:35 2020 (r361313) @@ -85,8 +85,7 @@ struct nfsexstuff { #define NFSVNO_SETEXRDONLY(e) ((e)->nes_exflag = (MNT_EXPORTED|MNT_EXRDONLY)) #define NFSVNO_CMPFH(f1, f2) \ - ((f1)->fh_fsid.val[0] == (f2)->fh_fsid.val[0] && \ - (f1)->fh_fsid.val[1] == (f2)->fh_fsid.val[1] && \ + (fsidcmp(&(f1)->fh_fsid, &(f2)->fh_fsid) == 0 && \ bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0) #define NFSLOCKHASH(f) \ Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:55:35 2020 (r361313) @@ -4019,11 +4019,8 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, if (tds->nfsdev_nmp != NULL) { if (tds->nfsdev_mdsisset == 0 && ds == NULL) ds = tds; - else if (tds->nfsdev_mdsisset != 0 && - mp->mnt_stat.f_fsid.val[0] == - tds->nfsdev_mdsfsid.val[0] && - mp->mnt_stat.f_fsid.val[1] == - tds->nfsdev_mdsfsid.val[1]) { + else if (tds->nfsdev_mdsisset != 0 && fsidcmp( + &mp->mnt_stat.f_fsid, &tds->nfsdev_mdsfsid) == 0) { ds = fds = tds; break; } @@ -4043,10 +4040,8 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, if (tds->nfsdev_nmp != NULL && ((tds->nfsdev_mdsisset == 0 && fds == NULL) || (tds->nfsdev_mdsisset != 0 && fds != NULL && - mp->mnt_stat.f_fsid.val[0] == - tds->nfsdev_mdsfsid.val[0] && - mp->mnt_stat.f_fsid.val[1] == - tds->nfsdev_mdsfsid.val[1]))) { + fsidcmp(&mp->mnt_stat.f_fsid, + &tds->nfsdev_mdsfsid) == 0))) { dsdir[mirrorcnt] = i; dvp[mirrorcnt] = tds->nfsdev_dsdir[i]; mirrorcnt++; @@ -4778,10 +4773,8 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char fndds->nfsdev_mdsisset == 0) || (tds->nfsdev_mdsisset != 0 && fndds->nfsdev_mdsisset != 0 && - tds->nfsdev_mdsfsid.val[0] == - mp->mnt_stat.f_fsid.val[0] && - tds->nfsdev_mdsfsid.val[1] == - mp->mnt_stat.f_fsid.val[1]))) { + fsidcmp(&tds->nfsdev_mdsfsid, + &mp->mnt_stat.f_fsid) == 0))) { *newnmpp = tds->nfsdev_nmp; break; } @@ -5968,8 +5961,7 @@ nfsrv_pnfsstatfs(struct statfs *sf, struct mount *mp) /* First, search for matches for same file system. */ TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == mp->mnt_stat.f_fsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == mp->mnt_stat.f_fsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, &mp->mnt_stat.f_fsid) == 0) { if (++i > nfsrv_devidcnt) break; *tdvpp++ = ds->nfsdev_dvp; Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Thu May 21 01:55:35 2020 (r361313) @@ -1059,10 +1059,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram if (!error && !nd->nd_repstat) { if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) { new_mp = nvp->v_mount; - if (cur_fsid.val[0] != - new_mp->mnt_stat.f_fsid.val[0] || - cur_fsid.val[1] != - new_mp->mnt_stat.f_fsid.val[1]) { + if (fsidcmp(&cur_fsid, &new_mp->mnt_stat.f_fsid) != 0) { /* crossed a server mount point */ nd->nd_repstat = nfsvno_checkexp(new_mp, nd->nd_nam, &nes, &credanon); @@ -1091,8 +1088,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; break; - } else if (cur_fsid.val[0] != save_fsid.val[0] || - cur_fsid.val[1] != save_fsid.val[1]) { + } else if (fsidcmp(&cur_fsid, &save_fsid) != 0) { nd->nd_repstat = NFSERR_XDEV; break; } Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 21 01:55:35 2020 (r361313) @@ -7535,8 +7535,7 @@ nfsrv_freelayouts(nfsquad_t *clid, fsid_t *fs, int lay TAILQ_FOREACH_SAFE(lyp, &lhyp->list, lay_list, nlyp) { if (clid->qval != lyp->lay_clientid.qval) continue; - if (fs != NULL && (fs->val[0] != lyp->lay_fsid.val[0] || - fs->val[1] != lyp->lay_fsid.val[1])) + if (fs != NULL && fsidcmp(fs, &lyp->lay_fsid) != 0) continue; if (laytype != lyp->lay_type) continue; @@ -7830,10 +7829,8 @@ nfsrv_delds(char *devid, NFSPROC_T *p) TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == - fndds->nfsdev_mdsfsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == - fndds->nfsdev_mdsfsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, + &fndds->nfsdev_mdsfsid) == 0) { fndmirror = 1; break; } @@ -8737,10 +8734,8 @@ nfsrv_findmirroredds(struct nfsmount *nmp) TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == - fndds->nfsdev_mdsfsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == - fndds->nfsdev_mdsfsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, + &fndds->nfsdev_mdsfsid) == 0) { fndmirror = 1; break; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/kern/vfs_subr.c Thu May 21 01:55:35 2020 (r361313) @@ -841,8 +841,7 @@ vfs_getvfs(fsid_t *fsid) CTR2(KTR_VFS, "%s: fsid %p", __func__, fsid); mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) { vfs_ref(mp); mtx_unlock(&mountlist_mtx); return (mp); @@ -877,16 +876,13 @@ vfs_busyfs(fsid_t *fsid) hash = fsid->val[0] ^ fsid->val[1]; hash = (hash >> 16 ^ hash) & (FSID_CACHE_SIZE - 1); mp = cache[hash]; - if (mp == NULL || - mp->mnt_stat.f_fsid.val[0] != fsid->val[0] || - mp->mnt_stat.f_fsid.val[1] != fsid->val[1]) + if (mp == NULL || fsidcmp(&mp->mnt_stat.f_fsid, fsid) != 0) goto slow; if (vfs_busy(mp, 0) != 0) { cache[hash] = NULL; goto slow; } - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) return (mp); else vfs_unbusy(mp); @@ -894,8 +890,7 @@ vfs_busyfs(fsid_t *fsid) slow: mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) { error = vfs_busy(mp, MBF_MNTLSTLOCK); if (error) { cache[hash] = NULL; Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/security/mac_bsdextended/mac_bsdextended.c Thu May 21 01:55:35 2020 (r361313) @@ -302,9 +302,8 @@ ugidfw_rulecheck(struct mac_bsdextended_rule *rule, } if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { - match = (bcmp(&(vp->v_mount->mnt_stat.f_fsid), - &(rule->mbr_object.mbo_fsid), - sizeof(rule->mbr_object.mbo_fsid)) == 0); + match = (fsidcmp(&vp->v_mount->mnt_stat.f_fsid, + &rule->mbr_object.mbo_fsid) == 0); if (rule->mbr_object.mbo_neg & MBO_FSID_DEFINED) match = !match; if (!match) Modified: head/sys/security/mac_bsdextended/mac_bsdextended.h ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/security/mac_bsdextended/mac_bsdextended.h Thu May 21 01:55:35 2020 (r361313) @@ -101,7 +101,7 @@ struct mac_bsdextended_object { uid_t mbo_uid_max; gid_t mbo_gid_min; gid_t mbo_gid_max; - struct fsid mbo_fsid; + fsid_t mbo_fsid; int mbo_type; }; Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/sys/mount.h Thu May 21 01:55:35 2020 (r361313) @@ -52,6 +52,8 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ +#define fsidcmp(a, b) memcmp((a), (b), sizeof(fsid_t)) + /* * File identifier. * These are unique per filesystem on a single machine. Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Thu May 21 01:55:10 2020 (r361312) +++ head/usr.sbin/autofs/autounmountd.c Thu May 21 01:55:35 2020 (r361313) @@ -67,8 +67,7 @@ automounted_find(fsid_t fsid) struct automounted_fs *af; TAILQ_FOREACH(af, &automounted, af_next) { - if (af->af_fsid.val[0] == fsid.val[0] && - af->af_fsid.val[1] == fsid.val[1]) + if (fsidcmp(&af->af_fsid, &fsid) == 0) return (af); } Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu May 21 01:55:10 2020 (r361312) +++ head/usr.sbin/mountd/mountd.c Thu May 21 01:55:35 2020 (r361313) @@ -1568,10 +1568,8 @@ get_exportlist_one(int passno) ep = get_exp(); } else { if (ep) { - if (ep->ex_fs.val[0] != - fsb.f_fsid.val[0] || - ep->ex_fs.val[1] != - fsb.f_fsid.val[1]) { + if (fsidcmp(&ep->ex_fs, &fsb.f_fsid) + != 0) { getexp_err(ep, tgrp, "fsid mismatch"); goto nextline; @@ -2088,8 +2086,7 @@ compare_nmount_exportlist(struct iovec *iov, int iovle if ((oep->ex_flag & EX_DONE) == 0) { LOGDEBUG("not done delete=%s", oep->ex_fsdir); if (statfs(oep->ex_fsdir, &ofs) >= 0 && - oep->ex_fs.val[0] == ofs.f_fsid.val[0] && - oep->ex_fs.val[1] == ofs.f_fsid.val[1]) { + fsidcmp(&oep->ex_fs, &ofs.f_fsid) == 0) { LOGDEBUG("do delete"); /* * Clear has_publicfh if if was set @@ -2353,8 +2350,7 @@ ex_search(fsid_t *fsid, struct exportlisthead *exhp) i = EXPHASH(fsid); SLIST_FOREACH(ep, &exhp[i], entries) { - if (ep->ex_fs.val[0] == fsid->val[0] && - ep->ex_fs.val[1] == fsid->val[1]) + if (fsidcmp(&ep->ex_fs, fsid) == 0) return (ep); } @@ -3122,8 +3118,7 @@ do_mount(struct exportlist *ep, struct grouplist *grp, * filesystem. */ if (statfs(dirp, &fsb1) != 0 || - bcmp(&fsb1.f_fsid, &fsb->f_fsid, - sizeof (fsb1.f_fsid)) != 0) { + fsidcmp(&fsb1.f_fsid, &fsb->f_fsid) != 0) { *cp = savedc; syslog(LOG_ERR, "can't export %s %s", dirp, From owner-svn-src-head@freebsd.org Thu May 21 02:09:01 2020 Return-Path: Delivered-To: svn-src-head@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 029F12FC98D; Thu, 21 May 2020 02:09:01 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCj81fdZz49Mf; Thu, 21 May 2020 02:09:00 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f195.google.com with SMTP id a10so2030412ybc.3; Wed, 20 May 2020 19:09:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HbuLSBhTmaFxy9dk611V0yncOhkhC7ronYs6oQp1tiw=; b=AV+BG/5s7NHGxXyGipdP5j6V9Xd7xXZ0jAS42/oETlHnXw5i6XgEKLQO67RndgjFwI LqWNppWTjyM8exLNrgyqau7cykFUzLa75H+t6/LEiv4kFSkhV7WLyBLY35GzTiXMZb8b kJUxvehkBfGrGq6nEboKO1eSC4aHJLGX5UCenLFJEwRdedZgwm08gPd7Cmi/VA4y+FDO 4kAdBMQsfPpuksXVH7TDPD3Rpw+jvXY+aO7etFmrbofNuPGI43uWx6hxfj7Tp+y1BumQ Z1fPfg5CZM2LtO5yEOpfsBoSsoeRKm5aHuGB1mkPbGVsILe/ajmRL69CxNUfxUwqVPXV xWQg== X-Gm-Message-State: AOAM531KTEexZ0Ik/GLRao+l+9pg/g6SELGjfr/sc7S6BN4L17R8HPpS nd8DN0FYOmmMsaLZD3Ez8572KhxJteB/tcBDGbk= X-Google-Smtp-Source: ABdhPJzPua1XPWlIHytQwwvkFXjMY2Eq99OJkHeQ4VKC4VeFq6QXJF+Im8whCSqf5Y+3KStQOMb5CBTVwePoLsB501I= X-Received: by 2002:a25:cace:: with SMTP id a197mr11988249ybg.405.1590026939035; Wed, 20 May 2020 19:08:59 -0700 (PDT) MIME-Version: 1.0 References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> In-Reply-To: From: Li-Wen Hsu Date: Thu, 21 May 2020 10:08:47 +0800 Message-ID: Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys To: Wei Hu Cc: Shawn Webb , Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49SCj81fdZz49Mf X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.195 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-1.11 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.23)[-0.227]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.01)[-0.012]; RCVD_IN_DNSWL_NONE(0.00)[209.85.219.195:from]; NEURAL_HAM_MEDIUM(-0.87)[-0.871]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.219.195:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 02:09:01 -0000 On Thu, May 21, 2020 at 9:50 AM Wei Hu wrote: > I was not familiar to the mechanism of __FreeBSD_version. But it looks > like a good idea. However I am not sure if I have the right to update the > chapter.xml file. Can you help on what I need to do the update this > version number? It's no problem (actually it's required) to update doc/head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml after you bump __FreeBSD_version in src/sys/sys/param.h Best, Li-Wen From owner-svn-src-head@freebsd.org Thu May 21 02:10:46 2020 Return-Path: Delivered-To: svn-src-head@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 5582E2FCA21; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SClB1dzgz49M5; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 339C925F16; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L2Ak0K068775; Thu, 21 May 2020 02:10:46 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L2AkSn068774; Thu, 21 May 2020 02:10:46 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005210210.04L2AkSn068774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Thu, 21 May 2020 02:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361316 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 361316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 02:10:46 -0000 Author: csjp Date: Thu May 21 02:10:45 2020 New Revision: 361316 URL: https://svnweb.freebsd.org/changeset/base/361316 Log: Decode the file descriptor argument to closefrom(2) as an Integer. This is consistent with what we are doing for close(2) and it makes it a bit easier to follow when debugging file descriptor operations. i.e. many other syscalls are decoding fds as integers rather than base 16 numbers. MFC after: 1 week Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu May 21 02:08:34 2020 (r361315) +++ head/usr.bin/truss/syscalls.c Thu May 21 02:10:45 2020 (r361316) @@ -157,6 +157,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, { .name = "close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, + { .name = "closefrom", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, { .name = "compat11.fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, From owner-svn-src-head@freebsd.org Thu May 21 02:41:11 2020 Return-Path: Delivered-To: svn-src-head@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 F19CC2FDD38 for ; Thu, 21 May 2020 02:41:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.ore.mailhop.org [44.233.67.66]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49SDQH16hVz4CT4 for ; Thu, 21 May 2020 02:41:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1590028869; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=lTH1KJJCtGnVFSKqjmchBMRGR57l7imJ2cr3o+rnj6yRg0O2YiStGL0gkzBbWbdSRBFHl+qBIogqb T4dNBkQZU0rMg00M5MPbqAglzRgJSTkxsUIvaT3YP0dDgoiANWeBOK9UvAu0qvDDWs/sflQ9Pvx0Yx s5Q9top+pGEz08tGk83pecQnf512U1U1ei54VNL3ADj90pfIY9YXlG1AcVSjPu1PHdXClswP7MdPHg iE9FExIb7e3E0SZz4fmnG2+3sioYOMk9Xlpj6S9GWmMCPpjRH5PNfOy8+gk682LVbyRSbu2ZtHdLem T1m4pRUnUicw74cJis9qzZkmbdY5gbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=1wC2H0fjTO3DY0a+2GROUANMyTkiFDLBaaxbHlHRf44=; b=muZuUAublVDNfjBRgpeeO1nPRcZ783BuQS7lsNz5/KggdW+OauVvXy3EajKZO+agpRB7pwKMF23DM D1+73qRz/t6sRZfbDFteHPt55mjwSGky4zaAF6GrG0dm8XuLGLTZwG3On4BR6UkVDOt1hwoGhQwWiL lxM63AJq9gBKqs65526fMIlK0giivGsqKWjKnhVJzKITJKNEgLX7PLysaqaaU+SZhzn2egUoxkGfXg vPa4eACoDR11JmnWseo2ZVohp+dzFF9ABaa2o+FmwM3Q6CEjUnt4nox8PY+nlIH8fUcQK9xkcWikPu UCln4d8tvjXaiWo+bBVMBTdljcvms/A== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=1wC2H0fjTO3DY0a+2GROUANMyTkiFDLBaaxbHlHRf44=; b=cqXuLDDQIDTUeTSEGgAoJgFf5oDyWY8v1PopdxiyiaRGxLrtubuCRLNPxior++CoHMQ2OJjfJvx/i IhnpBZuYqv7AmVlyIBQfuvI2YpKMFq97vs6yxUOFKRYfIbV2xxLiRS6QtAguUaFYavGC3DARHuItdl vXD3U11bFC+vHRCQqm7voCnnJZqbtpTTUreAduuM0gwyks2m6syU1WYxcUo0JtFXPVSzJ2Lzzlotv0 vqbl7Hyfy4lfBJE+CUIG7VsEcA+fKybOT7N9gSN+aKrWn7vr3WMvZiUPbHIP4XldzLmTZP+ShpG6o5 w7MB4unh+3e2hABBzsxQ8UpZLeV49nA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 851979c5-9b0c-11ea-b10c-b5956a7dd1a1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 851979c5-9b0c-11ea-b10c-b5956a7dd1a1; Thu, 21 May 2020 02:41:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04L2f5K5012589; Wed, 20 May 2020 20:41:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <761b75a4ad0a4630bce26aad1b03137ac45509fd.camel@freebsd.org> Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys From: Ian Lepore To: Wei Hu , Enji Cooper , Shawn Webb Cc: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Wed, 20 May 2020 20:41:05 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49SDQH16hVz4CT4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 02:41:12 -0000 On Thu, 2020-05-21 at 01:53 +0000, Wei Hu wrote: > > -----Original Message----- > > From: Enji Cooper > > Sent: Wednesday, May 20, 2020 11:58 PM > > To: Shawn Webb > > Cc: Wei Hu ; src-committers@freebsd.org; svn-src- > > all@freebsd.org; svn-src-head@freebsd.org > > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > > modules/hyperv/hvsock sys > > > > > > > On May 20, 2020, at 08:54, Enji Cooper wrote: > > > > > > > > On May 20, 2020, at 08:11, Shawn Webb > > > > wrote: > > > > > > > > > > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > > > > Author: whu > > > > > Date: Wed May 20 11:03:59 2020 > > > > > New Revision: 361275 > > > > > URL: > > > > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > > > > > > > > > nweb.freebsd.org%2Fchangeset%2Fbase%2F361275&data=02%7C01%7C > > weh% > > > > > > > > > 40microsoft.com%7Cd6ff3617bffa43d10a7708d7fcd68470%7C72f988bf86f141 > > a > > > > > > > > > f91ab2d7cd011db47%7C1%7C0%7C637255870581110888&sdata=mzz6R > > ILCVBk > > > > > q06RI1PAfVNKWZO2y7jBO0C1E%2F%2FEJwUY%3D&reserved=0 > > > > > > > > > > Log: > > > > > HyperV socket implementation for FreeBSD > > > > > > > > > > This change adds Hyper-V socket feature in FreeBSD. New socket > > > > > address family AF_HYPERV and its kernel support are added. > > > > > > Hi Wei, > > > Could you please further describe what this feature is/does? > > > > I realize after looking at the review that it contains the content I was hoping > > for. It would have been helpful to folks if this context had been included in the > > commit message. > > Hi Enji, > > I thought I just keep it simple for the commit log message while people can > refer to the review site for details. Sorry about that. Let me know if there is > anyway to make up for it. > > Wei > Ten years from now, phabricator may just be a fading memory, but the source code repo lives forever. Usually when I put something in phab for review, the description I enter in phab is exactly the text I intend to use when committing the change. That helps the people doing the review... the description is an overview of what is being changed, and most importantly, why it is being changed (fixes a bug, adds a new feature, better performance, etc). Everything you say there to help reviewers will be equally helpful in the repo history when someone needs to research some day why a change got made. -- Ian From owner-svn-src-head@freebsd.org Thu May 21 03:33:22 2020 Return-Path: Delivered-To: svn-src-head@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 1E4882FF2B4; Thu, 21 May 2020 03:33:22 +0000 (UTC) (envelope-from jhibbits@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SFZT727xz4GXD; Thu, 21 May 2020 03:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC03626C78; Thu, 21 May 2020 03:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L3XLrp023938; Thu, 21 May 2020 03:33:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3XKSK023931; Thu, 21 May 2020 03:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005210333.04L3XKSK023931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 21 May 2020 03:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361317 - in head/sys/powerpc: aim include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 361317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 03:33:22 -0000 Author: jhibbits Date: Thu May 21 03:33:20 2020 New Revision: 361317 URL: https://svnweb.freebsd.org/changeset/base/361317 Log: powerpc: Handle machine checks caused by D-ERAT multihit Instead of crashing the user process when a D-ERAT multihit is detected, try to flush the ERAT, and continue. This machine check indicates a likely PMAP invalidation shortcoming that will need to be addressed, but it's recoverable, so just recover. The recovery is pmap-specific to flush the ERAT, so add a pmap function to do so, currently only implemented by the POWER9 radix pmap. Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/aim_machdep.c Thu May 21 03:33:20 2020 (r361317) @@ -539,6 +539,10 @@ cpu_machine_check(struct thread *td, struct trapframe /* SLB multi-hit is recoverable. */ if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) return (0); + if ((frame->cpu.aim.dsisr & DSISR_MC_DERAT_MULTIHIT) != 0) { + pmap_tlbie_all(); + return (0); + } /* TODO: Add other machine check recovery procedures. */ } else { if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/mmu_radix.c Thu May 21 03:33:20 2020 (r361317) @@ -482,6 +482,7 @@ static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_ void **va); static void mmu_radix_scan_init(mmu_t mmu); static void mmu_radix_cpu_bootstrap(mmu_t, int ap); +static void mmu_radix_tlbie_all(mmu_t); static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), @@ -543,6 +544,8 @@ static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), + + MMUMETHOD(mmu_tlbie_all, mmu_radix_tlbie_all), { 0, 0 } }; @@ -772,6 +775,13 @@ mmu_radix_tlbiel_flush(int scope) tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); +} + +static void +mmu_radix_tlbie_all(mmu_t __unused mmu) +{ + /* TODO: LPID invalidate */ + mmu_radix_tlbiel_flush(TLB_INVAL_SCOPE_GLOBAL); } static void Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/include/pmap.h Thu May 21 03:33:20 2020 (r361317) @@ -341,6 +341,7 @@ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); void pmap_page_print_mappings(vm_page_t m); +void pmap_tlbie_all(void); static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/mmu_if.m Thu May 21 03:33:20 2020 (r361317) @@ -1100,3 +1100,11 @@ METHOD boolean_t ps_enabled { mmu_t _mmu; pmap_t _pmap; } DEFAULT mmu_null_ps_enabled; + + +/** + * @brief Flush the TLB (used by machine check handler). + */ +METHOD void tlbie_all { + mmu_t _mmu; +}; Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 21 03:33:20 2020 (r361317) @@ -631,6 +631,13 @@ pmap_ps_enabled(pmap_t pmap) return (MMU_PS_ENABLED(mmu_obj, pmap)); } +void +pmap_tlbie_all(void) +{ + CTR1(KTR_PMAP, "%s()", __func__); + return (MMU_TLBIE_ALL(mmu_obj)); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. From owner-svn-src-head@freebsd.org Thu May 21 03:50:57 2020 Return-Path: Delivered-To: svn-src-head@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 14E0F2FF8A7; Thu, 21 May 2020 03:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SFym6sbPz4H17; Thu, 21 May 2020 03:50:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6DC9270B1; Thu, 21 May 2020 03:50:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L3ouJX031526; Thu, 21 May 2020 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3ouOR031524; Thu, 21 May 2020 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210350.04L3ouOR031524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 03:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361318 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 03:50:57 -0000 Author: kevans Date: Thu May 21 03:50:56 2020 New Revision: 361318 URL: https://svnweb.freebsd.org/changeset/base/361318 Log: ls: fix a --color regression from r337956 The regression is in-fact that I flipped the default from never to auto. The incorrect impression was based on an alias that I failed to notice, installed by the Linux distribution that I used for testing compatibility here. Users that want the old default should be doing so with a shell alias as is done elsewhere, rather than making this decision in ls(1). Many thanks to rgrimes for pointing out the alias that I clearly overlooked that resulted in this; if you despised colors in your terminal from this, consider buying him a beer at the next venue that you see him at. MFC after: 1 week Relnotes: yes Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu May 21 03:33:20 2020 (r361317) +++ head/bin/ls/ls.1 Thu May 21 03:50:56 2020 (r361318) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 18, 2018 +.Dd May 20, 2020 .Dt LS 1 .Os .Sh NAME @@ -216,8 +216,8 @@ Output colored escape sequences based on .Ar when , which may be set to either .Cm always , -.Cm auto -(default), or +.Cm auto , +or .Cm never . .Pp .Cm always @@ -252,6 +252,12 @@ environment variable is set and not empty. .Pp .Cm never will disable color regardless of environment variables. +.Cm never +is the default when neither +.Fl -color +nor +.Fl G +is specified. .Pp For compatibility with GNU coreutils, .Nm Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 03:33:20 2020 (r361317) +++ head/bin/ls/ls.c Thu May 21 03:50:56 2020 (r361318) @@ -152,7 +152,7 @@ static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ #ifdef COLORLS - int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ + int colorflag = COLORFLAG_NEVER; /* passed in colorflag */ int f_color; /* add type in color for non-regular files */ bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ char *ansi_bgcol; /* ANSI sequence to set background colour */ From owner-svn-src-head@freebsd.org Thu May 21 03:53:46 2020 Return-Path: Delivered-To: svn-src-head@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 64EF22FFB21; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SG2220YTz4HY2; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F4812713A; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L3rk7L036381; Thu, 21 May 2020 03:53:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3rkE7036380; Thu, 21 May 2020 03:53:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210353.04L3rkE7036380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 03:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361319 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 03:53:46 -0000 Author: adrian Date: Thu May 21 03:53:45 2020 New Revision: 361319 URL: https://svnweb.freebsd.org/changeset/base/361319 Log: [ath_rate_sample] Obey the maximum frame length even when using static rates. I wasn't enforcing the maximum packet length when using static rates so although the driver was enforcing it itself OK, the statistics were sometimes going into the wrong bin. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:50:56 2020 (r361318) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:53:45 2020 (r361319) @@ -165,6 +165,11 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = { * MCS rate in the transmit schedule. * * Returns -1 if it's a legacy rate or no MRR. + * + * XXX TODO: this needs to be limited by the RTS/CTS AR5416 8KB bug limit! + * (by checking rts/cts flags and applying sc_rts_aggr_limit) + * + * XXX TODO: apply per-node max-ampdu size and driver ampdu size limits too. */ static int ath_rate_sample_find_min_pktlength(struct ath_softc *sc, @@ -693,6 +698,17 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod if (sn->static_rix != -1) { rix = sn->static_rix; *try0 = ATH_TXMAXTRY; + + /* + * Ensure we limit max packet length here too! + */ + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, + sn->static_rix, + is_aggr); + if (max_pkt_len > 0) { + *maxpktlen = frameLen = MIN(frameLen, max_pkt_len); + size_bin = size_to_bin(frameLen); + } goto done; } From owner-svn-src-head@freebsd.org Thu May 21 04:26:21 2020 Return-Path: Delivered-To: svn-src-head@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 5A8813287AC; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SGld1pFQz4K9D; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 390B627361; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L4QLMp055188; Thu, 21 May 2020 04:26:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L4QLhU055187; Thu, 21 May 2020 04:26:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210426.04L4QLhU055187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 04:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361320 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 361320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 04:26:21 -0000 Author: adrian Date: Thu May 21 04:26:20 2020 New Revision: 361320 URL: https://svnweb.freebsd.org/changeset/base/361320 Log: [ath] reset hardware if this particular mac bug is seen. I have to dig into why I'm seeing it on chips as late as the AR9380 era stuff (as it's marked as an AR5416 bug, but who knows!) but i'm seeing aggregate TX frames complete with no blockack bit set. So, everything should be treated as a failure and do a hardware reset for good measure. Tested: * AR9380, STA mode * AR9580 (5GHz), AP mode Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu May 21 03:53:45 2020 (r361319) +++ head/sys/dev/ath/if_ath_tx.c Thu May 21 04:26:20 2020 (r361320) @@ -5011,7 +5011,11 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); - /* XXX TODO: schedule an interface reset */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_fataltask); + /* And as we can't really trust the BA here .. */ + ba[0] = 0; + ba[1] = 0; + seq_st = 0; #ifdef ATH_DEBUG ath_printtxbuf(sc, bf_first, sc->sc_ac2q[atid->ac]->axq_qnum, 0, 0); From owner-svn-src-head@freebsd.org Thu May 21 04:35:13 2020 Return-Path: Delivered-To: svn-src-head@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 08900328B99; Thu, 21 May 2020 04:35:13 +0000 (UTC) (envelope-from adrian@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SGxr6DbHz4KQv; Thu, 21 May 2020 04:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D08E027859; Thu, 21 May 2020 04:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L4ZCHZ061230; Thu, 21 May 2020 04:35:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L4ZCvc061228; Thu, 21 May 2020 04:35:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210435.04L4ZCvc061228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 04:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361321 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 361321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 04:35:13 -0000 Author: adrian Date: Thu May 21 04:35:12 2020 New Revision: 361321 URL: https://svnweb.freebsd.org/changeset/base/361321 Log: [ath] Hopefully recover better-er upon RX restart on AR9380. This is all very long-standing bug stuff that is touchy and still poorly documented. Ok, here goes. The basic bug: * deleting a VAP causes the RX path (and TX path too) to be restarted without a full chip reset, which causes RX hangs on the AR9380 and later. (ie, the ones with the newer DMA engine.) The basic fix: * do an RX flush when stopping RX in ath_vap_delete() to match what happens when RX is stopped elsewhere. This ensures any pending frames are completed and we restart at the right spot; it also ensures we don't push new RX buffers into the hardware if we're stopping receive. The other issues I found: * Don't bother checking the RX packet ring in the deferred read taskqueue; that's specifically supposed to be for completing frames rather than just yanking them off the receive ring. * Cancel/drain any pending deferred read taskqueue. This isn't done inside any locks so we should be super careful here. This stops the hardware being reprogrammed at the same time in another thread/CPU whilst we're stopping RX. * .. (yes, this should be better serialised, but that's for another day. maybe.) * Add more debugging to trace what's going on here. And the fun bit: * Reinitialise the RX FIFO ONLY if we've been reset or stopped, rather than just reset. I noticed that after all the above was done I was STILL seeing RXEOL. RXEOL isn't enabled on the AR9380 so I'd only see it if I was sending TX frames (ie a ping where it'd be transmitted but never received) so I was not being spammed by RXEOL. So, as long as stuff is stopped, restart it. This seems to be doing the right thing in both AP and STA modes. What I should do next, if I ever get time: * as I said above, serialise the receive stop/start to include taskqueues * monitor RXEOL on the AR9380 and I keep seeing it spammed / lockups, just go do a full chip reset to get things back on track. It sucks, but it is better than nothing. Tested: * AR9380 AP/STA mode, adding/deleting a hostap VAP to trigger the TX/RX queue stop/start; whilst also running an iperf through it. Lots of times. Lots. Of.. Times. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu May 21 04:26:20 2020 (r361320) +++ head/sys/dev/ath/if_ath.c Thu May 21 04:35:12 2020 (r361321) @@ -1801,6 +1801,7 @@ ath_vap_delete(struct ieee80211vap *vap) ath_hal_intrset(ah, 0); /* disable interrupts */ /* XXX Do all frames from all vaps/nodes need draining here? */ ath_stoprecv(sc, 1); /* stop recv side */ + ath_rx_flush(sc); ath_draintxq(sc, ATH_RESET_DEFAULT); /* stop hw xmit side */ } Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:26:20 2020 (r361320) +++ head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:35:12 2020 (r361321) @@ -162,6 +162,9 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called, dodelay=%d\n", + __func__, dodelay); + ATH_RX_LOCK(sc); ath_hal_stoppcurecv(ah); @@ -191,6 +194,8 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; } ATH_RX_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -205,6 +210,8 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU struct ath_buf *bf; int i, j; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called\n", __func__); + ATH_RX_LOCK_ASSERT(sc); i = re->m_fifo_head; @@ -227,6 +234,7 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU i, re->m_fifo_tail); } + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -237,6 +245,10 @@ ath_edma_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: called; resetted=%d, stopped=%d\n", __func__, + sc->sc_rx_resetted, sc->sc_rx_stopped); + ATH_RX_LOCK(sc); /* @@ -252,7 +264,7 @@ ath_edma_startrecv(struct ath_softc *sc) /* * In theory the hardware has been initialised, right? */ - if (sc->sc_rx_resetted == 1) { + if (sc->sc_rx_resetted == 1 || sc->sc_rx_stopped == 1) { DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Re-initing HP FIFO\n", __func__); ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_HP); @@ -262,8 +274,11 @@ ath_edma_startrecv(struct ath_softc *sc) sc->sc_rx_resetted = 0; } else { device_printf(sc->sc_dev, - "%s: called without resetting chip?\n", - __func__); + "%s: called without resetting chip? " + "resetted=%d, stopped=%d\n", + __func__, + sc->sc_rx_resetted, + sc->sc_rx_stopped); } /* Add up to m_fifolen entries in each queue */ @@ -290,6 +305,7 @@ ath_edma_startrecv(struct ath_softc *sc) sc->sc_rx_stopped = 0; ATH_RX_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: ready\n", __func__); return (0); } @@ -298,6 +314,8 @@ static void ath_edma_recv_sched_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype, int dosched) { + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; qtype=%d, dosched=%d\n", + __func__, qtype, dosched); ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); @@ -309,13 +327,19 @@ ath_edma_recv_sched_queue(struct ath_softc *sc, HAL_RX ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + /* XXX TODO: methodize */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } static void ath_edma_recv_sched(struct ath_softc *sc, int dosched) { + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; dosched=%d\n", + __func__, dosched); + ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -327,19 +351,27 @@ ath_edma_recv_sched(struct ath_softc *sc, int dosched) ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + /* XXX TODO: methodize */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } static void ath_edma_recv_flush(struct ath_softc *sc) { - DPRINTF(sc, ATH_DEBUG_RECV, "%s: called\n", __func__); + DPRINTF(sc, ATH_DEBUG_RECV | ATH_DEBUG_EDMA_RX, "%s: called\n", __func__); ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt++; ATH_PCU_UNLOCK(sc); + // XXX TODO: methodize; make it an RX stop/block + while (taskqueue_cancel(sc->sc_tq, &sc->sc_rxtask, NULL) != 0) { + taskqueue_drain(sc->sc_tq, &sc->sc_rxtask); + } + ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -368,6 +400,8 @@ ath_edma_recv_flush(struct ath_softc *sc) ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt--; ATH_PCU_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_RECV | ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -391,6 +425,8 @@ ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_ nf = ath_hal_getchannoise(ah, sc->sc_curchan); sc->sc_stats.ast_rx_noise = nf; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; qtype=%d, dosched=%d\n", __func__, qtype, dosched); + ATH_RX_LOCK(sc); #if 1 @@ -608,9 +644,6 @@ ath_edma_recv_tasklet(void *arg, int npending) ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 1); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 1); - ath_edma_recv_proc_deferred_queue(sc, HAL_RX_QUEUE_HP, 1); ath_edma_recv_proc_deferred_queue(sc, HAL_RX_QUEUE_LP, 1); @@ -632,6 +665,8 @@ ath_edma_recv_tasklet(void *arg, int npending) ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt--; ATH_PCU_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; done!\n", __func__); } /* From owner-svn-src-head@freebsd.org Thu May 21 05:34:02 2020 Return-Path: Delivered-To: svn-src-head@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 BD0F7329F53; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SJFk4dl7z4QFv; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A0A38355; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L5Y2l2001035; Thu, 21 May 2020 05:34:02 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L5Y2VB001034; Thu, 21 May 2020 05:34:02 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202005210534.04L5Y2VB001034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 21 May 2020 05:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361324 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 05:34:02 -0000 Author: dougm Date: Thu May 21 05:34:02 2020 New Revision: 361324 URL: https://svnweb.freebsd.org/changeset/base/361324 Log: For the case when RB_REMOVE requires a nontrivial search to find the node to replace the one being removed, restructure to first remove the replacement node and correct the parent pointers around it, and then let the all-cases code at the end deal with the parent of the deleted node, making it point to the replacement node. This removes one or two conditional branches. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D24845 Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Thu May 21 05:02:58 2020 (r361323) +++ head/sys/sys/tree.h Thu May 21 05:34:02 2020 (r361324) @@ -562,48 +562,44 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ - struct type *child, *parent, *old = elm; \ + struct type *child, *parent, *parent_old, *old = elm; \ int color; \ - if (RB_LEFT(elm, field) == NULL) \ - child = RB_RIGHT(elm, field); \ - else if (RB_RIGHT(elm, field) == NULL) \ - child = RB_LEFT(elm, field); \ - else { \ + parent_old = parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (RB_LEFT(elm, field) == NULL) { \ + elm = child = RB_RIGHT(elm, field); \ + if (elm != NULL) \ + RB_PARENT(elm, field) = parent; \ + } else if (RB_RIGHT(elm, field) == NULL) { \ + elm = child = RB_LEFT(elm, field); \ + RB_PARENT(elm, field) = parent; \ + } else { \ elm = RB_RIGHT(old, field); \ if ((child = RB_LEFT(elm, field)) == NULL) { \ child = RB_RIGHT(elm, field); \ RB_RIGHT(old, field) = child; \ - RB_PARENT(elm, field) = elm; \ + parent = elm; \ } else { \ do \ elm = child; \ while ((child = RB_LEFT(elm, field)) != NULL); \ child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + RB_LEFT(parent, field) = child; \ + if (child != NULL) \ + RB_PARENT(child, field) = parent; \ RB_PARENT(RB_RIGHT(old, field), field) = elm; \ } \ RB_PARENT(RB_LEFT(old, field), field) = elm; \ - parent = RB_PARENT(old, field); \ - if (parent != NULL) { \ - if (RB_LEFT(parent, field) == old) \ - RB_LEFT(parent, field) = elm; \ - else \ - RB_RIGHT(parent, field) = elm; \ - } else \ - RB_ROOT(head) = elm; \ + color = RB_COLOR(elm, field); \ + elm->field = old->field; \ } \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child != NULL) \ - RB_PARENT(child, field) = parent; \ - if (parent != NULL) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - } else \ - RB_ROOT(head) = child; \ - if (elm != old) \ - (elm)->field = (old)->field; \ + if (parent_old == NULL) \ + RB_ROOT(head) = elm; \ + else if (RB_LEFT(parent_old, field) == old) \ + RB_LEFT(parent_old, field) = elm; \ + else \ + RB_RIGHT(parent_old, field) = elm; \ if (color == RB_BLACK) \ name##_RB_REMOVE_COLOR(head, parent, child); \ while (parent != NULL) { \ From owner-svn-src-head@freebsd.org Thu May 21 06:17:55 2020 Return-Path: Delivered-To: svn-src-head@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 7262532A932; Thu, 21 May 2020 06:17:55 +0000 (UTC) (envelope-from jmg@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SKDM2Pp0z4S7w; Thu, 21 May 2020 06:17:55 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D8D09074; Thu, 21 May 2020 06:17:55 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L6HtO1025601; Thu, 21 May 2020 06:17:55 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L6Ht8S025600; Thu, 21 May 2020 06:17:55 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202005210617.04L6Ht8S025600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 21 May 2020 06:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361325 - head/sys/arm/xilinx X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/arm/xilinx X-SVN-Commit-Revision: 361325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 06:17:55 -0000 Author: jmg Date: Thu May 21 06:17:54 2020 New Revision: 361325 URL: https://svnweb.freebsd.org/changeset/base/361325 Log: minor cleanup of white space, and function name in panic... This is a partial commit of the review. Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D23319 Reviewed by: andrew Modified: head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Thu May 21 05:34:02 2020 (r361324) +++ head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:17:54 2020 (r361325) @@ -58,7 +58,7 @@ zynq7_mp_setmaxid(platform_t plat) mp_ncpus = 2; } -void +void zynq7_mp_start_ap(platform_t plat) { bus_space_handle_t scu_handle; @@ -67,8 +67,8 @@ zynq7_mp_start_ap(platform_t plat) /* Map in SCU control register. */ if (bus_space_map(fdtbus_bs_tag, SCU_CONTROL_REG, 4, - 0, &scu_handle) != 0) - panic("platform_mp_start_ap: Couldn't map SCU config reg\n"); + 0, &scu_handle) != 0) + panic("%s: Could not map SCU control reg.\n", __func__); /* Set SCU enable bit. */ scu_ctrl = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0); @@ -80,7 +80,7 @@ zynq7_mp_start_ap(platform_t plat) /* Map in magic location to give entry address to CPU1. */ if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4, 0, &ocm_handle) != 0) - panic("platform_mp_start_ap: Couldn't map OCM\n"); + panic("%s: Could not map OCM\n", __func__); /* Write start address for CPU1. */ bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0, From owner-svn-src-head@freebsd.org Thu May 21 06:40:51 2020 Return-Path: Delivered-To: svn-src-head@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 BB68132B1E5; Thu, 21 May 2020 06:40:51 +0000 (UTC) (envelope-from jmg@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SKkq4xbqz4SvF; Thu, 21 May 2020 06:40:51 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C798D70; Thu, 21 May 2020 06:40:51 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L6epTN038750; Thu, 21 May 2020 06:40:51 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L6epG6038748; Thu, 21 May 2020 06:40:51 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202005210640.04L6epG6038748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 21 May 2020 06:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361326 - head/sys/arm/xilinx X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/arm/xilinx X-SVN-Commit-Revision: 361326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 06:40:51 -0000 Author: jmg Date: Thu May 21 06:40:51 2020 New Revision: 361326 URL: https://svnweb.freebsd.org/changeset/base/361326 Log: Bring in support for single core Zynq devices. Turns out that real hardware, the registers appear like there's two cores, but the second core does not work, so base the number of cores upon the chip id. Tested on a XC7Z007S. also, previous commit was suppose to be D14429. Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D14429 Modified: head/sys/arm/xilinx/zy7_mp.c head/sys/arm/xilinx/zy7_slcr.h Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:17:54 2020 (r361325) +++ head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:40:51 2020 (r361326) @@ -44,18 +44,59 @@ __FBSDID("$FreeBSD$"); #include #include +#include -#define ZYNQ7_CPU1_ENTRY 0xfffffff0 +#define ZYNQ7_CPU1_ENTRY 0xfffffff0 -#define SCU_CONTROL_REG 0xf8f00000 -#define SCU_CONTROL_ENABLE (1 << 0) +#define SCU_CONTROL_REG 0xf8f00000 +#define SCU_CONTROL_ENABLE 1 +#define SCU_CONFIG_REG 0xf8f00004 +#define SCU_CONFIG_N_CPUS_MASK 3 +#define SLCR_PSS_IDCODE 0xf8000530 + void zynq7_mp_setmaxid(platform_t plat) { + bus_space_handle_t slcr_handle; + int device_id; + bus_space_handle_t scu_handle; - mp_maxid = 1; - mp_ncpus = 2; + if (mp_ncpus != 0) + return; + + /* Map in SLCR PSS_IDCODE register. */ + if (bus_space_map(fdtbus_bs_tag, SLCR_PSS_IDCODE, 4, 0, + &slcr_handle) != 0) + panic("%s: Could not map SLCR IDCODE reg.\n", __func__); + + device_id = bus_space_read_4(fdtbus_bs_tag, slcr_handle, 0) & + ZY7_SLCR_PSS_IDCODE_DEVICE_MASK; + + bus_space_unmap(fdtbus_bs_tag, slcr_handle, 4); + + /* + * Zynq XC7z0xxS single core chips indicate incorrect number of CPUs in + * SCU configuration register. + */ + if (device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z007S || + device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z012S || + device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z014S) { + mp_maxid = 0; + mp_ncpus = 1; + return; + } + + /* Map in SCU config register. */ + if (bus_space_map(fdtbus_bs_tag, SCU_CONFIG_REG, 4, 0, + &scu_handle) != 0) + panic("zynq7_mp_setmaxid: Could not map SCU config reg.\n"); + + mp_maxid = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0) & + SCU_CONFIG_N_CPUS_MASK; + mp_ncpus = mp_maxid + 1; + + bus_space_unmap(fdtbus_bs_tag, scu_handle, 4); } void Modified: head/sys/arm/xilinx/zy7_slcr.h ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.h Thu May 21 06:17:54 2020 (r361325) +++ head/sys/arm/xilinx/zy7_slcr.h Thu May 21 06:40:51 2020 (r361326) @@ -53,91 +53,91 @@ #define ZY7_SLCR_ARM_PLL_CTRL 0x0100 #define ZY7_SLCR_DDR_PLL_CTRL 0x0104 #define ZY7_SLCR_IO_PLL_CTRL 0x0108 -#define ZY7_SLCR_PLL_CTRL_RESET (1<<0) -#define ZY7_SLCR_PLL_CTRL_PWRDWN (1<<1) -#define ZY7_SLCR_PLL_CTRL_BYPASS_QUAL (1<<3) -#define ZY7_SLCR_PLL_CTRL_BYPASS_FORCE (1<<4) +#define ZY7_SLCR_PLL_CTRL_RESET (1 << 0) +#define ZY7_SLCR_PLL_CTRL_PWRDWN (1 << 1) +#define ZY7_SLCR_PLL_CTRL_BYPASS_QUAL (1 << 3) +#define ZY7_SLCR_PLL_CTRL_BYPASS_FORCE (1 << 4) #define ZY7_SLCR_PLL_CTRL_FDIV_SHIFT 12 -#define ZY7_SLCR_PLL_CTRL_FDIV_MASK (0x7f<<12) +#define ZY7_SLCR_PLL_CTRL_FDIV_MASK (0x7f << 12) #define ZY7_SLCR_PLL_STATUS 0x010c -#define ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK (1<<0) -#define ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK (1<<1) -#define ZY7_SLCR_PLL_STAT_IO_PLL_LOCK (1<<2) -#define ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1<<3) -#define ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1<<4) -#define ZY7_SLCR_PLL_STAT_IO_PLL_STABLE (1<<5) +#define ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK (1 << 0) +#define ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK (1 << 1) +#define ZY7_SLCR_PLL_STAT_IO_PLL_LOCK (1 << 2) +#define ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1 << 3) +#define ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1 << 4) +#define ZY7_SLCR_PLL_STAT_IO_PLL_STABLE (1 << 5) #define ZY7_SLCR_ARM_PLL_CFG 0x0110 #define ZY7_SLCR_DDR_PLL_CFG 0x0114 #define ZY7_SLCR_IO_PLL_CFG 0x0118 #define ZY7_SLCR_PLL_CFG_RES_SHIFT 4 -#define ZY7_SLCR_PLL_CFG_RES_MASK (0xf<<4) +#define ZY7_SLCR_PLL_CFG_RES_MASK (0xf << 4) #define ZY7_SLCR_PLL_CFG_PLL_CP_SHIFT 8 -#define ZY7_SLCR_PLL_CFG_PLL_CP_MASK (0xf<<8) +#define ZY7_SLCR_PLL_CFG_PLL_CP_MASK (0xf << 8) #define ZY7_SLCR_PLL_CFG_LOCK_CNT_SHIFT 12 -#define ZY7_SLCR_PLL_CFG_LOCK_CNT_MASK (0x3ff<<12) +#define ZY7_SLCR_PLL_CFG_LOCK_CNT_MASK (0x3ff << 12) /* Clock controls. */ #define ZY7_SLCR_ARM_CLK_CTRL 0x0120 -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_PERI_CLKACT (1<<28) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_1XCLKACT (1<<27) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_2XCLKACT (1<<26) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_3OR2XCLKACT (1<<25) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_6OR4XCLKACT (1<<24) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_MASK (3<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_ARM_PLL (0<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_DDR_PLL (2<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_IO_PLL (3<<4) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_PERI_CLKACT (1 << 28) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_1XCLKACT (1 << 27) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_2XCLKACT (1 << 26) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_3OR2XCLKACT (1 << 25) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_6OR4XCLKACT (1 << 24) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_MASK (3 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_ARM_PLL (0 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_DDR_PLL (2 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_IO_PLL (3 << 4) #define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_SHIFT 8 -#define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_MASK (0x3f<<8) +#define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_MASK (0x3f << 8) #define ZY7_SLCR_DDR_CLK_CTRL 0x0124 -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_SHIFT 26 -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_MASK (0x3f<<26) +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_SHIFT 26 +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_MASK (0x3f << 26) #define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_SHIFT 20 -#define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_MASK (0x3f<<20) -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLKACT (1<<1) -#define ZY7_SLCR_DDR_CLK_CTRL_3XCLKACT (1<<0) +#define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_MASK (0x3f << 20) +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLKACT (1 << 1) +#define ZY7_SLCR_DDR_CLK_CTRL_3XCLKACT (1 << 0) #define ZY7_SLCR_DCI_CLK_CTRL 0x0128 #define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_SHIFT 20 -#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_MASK (0x3f<<20) +#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) #define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_SHIFT 8 -#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_MASK (0x3f<<8) -#define ZY7_SLCR_DCI_CLK_CTRL_CLKACT (1<<0) +#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) +#define ZY7_SLCR_DCI_CLK_CTRL_CLKACT (1 << 0) #define ZY7_SLCR_APER_CLK_CTRL 0x012c /* amba periph clk ctrl */ -#define ZY7_SLCR_APER_CLK_CTRL_SMC_CPU_1XCLKACT (1<<24) -#define ZY7_SLCR_APER_CLK_CTRL_LQSPI_CPU_1XCLKACT (1<<23) -#define ZY7_SLCR_APER_CLK_CTRL_GPIO_CPU_1XCLKACT (1<<22) -#define ZY7_SLCR_APER_CLK_CTRL_UART1_CPU_1XCLKACT (1<<21) -#define ZY7_SLCR_APER_CLK_CTRL_UART0_CPU_1XCLKACT (1<<20) -#define ZY7_SLCR_APER_CLK_CTRL_I2C1_CPU_1XCLKACT (1<<19) -#define ZY7_SLCR_APER_CLK_CTRL_I2C0_CPU_1XCLKACT (1<<18) -#define ZY7_SLCR_APER_CLK_CTRL_CAN1_CPU_1XCLKACT (1<<17) -#define ZY7_SLCR_APER_CLK_CTRL_CAN0_CPU_1XCLKACT (1<<16) -#define ZY7_SLCR_APER_CLK_CTRL_SPI1_CPU_1XCLKACT (1<<15) -#define ZY7_SLCR_APER_CLK_CTRL_SPI0_CPU_1XCLKACT (1<<14) -#define ZY7_SLCR_APER_CLK_CTRL_SDI1_CPU_1XCLKACT (1<<11) -#define ZY7_SLCR_APER_CLK_CTRL_SDI0_CPU_1XCLKACT (1<<10) -#define ZY7_SLCR_APER_CLK_CTRL_GEM1_CPU_1XCLKACT (1<<7) -#define ZY7_SLCR_APER_CLK_CTRL_GEM0_CPU_1XCLKACT (1<<6) -#define ZY7_SLCR_APER_CLK_CTRL_USB1_CPU_1XCLKACT (1<<3) -#define ZY7_SLCR_APER_CLK_CTRL_USB0_CPU_1XCLKACT (1<<2) -#define ZY7_SLCR_APER_CLK_CTRL_DMA_CPU_1XCLKACT (1<<0) +#define ZY7_SLCR_APER_CLK_CTRL_SMC_CPU_1XCLKACT (1 << 24) +#define ZY7_SLCR_APER_CLK_CTRL_LQSPI_CPU_1XCLKACT (1 << 23) +#define ZY7_SLCR_APER_CLK_CTRL_GPIO_CPU_1XCLKACT (1 << 22) +#define ZY7_SLCR_APER_CLK_CTRL_UART1_CPU_1XCLKACT (1 << 21) +#define ZY7_SLCR_APER_CLK_CTRL_UART0_CPU_1XCLKACT (1 << 20) +#define ZY7_SLCR_APER_CLK_CTRL_I2C1_CPU_1XCLKACT (1 << 19) +#define ZY7_SLCR_APER_CLK_CTRL_I2C0_CPU_1XCLKACT (1 << 18) +#define ZY7_SLCR_APER_CLK_CTRL_CAN1_CPU_1XCLKACT (1 << 17) +#define ZY7_SLCR_APER_CLK_CTRL_CAN0_CPU_1XCLKACT (1 << 16) +#define ZY7_SLCR_APER_CLK_CTRL_SPI1_CPU_1XCLKACT (1 << 15) +#define ZY7_SLCR_APER_CLK_CTRL_SPI0_CPU_1XCLKACT (1 << 14) +#define ZY7_SLCR_APER_CLK_CTRL_SDI1_CPU_1XCLKACT (1 << 11) +#define ZY7_SLCR_APER_CLK_CTRL_SDI0_CPU_1XCLKACT (1 << 10) +#define ZY7_SLCR_APER_CLK_CTRL_GEM1_CPU_1XCLKACT (1 << 7) +#define ZY7_SLCR_APER_CLK_CTRL_GEM0_CPU_1XCLKACT (1 << 6) +#define ZY7_SLCR_APER_CLK_CTRL_USB1_CPU_1XCLKACT (1 << 3) +#define ZY7_SLCR_APER_CLK_CTRL_USB0_CPU_1XCLKACT (1 << 2) +#define ZY7_SLCR_APER_CLK_CTRL_DMA_CPU_1XCLKACT (1 << 0) #define ZY7_SLCR_USB0_CLK_CTRL 0x0130 #define ZY7_SLCR_USB1_CLK_CTRL 0x0134 #define ZY7_SLCR_GEM0_RCLK_CTRL 0x0138 #define ZY7_SLCR_GEM1_RCLK_CTRL 0x013c #define ZY7_SLCR_GEM0_CLK_CTRL 0x0140 #define ZY7_SLCR_GEM1_CLK_CTRL 0x0144 -#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MASK (0x3f<<20) +#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_SHIFT 20 #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MAX 0x3f -#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MASK (0x3f<<8) +#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MASK (0x3f << 8) #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_SHIFT 8 #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MAX 0x3f -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_MASK (7<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_IO_PLL (0<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_ARM_PLL (2<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_DDR_PLL (3<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_EMIO_CLK (4<<4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_MASK (7 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_IO_PLL (0 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_ARM_PLL (2 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_DDR_PLL (3 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_EMIO_CLK (4 << 4) #define ZY7_SLCR_GEM_CLK_CTRL_CLKACT 1 #define ZY7_SLCR_SMC_CLK_CTRL 0x0148 #define ZY7_SLCR_LQSPI_CLK_CTRL 0x014c @@ -149,24 +149,24 @@ #define ZY7_SLCR_DBG_CLK_CTRL 0x0164 #define ZY7_SLCR_PCAP_CLK_CTRL 0x0168 #define ZY7_SLCR_TOPSW_CLK_CTRL 0x016c /* central intercnn clk ctrl */ -#define ZY7_SLCR_FPGA_CLK_CTRL(unit) (0x0170 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT 20 -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT 8 -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX 0x3f -#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT 4 -#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK (3 << 4) -#define ZY7_SLCR_FPGA_THR_CTRL(unit) (0x0174 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_THR_CTRL_CNT_RST (1 << 1) -#define ZY7_SLCR_FPGA_THR_CTRL_CPU_START (1 << 0) -#define ZY7_SLCR_FPGA_THR_CNT(unit) (0x0178 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_THR_STA(unit) (0x017c + 0x10*(unit)) +#define ZY7_SLCR_FPGA_CLK_CTRL(unit) (0x0170 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT 20 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT 8 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX 0x3f +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT 4 +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK (3 << 4) +#define ZY7_SLCR_FPGA_THR_CTRL(unit) (0x0174 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_THR_CTRL_CNT_RST (1 << 1) +#define ZY7_SLCR_FPGA_THR_CTRL_CPU_START (1 << 0) +#define ZY7_SLCR_FPGA_THR_CNT(unit) (0x0178 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_THR_STA(unit) (0x017c + 0x10 * (unit)) #define ZY7_SLCR_CLK_621_TRUE 0x01c4 /* cpu clock ratio mode */ /* Reset controls. */ #define ZY7_SLCR_PSS_RST_CTRL 0x0200 -#define ZY7_SLCR_PSS_RST_CTRL_SOFT_RESET (1<<0) +#define ZY7_SLCR_PSS_RST_CTRL_SOFT_RESET (1 << 0) #define ZY7_SLCR_DDR_RST_CTRL 0x0204 #define ZY7_SLCR_TOPSW_RST_CTRL 0x0208 #define ZY7_SLCR_DMAC_RST_CTRL 0x020c @@ -183,27 +183,27 @@ #define ZY7_SLCR_OCM_RST_CTRL 0x0238 #define ZY7_SLCR_DEVCI_RST_CTRL 0x023c #define ZY7_SLCR_FPGA_RST_CTRL 0x0240 -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA3_OUT_RST (1<<3) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA2_OUT_RST (1<<2) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA1_OUT_RST (1<<1) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA0_OUT_RST (1<<0) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA3_OUT_RST (1 << 3) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA2_OUT_RST (1 << 2) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA1_OUT_RST (1 << 1) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA0_OUT_RST (1 << 0) #define ZY7_SLCR_FPGA_RST_CTRL_RST_ALL 0xf #define ZY7_SLCR_A9_CPU_RST_CTRL 0x0244 #define ZY7_SLCR_RS_AWDT_CTRL 0x024c #define ZY7_SLCR_REBOOT_STAT 0x0258 -#define ZY7_SLCR_REBOOT_STAT_STATE_MASK (0xff<<24) -#define ZY7_SLCR_REBOOT_STAT_POR (1<<22) -#define ZY7_SLCR_REBOOT_STAT_SRST_B (1<<21) -#define ZY7_SLCR_REBOOT_STAT_DBG_RST (1<<20) -#define ZY7_SLCR_REBOOT_STAT_SLC_RST (1<<19) -#define ZY7_SLCR_REBOOT_STAT_AWDT1_RST (1<<18) -#define ZY7_SLCR_REBOOT_STAT_AWDT0_RST (1<<17) -#define ZY7_SLCR_REBOOT_STAT_SWDT_RST (1<<16) -#define ZY7_SLCR_REBOOT_STAT_BOOTROM_ERR_CODE_MASK (0xffff) +#define ZY7_SLCR_REBOOT_STAT_STATE_MASK (0xffU << 24) +#define ZY7_SLCR_REBOOT_STAT_POR (1 << 22) +#define ZY7_SLCR_REBOOT_STAT_SRST_B (1 << 21) +#define ZY7_SLCR_REBOOT_STAT_DBG_RST (1 << 20) +#define ZY7_SLCR_REBOOT_STAT_SLC_RST (1 << 19) +#define ZY7_SLCR_REBOOT_STAT_AWDT1_RST (1 << 18) +#define ZY7_SLCR_REBOOT_STAT_AWDT0_RST (1 << 17) +#define ZY7_SLCR_REBOOT_STAT_SWDT_RST (1 << 16) +#define ZY7_SLCR_REBOOT_STAT_BOOTROM_ERR_CODE_MASK (0xffff) #define ZY7_SLCR_BOOT_MODE 0x025c -#define ZY7_SLCR_BOOT_MODE_PLL_BYPASS (1<<4) -#define ZY7_SLCR_BOOT_MODE_JTAG_INDEP (1<<3) +#define ZY7_SLCR_BOOT_MODE_PLL_BYPASS (1 << 4) +#define ZY7_SLCR_BOOT_MODE_JTAG_INDEP (1 << 3) #define ZY7_SLCR_BOOT_MODE_BOOTDEV_MASK 7 #define ZY7_SLCR_BOOT_MODE_BOOTDEV_JTAG 0 #define ZY7_SLCR_BOOT_MODE_BOOTDEV_QUAD_SPI 1 @@ -214,15 +214,24 @@ #define ZY7_SLCR_WDT_CLK_SEL 0x0304 #define ZY7_SLCR_PSS_IDCODE 0x0530 -#define ZY7_SLCR_PSS_IDCODE_REVISION_MASK (0xf<<28) +#define ZY7_SLCR_PSS_IDCODE_REVISION_MASK (0xfU << 28) #define ZY7_SLCR_PSS_IDCODE_REVISION_SHIFT 28 -#define ZY7_SLCR_PSS_IDCODE_FAMILY_MASK (0x7f<<21) +#define ZY7_SLCR_PSS_IDCODE_FAMILY_MASK (0x7f << 21) #define ZY7_SLCR_PSS_IDCODE_FAMILY_SHIFT 21 -#define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_MASK (0xf<<17) +#define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_MASK (0xf << 17) #define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_SHIFT 17 -#define ZY7_SLCR_PSS_IDCODE_DEVICE_MASK (0x1f<<12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_MASK (0x1f << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z007S (0x03 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z010 (0x02 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z012S (0x1c << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z014S (0x08 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z015 (0x1b << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z020 (0x07 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z030 (0x0c << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z045 (0x11 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z100 (0x16 << 12) #define ZY7_SLCR_PSS_IDCODE_DEVICE_SHIFT 12 -#define ZY7_SLCR_PSS_IDCODE_MNFR_ID_MASK (0x7ff<<1) +#define ZY7_SLCR_PSS_IDCODE_MNFR_ID_MASK (0x7ff << 1) #define ZY7_SLCR_PSS_IDCODE_MNFR_ID_SHIFT 1 #define ZY7_SLCR_DDR_URGENT 0x0600 @@ -233,29 +242,29 @@ #define ZY7_SLCR_DDR_DFI_STATUS 0x0620 /* MIO Pin controls */ -#define ZY7_SLCR_MIO_PIN(n) (0x0700+(n)*4) /* 0-53 */ -#define ZY7_SLCR_MIO_PIN_RCVR_DIS (1<<13) -#define ZY7_SLCR_MIO_PIN_PULLUP_EN (1<<12) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_MASK (7<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVTTL (0<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS18 (1<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS25 (2<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS33 (3<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_HSTL (4<<9) -#define ZY7_SLCR_MIO_PIN_L2_SEL_MASK (3<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_L3_MUX (0<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_SRAM_NOR_CS0 (1<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_NAND_CS (2<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_SDIO0_PC (3<<3) -#define ZY7_SLCR_MIO_PIN_L1_SEL (1<<2) -#define ZY7_SLCR_MIO_PIN_L0_SEL (1<<1) -#define ZY7_SLCR_MIO_PIN_TRI_EN (1<<0) +#define ZY7_SLCR_MIO_PIN(n) (0x0700 + (n) * 4) /* 0-53 */ +#define ZY7_SLCR_MIO_PIN_RCVR_DIS (1 << 13) +#define ZY7_SLCR_MIO_PIN_PULLUP_EN (1 << 12) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_MASK (7 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVTTL (0 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS18 (1 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS25 (2 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS33 (3 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_HSTL (4 << 9) +#define ZY7_SLCR_MIO_PIN_L2_SEL_MASK (3 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_L3_MUX (0 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_SRAM_NOR_CS0 (1 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_NAND_CS (2 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_SDIO0_PC (3 << 3) +#define ZY7_SLCR_MIO_PIN_L1_SEL (1 << 2) +#define ZY7_SLCR_MIO_PIN_L0_SEL (1 << 1) +#define ZY7_SLCR_MIO_PIN_TRI_EN (1 << 0) #define ZY7_SLCR_MIO_LOOPBACK 0x0804 -#define ZY7_SLCR_MIO_LOOPBACK_I2C0_I2C1 (1<<3) -#define ZY7_SLCR_MIO_LOOPBACK_CAN0_CAN1 (1<<2) -#define ZY7_SLCR_MIO_LOOPBACK_UA0_UA1 (1<<1) -#define ZY7_SLCR_MIO_LOOPBACK_SPI0_SPI1 (1<<0) +#define ZY7_SLCR_MIO_LOOPBACK_I2C0_I2C1 (1 << 3) +#define ZY7_SLCR_MIO_LOOPBACK_CAN0_CAN1 (1 << 2) +#define ZY7_SLCR_MIO_LOOPBACK_UA0_UA1 (1 << 1) +#define ZY7_SLCR_MIO_LOOPBACK_SPI0_SPI1 (1 << 0) #define ZY7_SLCR_MIO_MST_TRI0 0x080c #define ZY7_SLCR_MIO_MST_TRI1 0x0810 #define ZY7_SLCR_SD0_WP_CD_SEL 0x0830 @@ -263,10 +272,10 @@ /* PS-PL level shifter control. */ #define ZY7_SLCR_LVL_SHFTR_EN 0x900 -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_0 (1<<3) /* PL to PS */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_0 (1<<2) /* PS to PL */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_1 (1<<1) /* PL to PS */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_1 (1<<0) /* PS to PL */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_0 (1 << 3) /* PL to PS */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_0 (1 << 2) /* PS to PL */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_1 (1 << 1) /* PL to PS */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_1 (1 << 0) /* PS to PL */ #define ZY7_SLCR_LVL_SHFTR_EN_ALL 0xf #define ZY7_SLCR_OCM_CFG 0x0910 @@ -289,7 +298,7 @@ #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_ADDR 0x0b5c #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_DATA 0x0b60 #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_DIFF 0x0b64 -#define ZY7_SLCR_DDRIOB_DRIVE_SLEW_CLK 0x0b68 +#define ZY7_SLCR_DDRIOB_DRIVE_SLEW_CLK 0x0b68 #define ZY7_SLCR_DDRIOB_DDR_CTRL 0x0b6c #define ZY7_SLCR_DDRIOB_DCI_CTRL 0x0b70 #define ZY7_SLCR_DDRIOB_DCI_STATUS 0x0b74 @@ -300,7 +309,7 @@ extern void zy7_slcr_postload_pl(int en_level_shifters extern int cgem_set_ref_clk(int unit, int frequency); /* Should be consistent with SRCSEL field of FPGAx_CLK_CTRL */ -#define ZY7_PL_FCLK_SRC_IO 0 +#define ZY7_PL_FCLK_SRC_IO 0 #define ZY7_PL_FCLK_SRC_IO_ALT 1 /* ZY7_PL_FCLK_SRC_IO is b0x */ #define ZY7_PL_FCLK_SRC_ARM 2 #define ZY7_PL_FCLK_SRC_DDR 3 From owner-svn-src-head@freebsd.org Thu May 21 12:24:25 2020 Return-Path: Delivered-To: svn-src-head@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 D04342CDB4A; Thu, 21 May 2020 12:24:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49STMF0Wm3z4thX; Thu, 21 May 2020 12:24:24 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (ip-5-186-118-155.cgn.fibianet.dk [5.186.118.155]) by relay05.pair.com (Postfix) with ESMTP id DD3A71A23AA; Thu, 21 May 2020 08:24:23 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 04LCOMfe065684 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 14:24:22 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 04LCOM6C065683; Thu, 21 May 2020 14:24:22 +0200 (CEST) (envelope-from pho) Date: Thu, 21 May 2020 14:24:22 +0200 From: Peter Holm To: Wei Hu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200521122422.GA65523@x8.osted.lan> References: <202005201103.04KB3xTp013965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Rspamd-Queue-Id: 49STMF0Wm3z4thX X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pho@holm.cc has no SPF policy when checking 216.92.24.67) smtp.mailfrom=pho@holm.cc X-Spamd-Result: default: False [-0.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.57)[-0.567]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.50)[-0.498]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.06)[-0.058]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[pho@freebsd.org,pho@holm.cc]; RCVD_IN_DNSWL_LOW(-0.10)[216.92.24.67:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[pho@freebsd.org,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[5.186.118.155:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 12:24:25 -0000 On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 > > Log: > HyperV socket implementation for FreeBSD > > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > Found this with a syscall fuzz test: panic: page fault cpuid = 2 time = 1590050529 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe033d21d530 vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 panic() at panic+0x43/frame 0xfffffe033d21d5e0 trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 --- trap 0xc, rip = 0xffffffff80bcd3ba, rsp = 0xfffffe033d21d880, rbp = 0xfffffe033d21d910 --- _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 closef() at closef+0x1db/frame 0xfffffe033d21da90 closefp() at closefp+0x96/frame 0xfffffe033d21dad0 amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe033d21dbf0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 0x7fffffffe328, rbp = 0x7fffffffe460 --- https://people.freebsd.org/~pho/stress/log/setsockopt2-2.txt Could this be yours? - Peter From owner-svn-src-head@freebsd.org Thu May 21 12:59:46 2020 Return-Path: Delivered-To: svn-src-head@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 947FF2CF006; Thu, 21 May 2020 12:59:46 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49SV816b3Jz3SBJ; Thu, 21 May 2020 12:59:45 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04LCxhph016513; Thu, 21 May 2020 05:59:43 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04LCxh0C016512; Thu, 21 May 2020 05:59:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361318 - head/bin/ls In-Reply-To: <202005210350.04L3ouOR031524@repo.freebsd.org> To: Kyle Evans Date: Thu, 21 May 2020 05:59:43 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49SV816b3Jz3SBJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 12:59:46 -0000 > Author: kevans > Date: Thu May 21 03:50:56 2020 > New Revision: 361318 > URL: https://svnweb.freebsd.org/changeset/base/361318 > > Log: > ls: fix a --color regression from r337956 > > The regression is in-fact that I flipped the default from never to auto. The > incorrect impression was based on an alias that I failed to notice, > installed by the Linux distribution that I used for testing compatibility > here. Users that want the old default should be doing so with a shell alias > as is done elsewhere, rather than making this decision in ls(1). > > Many thanks to rgrimes for pointing out the alias that I clearly overlooked > that resulted in this; if you despised colors in your terminal from this, > consider buying him a beer at the next venue that you see him at. Thanks Kyle, but this is likely to get me more rocks than beers :-) > > MFC after: 1 week > Relnotes: yes > > Modified: > head/bin/ls/ls.1 > head/bin/ls/ls.c > > Modified: head/bin/ls/ls.1 > ============================================================================== > --- head/bin/ls/ls.1 Thu May 21 03:33:20 2020 (r361317) > +++ head/bin/ls/ls.1 Thu May 21 03:50:56 2020 (r361318) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd August 18, 2018 > +.Dd May 20, 2020 > .Dt LS 1 > .Os > .Sh NAME > @@ -216,8 +216,8 @@ Output colored escape sequences based on > .Ar when , > which may be set to either > .Cm always , > -.Cm auto > -(default), or > +.Cm auto , > +or > .Cm never . > .Pp > .Cm always > @@ -252,6 +252,12 @@ environment variable is set and not empty. > .Pp > .Cm never > will disable color regardless of environment variables. > +.Cm never > +is the default when neither > +.Fl -color > +nor > +.Fl G > +is specified. > .Pp > For compatibility with GNU coreutils, > .Nm > > Modified: head/bin/ls/ls.c > ============================================================================== > --- head/bin/ls/ls.c Thu May 21 03:33:20 2020 (r361317) > +++ head/bin/ls/ls.c Thu May 21 03:50:56 2020 (r361318) > @@ -152,7 +152,7 @@ static int f_timesort; /* sort by time vice name */ > int f_type; /* add type character for non-regular files */ > static int f_whiteout; /* show whiteout entries */ > #ifdef COLORLS > - int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ > + int colorflag = COLORFLAG_NEVER; /* passed in colorflag */ > int f_color; /* add type in color for non-regular files */ > bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ > char *ansi_bgcol; /* ANSI sequence to set background colour */ > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu May 21 13:01:25 2020 Return-Path: Delivered-To: svn-src-head@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 6FDD32CEDFB; Thu, 21 May 2020 13:01:25 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on0718.outbound.protection.outlook.com [IPv6:2a01:111:f400:febd::718]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SV9w5LFNz3Sbf; Thu, 21 May 2020 13:01:24 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2XL207ig6As3puYOhP2jmDBLF1N+WG8yi+GPf/tJDdF05X4A/oh3jf9jMTekAz6Sg73CM18J1bz8feO+LF1KQSROf8LPlzgSrj2urnPOHkR+nWzWKSeqW7wN7ZNQXK1HsooMpSyLSoCf2yXV646W2hfZBe/CoJeDDz9doQeq+HhsZJcq88QQET+KBr5gHkzL+NNIA5v/cbwZ7BUmdjrmF6WENjV8sE6oqIeLk+TbcuNH3BdYECk08XaKyfFhFLuU9y1tIAoBwn+UiVCKcmnZ1wYGrKDO7ZjRUfUC7TliQbgK45nCPBtZsp20UKSi9xiJg34w1Ctk6AXpqC7wNLlPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KI0v1sWm4JR1QHEBzZwAPuIy0lI0aj5iJOQ2nVSlhEY=; b=DIvlH0wLDQrTAct1Co2WZDMN2Fy0rIdzXJiyFyf7xZciSYcnKmZsGdTxExjLxh9YyXv2iNfR3VIf6UMETMHF6crf4ek7h2uPkj1uX6NVtDKb8HmgvRdgxn+W7jMVGKZ9MJLftkPbxnCO3Rbpwji8iZWxk6kFTV9MsgO3ZAdLXrhShj+qwSsb/sbl5JOCgNFtZMH0e4hkULiXr1Prr8lEWoJaPSQriEJUeMwN9MVt8MW7hyAjFtf9SGJmVplpqBlwQKHBKWbWSdUjltBWY82//VIRUM2yFPS8nep5FJb09SMuepEOJ+yIcmh5gY++LBrfzXDeJ0RlaD5/rUSCH/O/PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0255.APCP153.PROD.OUTLOOK.COM (2603:1096:4:ae::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.7; Thu, 21 May 2020 13:01:19 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 13:01:19 +0000 From: Wei Hu To: Peter Holm , Wei Hu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qiyeFYAgAAJc+A= Date: Thu, 21 May 2020 13:01:18 +0000 Message-ID: References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200521122422.GA65523@x8.osted.lan> In-Reply-To: <20200521122422.GA65523@x8.osted.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T13:01:17Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=9a22f5a9-5911-4d80-9d5f-05d7c2283187; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c6041649-9aaf-44f4-c52e-08d7fd870dfc x-ms-traffictypediagnostic: SG2P153MB0255: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:277; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YRsPjxi17o6umhxzl6JRYLSfs+d5PptaB/kCrlSIMoeIdo2dP+hkpQaVrxW5MwhK+nvPFjaoQOOFcoj9+x1EkmQqw+f7ajVgCxuA/jtCQNkARZulxyW1A8Hd7K7GQ1vLPvCyw+jWYOFdK8jb0j04AIQpY62KNCM1dmcGq1eC0GpGiSfhIMbi6tpG0KchrD5KBqG5Jx2f0S7u4f+iXh4AMk8TJvHyFVYlvgVY9Pi8MUA8AKmes5vAzsijPs4SFe2pFtc6oC5/giXskQYlCGy9RH+bDZWIak3KhRiNHyeNQzHAd6QWu06JyhWKy7bnNnAc49q/gL29EB0cUDcUSSK6OH7B9LXGfjQZivNx+nXrpl2yeO6i/sTArIBEo40h5zOXiUUhSRBPOpMRwmJ3qm2XY+YJNVpvInfiwBpHS7EcuoZEP3dAA+ZliDBSr6f21AipLkehGhsg+mqqbaN3E15b6QJSJT9+V/bnjO3qsWvqXQEnhvMXwF6wGKj504r1+xI3 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(86362001)(2906002)(71200400001)(83080400001)(450100002)(4326008)(82950400001)(82960400001)(66446008)(66556008)(66476007)(66946007)(64756008)(53546011)(6506007)(478600001)(33656002)(966005)(110136005)(52536014)(8936002)(76116006)(8676002)(5660300002)(316002)(54906003)(7696005)(9686003)(10290500003)(8990500004)(186003)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: j1S+IsB3WK3t5VKs+Oij3zzUfMwdbO+8jSN0jTAMP7npbcqtrwLoZ0zp8Zk5ZBPCwYIgV//I3WUn5ngTJKcQItQPBbREND8W6LtHxJUkL05hEr4ig0mKRRSkPegNXK1+C+OjTDxjgBVIdMsVafNcyqbA9KNzeOGRhbbLdCalMZ87PUiQPGw31FN2f3frYEBUBTrXHXGWwqAJuPwiBwBtiMS1FqX7hsdB8JrkgkL+rdTfWIvxEgSLq1mjQEEICOvZ4SgIdQoqCh1XKJY4JD+RRtOHBuMOGqp1rEtB7+mQrxBEKFrllnYbJwBKd07xZZRNXN8UbkDymPp5/F3jgczbK1wOiWShNx1v1nYArFb9R27e5/4ChysTKDWP5ISbjzXNubgurO0/wJrs6973R6Wg0GAC3ITW9BnTLotzU55cCCxlBmOF20IX0qOinHBzAMCUY8w0Iu+TraWo+nuDtHduLhCU37Gd/c2fK6TV9xmHoM8FLQ9J0rJxxWawYj1/M/Pk/K7imep5ZcCmVt1oYOSuog== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6041649-9aaf-44f4-c52e-08d7fd870dfc X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 13:01:18.8208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cUbauwh9UXqGv4UNmvD1jR2B1NPREphk8nTcMsuCNmbjfyX5POeNIJJVeeu9LPwzcmeBilhSlxokYBRkEkCvmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0255 X-Rspamd-Queue-Id: 49SV9w5LFNz3Sbf X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:01:25 -0000 > -----Original Message----- > From: Peter Holm > Sent: Thursday, May 21, 2020 8:24 PM > To: Wei Hu > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys >=20 > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fsvnwe= b > .freebsd.org%2Fchangeset%2Fbase%2F361275&data=3D02%7C01%7Cweh% > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14 > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658&sdata=3Dmw > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3D&reserved=3D0 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket addres= s > > family AF_HYPERV and its kernel support are added. > > >=20 > Found this with a syscall fuzz test: >=20 > panic: page fault > cpuid =3D 2 > time =3D 1590050529 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe033d21d530 > vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 > panic() at panic+0x43/frame 0xfffffe033d21d5e0 > trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 > trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 > trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 > calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 > --- trap 0xc, rip =3D 0xffffffff80bcd3ba, rsp =3D 0xfffffe033d21d880, rbp= =3D > 0xfffffe033d21d910 --- > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 > _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 > soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 > _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 > closef() at closef+0x1db/frame 0xfffffe033d21da90 > closefp() at closefp+0x96/frame 0xfffffe033d21dad0 > amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 > fast_syscall_common() at fast_syscall_common+0x101/frame > 0xfffffe033d21dbf0 > --- syscall (6, FreeBSD ELF64, sys_close), rip =3D 0x8004283ca, rsp =3D 0= x7fffffffe328, > rbp =3D 0x7fffffffe460 --- >=20 > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps:%2F%2Fpeople.= free > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2- > 2.txt&data=3D02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 > 7256606689750658&sdata=3DRuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk > RZl260KSIw%3D&reserved=3D0 >=20 > Could this be yours? Yes. Looks the lock was not initialized. The lock only gets initialized whe= n it is running on HyperV. This type of socket only works on HyperV.=20 How to reproduce it? Was it on HyperV? I am not sure how it can enter this = state. Wei From owner-svn-src-head@freebsd.org Thu May 21 13:02:21 2020 Return-Path: Delivered-To: svn-src-head@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 23DF72CF380; Thu, 21 May 2020 13:02:21 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SVC061f3z3StQ; Thu, 21 May 2020 13:02:20 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qv1-f66.google.com with SMTP id z5so3009730qvw.4; Thu, 21 May 2020 06:02:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OjMwOs/Lvs1aikdqR/RwTzkREBYkgubMU4hxEdaoVGc=; b=oST/RD4RhoUIHxhvU23ns/EMyVsvF0jmwE24VCL6E18MI0B9zKEni3jt1/M0DD53it eNSBJR5YjM17qKZ/f4DyhH/s5k/XC0q18xfBF7VNR1AL9S6MIeldcK5PYeuD4gyoXhfk y7e0OjT8Y0Rl2eho84hJdEFNOtRW2ydUd54WA2LMZJNl6SZQ7wA1VaPRblumCEpZsTva I3Yx3eC3dGuEFgzh3MZsnDvGNWc79rcmdiDVl/LSheWL+160m7avQudTxWkO8ZPHZuM7 6bgadtkZNF1yzKYVblp+zdQR1Cr+KGy4zu49QBMDg9PRbPkYxrw8aqJu0booEPw6gulT oSmA== X-Gm-Message-State: AOAM530fLs6jNUot/Fsp1helumlPg45oe4tmP8TN3hLJtod+7svMGBxA DZ0Ikt9snpkUr7uYTCZ3h+4J+OTXYb4ugSK0gfKh+F2Q X-Google-Smtp-Source: ABdhPJwEbyC1XV22YmR21smLm/wF/WCncyR+bgE09wWWWrdVEkhqGFNlBD5XlXHCjyUwSk4OmOv1Ghe6xsLJZef0qZI= X-Received: by 2002:ad4:58cb:: with SMTP id dh11mr5857329qvb.211.1590066139393; Thu, 21 May 2020 06:02:19 -0700 (PDT) MIME-Version: 1.0 References: <202005202208.04KM8QPA020707@repo.freebsd.org> In-Reply-To: <202005202208.04KM8QPA020707@repo.freebsd.org> From: Antoine Brodin Date: Thu, 21 May 2020 15:02:07 +0200 Message-ID: Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49SVC061f3z3StQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:02:21 -0000 On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > Author: kib > Date: Wed May 20 22:08:26 2020 > New Revision: 361303 > URL: https://svnweb.freebsd.org/changeset/base/361303 > > Log: > Change the samantic of struct link_map l_addr member. > > It previously returned the object map base address, while all other > ELF operating systems return load offset, i.e. the difference between > map base and the link base. > > Explain the meaning of the field in the man page. > > Stop filling the mips-only l_offs member, which is apparently unused. > > PR: 246561 > Requested by: Damjan Jovanovic > Reviewed by: emaste, jhb, cem (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D24918 > > Modified: > head/lib/libc/gen/dlinfo.3 > head/libexec/rtld-elf/rtld.c > head/sys/sys/link_elf.h Hi, After this commit, some ports fail to build with signal 11. For instance lang/perl5.30 fails to build with default options (DTRACE on) Disabling the DTRACE option makes it able to build again. Cheers, Antoine From owner-svn-src-head@freebsd.org Thu May 21 13:22:20 2020 Return-Path: Delivered-To: svn-src-head@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 6795F2CF951; Thu, 21 May 2020 13:22:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SVf425Vkz3Tpk; Thu, 21 May 2020 13:22:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3DD6219184; Thu, 21 May 2020 13:22:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f175.google.com with SMTP id 190so7191651qki.1; Thu, 21 May 2020 06:22:20 -0700 (PDT) X-Gm-Message-State: AOAM533L+q3akYZH8Hm3AktGLTYBVsIDRSvomesUt8MasgJbIOJ2uUKn RkOg5L4Xy3Dfj7yiAeclcOm2lV1zXf4gGh0H/UI= X-Google-Smtp-Source: ABdhPJwPNlOz8DvXWrAubV9uWBalHosO8xx70hqb4oCgaVHzKhEgqVLMNV5wj85z1FNAMVQfrODDR2Ko09SPT9Wp6MQ= X-Received: by 2002:a37:9f44:: with SMTP id i65mr4153785qke.103.1590067339676; Thu, 21 May 2020 06:22:19 -0700 (PDT) MIME-Version: 1.0 References: <202005210350.04L3ouOR031524@repo.freebsd.org> <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> In-Reply-To: <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> From: Kyle Evans Date: Thu, 21 May 2020 08:22:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361318 - head/bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:22:20 -0000 On Thu, May 21, 2020 at 7:59 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Thu May 21 03:50:56 2020 > > New Revision: 361318 > > URL: https://svnweb.freebsd.org/changeset/base/361318 > > > > Log: > > ls: fix a --color regression from r337956 > > > > The regression is in-fact that I flipped the default from never to auto. The > > incorrect impression was based on an alias that I failed to notice, > > installed by the Linux distribution that I used for testing compatibility > > here. Users that want the old default should be doing so with a shell alias > > as is done elsewhere, rather than making this decision in ls(1). > > > > Many thanks to rgrimes for pointing out the alias that I clearly overlooked > > that resulted in this; if you despised colors in your terminal from this, > > consider buying him a beer at the next venue that you see him at. > > Thanks Kyle, but this is likely to get me more rocks than beers :-) > FWIW- I received a not-insignificant number of valid complaints about the original default change because default color schemes are hard, and continued to receive an insignificant number of complaints as recent as a couple months ago (~2 years after the change?). This is considerably more flack than I expect to receive from other controversial proposals I've made and it was based on a fundamental misunderstanding of coreutils. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu May 21 13:39:27 2020 Return-Path: Delivered-To: svn-src-head@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 745C92D854F; Thu, 21 May 2020 13:39:27 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49SW1p3hdjz3VhP; Thu, 21 May 2020 13:39:26 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (ip-5-186-118-155.cgn.fibianet.dk [5.186.118.155]) by relay05.pair.com (Postfix) with ESMTP id F17BF1A2D63; Thu, 21 May 2020 09:39:24 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 04LDdOLr066570 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 15:39:24 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 04LDdO7Q066569; Thu, 21 May 2020 15:39:24 +0200 (CEST) (envelope-from pho) Date: Thu, 21 May 2020 15:39:24 +0200 From: Peter Holm To: Wei Hu Cc: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200521133924.GA66412@x8.osted.lan> References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200521122422.GA65523@x8.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49SW1p3hdjz3VhP X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pho@holm.cc has no SPF policy when checking 216.92.24.67) smtp.mailfrom=pho@holm.cc X-Spamd-Result: default: False [1.09 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.66)[-0.658]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.68)[0.680]; NEURAL_HAM_LONG(-0.03)[-0.033]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[pho@freebsd.org,pho@holm.cc]; RCVD_IN_DNSWL_LOW(-0.10)[216.92.24.67:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[pho@freebsd.org,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[5.186.118.155:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:39:27 -0000 On Thu, May 21, 2020 at 01:01:18PM +0000, Wei Hu wrote: > > -----Original Message----- > > From: Peter Holm > > Sent: Thursday, May 21, 2020 8:24 PM > > To: Wei Hu > > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > > head@freebsd.org > > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > > modules/hyperv/hvsock sys > > > > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > > Author: whu > > > Date: Wed May 20 11:03:59 2020 > > > New Revision: 361275 > > > URL: > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvnweb > > .freebsd.org%2Fchangeset%2Fbase%2F361275&data=02%7C01%7Cweh% > > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14 > > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658&sdata=mw > > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3D&reserved=0 > > > > > > Log: > > > HyperV socket implementation for FreeBSD > > > > > > This change adds Hyper-V socket feature in FreeBSD. New socket address > > > family AF_HYPERV and its kernel support are added. > > > > > > > Found this with a syscall fuzz test: > > > > panic: page fault > > cpuid = 2 > > time = 1590050529 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe033d21d530 > > vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 > > panic() at panic+0x43/frame 0xfffffe033d21d5e0 > > trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 > > trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 > > trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 > > calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 > > --- trap 0xc, rip = 0xffffffff80bcd3ba, rsp = 0xfffffe033d21d880, rbp = > > 0xfffffe033d21d910 --- > > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 > > _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 > > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 > > soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 > > _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 > > closef() at closef+0x1db/frame 0xfffffe033d21da90 > > closefp() at closefp+0x96/frame 0xfffffe033d21dad0 > > amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 > > fast_syscall_common() at fast_syscall_common+0x101/frame > > 0xfffffe033d21dbf0 > > --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 0x7fffffffe328, > > rbp = 0x7fffffffe460 --- > > > > https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Fpeople.free > > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2- > > 2.txt&data=02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c > > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 > > 7256606689750658&sdata=RuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk > > RZl260KSIw%3D&reserved=0 > > > > Could this be yours? > > > Yes. Looks the lock was not initialized. The lock only gets initialized when it is running > on HyperV. This type of socket only works on HyperV. > > How to reproduce it? Was it on HyperV? I am not sure how it can enter this state. > > Wei The test is syscall() fuzzing, which typically flushes out missing parameter validations. This was *not* run on HyperV. You can find the test case here: https://svnweb.freebsd.org/base/user/pho/stress2/misc/setsockopt2.sh - Peter From owner-svn-src-head@freebsd.org Thu May 21 13:42:01 2020 Return-Path: Delivered-To: svn-src-head@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 600082D87AD; Thu, 21 May 2020 13:42:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49SW4m5bzYz3Wdg; Thu, 21 May 2020 13:42:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LDfrIp076844 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 16:41:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LDfrIp076844 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LDfr8Z076843; Thu, 21 May 2020 16:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 16:41:52 +0300 From: Konstantin Belousov To: Antoine Brodin Cc: jhb@freebsd.org, markj@freebsd.org, src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521134152.GE64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49SW4m5bzYz3Wdg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:42:01 -0000 On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Wed May 20 22:08:26 2020 > > New Revision: 361303 > > URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > Log: > > Change the samantic of struct link_map l_addr member. > > > > It previously returned the object map base address, while all other > > ELF operating systems return load offset, i.e. the difference between > > map base and the link base. > > > > Explain the meaning of the field in the man page. > > > > Stop filling the mips-only l_offs member, which is apparently unused. > > > > PR: 246561 > > Requested by: Damjan Jovanovic > > Reviewed by: emaste, jhb, cem (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D24918 > > > > Modified: > > head/lib/libc/gen/dlinfo.3 > > head/libexec/rtld-elf/rtld.c > > head/sys/sys/link_elf.h > > Hi, > > After this commit, some ports fail to build with signal 11. > For instance lang/perl5.30 fails to build with default options (DTRACE on) > Disabling the DTRACE option makes it able to build again. > I see, thank you for reporting. So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes that l_addr is the base, not relocbase. Mark, was dofhp_addr initialization changed comparing to Solaris ? From owner-svn-src-head@freebsd.org Thu May 21 13:46:31 2020 Return-Path: Delivered-To: svn-src-head@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 701F42D8A58; Thu, 21 May 2020 13:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SW9z2LlKz3Wnv; Thu, 21 May 2020 13:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BBF4E1FD; Thu, 21 May 2020 13:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LDkVOj007202; Thu, 21 May 2020 13:46:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LDkVuV007201; Thu, 21 May 2020 13:46:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005211346.04LDkVuV007201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 21 May 2020 13:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361330 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 361330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 13:46:31 -0000 Author: avg Date: Thu May 21 13:46:30 2020 New Revision: 361330 URL: https://svnweb.freebsd.org/changeset/base/361330 Log: libprocstat: fix reading of file descriptor table via kvm This seems to have been broken since r247602 (from year 2013!). Can be easily tested with fstat -N /boot/kernel/kernel -M /var/crash/vmcore.last MFC after: 1 week Sponsored by: Panzura Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu May 21 12:43:34 2020 (r361329) +++ head/lib/libprocstat/libprocstat.c Thu May 21 13:46:30 2020 (r361330) @@ -467,7 +467,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struc vm_map_entry_t entryp; vm_object_t objp; struct vnode *vp; - struct file **ofiles; + struct filedescent *ofiles; struct filestat *entry; struct filestat_list *head; kvm_t *kd; @@ -554,25 +554,25 @@ procstat_getfiles_kvm(struct procstat *procstat, struc } nfiles = filed.fd_lastfile + 1; - ofiles = malloc(nfiles * sizeof(struct file *)); + ofiles = malloc(nfiles * sizeof(struct filedescent)); if (ofiles == NULL) { - warn("malloc(%zu)", nfiles * sizeof(struct file *)); + warn("malloc(%zu)", nfiles * sizeof(struct filedescent)); goto do_mmapped; } if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, - nfiles * sizeof(struct file *))) { + nfiles * sizeof(struct filedescent))) { warnx("cannot read file structures at %p", (void *)filed.fd_ofiles); free(ofiles); goto do_mmapped; } for (i = 0; i <= filed.fd_lastfile; i++) { - if (ofiles[i] == NULL) + if (ofiles[i].fde_file == NULL) continue; - if (!kvm_read_all(kd, (unsigned long)ofiles[i], &file, + if (!kvm_read_all(kd, (unsigned long)ofiles[i].fde_file, &file, sizeof(struct file))) { warnx("can't read file %d at %p", i, - (void *)ofiles[i]); + (void *)ofiles[i].fde_file); continue; } switch (file.f_type) { From owner-svn-src-head@freebsd.org Thu May 21 14:39:01 2020 Return-Path: Delivered-To: svn-src-head@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 70A292DAD32; Thu, 21 May 2020 14:39:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SXLY2LG0z3bDy; Thu, 21 May 2020 14:39:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B766ED36; Thu, 21 May 2020 14:39:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LEd1TK038266; Thu, 21 May 2020 14:39:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LEd0G0038264; Thu, 21 May 2020 14:39:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211439.04LEd0G0038264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 14:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361331 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 14:39:01 -0000 Author: kevans Date: Thu May 21 14:39:00 2020 New Revision: 361331 URL: https://svnweb.freebsd.org/changeset/base/361331 Log: ls(1): actually restore proper behavior Highlights: - CLICOLOR in the environment should imply --color=auto to maintain compatibility with historical behavior - -G should set CLICOLOR and imply --color=auto The manpage has been updated to draw the connection between -G and --color; the former is in-fact a sort of compromise between --color=always and --color=auto, where we'll output color regardless of the environment lacking CLICOLOR/COLORTERM assuming stdout is a tty. X-MFC-With: r361318 Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu May 21 13:46:30 2020 (r361330) +++ head/bin/ls/ls.1 Thu May 21 14:39:00 2020 (r361331) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd May 20, 2020 +.Dd May 21, 2020 .Dt LS 1 .Os .Sh NAME @@ -135,7 +135,8 @@ This option is equivalent to defining .Ev CLICOLOR or .Ev COLORTERM -in the environment. +in the environment and setting +.Fl -color Ns = Ns Ar auto . (See below.) This functionality can be compiled out by removing the definition of .Ev COLORLS . Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 13:46:30 2020 (r361330) +++ head/bin/ls/ls.c Thu May 21 14:39:00 2020 (r361331) @@ -265,6 +265,13 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; + + /* + * For historical compatibility, we'll use our autodetection if CLICOLOR + * is set. + */ + if (getenv("CLICOLOR")) + colorflag = COLORFLAG_AUTO; while ((ch = getopt_long(argc, argv, "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, NULL)) != -1) { @@ -342,7 +349,13 @@ main(int argc, char *argv[]) f_slash = 0; break; case 'G': + /* + * We both set CLICOLOR here and set colorflag to + * COLORFLAG_AUTO, because -G should not force color if + * stdout isn't a tty. + */ setenv("CLICOLOR", "", 1); + colorflag = COLORFLAG_AUTO; break; case 'H': fts_options |= FTS_COMFOLLOW; From owner-svn-src-head@freebsd.org Thu May 21 15:12:56 2020 Return-Path: Delivered-To: svn-src-head@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 8BFEC2DBBDF; Thu, 21 May 2020 15:12:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SY5g6vffz3d3Z; Thu, 21 May 2020 15:12:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id i5so7463050qkl.12; Thu, 21 May 2020 08:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VKCEuJYJ8YkIe1lbAvbVynDVmPPNWye5Fcme50TyaFI=; b=DAmGUb81wBfKzkEh+jhtdlO7F5svt1PbyvvTiSm/TFeoEK1LSxP3D+1stxTXVVGppF cjRBr9aUXpEkuTDRh3ud95psC8t57PtF/PBk29wrq/oBlurWuNO/Tqp+TH/s+QMfSciS KVAEBunK4siNZgchqKH3zufEcJ639UbGpiljeN/xysQXiB6E6MN6gJbKOR6hyIG16b6n vtx+w1ziv7LAdxwgj/dmZUk6bmTFgGC06umpeWzFWK4qNfUp6R8jFyV5bClbFYNdxIGt jMRKp+W3WrkRnfRa4+hgq/W5p+2gsLCY6XOzGf+o81/Qbc+5kbm25Udttrr1ZYwaoe0g UGUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=VKCEuJYJ8YkIe1lbAvbVynDVmPPNWye5Fcme50TyaFI=; b=P34/WFwQWsV4emwdQB2Y0nPopms/Q9tG2VJxycW39GgZDCm/BXqeBeNIW0wzSc1a3H Jnv2pFixEW+/U1DFbyYAQXpU5LvmbYBPeGuSR4r705dSaN4K8tjbZIrOOrs/kIA3WHZp fPkqCnrAThV1cEpqruDfgne0/CC7Ab6L3dVretBe2Vcf2pz8Jqo6Ig2smUXJiJRaVRzk 6MAJ2EtpwWmMQ4Rycn09BKDtmWZZkwdbyuPxJ3VsNtPtgU7CuZz8BCz5fpyKLp5gVhuo yRlySvkGiPRTMr/pQ4e2Q0TgP7OnvzYJbBtwm9EYmggw7Hq7gK+Keq7evB1Y/x64VgQE oHLg== X-Gm-Message-State: AOAM533no2uFsL7M7Qn7BgW7/HPQv7f7jUyAN67HxeD9ehjoV8Ra09tA GNYfZheKjjHOAbhlWoyExoI= X-Google-Smtp-Source: ABdhPJwWNILCxg07NoBurZlGiuZ75NApEQIKJGQyHl+cJiKowiXnSdOAI0IM9FX6kYUlxKeagTllvA== X-Received: by 2002:a05:620a:1455:: with SMTP id i21mr9947083qkl.124.1590073975017; Thu, 21 May 2020 08:12:55 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id i3sm5063665qkf.39.2020.05.21.08.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 08:12:53 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 11:12:48 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Antoine Brodin , jhb@freebsd.org, src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521151248.GA85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521134152.GE64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SY5g6vffz3d3Z X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=DAmGUb81; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-0.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.66)[-0.661]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.41)[-0.406]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.03)[0.029]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::741:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 15:12:56 -0000 On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > > > Author: kib > > > Date: Wed May 20 22:08:26 2020 > > > New Revision: 361303 > > > URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > > > Log: > > > Change the samantic of struct link_map l_addr member. > > > > > > It previously returned the object map base address, while all other > > > ELF operating systems return load offset, i.e. the difference between > > > map base and the link base. > > > > > > Explain the meaning of the field in the man page. > > > > > > Stop filling the mips-only l_offs member, which is apparently unused. > > > > > > PR: 246561 > > > Requested by: Damjan Jovanovic > > > Reviewed by: emaste, jhb, cem (previous version) > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D24918 > > > > > > Modified: > > > head/lib/libc/gen/dlinfo.3 > > > head/libexec/rtld-elf/rtld.c > > > head/sys/sys/link_elf.h > > > > Hi, > > > > After this commit, some ports fail to build with signal 11. > > For instance lang/perl5.30 fails to build with default options (DTRACE on) > > Disabling the DTRACE option makes it able to build again. > > > I see, thank you for reporting. > > So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > that l_addr is the base, not relocbase. > > Mark, was dofhp_addr initialization changed comparing to Solaris ? It appears it has been the same since DTrace was imported. illumos still has similar code. Note that drti.o is linked into any executable and shlib that defines static probes, so the ABI change affects more than just dtrace(1). Would it be possible to define a new value for RTLD_DI_LINKMAP, and preserve the old behaviour for the old value? From owner-svn-src-head@freebsd.org Thu May 21 15:15:51 2020 Return-Path: Delivered-To: svn-src-head@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 1317E2DBA68; Thu, 21 May 2020 15:15:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SY926lcrz3cnj; Thu, 21 May 2020 15:15:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3021F159; Thu, 21 May 2020 15:15:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LFFo88062238; Thu, 21 May 2020 15:15:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFFo3C062237; Thu, 21 May 2020 15:15:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211515.04LFFo3C062237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 15:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361332 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 15:15:51 -0000 Author: kevans Date: Thu May 21 15:15:50 2020 New Revision: 361332 URL: https://svnweb.freebsd.org/changeset/base/361332 Log: ls: fix WITHOUT_LS_COLORS build *sigh* references to colorflags should be gated by COLORLS. Pointy hat to: kevans Reported by: jenkins (rescue build) X-MFC-With: r361318 Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 14:39:00 2020 (r361331) +++ head/bin/ls/ls.c Thu May 21 15:15:50 2020 (r361332) @@ -270,8 +270,10 @@ main(int argc, char *argv[]) * For historical compatibility, we'll use our autodetection if CLICOLOR * is set. */ +#ifdef COLORLS if (getenv("CLICOLOR")) colorflag = COLORFLAG_AUTO; +#endif while ((ch = getopt_long(argc, argv, "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, NULL)) != -1) { @@ -355,7 +357,9 @@ main(int argc, char *argv[]) * stdout isn't a tty. */ setenv("CLICOLOR", "", 1); +#ifdef COLORLS colorflag = COLORFLAG_AUTO; +#endif break; case 'H': fts_options |= FTS_COMFOLLOW; From owner-svn-src-head@freebsd.org Thu May 21 15:53:17 2020 Return-Path: Delivered-To: svn-src-head@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 873BD2DCA14; Thu, 21 May 2020 15:53:17 +0000 (UTC) (envelope-from bdragon@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SZ0F31KXz3gYm; Thu, 21 May 2020 15:53:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B8EFD9C; Thu, 21 May 2020 15:53:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LFrHfG086489; Thu, 21 May 2020 15:53:17 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFrH3m086488; Thu, 21 May 2020 15:53:17 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005211553.04LFrH3m086488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 21 May 2020 15:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361336 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 361336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 15:53:17 -0000 Author: bdragon Date: Thu May 21 15:53:16 2020 New Revision: 361336 URL: https://svnweb.freebsd.org/changeset/base/361336 Log: [PowerPC] Fix kernel boot on powerpc Recent changes have caused the vmspace objects to start coming from KVA instead of direct-mapped memory on powerpc. As far as I can tell, this is not actually a problem, so we should stop arbitrarily asserting that it is. I do not know why this was not being triggered before. Approved by: jhibbits Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu May 21 15:29:03 2020 (r361335) +++ head/sys/powerpc/aim/mmu_oea.c Thu May 21 15:53:16 2020 (r361336) @@ -1703,7 +1703,6 @@ moea_pinit(mmu_t mmu, pmap_t pmap) int i, mask; u_int entropy; - KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("moea_pinit: virt pmap")); RB_INIT(&pmap->pmap_pvo); entropy = 0; From owner-svn-src-head@freebsd.org Thu May 21 16:03:46 2020 Return-Path: Delivered-To: svn-src-head@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 B09E52DD01E; Thu, 21 May 2020 16:03:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SZDL4KqCz3gwK; Thu, 21 May 2020 16:03:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:c7d:9a4b:586:998a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E55E719760; Thu, 21 May 2020 16:03:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Mark Johnston , Konstantin Belousov Cc: Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 21 May 2020 09:03:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200521151248.GA85681@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 16:03:46 -0000 On 5/21/20 8:12 AM, Mark Johnston wrote: > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: >>>> >>>> Author: kib >>>> Date: Wed May 20 22:08:26 2020 >>>> New Revision: 361303 >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 >>>> >>>> Log: >>>> Change the samantic of struct link_map l_addr member. >>>> >>>> It previously returned the object map base address, while all other >>>> ELF operating systems return load offset, i.e. the difference between >>>> map base and the link base. >>>> >>>> Explain the meaning of the field in the man page. >>>> >>>> Stop filling the mips-only l_offs member, which is apparently unused. >>>> >>>> PR: 246561 >>>> Requested by: Damjan Jovanovic >>>> Reviewed by: emaste, jhb, cem (previous version) >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 week >>>> Differential revision: https://reviews.freebsd.org/D24918 >>>> >>>> Modified: >>>> head/lib/libc/gen/dlinfo.3 >>>> head/libexec/rtld-elf/rtld.c >>>> head/sys/sys/link_elf.h >>> >>> Hi, >>> >>> After this commit, some ports fail to build with signal 11. >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) >>> Disabling the DTRACE option makes it able to build again. >>> >> I see, thank you for reporting. >> >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes >> that l_addr is the base, not relocbase. >> >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > It appears it has been the same since DTrace was imported. illumos > still has similar code. > > Note that drti.o is linked into any executable and shlib that defines > static probes, so the ABI change affects more than just dtrace(1). > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > preserve the old behaviour for the old value? I think a bigger question is if Solaris/illumos treat l_addr as mapbase (absolute address) or relocbase (relative address). In the discussion in the phabricator I had assumed that all other OS's treated l_addr as the relative offset (relocbase). Does the code for illumos assume an absolute address or does it assume a relative address in l_addr? -- John Baldwin From owner-svn-src-head@freebsd.org Thu May 21 16:54:54 2020 Return-Path: Delivered-To: svn-src-head@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 946E52DDB55; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbML3Nvfz4194; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id a23so6054693qto.1; Thu, 21 May 2020 09:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=uEQxjRYuSrvbIU03x4pYUAg1OxJ0zEOlwG3E4osMf95JcLqPlmyTeKm7hWKoILzwPJ PR5bJqHH5PqnUV7EdazUaJWjXA2qoXK8KoxX6zpMONhB4n1iVmeUVUGZLWdO5BCIYBjC KNBj/SQZezM+VLnoXlWUoX8hemiHOPGDIh75wWKBmOxPkVQTGHgroK68v2bZkYJqQ8lN yDVRaRb5ti3vRKn7273VQXM5JF5x5aFLhDlRjOJT3Glmmo3lYy5bO3thwsnYl+rKfmv6 aC3vJ9fMSpWa24TJjslr6TC1w57EDuL2rPz9kBFDeePO4fIRl+xZeh8qUXKYMdHhWOPV x5Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=OwNPbNGnqEFlDHyuZ/KfJZUB2Gz0bS2X+VdrBVYp8nMG6Fjy2++KKCbhQbLRIaeZbE Q8trdAR0IMZEZBnCIwBrhIrcNCPOOjvNihd7osJzdSJpUxFmbExgOC2B+45W7Rm0CUtb FlgTUZlOTnfQSXrpL104DmIf4a7fJ4Pjt+Zgo7nbyJ4jskVBhC+qnwnNWyMilWYnS483 14zRgvfwHoOYXfTzkULlVm7CiAJrx5jBbjlJPJmEl1hpu9jRZSTvr92ZHJlu++udNdEz PhwAkKM6Q+NlsvNauCQafWUxeoEZHusnYdWQVcsvVPDQZALQ/ZyyIAJhhEwAeNFfyfhj 9MdA== X-Gm-Message-State: AOAM5305IFdnvbk5ZdVOqvj0K81PqJ28hnsp7jS0qBIbMZuIlZM/9bJ8 e0YXmOz58zESFDjtIO0RgBXYtZ/v X-Google-Smtp-Source: ABdhPJw5OGU9Y86OJx+ZWOQ46C/ajZJDGxC4pDlaeWQv6hoNSrvEs9haOVxscaO9CgycjN68JDM9sA== X-Received: by 2002:aed:3fe8:: with SMTP id w37mr11200375qth.335.1590080093331; Thu, 21 May 2020 09:54:53 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id g26sm5685087qtk.76.2020.05.21.09.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:54:52 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 12:54:50 -0400 From: Mark Johnston To: John Baldwin Cc: Konstantin Belousov , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521165450.GC85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49SbML3Nvfz4194 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 16:54:54 -0000 On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > On 5/21/20 8:12 AM, Mark Johnston wrote: > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>> > >>>> Author: kib > >>>> Date: Wed May 20 22:08:26 2020 > >>>> New Revision: 361303 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>> > >>>> Log: > >>>> Change the samantic of struct link_map l_addr member. > >>>> > >>>> It previously returned the object map base address, while all other > >>>> ELF operating systems return load offset, i.e. the difference between > >>>> map base and the link base. > >>>> > >>>> Explain the meaning of the field in the man page. > >>>> > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>> > >>>> PR: 246561 > >>>> Requested by: Damjan Jovanovic > >>>> Reviewed by: emaste, jhb, cem (previous version) > >>>> Sponsored by: The FreeBSD Foundation > >>>> MFC after: 1 week > >>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>> > >>>> Modified: > >>>> head/lib/libc/gen/dlinfo.3 > >>>> head/libexec/rtld-elf/rtld.c > >>>> head/sys/sys/link_elf.h > >>> > >>> Hi, > >>> > >>> After this commit, some ports fail to build with signal 11. > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>> Disabling the DTRACE option makes it able to build again. > >>> > >> I see, thank you for reporting. > >> > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >> that l_addr is the base, not relocbase. > >> > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > It appears it has been the same since DTrace was imported. illumos > > still has similar code. > > > > Note that drti.o is linked into any executable and shlib that defines > > static probes, so the ABI change affects more than just dtrace(1). > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > preserve the old behaviour for the old value? > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > (absolute address) or relocbase (relative address). In the discussion > in the phabricator I had assumed that all other OS's treated l_addr as > the relative offset (relocbase). Does the code for illumos assume an > absolute address or does it assume a relative address in l_addr? It should be an absolute address, since dtrace appears to assume that an ELF header is mapped at l_addr. Here, "addr" is the value of l_addr for the RTLD_SELF linkmap: https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/libdtrace/common/dlink_common.c#L124 From owner-svn-src-head@freebsd.org Thu May 21 16:56:54 2020 Return-Path: Delivered-To: svn-src-head@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 B4CF12DDEA2; Thu, 21 May 2020 16:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49SbPf1MsSz417X; Thu, 21 May 2020 16:56:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LGukch022188 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 19:56:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LGukch022188 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LGukV6022187; Thu, 21 May 2020 19:56:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 19:56:46 +0300 From: Konstantin Belousov To: John Baldwin Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521165646.GF64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49SbPf1MsSz417X X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 16:56:54 -0000 On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > On 5/21/20 8:12 AM, Mark Johnston wrote: > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>> > >>>> Author: kib > >>>> Date: Wed May 20 22:08:26 2020 > >>>> New Revision: 361303 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>> > >>>> Log: > >>>> Change the samantic of struct link_map l_addr member. > >>>> > >>>> It previously returned the object map base address, while all other > >>>> ELF operating systems return load offset, i.e. the difference between > >>>> map base and the link base. > >>>> > >>>> Explain the meaning of the field in the man page. > >>>> > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>> > >>>> PR: 246561 > >>>> Requested by: Damjan Jovanovic > >>>> Reviewed by: emaste, jhb, cem (previous version) > >>>> Sponsored by: The FreeBSD Foundation > >>>> MFC after: 1 week > >>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>> > >>>> Modified: > >>>> head/lib/libc/gen/dlinfo.3 > >>>> head/libexec/rtld-elf/rtld.c > >>>> head/sys/sys/link_elf.h > >>> > >>> Hi, > >>> > >>> After this commit, some ports fail to build with signal 11. > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>> Disabling the DTRACE option makes it able to build again. > >>> > >> I see, thank you for reporting. > >> > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >> that l_addr is the base, not relocbase. > >> > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > It appears it has been the same since DTrace was imported. illumos > > still has similar code. > > > > Note that drti.o is linked into any executable and shlib that defines > > static probes, so the ABI change affects more than just dtrace(1). > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > preserve the old behaviour for the old value? > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > (absolute address) or relocbase (relative address). In the discussion > in the phabricator I had assumed that all other OS's treated l_addr as > the relative offset (relocbase). Does the code for illumos assume an > absolute address or does it assume a relative address in l_addr? It is rather clear, since the dtrace code was pristine, that Solaris provides the mapbase. I do not have Solaris/Illumos box anymore (for quite some time), so I cannot check directly. My current PoV is that l_addr semantic must be restored, and relocbase provided by newly added member. BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? From owner-svn-src-head@freebsd.org Thu May 21 17:01:29 2020 Return-Path: Delivered-To: svn-src-head@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 A369B2DE3F9; Thu, 21 May 2020 17:01:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbVw6ps3z41Qt; Thu, 21 May 2020 17:01:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id a23so6074065qto.1; Thu, 21 May 2020 10:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=fio+83qPivCTeET29WjgbzGU32aI9oWj6bT+ijVETvj7nVAkws7PgwY62/KxyxGGDG 5V9FuuuI1/sjFZCfvC8w2e1PgnL1U5eonyK1mf+wyjAvASkmByselfUIgxhxbthiks/f lziYOYOvs5LD80olARTDYsqazdcwZCAAEgmAazjGzLKKP5mpwgtsVKcqsbqgwgBB0arx VohEKX/1IIOXar2zDrhlNtk8aauD8IUwHqb9v2oV+GHEwuA6qHh59crWUiZjgiZi9fl8 0jDLJe0VDnbvKUsYTag7oJPrtWIowqg5i0GWXe9u1xHY4Czrkdr9WqdlInov6XHFqqiX 7iuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=RC414EnTs0dbemcjpHv7PXQsFSw6tSQNRhlagmOZaQQNMpPZl1YITWohZ7J4NEv0L2 HMkn04PY0DHXUzEiksWBMdEEbujAiZmTroGP5sxuMgoDpU0Z1d+vGUGTUXewZXXduMtU XsfOjb81DO5XMW17XI1wTrXpsP92u1S5x0gXRdlBHjsTol6Dqnplp02Svl+kyTXXSvPx Xo2sbZpS8EW6jJr3s018kD17/krpkMNnO4J3XVB2Mlz3D8i5rTstzpk/PgRTLsn+znx6 Ev/m7gVjdRyA3JuE4epKLxJ79frPfJblAJ42hF5Xu/PG9DJIvYwtSThyLHXbt8Q1V0A6 BjAg== X-Gm-Message-State: AOAM532HE6EZZrHvH18O7Ubz1rcJ5K3Aw/FlxBY3u7dv/WREQBXUQKLz Jt838ixrn+IIPi7dViRRP78= X-Google-Smtp-Source: ABdhPJzVg42PRPQOfJlaQvEorAy//JmnQk/yzBXTmGboa7C67a4Le8btklyWADLCIF8Lk4M5f6y7oA== X-Received: by 2002:ac8:47c4:: with SMTP id d4mr11944539qtr.110.1590080487837; Thu, 21 May 2020 10:01:27 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id r14sm3627558qke.62.2020.05.21.10.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:01:26 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:01:24 -0400 From: Mark Johnston To: Konstantin Belousov Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521170124.GE85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521165646.GF64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SbVw6ps3z41Qt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fio+83qP; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.32 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.66)[-0.663]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.41)[-0.408]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.55)[-0.548]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:01:29 -0000 On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > >>>> > > >>>> Author: kib > > >>>> Date: Wed May 20 22:08:26 2020 > > >>>> New Revision: 361303 > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > >>>> > > >>>> Log: > > >>>> Change the samantic of struct link_map l_addr member. > > >>>> > > >>>> It previously returned the object map base address, while all other > > >>>> ELF operating systems return load offset, i.e. the difference between > > >>>> map base and the link base. > > >>>> > > >>>> Explain the meaning of the field in the man page. > > >>>> > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > >>>> > > >>>> PR: 246561 > > >>>> Requested by: Damjan Jovanovic > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > >>>> Sponsored by: The FreeBSD Foundation > > >>>> MFC after: 1 week > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > >>>> > > >>>> Modified: > > >>>> head/lib/libc/gen/dlinfo.3 > > >>>> head/libexec/rtld-elf/rtld.c > > >>>> head/sys/sys/link_elf.h > > >>> > > >>> Hi, > > >>> > > >>> After this commit, some ports fail to build with signal 11. > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > >>> Disabling the DTRACE option makes it able to build again. > > >>> > > >> I see, thank you for reporting. > > >> > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > >> that l_addr is the base, not relocbase. > > >> > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > It appears it has been the same since DTrace was imported. illumos > > > still has similar code. > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > static probes, so the ABI change affects more than just dtrace(1). > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > preserve the old behaviour for the old value? > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > (absolute address) or relocbase (relative address). In the discussion > > in the phabricator I had assumed that all other OS's treated l_addr as > > the relative offset (relocbase). Does the code for illumos assume an > > absolute address or does it assume a relative address in l_addr? > > It is rather clear, since the dtrace code was pristine, that Solaris > provides the mapbase. I do not have Solaris/Illumos box anymore > (for quite some time), so I cannot check directly. > > My current PoV is that l_addr semantic must be restored, and relocbase > provided by newly added member. > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? Isn't the problem when perl is *not* linked as PIE? In this case relocbase is 0, so the ELF header access becomes a NULL pointer dereference. From owner-svn-src-head@freebsd.org Thu May 21 17:09:58 2020 Return-Path: Delivered-To: svn-src-head@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 1E5B72DE27D; Thu, 21 May 2020 17:09:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sbhj6gmsz427v; Thu, 21 May 2020 17:09:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id d7so6026206qtn.11; Thu, 21 May 2020 10:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Fwxi6IE7uLYMM1zNlo5EvguEHNEJZW/CwZjvuXN+gzM=; b=sH5Jlncpz/JXLkSdcg4AAcWb7+DaVbWacRaaFbKpLwDQpcn4GG7dM0SzixXYCpmKju HWFTo8QhVF7ami/7YvAyRRcQUYMGS/JtemTl5ejJlxbBsi/kXuYouzdF/naDME0+LdLu NjEWJMeNhVljkyh5hDUhfzt6acBauSkBnJznAL5DCRbX1RjIJ7BaAydr/wcf/1FqtMrf tFrzxhvzIjekfcYg7qQZHTkl73tu60PtCVAtNrqOuN5V7ZSQ8M4VALP2YH34p9qs6NJS yB4CsZD+PFiT9SPYoj2KaP+tyX9Upnk9MUhU9AcKhUD/FiXn1eESqVwzadJ7btkE3n4k x/oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=Fwxi6IE7uLYMM1zNlo5EvguEHNEJZW/CwZjvuXN+gzM=; b=WOHjh2n+/gIVDicCS6q7b7V2JJXsNl65rpHA+CNGjbMJG7a89jU63dGaDpXhr8KO4I Rkx3NzJE8C2h4wWfgZAHsCxUO1OLbaenaqWnsJSO7knWGqyredDzdX37QT5AReOR3fPa 7aIPy81vIPiclWFo78/KeALKcp99rVbXeAmkwPGu2tUQHU1IxbJn+071A+ZRyN+/d/lC FVQVl0iNiAdBeORcBsAk8ApA48TNzpZbSOqr5KCL5sgZhxM1760blk4EhGgXxsCEVo0T Sd3KnEWPFh2BmIK3hJec9ZhwdYDtpmH1SXK72NYBuv4wO8ojY5gVbsYegWM5TZULjPuK einw== X-Gm-Message-State: AOAM530rSToZ9vEqIjladFTLH+XTejfwtBuHP2t2mPp7ZSiTF+uucAQl mT+KbvJwuyPuHS+f8kS4lWcFFvse X-Google-Smtp-Source: ABdhPJzSpUtiAVgDkY/P+Z8aIdNl8DEvO3VlvCZGae+V0OXBoN4EOpkf1NH/PWDeQCQ/2KHRQB5fqQ== X-Received: by 2002:ac8:1194:: with SMTP id d20mr12209863qtj.359.1590080996468; Thu, 21 May 2020 10:09:56 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id v1sm2114833qkb.19.2020.05.21.10.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:09:55 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:09:53 -0400 From: Mark Johnston To: Brandon Bergren Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361336 - head/sys/powerpc/aim Message-ID: <20200521170953.GF85681@raichu> References: <202005211553.04LFrH3m086488@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005211553.04LFrH3m086488@repo.freebsd.org> X-Rspamd-Queue-Id: 49Sbhj6gmsz427v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:09:58 -0000 On Thu, May 21, 2020 at 03:53:17PM +0000, Brandon Bergren wrote: > Author: bdragon > Date: Thu May 21 15:53:16 2020 > New Revision: 361336 > URL: https://svnweb.freebsd.org/changeset/base/361336 > > Log: > [PowerPC] Fix kernel boot on powerpc > > Recent changes have caused the vmspace objects to start coming from KVA > instead of direct-mapped memory on powerpc. As far as I can tell, this is > not actually a problem, so we should stop arbitrarily asserting that it is. > > I do not know why this was not being triggered before. UMA was recently changed in r357549 to use multi-page slabs if doing so would reduce internal fragmentation to a certain degree. In that case the slabs will be mapped into KVA. vmspace objects are quite large but smaller than a page, so they benefit from this. You can verify by checking the vm.uma.VMSPACE.keg.ppera sysctl, which gives the number of pages per slab. From owner-svn-src-head@freebsd.org Thu May 21 17:10:07 2020 Return-Path: Delivered-To: svn-src-head@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 546EE2DE536; Thu, 21 May 2020 17:10:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49Sbht4KCqz426B; Thu, 21 May 2020 17:10:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LH9w5u024629 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 20:10:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LH9w5u024629 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LH9wfT024628; Thu, 21 May 2020 20:09:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 20:09:58 +0300 From: Konstantin Belousov To: Mark Johnston Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521170958.GG64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <20200521170124.GE85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521170124.GE85681@raichu> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49Sbht4KCqz426B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:10:07 -0000 On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote: > On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > >>>> > > > >>>> Author: kib > > > >>>> Date: Wed May 20 22:08:26 2020 > > > >>>> New Revision: 361303 > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > > >>>> > > > >>>> Log: > > > >>>> Change the samantic of struct link_map l_addr member. > > > >>>> > > > >>>> It previously returned the object map base address, while all other > > > >>>> ELF operating systems return load offset, i.e. the difference between > > > >>>> map base and the link base. > > > >>>> > > > >>>> Explain the meaning of the field in the man page. > > > >>>> > > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > > >>>> > > > >>>> PR: 246561 > > > >>>> Requested by: Damjan Jovanovic > > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > > >>>> Sponsored by: The FreeBSD Foundation > > > >>>> MFC after: 1 week > > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > > >>>> > > > >>>> Modified: > > > >>>> head/lib/libc/gen/dlinfo.3 > > > >>>> head/libexec/rtld-elf/rtld.c > > > >>>> head/sys/sys/link_elf.h > > > >>> > > > >>> Hi, > > > >>> > > > >>> After this commit, some ports fail to build with signal 11. > > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > > >>> Disabling the DTRACE option makes it able to build again. > > > >>> > > > >> I see, thank you for reporting. > > > >> > > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > > >> that l_addr is the base, not relocbase. > > > >> > > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > > > It appears it has been the same since DTrace was imported. illumos > > > > still has similar code. > > > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > > static probes, so the ABI change affects more than just dtrace(1). > > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > > preserve the old behaviour for the old value? > > > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > > (absolute address) or relocbase (relative address). In the discussion > > > in the phabricator I had assumed that all other OS's treated l_addr as > > > the relative offset (relocbase). Does the code for illumos assume an > > > absolute address or does it assume a relative address in l_addr? > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > provides the mapbase. I do not have Solaris/Illumos box anymore > > (for quite some time), so I cannot check directly. > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > provided by newly added member. > > > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? > > Isn't the problem when perl is *not* linked as PIE? In this case > relocbase is 0, so the ELF header access becomes a NULL pointer > dereference. drti checks for ET_DYN, only then it uses l_addr at all. PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC, which should make dtri.c ignore the l_addr value. From owner-svn-src-head@freebsd.org Thu May 21 17:13:04 2020 Return-Path: Delivered-To: svn-src-head@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 9AF202DE636; Thu, 21 May 2020 17:13:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbmJ0fYmz42XW; Thu, 21 May 2020 17:13:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id c24so6070648qtw.7; Thu, 21 May 2020 10:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NBDsI+qr84dPVJLbT/b6zIwLekn5fluTJ4mnvqOwepw=; b=OW7zNKHsooh44N3rKVZRJaYPZxGMq/50Yo1+3j2X+mPSrH8SmdgSG/aZcnfhuUaUCY IYnwm9dQ18gQ7OgTIJF72K1eyh3nZMHs8D2r4FSpOv0Aoye71UkfTwhx/rpdD/+ogDgC qaORkeG9AJq5tXim9ZLRhRVZesfR2Cxsp/ooRYrzuIhSFYpXfRLnHyCzTFOUBiRk5Gpq j7G0eBgj6t/WjL3hiBpVmOOiS2MMbsiJNE0hyP7iOYbrfv3wT741D++f9wsHaHO5zBAZ acXmiQsWtmfeI8kPy+QVWunsRlvtmNP4npOrwRzAjdZjS3h1LISiuRMN2r33vI93dcTH 9ZAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=NBDsI+qr84dPVJLbT/b6zIwLekn5fluTJ4mnvqOwepw=; b=l/+Hs1USWyDhA3K6e0iWxaV9DV7OfwkcP10UGaAKi3M24JiQMFd+wKljYK86chLeKK d7zwES/YXaawNw7XWa2Y5Yiq9urSWMVE6r40325qrUFaAe3Lwgsmbi2OheLMKbCunPHC 5lgnpR6nXlnOo/MSlvGPGOf3eRw8WxSwrkoSgG41PKJbbon52T9E/05hnLqz5g4GcypF y1EsLy+WKKfBkhGXLErQ6g4fPzFfguCwzUBOPsnZ/Nvcd+05/w39PSgDOdR9JiwM+bb4 91scKAwmXGehzVVhEBXzcXGFcyDjyIRZr6iM59g4Zf0FXKm8pYvPlEUeB5c2Z3r0MpHd 6ExQ== X-Gm-Message-State: AOAM5310/1MRiQcrLZP/3wdcZZ0FlTgl5WUg4/hbPXwX1nku9IE01ZQ/ BwlrI/kQRY+z4FOlGWn5AKI= X-Google-Smtp-Source: ABdhPJyL3OYlugIRsHfz2X/i1881xUg6UktuBT/BLufaSLNHHACNNEDx8QD6u7jt8gaKuuXNAY6ojQ== X-Received: by 2002:ac8:1621:: with SMTP id p30mr10171634qtj.321.1590081183420; Thu, 21 May 2020 10:13:03 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id h15sm3744066qkh.18.2020.05.21.10.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:13:02 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:13:00 -0400 From: Mark Johnston To: Konstantin Belousov Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521171300.GG85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <20200521170124.GE85681@raichu> <20200521170958.GG64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521170958.GG64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SbmJ0fYmz42XW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=OW7zNKHs; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.69)[-0.693]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-0.50)[-0.504]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.52)[-0.521]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:13:04 -0000 On Thu, May 21, 2020 at 08:09:58PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote: > > On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > >>>> > > > > >>>> Author: kib > > > > >>>> Date: Wed May 20 22:08:26 2020 > > > > >>>> New Revision: 361303 > > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > >>>> > > > > >>>> Log: > > > > >>>> Change the samantic of struct link_map l_addr member. > > > > >>>> > > > > >>>> It previously returned the object map base address, while all other > > > > >>>> ELF operating systems return load offset, i.e. the difference between > > > > >>>> map base and the link base. > > > > >>>> > > > > >>>> Explain the meaning of the field in the man page. > > > > >>>> > > > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > > > >>>> > > > > >>>> PR: 246561 > > > > >>>> Requested by: Damjan Jovanovic > > > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > > > >>>> Sponsored by: The FreeBSD Foundation > > > > >>>> MFC after: 1 week > > > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > > > >>>> > > > > >>>> Modified: > > > > >>>> head/lib/libc/gen/dlinfo.3 > > > > >>>> head/libexec/rtld-elf/rtld.c > > > > >>>> head/sys/sys/link_elf.h > > > > >>> > > > > >>> Hi, > > > > >>> > > > > >>> After this commit, some ports fail to build with signal 11. > > > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > > > >>> Disabling the DTRACE option makes it able to build again. > > > > >>> > > > > >> I see, thank you for reporting. > > > > >> > > > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > > > >> that l_addr is the base, not relocbase. > > > > >> > > > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > > > > > It appears it has been the same since DTrace was imported. illumos > > > > > still has similar code. > > > > > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > > > static probes, so the ABI change affects more than just dtrace(1). > > > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > > > preserve the old behaviour for the old value? > > > > > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > > > (absolute address) or relocbase (relative address). In the discussion > > > > in the phabricator I had assumed that all other OS's treated l_addr as > > > > the relative offset (relocbase). Does the code for illumos assume an > > > > absolute address or does it assume a relative address in l_addr? > > > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > > provides the mapbase. I do not have Solaris/Illumos box anymore > > > (for quite some time), so I cannot check directly. > > > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > > provided by newly added member. > > > > > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? > > > > Isn't the problem when perl is *not* linked as PIE? In this case > > relocbase is 0, so the ELF header access becomes a NULL pointer > > dereference. > drti checks for ET_DYN, only then it uses l_addr at all. The problem is before that, where it treats l_addr as a pointer to the ELF header so it can check the type. > PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC, > which should make dtri.c ignore the l_addr value. From owner-svn-src-head@freebsd.org Thu May 21 17:34:32 2020 Return-Path: Delivered-To: svn-src-head@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 1515B2DEDB5; Thu, 21 May 2020 17:34:32 +0000 (UTC) (envelope-from pstef@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ScF36nw4z43YZ; Thu, 21 May 2020 17:34:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E491511331; Thu, 21 May 2020 17:34:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LHYVoR047007; Thu, 21 May 2020 17:34:31 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LHYVON047006; Thu, 21 May 2020 17:34:31 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005211734.04LHYVON047006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 21 May 2020 17:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361337 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 361337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:34:32 -0000 Author: pstef Date: Thu May 21 17:34:31 2020 New Revision: 361337 URL: https://svnweb.freebsd.org/changeset/base/361337 Log: indent(1): add fallthrough markers This silences -Wimplicit-fallthrough warnings. Submitted by: Michael Paquier Obtained from: postgresql.org MFC after: 3 days Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Thu May 21 15:53:16 2020 (r361336) +++ head/usr.bin/indent/indent.c Thu May 21 17:34:31 2020 (r361337) @@ -967,6 +967,7 @@ check_type: case structure: if (ps.p_l_follow > 0) goto copy_id; + /* FALLTHROUGH */ case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Thu May 21 15:53:16 2020 (r361336) +++ head/usr.bin/indent/parse.c Thu May 21 17:34:31 2020 (r361337) @@ -107,6 +107,7 @@ parse(int tk) /* tk: the code for the construct scanne */ ps.i_l_follow = ps.il[ps.tos--]; /* the rest is the same as for dolit and forstmt */ + /* FALLTHROUGH */ case dolit: /* 'do' */ case forstmt: /* for (...) */ ps.p_stack[++ps.tos] = tk; From owner-svn-src-head@freebsd.org Thu May 21 18:38:42 2020 Return-Path: Delivered-To: svn-src-head@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 840102F0E8D; Thu, 21 May 2020 18:38:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sdg62yXWz46ny; Thu, 21 May 2020 18:38:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 609FE11BAB; Thu, 21 May 2020 18:38:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LIcgg1084102; Thu, 21 May 2020 18:38:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LIcgdS084101; Thu, 21 May 2020 18:38:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005211838.04LIcgdS084101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 18:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361338 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 18:38:42 -0000 Author: markj Date: Thu May 21 18:38:41 2020 New Revision: 361338 URL: https://svnweb.freebsd.org/changeset/base/361338 Log: Fix ACCEPT_FILTER_DEFINE to pass the version to MODULE_VERSION. MFC with: r361263 Modified: head/sys/sys/socketvar.h Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Thu May 21 17:34:31 2020 (r361337) +++ head/sys/sys/socketvar.h Thu May 21 18:38:41 2020 (r361338) @@ -349,7 +349,7 @@ struct accept_filter { }; \ DECLARE_MODULE(modname, modname##_mod, SI_SUB_DRIVERS, \ SI_ORDER_MIDDLE); \ - MODULE_VERSION(modname, 1) + MODULE_VERSION(modname, ver) #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ACCF); From owner-svn-src-head@freebsd.org Thu May 21 19:30:49 2020 Return-Path: Delivered-To: svn-src-head@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 ECD302F23EC; Thu, 21 May 2020 19:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SfqF63SJz4B31; Thu, 21 May 2020 19:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:fd49:a52a:25ad:4719]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1445C1B168; Thu, 21 May 2020 19:30:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> Date: Thu, 21 May 2020 12:30:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200521165646.GF64045@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 19:30:50 -0000 On 5/21/20 9:56 AM, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: >> On 5/21/20 8:12 AM, Mark Johnston wrote: >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: >>>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: >>>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: >>>>>> >>>>>> Author: kib >>>>>> Date: Wed May 20 22:08:26 2020 >>>>>> New Revision: 361303 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361303 >>>>>> >>>>>> Log: >>>>>> Change the samantic of struct link_map l_addr member. >>>>>> >>>>>> It previously returned the object map base address, while all other >>>>>> ELF operating systems return load offset, i.e. the difference between >>>>>> map base and the link base. >>>>>> >>>>>> Explain the meaning of the field in the man page. >>>>>> >>>>>> Stop filling the mips-only l_offs member, which is apparently unused. >>>>>> >>>>>> PR: 246561 >>>>>> Requested by: Damjan Jovanovic >>>>>> Reviewed by: emaste, jhb, cem (previous version) >>>>>> Sponsored by: The FreeBSD Foundation >>>>>> MFC after: 1 week >>>>>> Differential revision: https://reviews.freebsd.org/D24918 >>>>>> >>>>>> Modified: >>>>>> head/lib/libc/gen/dlinfo.3 >>>>>> head/libexec/rtld-elf/rtld.c >>>>>> head/sys/sys/link_elf.h >>>>> >>>>> Hi, >>>>> >>>>> After this commit, some ports fail to build with signal 11. >>>>> For instance lang/perl5.30 fails to build with default options (DTRACE on) >>>>> Disabling the DTRACE option makes it able to build again. >>>>> >>>> I see, thank you for reporting. >>>> >>>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes >>>> that l_addr is the base, not relocbase. >>>> >>>> Mark, was dofhp_addr initialization changed comparing to Solaris ? >>> >>> It appears it has been the same since DTrace was imported. illumos >>> still has similar code. >>> >>> Note that drti.o is linked into any executable and shlib that defines >>> static probes, so the ABI change affects more than just dtrace(1). >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and >>> preserve the old behaviour for the old value? >> >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase >> (absolute address) or relocbase (relative address). In the discussion >> in the phabricator I had assumed that all other OS's treated l_addr as >> the relative offset (relocbase). Does the code for illumos assume an >> absolute address or does it assume a relative address in l_addr? > > It is rather clear, since the dtrace code was pristine, that Solaris > provides the mapbase. I do not have Solaris/Illumos box anymore > (for quite some time), so I cannot check directly. > > My current PoV is that l_addr semantic must be restored, and relocbase > provided by newly added member. I am fine with reverting the l_addr semantic. I'm still not sure how to resolve the original PR, though perhaps Wine just has to carry a local patch forever? GDB will work via the current accident so long as we never pre-link libraries. As long as PIE binaries have a starting VA of 0 like our shared libraries then I think GDB will be ok with our PIE binaries as well. -- John Baldwin From owner-svn-src-head@freebsd.org Thu May 21 19:50:19 2020 Return-Path: Delivered-To: svn-src-head@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 C5C962F318B; Thu, 21 May 2020 19:50:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49SgFk6ltmz4DXQ; Thu, 21 May 2020 19:50:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LJoAmp062897 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 22:50:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LJoAmp062897 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LJoAVC062895; Thu, 21 May 2020 22:50:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 22:50:10 +0300 From: Konstantin Belousov To: John Baldwin Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521195010.GJ64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49SgFk6ltmz4DXQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 19:50:19 -0000 On Thu, May 21, 2020 at 12:30:47PM -0700, John Baldwin wrote: > On 5/21/20 9:56 AM, Konstantin Belousov wrote: > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > >> On 5/21/20 8:12 AM, Mark Johnston wrote: > >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >>>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>>>> > >>>>>> Author: kib > >>>>>> Date: Wed May 20 22:08:26 2020 > >>>>>> New Revision: 361303 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>>>> > >>>>>> Log: > >>>>>> Change the samantic of struct link_map l_addr member. > >>>>>> > >>>>>> It previously returned the object map base address, while all other > >>>>>> ELF operating systems return load offset, i.e. the difference between > >>>>>> map base and the link base. > >>>>>> > >>>>>> Explain the meaning of the field in the man page. > >>>>>> > >>>>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>>>> > >>>>>> PR: 246561 > >>>>>> Requested by: Damjan Jovanovic > >>>>>> Reviewed by: emaste, jhb, cem (previous version) > >>>>>> Sponsored by: The FreeBSD Foundation > >>>>>> MFC after: 1 week > >>>>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>>>> > >>>>>> Modified: > >>>>>> head/lib/libc/gen/dlinfo.3 > >>>>>> head/libexec/rtld-elf/rtld.c > >>>>>> head/sys/sys/link_elf.h > >>>>> > >>>>> Hi, > >>>>> > >>>>> After this commit, some ports fail to build with signal 11. > >>>>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>>>> Disabling the DTRACE option makes it able to build again. > >>>>> > >>>> I see, thank you for reporting. > >>>> > >>>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >>>> that l_addr is the base, not relocbase. > >>>> > >>>> Mark, was dofhp_addr initialization changed comparing to Solaris ? > >>> > >>> It appears it has been the same since DTrace was imported. illumos > >>> still has similar code. > >>> > >>> Note that drti.o is linked into any executable and shlib that defines > >>> static probes, so the ABI change affects more than just dtrace(1). > >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and > >>> preserve the old behaviour for the old value? > >> > >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase > >> (absolute address) or relocbase (relative address). In the discussion > >> in the phabricator I had assumed that all other OS's treated l_addr as > >> the relative offset (relocbase). Does the code for illumos assume an > >> absolute address or does it assume a relative address in l_addr? > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > provides the mapbase. I do not have Solaris/Illumos box anymore > > (for quite some time), so I cannot check directly. > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > provided by newly added member. > > I am fine with reverting the l_addr semantic. I'm still not sure how to > resolve the original PR, though perhaps Wine just has to carry a local > patch forever? GDB will work via the current accident so long as we > never pre-link libraries. As long as PIE binaries have a starting VA of > 0 like our shared libraries then I think GDB will be ok with our PIE > binaries as well. Wine should work without patch now, and after the D24918 is applied, too. I do not intend to revert l_addr to the 'load address' semantic. I am actually trying to find a solaris box to compile the test program. From owner-svn-src-head@freebsd.org Thu May 21 20:18:38 2020 Return-Path: Delivered-To: svn-src-head@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 D6CB62F3B58; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SgtQ5FmGz4Fq9; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF7B012D76; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LKIcxO045752; Thu, 21 May 2020 20:18:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LKIcJ7045750; Thu, 21 May 2020 20:18:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005212018.04LKIcJ7045750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 21 May 2020 20:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361343 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 361343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 20:18:38 -0000 Author: manu Date: Thu May 21 20:18:38 2020 New Revision: 361343 URL: https://svnweb.freebsd.org/changeset/base/361343 Log: linuxkpi: Add rcu_work functions The rcu_work function helps to queue some work after waiting for a grace period. This is needed by DRM drivers. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24942 Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu May 21 19:46:11 2020 (r361342) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu May 21 20:18:38 2020 (r361343) @@ -72,6 +72,13 @@ struct work_struct { atomic_t state; }; +struct rcu_work { + struct work_struct work; + struct rcu_head rcu; + + struct workqueue_struct *wq; +}; + #define DECLARE_WORK(name, fn) \ struct work_struct name; \ static void name##_init(void *arg) \ @@ -112,6 +119,9 @@ do { \ TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ } while (0) +#define INIT_RCU_WORK(_work, _fn) \ + INIT_WORK(&(_work)->work, (_fn)) + #define INIT_WORK_ONSTACK(work, fn) \ INIT_WORK(work, fn) @@ -192,6 +202,12 @@ do { \ #define flush_work(work) \ linux_flush_work(work) +#define queue_rcu_work(wq, rwork) \ + linux_queue_rcu_work(wq, rwork) + +#define flush_rcu_work(rwork) \ + linux_flush_rcu_work(rwork) + #define flush_delayed_work(dwork) \ linux_flush_delayed_work(dwork) @@ -237,5 +253,7 @@ extern bool linux_flush_delayed_work(struct delayed_wo extern bool linux_work_pending(struct work_struct *); extern bool linux_work_busy(struct work_struct *); extern struct work_struct *linux_current_work(void); +extern bool linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork); +extern bool linux_flush_rcu_work(struct rcu_work *rwork); #endif /* _LINUX_WORKQUEUE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Thu May 21 19:46:11 2020 (r361342) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Thu May 21 20:18:38 2020 (r361343) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -153,6 +154,53 @@ linux_queue_work_on(int cpu __unused, struct workqueue default: return (false); /* already on a queue */ } +} + +/* + * Callback func for linux_queue_rcu_work + */ +static void +rcu_work_func(struct rcu_head *rcu) +{ + struct rcu_work *rwork; + + rwork = container_of(rcu, struct rcu_work, rcu); + linux_queue_work_on(WORK_CPU_UNBOUND, rwork->wq, &rwork->work); +} + +/* + * This function queue a work after a grace period + * If the work was already pending it returns false, + * if not it calls call_rcu and returns true. + */ +bool +linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork) +{ + + if (!linux_work_pending(&rwork->work)) { + rwork->wq = wq; + linux_call_rcu(RCU_TYPE_REGULAR, &rwork->rcu, rcu_work_func); + return (true); + } + return (false); +} + +/* + * This function waits for the last execution of a work and then + * flush the work. + * It returns true if the work was pending and we waited, it returns + * false otherwise. + */ +bool +linux_flush_rcu_work(struct rcu_work *rwork) +{ + + if (linux_work_pending(&rwork->work)) { + linux_rcu_barrier(RCU_TYPE_REGULAR); + linux_flush_work(&rwork->work); + return (true); + } + return (linux_flush_work(&rwork->work)); } /* From owner-svn-src-head@freebsd.org Thu May 21 21:00:47 2020 Return-Path: Delivered-To: svn-src-head@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 27A6E2F4B70; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Shq30Vnxz4L6N; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BE7013BAC; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LL0lF0073879; Thu, 21 May 2020 21:00:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LL0l4p073877; Thu, 21 May 2020 21:00:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005212100.04LL0l4p073877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 21 May 2020 21:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361344 - in head: contrib/unbound contrib/unbound/.github contrib/unbound/cachedb contrib/unbound/compat contrib/unbound/contrib contrib/unbound/daemon contrib/unbound/doc contrib/unbo... X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: contrib/unbound contrib/unbound/.github contrib/unbound/cachedb contrib/unbound/compat contrib/unbound/contrib contrib/unbound/daemon contrib/unbound/doc contrib/unbound/edns-subnet contrib/u... X-SVN-Commit-Revision: 361344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 21:00:47 -0000 Author: cy Date: Thu May 21 21:00:46 2020 New Revision: 361344 URL: https://svnweb.freebsd.org/changeset/base/361344 Log: MFV r361322: Update unbound 1.9.6 --> 1.10.1. Bug Fixes: - CVE-2020-12662 Unbound can be tricked into amplifying an incoming query into a large number of queries directed to a target. - CVE-2020-12663 Malformed answers from upstream name servers can be used to make Unbound unresponsive. Reported by: emaste MFC after: 3 days Relnotes: yes Security: CVE-2020-12662, CVE-2020-12663 Added: head/contrib/unbound/.github/ - copied from r361322, vendor/unbound/dist/.github/ head/contrib/unbound/contrib/drop2rpz - copied unchanged from r361322, vendor/unbound/dist/contrib/drop2rpz head/contrib/unbound/contrib/unbound_portable.service.in - copied unchanged from r361322, vendor/unbound/dist/contrib/unbound_portable.service.in head/contrib/unbound/contrib/unbound_smf23.tar.gz - copied unchanged from r361322, vendor/unbound/dist/contrib/unbound_smf23.tar.gz head/contrib/unbound/services/rpz.c - copied unchanged from r361322, vendor/unbound/dist/services/rpz.c head/contrib/unbound/services/rpz.h - copied unchanged from r361322, vendor/unbound/dist/services/rpz.h Deleted: head/contrib/unbound/contrib/unbound_smf22.tar.gz Modified: head/contrib/unbound/Makefile.in head/contrib/unbound/README.md head/contrib/unbound/aclocal.m4 head/contrib/unbound/cachedb/cachedb.c head/contrib/unbound/compat/getentropy_solaris.c head/contrib/unbound/config.guess head/contrib/unbound/config.h.in head/contrib/unbound/config.sub head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/contrib/README head/contrib/unbound/contrib/fastrpz.patch head/contrib/unbound/contrib/libunbound.pc.in head/contrib/unbound/contrib/unbound.service.in head/contrib/unbound/contrib/unbound_munin_ head/contrib/unbound/daemon/daemon.c head/contrib/unbound/daemon/daemon.h head/contrib/unbound/daemon/remote.c head/contrib/unbound/daemon/stats.c head/contrib/unbound/daemon/unbound.c head/contrib/unbound/daemon/worker.c head/contrib/unbound/doc/Changelog head/contrib/unbound/doc/README head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/libunbound.3.in head/contrib/unbound/doc/unbound-anchor.8.in head/contrib/unbound/doc/unbound-checkconf.8.in head/contrib/unbound/doc/unbound-control.8.in head/contrib/unbound/doc/unbound-host.1.in head/contrib/unbound/doc/unbound.8.in head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/edns-subnet/subnetmod.c head/contrib/unbound/install-sh head/contrib/unbound/iterator/iter_delegpt.c head/contrib/unbound/iterator/iter_delegpt.h head/contrib/unbound/iterator/iter_scrub.c head/contrib/unbound/iterator/iter_utils.c head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h head/contrib/unbound/libunbound/context.c head/contrib/unbound/libunbound/libworker.c head/contrib/unbound/libunbound/unbound.h head/contrib/unbound/respip/respip.c head/contrib/unbound/respip/respip.h head/contrib/unbound/services/authzone.c head/contrib/unbound/services/authzone.h head/contrib/unbound/services/cache/dns.c head/contrib/unbound/services/cache/dns.h head/contrib/unbound/services/localzone.c head/contrib/unbound/services/localzone.h head/contrib/unbound/services/mesh.c head/contrib/unbound/services/mesh.h head/contrib/unbound/services/outside_network.c head/contrib/unbound/services/view.c head/contrib/unbound/sldns/parse.c head/contrib/unbound/sldns/str2wire.c head/contrib/unbound/smallapp/unbound-checkconf.c head/contrib/unbound/smallapp/unbound-control.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/contrib/unbound/util/data/dname.c head/contrib/unbound/util/data/dname.h head/contrib/unbound/util/data/msgencode.c head/contrib/unbound/util/data/msgparse.c head/contrib/unbound/util/data/msgparse.h head/contrib/unbound/util/data/msgreply.c head/contrib/unbound/util/data/packed_rrset.c head/contrib/unbound/util/data/packed_rrset.h head/contrib/unbound/util/fptr_wlist.c head/contrib/unbound/util/fptr_wlist.h head/contrib/unbound/util/iana_ports.inc head/contrib/unbound/util/log.c head/contrib/unbound/util/log.h head/contrib/unbound/util/module.h head/contrib/unbound/util/net_help.c head/contrib/unbound/util/net_help.h head/contrib/unbound/util/netevent.c head/contrib/unbound/util/random.c head/contrib/unbound/util/storage/dnstree.c head/contrib/unbound/util/storage/dnstree.h head/contrib/unbound/validator/val_secalgo.c head/contrib/unbound/validator/validator.c head/lib/libunbound/Makefile Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/Makefile.in ============================================================================== --- head/contrib/unbound/Makefile.in Thu May 21 20:18:38 2020 (r361343) +++ head/contrib/unbound/Makefile.in Thu May 21 21:00:46 2020 (r361344) @@ -110,6 +110,7 @@ iterator/iter_delegpt.c iterator/iter_donotq.c iterato iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ iterator/iter_scrub.c iterator/iter_utils.c services/listen_dnsport.c \ services/localzone.c services/mesh.c services/modstack.c services/view.c \ +services/rpz.c \ services/outbound_list.c services/outside_network.c util/alloc.c \ util/config_file.c util/configlexer.c util/configparser.c \ util/shm_side/shm_main.c services/authzone.c \ @@ -135,7 +136,7 @@ outbound_list.lo alloc.lo config_file.lo configlexer.l fptr_wlist.lo edns.lo locks.lo log.lo mini_event.lo module.lo net_help.lo \ random.lo rbtree.lo regional.lo rtt.lo dnstree.lo lookup3.lo lruhash.lo \ slabhash.lo tcp_conn_limit.lo timehist.lo tube.lo winsock_event.lo \ -autotrust.lo val_anchor.lo \ +autotrust.lo val_anchor.lo rpz.lo \ validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \ val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo cachedb.lo redis.lo authzone.lo \ $(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ) $(DNSCRYPT_OBJ) \ @@ -642,6 +643,9 @@ depend: fi rm -f $(DEPEND_TMP) $(DEPEND_TMP2) +# build rules +ipset.lo ipset.o: $(srcdir)/ipset/ipset.c + # Dependencies dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/validator/val_nsec.h \ @@ -654,9 +658,9 @@ infra.lo infra.o: $(srcdir)/services/cache/infra.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h rrset.lo rrset.o: $(srcdir)/services/cache/rrset.c config.h $(srcdir)/services/cache/rrset.h \ @@ -681,11 +685,14 @@ msgparse.lo msgparse.o: $(srcdir)/util/data/msgparse.c msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c config.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/util/module.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/module.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \ @@ -699,11 +706,12 @@ iterator.lo iterator.o: $(srcdir)/iterator/iterator.c $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_scrub.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/validator/val_neg.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \ $(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \ @@ -745,88 +753,106 @@ iter_utils.lo iter_utils.o: $(srcdir)/iterator/iter_ut $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/iterator/iter_donotq.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/str2wire.h listen_dnsport.lo listen_dnsport.o: $(srcdir)/services/listen_dnsport.c config.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h localzone.lo localzone.o: $(srcdir)/services/localzone.c config.h $(srcdir)/services/localzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/as112.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/timehist.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h $(srcdir)/util/edns.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/util/data/dname.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h \ $(srcdir)/services/listen_dnsport.h modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h +rpz.lo rpz.o: $(srcdir)/services/rpz.c config.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h outbound_list.lo outbound_list.o: $(srcdir)/services/outbound_list.c config.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h + outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c config.h \ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/dnstap/dnstap.h \ - + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/dnstap/dnstap.h alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/configyyrename.h $(srcdir)/util/config_file.h util/configparser.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h @@ -837,71 +863,83 @@ shm_main.lo shm_main.o: $(srcdir)/util/shm_side/shm_ma $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h + $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/util/tcp_conn_limit.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/listen_dnsport.h \ - + $(srcdir)/util/ub_event.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h regional.lo regional.o: $(srcdir)/util/regional.c config.h $(srcdir)/util/log.h $(srcdir)/util/regional.h rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -909,19 +947,22 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h lookup3.lo lookup3.o: $(srcdir)/util/storage/lookup3.c config.h $(srcdir)/util/storage/lookup3.h lruhash.lo lruhash.o: $(srcdir)/util/storage/lruhash.c config.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h slabhash.lo slabhash.o: $(srcdir)/util/storage/slabhash.c config.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp_conn_limit.c config.h $(srcdir)/util/regional.h \ @@ -929,26 +970,30 @@ tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/services/localzone.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h timehist.lo timehist.o: $(srcdir)/util/timehist.c config.h $(srcdir)/util/timehist.h $(srcdir)/util/log.h tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/ub_event.h + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/tube.h \ - + $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h \ - + $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -957,10 +1002,11 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrus $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/modstack.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -977,8 +1023,11 @@ validator.lo validator.o: $(srcdir)/validator/validato $(srcdir)/validator/autotrust.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/validator/val_kcache.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_kentry.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ @@ -987,13 +1036,11 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kc val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ - $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1011,17 +1058,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h \ - + $(srcdir)/sldns/sbuffer.h val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1037,9 +1082,11 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(s $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/config_file.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ @@ -1053,36 +1100,16 @@ respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h -dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h -dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ - -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ - $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ - $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1091,16 +1118,15 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h + $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1134,59 +1160,59 @@ unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/testcode/unitmain.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/sldns/wire2str.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h \ - $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/data/dname.h $(srcdir)/validator/validator.h \ $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ @@ -1197,56 +1223,59 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $( $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/daemon/daemon.h \ - $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ + $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1254,77 +1283,79 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h \ - $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/rrdef.h + $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ + $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/testcode/fake_event.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h pktview.lo pktview.o: $(srcdir)/testcode/pktview.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h $(srcdir)/sldns/sbuffer.h \ @@ -1333,10 +1364,13 @@ readhex.lo readhex.o: $(srcdir)/testcode/readhex.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h memstats.lo memstats.o: $(srcdir)/testcode/memstats.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ @@ -1344,27 +1378,31 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/sm $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1373,70 +1411,70 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libun $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h \ $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h \ $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/sldns/sbuffer.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 21 21:15:26 2020 Return-Path: Delivered-To: svn-src-head@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 054A72F5A94; Thu, 21 May 2020 21:15:26 +0000 (UTC) (envelope-from rscheff@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sj7x6Jghz4MBF; Thu, 21 May 2020 21:15:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B5613F81; Thu, 21 May 2020 21:15:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLFPl8085738; Thu, 21 May 2020 21:15:25 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLFPA6085735; Thu, 21 May 2020 21:15:25 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212115.04LLFPA6085735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361345 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 21:15:26 -0000 Author: rscheff Date: Thu May 21 21:15:25 2020 New Revision: 361345 URL: https://svnweb.freebsd.org/changeset/base/361345 Log: Handle ECN handshake in simultaneous open While testing simultaneous open TCP with ECN, found that negotiation fails to arrive at the expected final state. Reviewed by: tuexen (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23373 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_input.c Thu May 21 21:15:25 2020 (r361345) @@ -1611,6 +1611,14 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * XXX this is traditional behavior, may need to be cleaned up. */ if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) { + /* Handle parallel SYN for ECN */ + if (!(thflags & TH_ACK) && + ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && + ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { + tp->t_flags2 |= TF2_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_SND_ECE; + TCPSTAT_INC(tcps_ecn_shs); + } if ((to.to_flags & TOF_SCALE) && (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_output.c Thu May 21 21:15:25 2020 (r361345) @@ -1154,6 +1154,12 @@ send: } else flags |= TH_ECE|TH_CWR; } + /* Handle parallel SYN for ECN */ + if ((tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_flags2 & TF2_ECN_SND_ECE)) { + flags |= TH_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; + } if (tp->t_state == TCPS_ESTABLISHED && (tp->t_flags2 & TF2_ECN_PERMIT)) { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:15:25 2020 (r361345) @@ -11070,6 +11070,14 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr * this is traditional behavior, may need to be cleaned up. */ if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) { + /* Handle parallel SYN for ECN */ + if (!(thflags & TH_ACK) && + ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && + ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { + tp->t_flags2 |= TF2_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_SND_ECE; + TCPSTAT_INC(tcps_ecn_shs); + } if ((to.to_flags & TOF_SCALE) && (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; @@ -13522,6 +13530,12 @@ send: flags |= TH_ECE | TH_CWR; } else flags |= TH_ECE | TH_CWR; + } + /* Handle parallel SYN for ECN */ + if ((tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_flags2 & TF2_ECN_SND_ECE)) { + flags |= TH_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; } if (tp->t_state == TCPS_ESTABLISHED && (tp->t_flags2 & TF2_ECN_PERMIT)) { From owner-svn-src-head@freebsd.org Thu May 21 21:26:22 2020 Return-Path: Delivered-To: svn-src-head@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 F280E2F5B29; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjNZ65VHz4MqX; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC94D13BEA; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLQMXj091814; Thu, 21 May 2020 21:26:22 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLQMw3091812; Thu, 21 May 2020 21:26:22 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212126.04LLQMw3091812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361346 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 21:26:23 -0000 Author: rscheff Date: Thu May 21 21:26:21 2020 New Revision: 361346 URL: https://svnweb.freebsd.org/changeset/base/361346 Log: Retain only mutually supported TCP options after simultaneous SYN When receiving a parallel SYN in SYN-SENT state, remove all the options only we supported locally before sending the SYN,ACK. This addresses a consistency issue on parallel opens. Also, on such a parallel open, the stack could be coaxed into running with timestamps enabled, even if administratively disabled. Reviewed by: tuexen (mentor) Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23371 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_input.c Thu May 21 21:26:21 2020 (r361346) @@ -1623,17 +1623,20 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with * the next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_ts_getticks(); - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_stacks/bbr.c Thu May 21 21:26:21 2020 (r361346) @@ -11595,17 +11595,20 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with the * next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:26:21 2020 (r361346) @@ -11082,17 +11082,20 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with the * next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = cts; - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && From owner-svn-src-head@freebsd.org Thu May 21 21:33:16 2020 Return-Path: Delivered-To: svn-src-head@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 E6CBB2F5AFA; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjXX5n06z4NRC; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C18CD13FAB; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLXGgI098068; Thu, 21 May 2020 21:33:16 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLXGEI098066; Thu, 21 May 2020 21:33:16 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212133.04LLXGEI098066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361347 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 21:33:17 -0000 Author: rscheff Date: Thu May 21 21:33:15 2020 New Revision: 361347 URL: https://svnweb.freebsd.org/changeset/base/361347 Log: With RFC3168 ECN, CWR SHOULD only be sent with new data Overly conservative data receivers may ignore the CWR flag on other packets, and keep ECE latched. This can result in continous reduction of the congestion window, and very poor performance when ECN is enabled. Reviewed by: rgrimes (mentor), rrs Approved by: rgrimes (mentor), tuexen (mentor) MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23364 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_input.c Thu May 21 21:33:15 2020 (r361347) @@ -447,9 +447,15 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui } break; case CC_ECN: - if (!IN_CONGRECOVERY(tp->t_flags)) { + if (!IN_CONGRECOVERY(tp->t_flags) || + /* + * Allow ECN reaction on ACK to CWR, if + * that data segment was also CE marked. + */ + SEQ_GEQ(th->th_ack, tp->snd_recover)) { + EXIT_CONGRECOVERY(tp->t_flags); TCPSTAT_INC(tcps_ecn_rcwnd); - tp->snd_recover = tp->snd_max; + tp->snd_recover = tp->snd_max + 1; if (tp->t_flags2 & TF2_ECN_PERMIT) tp->t_flags2 |= TF2_ECN_SND_CWR; } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_output.c Thu May 21 21:33:15 2020 (r361347) @@ -1170,7 +1170,8 @@ send: */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && (sack_rxmit == 0) && - !((tp->t_flags & TF_FORCEDATA) && len == 1)) { + !((tp->t_flags & TF_FORCEDATA) && len == 1 && + SEQ_LT(tp->snd_una, tp->snd_max))) { #ifdef INET6 if (isipv6) ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); @@ -1178,14 +1179,14 @@ send: #endif ip->ip_tos |= IPTOS_ECN_ECT0; TCPSTAT_INC(tcps_ecn_ect0); - } - - /* - * Reply with proper ECN notifications. - */ - if (tp->t_flags2 & TF2_ECN_SND_CWR) { - flags |= TH_CWR; - tp->t_flags2 &= ~TF2_ECN_SND_CWR; + /* + * Reply with proper ECN notifications. + * Only set CWR on new data segments. + */ + if (tp->t_flags2 & TF2_ECN_SND_CWR) { + flags |= TH_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; + } } if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:33:15 2020 (r361347) @@ -4095,9 +4095,15 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, } break; case CC_ECN: - if (!IN_CONGRECOVERY(tp->t_flags)) { + if (!IN_CONGRECOVERY(tp->t_flags) || + /* + * Allow ECN reaction on ACK to CWR, if + * that data segment was also CE marked. + */ + SEQ_GEQ(th->th_ack, tp->snd_recover)) { + EXIT_CONGRECOVERY(tp->t_flags); KMOD_TCPSTAT_INC(tcps_ecn_rcwnd); - tp->snd_recover = tp->snd_max; + tp->snd_recover = tp->snd_max + 1; if (tp->t_flags2 & TF2_ECN_PERMIT) tp->t_flags2 |= TF2_ECN_SND_CWR; } @@ -13556,13 +13562,14 @@ send: #endif ip->ip_tos |= IPTOS_ECN_ECT0; KMOD_TCPSTAT_INC(tcps_ecn_ect0); - } - /* - * Reply with proper ECN notifications. - */ - if (tp->t_flags2 & TF2_ECN_SND_CWR) { - flags |= TH_CWR; - tp->t_flags2 &= ~TF2_ECN_SND_CWR; + /* + * Reply with proper ECN notifications. + * Only set CWR on new data segments. + */ + if (tp->t_flags2 & TF2_ECN_SND_CWR) { + flags |= TH_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; + } } if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; From owner-svn-src-head@freebsd.org Thu May 21 21:42:50 2020 Return-Path: Delivered-To: svn-src-head@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 67EFC2F6552; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjlZ28D8z4PDn; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4474F14580; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLgo3Z003968; Thu, 21 May 2020 21:42:50 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLgobu003967; Thu, 21 May 2020 21:42:50 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212142.04LLgobu003967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361348 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 361348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 21:42:50 -0000 Author: rscheff Date: Thu May 21 21:42:49 2020 New Revision: 361348 URL: https://svnweb.freebsd.org/changeset/base/361348 Log: DCTCP: update alpha only once after loss recovery. In mixed ECN marking and loss scenarios it was found, that the alpha value of DCTCP is updated two times. The second update happens with freshly initialized counters indicating to ECN loss. Overall this leads to alpha not adjusting as quickly as expected to ECN markings, and therefore lead to excessive loss. Reported by: Cheng Cui Reviewed by: chengc_netapp.com, rrs, tuexen (mentor) Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24817 Modified: head/sys/netinet/cc/cc_dctcp.c Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Thu May 21 21:33:15 2020 (r361347) +++ head/sys/netinet/cc/cc_dctcp.c Thu May 21 21:42:49 2020 (r361348) @@ -154,10 +154,8 @@ dctcp_ack_received(struct cc_var *ccv, uint16_t type) * Update the fraction of marked bytes at the end of * current window size. */ - if ((IN_FASTRECOVERY(CCV(ccv, t_flags)) && - SEQ_GEQ(ccv->curack, CCV(ccv, snd_recover))) || - (!IN_FASTRECOVERY(CCV(ccv, t_flags)) && - SEQ_GT(ccv->curack, dctcp_data->save_sndnxt))) + if (!IN_FASTRECOVERY(CCV(ccv, t_flags)) && + SEQ_GT(ccv->curack, dctcp_data->save_sndnxt)) dctcp_update_alpha(ccv); } else newreno_cc_algo.ack_received(ccv, type); From owner-svn-src-head@freebsd.org Thu May 21 22:24:24 2020 Return-Path: Delivered-To: svn-src-head@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 913542F6A31; Thu, 21 May 2020 22:24:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SkgX21yHz4R03; Thu, 21 May 2020 22:24:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C5651485B; Thu, 21 May 2020 22:24:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LMONMg028798; Thu, 21 May 2020 22:24:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LMONEF028795; Thu, 21 May 2020 22:24:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005212224.04LMONEF028795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 22:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361349 - in head: cddl/contrib/opensolaris/lib/libdtrace/common lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libdtrace/common lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 22:24:24 -0000 Author: kib Date: Thu May 21 22:24:23 2020 New Revision: 361349 URL: https://svnweb.freebsd.org/changeset/base/361349 Log: Restore the binary compatibility for link_map l_addr. Keep link_map l_addr binary layout compatible, rename l_addr to l_base where rtld returns map base. Provide relocbase in newly added l_addr. This effectively reverts the patch to the initial version of D24918. Reported by: antoine (portmgr) Reviewed by: jhb, markj Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24946 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Thu May 21 21:42:49 2020 (r361348) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Thu May 21 22:24:23 2020 (r361349) @@ -143,12 +143,18 @@ dtrace_dof_init(void) return; } +#ifdef __FreeBSD__ + elf = (void *)lmp->l_base; +#else elf = (void *)lmp->l_addr; +#endif dh.dofhp_dof = (uintptr_t)dof; - dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0; #ifdef __FreeBSD__ + dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_base : 0; dh.dofhp_pid = getpid(); +#else + dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0; #endif if (lmid == 0) { Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Thu May 21 21:42:49 2020 (r361348) +++ head/lib/libc/gen/dlinfo.3 Thu May 21 22:24:23 2020 (r361349) @@ -105,17 +105,16 @@ structure is defined in .In link.h and has the following members: .Bd -literal -offset indent -caddr_t l_addr; /* Load Offset of library */ +caddr_t l_base; /* Base Address of library */ const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, /* linked list of mapped libs */ *l_prev; +caddr_t l_addr; /* Load Offset of library */ .Ed .Bl -tag -width ".Va l_addr" -.It Va l_addr -The load offset of the object, that is, the difference between -the actual load address and the base virtual address the object -was linked at. +.It Va l_base +The base address of the object loaded into memory. .It Va l_name The full name of the loaded shared object. .It Va l_ld @@ -130,6 +129,10 @@ structure on the link-map list. The previous .Vt Link_map structure on the link-map list. +.It Va l_addr +The load offset of the object, that is, the difference between +the actual load address and the base virtual address the object +was linked at. .El .It Dv RTLD_DI_SERINFO Retrieve the library search paths associated with the given Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu May 21 21:42:49 2020 (r361348) +++ head/libexec/rtld-elf/rtld.c Thu May 21 22:24:23 2020 (r361349) @@ -4032,8 +4032,9 @@ linkmap_add(Obj_Entry *obj) struct link_map *prev; obj->linkmap.l_name = obj->path; - obj->linkmap.l_addr = obj->relocbase; + obj->linkmap.l_base = obj->mapbase; obj->linkmap.l_ld = obj->dynamic; + obj->linkmap.l_addr = obj->relocbase; if (r_debug.r_map == NULL) { r_debug.r_map = l; Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Thu May 21 21:42:49 2020 (r361348) +++ head/sys/sys/link_elf.h Thu May 21 22:24:23 2020 (r361349) @@ -57,13 +57,14 @@ #define LA_SER_SECURE 0x80 /* default (secure) path prepended */ typedef struct link_map { - caddr_t l_addr; /* Load Offset of library */ + caddr_t l_base; /* Base Address of library */ #ifdef __mips__ caddr_t l_xxx; /* unused */ #endif const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, *l_prev; /* linked list of of mapped libs */ + caddr_t l_addr; /* Load Offset of library */ } Link_map; struct r_debug { From owner-svn-src-head@freebsd.org Fri May 22 01:18:55 2020 Return-Path: Delivered-To: svn-src-head@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 CE61C2FA99F; Fri, 22 May 2020 01:18:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SpXv54Q6z4Ztq; Fri, 22 May 2020 01:18:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4BF316B32; Fri, 22 May 2020 01:18:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M1Itgr032878; Fri, 22 May 2020 01:18:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M1ItwO032876; Fri, 22 May 2020 01:18:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005220118.04M1ItwO032876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 22 May 2020 01:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 361352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 01:18:55 -0000 Author: markj Date: Fri May 22 01:18:55 2020 New Revision: 361352 URL: https://svnweb.freebsd.org/changeset/base/361352 Log: Fix the build after r361033 when ACPI is disabled. Reported by: Herbert J. Skuhra Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) +++ head/sys/amd64/amd64/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" @@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (KERNBASE + 0x0467) @@ -265,7 +268,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) +++ head/sys/i386/i386/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_apic.h" #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) @@ -202,7 +205,7 @@ cpu_mp_start(void) set_interrupt_apic_ids(); -#if MAXMEMDOM > 1 +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); #endif } From owner-svn-src-head@freebsd.org Fri May 22 03:13:29 2020 Return-Path: Delivered-To: svn-src-head@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 99ED02FC8B9; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ss553VV3z3S5g; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7337D18214; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M3DTdt007545; Fri, 22 May 2020 03:13:29 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M3DTuZ007544; Fri, 22 May 2020 03:13:29 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <202005220313.04M3DTuZ007544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 22 May 2020 03:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361355 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 03:13:29 -0000 Author: rgrimes Date: Fri May 22 03:13:29 2020 New Revision: 361355 URL: https://svnweb.freebsd.org/changeset/base/361355 Log: Include all currently present kernel options for IPFW Also fix igor complaint about manpage/s/man page Reported by: rgrimes@freebsd.org PR: 219075 Submitted by: Dries Michiels driesm.michiels_gmail.com Reported by: rgrimes Reviewed by: bcr (manpages), 0mp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24541 Modified: head/share/man/man4/ipfirewall.4 Modified: head/share/man/man4/ipfirewall.4 ============================================================================== --- head/share/man/man4/ipfirewall.4 Fri May 22 03:11:33 2020 (r361354) +++ head/share/man/man4/ipfirewall.4 Fri May 22 03:13:29 2020 (r361355) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd May 21, 2020 .Dt IPFW 4 .Os .Sh NAME @@ -20,8 +20,14 @@ Other related kernel options which may also be useful are: .Bd -ragged -offset indent .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" +.Cd "options IPDIVERT" +.Cd "options IPFIREWALL_NAT" +.Cd "options IPFIREWALL_NAT64" +.Cd "options IPFIREWALL_NPTV6" +.Cd "options IPFIREWALL_PMOD" .Cd "options IPFIREWALL_VERBOSE" .Cd "options IPFIREWALL_VERBOSE_LIMIT=100" +.Cd "options LIBALIAS" .Ed .Pp To load @@ -57,6 +63,54 @@ If the default behavior is to allow everything, it is easier to cope with firewall-tuning mistakes which may accidentally block all traffic. .Pp +When using +.Xr natd 8 +in conjunction with +.Nm +as +.Tn NAT +facility, the kernel option +.Dv IPDIVERT +enables diverting packets to +.Xr natd 8 +for translation. +.Pp +When using the in-kernel +.Tn NAT +facility of +.Nm , +the kernel option +.Dv IPFIREWALL_NAT +enables basic +.Xr libalias 3 +functionality in the kernel. +.Pp +When using any of the +.Tn IPv4 +to +.Tn IPv6 +transition mechanisms in +.Nm , +the kernel option +.Dv IPFIREWALL_NAT64 +enables all of these +.Tn NAT64 +methods in the kernel. +.Pp +When using the +.Tn IPv6 +network prefix translation facility of +.Nm , +the kernel option +.Dv IPFIREWALL_NPTV6 +enables this functionality in the kernel. +.Pp +When using the packet modification facility of +.Nm , +the kernel option +.Dv IPFIREWALL_PMOD +enables this functionality in the kernel. +.Pp To enable logging of packets passing through .Nm , enable the @@ -70,20 +124,39 @@ from flooding system logs or causing local Denial of S This option may be set to the number of packets which will be logged on a per-entry basis before the entry is rate-limited. .Pp +When using the in-kernel +.Tn NAT +facility of +.Nm , +the kernel option +.Dv LIBALIAS +enables full +.Xr libalias 3 +functionality in the kernel. +Full functionality refers to included support for cuseeme, ftp, bbt, +skinny, irc, pptp and smedia packets, which are missing in the basic +.Xr libalias 3 +functionality accomplished with the +.Dv IPFIREWALL_NAT +kernel option. +.Pp The user interface for .Nm is implemented by the .Xr ipfw 8 utility, so please refer to the .Xr ipfw 8 -manpage for a complete description of the +man page for a complete description of the .Nm capabilities and how to use it. .Sh SEE ALSO .Xr setsockopt 2 , .Xr divert 4 , .Xr ip 4 , +.Xr ip6 4 , .Xr ipfw 8 , +.Xr libalias 3 , +.Xr natd 8 , .Xr sysctl 8 , .Xr syslogd 8 , .Xr pfil 9 From owner-svn-src-head@freebsd.org Fri May 22 09:17:07 2020 Return-Path: Delivered-To: svn-src-head@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 B9AE732B6A0; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T18g4Yjgz43L7; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97C151C68D; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M9H7mx028709; Fri, 22 May 2020 09:17:07 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M9H7oE028708; Fri, 22 May 2020 09:17:07 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005220917.04M9H7oE028708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Fri, 22 May 2020 09:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361360 - head/sys/dev/hyperv/hvsock X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/hvsock X-SVN-Commit-Revision: 361360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 09:17:07 -0000 Author: whu Date: Fri May 22 09:17:07 2020 New Revision: 361360 URL: https://svnweb.freebsd.org/changeset/base/361360 Log: Socket AF_HYPERV should return failure when it is not running on HyperV Reported by: pho Sponsored by: Microsoft Modified: head/sys/dev/hyperv/hvsock/hv_sock.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- head/sys/dev/hyperv/hvsock/hv_sock.c Fri May 22 09:02:40 2020 (r361359) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Fri May 22 09:17:07 2020 (r361360) @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, struct { struct hvs_pcb *pcb = so2hvspcb(so); + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_attach called\n", __func__); @@ -380,6 +383,9 @@ hvs_trans_detach(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_detach called\n", __func__); @@ -589,6 +595,9 @@ hvs_trans_disconnect(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); @@ -916,6 +925,9 @@ hvs_trans_close(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_close called\n", __func__); @@ -956,6 +968,9 @@ void hvs_trans_abort(struct socket *so) { struct hvs_pcb *pcb = so2hvspcb(so); + + if (vm_guest != VM_GUEST_HV) + return; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_abort called\n", __func__); From owner-svn-src-head@freebsd.org Fri May 22 09:38:44 2020 Return-Path: Delivered-To: svn-src-head@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 CBB5232BA42; Fri, 22 May 2020 09:38:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T1dc5L1yz44QJ; Fri, 22 May 2020 09:38:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B20481C54F; Fri, 22 May 2020 09:38:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M9ciCq040981; Fri, 22 May 2020 09:38:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M9ciK7040980; Fri, 22 May 2020 09:38:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202005220938.04M9ciK7040980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 22 May 2020 09:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361361 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 361361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 09:38:44 -0000 Author: bapt Date: Fri May 22 09:38:44 2020 New Revision: 361361 URL: https://svnweb.freebsd.org/changeset/base/361361 Log: Update pciids to 2020.05.22 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Fri May 22 09:17:07 2020 (r361360) +++ head/share/misc/pci_vendors Fri May 22 09:38:44 2020 (r361361) @@ -2,8 +2,8 @@ # List of PCI ID's # -# Version: 2020.02.22 -# Date: 2020-02-22 03:15:04 +# Version: 2020.05.22 +# Date: 2020-05-22 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -438,8 +438,8 @@ 1028 1fd1 PERC H730P MX 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix - 1bd4 0014 6G SAS3108 2G - 1bd4 0015 6G SAS3108 4G + 1bd4 0014 12G SAS3108 2G + 1bd4 0015 12G SAS3108 4G 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter 1d49 0608 ThinkSystem RAID 730-8i 2GB Flash PCIe 12Gb Adapter 1d49 0609 ThinkSystem RAID 730-8i 4GB Flash PCIe 12Gb Adapter @@ -456,6 +456,7 @@ 1028 1f4c PERC H330 Mini (for blades) 1028 1f4d PERC H330 Embedded (for monolithic) 1054 306a SAS 3004 iMR ROMB + 1734 1211 PRAID CP400i [D3307-A12] 1d49 04db ServeRAID M1210 SAS/SATA Controller 1d49 0504 ThinkSystem RAID 520-8i PCIe 12Gb Adapter 0060 MegaRAID SAS 1078 @@ -655,10 +656,13 @@ 1028 1fd3 HBA330 MMZ # Supermicro AOC-S3008L-L8e uses 0808 for their SAS3008 SAS controller 15d9 0808 AOC-S3008L-L8e + 1bd4 0008 12G SAS3008IMR Onboard 1bd4 000b 12G SAS3008IR 1bd4 000c 12G SAS3008IT 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 1bd4 0012 12Gb SAS3008IR UDM + 1bd4 001f 12G SAS3008IR Onboard + 1bd4 0020 12G SAS3008IT Onboard 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK @@ -929,11 +933,13 @@ 1561 Anubis 15d8 Picasso 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile 1458 d000 Radeon RX Vega 11 15de Raven/Raven2/Fenghuang HDMI/DP Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15df Raven/Raven2/Fenghuang/Renoir Cryptographic Coprocessor 103c 8615 Pavilion Laptop 15-cw1xxx 15ff Fenghuang [Zhongshan Subor Z+] @@ -1120,6 +1126,7 @@ 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard + 1458 a102 GA-880GMA-USB3 17f2 5000 KI690-AM2 Motherboard 4384 SBx00 PCI to PCI Bridge 4385 SBx00 SMBus Controller @@ -1190,6 +1197,7 @@ 1043 8443 M5A88-V EVO 1043 84dd M5A99X EVO (R1.0) SB950 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 b002 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] 105b 0e13 N15235/A74MX mainboard / AMD SB700 @@ -1203,6 +1211,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4397 SB7x0/SB8x0/SB9x0 USB OHCI0 Controller @@ -1212,6 +1221,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4398 SB7x0 USB OHCI1 Controller @@ -1224,6 +1234,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller 1002 4392 MSI MS-7713 motherboard @@ -1878,9 +1889,9 @@ 1642 3c81 Radeon HD 8670 1642 3c91 Radeon HD 8670 1642 3f09 Radeon R7 350 - 6611 Oland [Radeon HD 8570 / R7 240/340 OEM] + 6611 Oland [Radeon HD 8570 / R7 240/340 / Radeon 520 OEM] 1028 210b Radeon R5 240 OEM - 1642 1869 AMD Radeon 520 + 1642 1869 Radeon 520 OEM 174b 4248 Radeon R7 240 OEM 174b a240 Radeon R7 240 OEM 174b d340 Radeon R7 340 OEM @@ -1903,6 +1914,7 @@ 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] + 1043 048f R7260X-DC2OC-2GD5 1043 04d3 AMD Radeon R7 260X 148c 0907 Radeon R7 360 1682 0907 Radeon R7 360 @@ -2561,6 +2573,8 @@ 1002 0b37 Radeon RX 480 1028 1722 Radeon RX 570X 1028 1723 Radeon RX 580X +# OEM card found in desktops sold by HP. + 103c 840e Radeon RX 580 4GB 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 @@ -2844,7 +2858,7 @@ 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] - 6864 Vega + 6864 Vega 10 [Radeon Pro V340] 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 10 [Radeon PRO WX 8100/8200] 686c Vega 10 [Radeon Instinct MI25 MxGPU] @@ -3349,7 +3363,8 @@ 6901 Topaz PRO [Radeon R5 M255] 103c 1318 Radeon R6 M255DX 6907 Meso XT [Radeon R5 M315] - 6921 Amethyst XT [Radeon R9 M295X] + 6920 Amethyst [Radeon R9 M395/ M395X Mac Edition] + 6921 Amethyst XT [Radeon R9 M295X / M390X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] 13cc 3d2b MXRT-7600 @@ -3917,6 +3932,7 @@ aab0 Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] aab8 Tiran HDMI Audio aac0 Tobago HDMI Audio [Radeon R7 360 / R9 360 OEM] + 1043 aac0 R7260X-DC2OC-2GD5 aac8 Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio @@ -4694,13 +4710,18 @@ 15dc Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B 15de Raven/Raven2/FireFlight HD Audio Controller 15df Family 17h (Models 10h-1fh) Platform Security Processor + 17aa 5124 ThinkPad E595 15e0 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e1 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor + 17aa 5124 ThinkPad E595 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e4 Raven/Raven2/Renoir Sensor Fusion Hub 15e5 Raven2 USB 3.1 15e6 Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver @@ -4968,9 +4989,11 @@ 790b FCH SMBus Controller 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790e FCH LPC Bridge 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790f FCH PCI Bridge 7914 FCH USB XHCI Controller 9600 RS780 Host Bridge @@ -10974,6 +10997,7 @@ 0fb9 GP107GL High Definition Audio Controller 0fba GM206 High Definition Audio Controller 0fbb GM204 High Definition Audio Controller + 0fbc GM107 High Definition Audio Controller [GeForce 940MX] 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] @@ -11772,6 +11796,7 @@ 174e GM108M [GeForce MX110] 1789 GM107GL [GRID M3-3020] 179c GM107 [GeForce 940MX] + 1025 1094 Acer Aspire E5-575G 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] @@ -11787,7 +11812,8 @@ 1adb TU106 USB Type-C UCSI Controller 1043 8673 TURBO-RTX2070-8G 1aeb TU116 High Definition Audio Controller - 1aed TU116 [GeForce GTX 1650 SUPER] + 1aec TU116 USB 3.1 Host Controller + 1aed TU116 USB Type-C UCSI Controller 1b00 GP102 [TITAN X] 1b01 GP102 [GeForce GTX 1080 Ti 10GB] 1b02 GP102 [TITAN Xp] @@ -11869,6 +11895,7 @@ 1c91 GP107M [GeForce GTX 1050 3 GB Max-Q] 1c92 GP107M [GeForce GTX 1050 Mobile] 1c94 GP107M [GeForce MX350] + 1c96 GP107M [GeForce MX350] 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -11901,6 +11928,7 @@ 1d33 GP108GLM [Quadro P500 Mobile] 1d34 GP108GLM [Quadro P520] 1d52 GP108BM [GeForce MX250] + 1d56 GP108BM [GeForce MX330] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2 16GB] 1db2 GV100GL [Tesla V100 DGXS 16GB] @@ -11926,6 +11954,7 @@ 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e36 TU102GL 1e37 TU102GL [GRID RTX T10-4/T10-8/T10-16] 10de 1347 GRID RTX T10-8 10de 1348 GRID RTX T10-4 @@ -11943,6 +11972,8 @@ 1e87 TU104 [GeForce RTX 2080 Rev. A] 1e89 TU104 [GeForce RTX 2060] 1e90 TU104M [GeForce RTX 2080 Mobile] + 1e91 TU104M [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1e93 TU104M [GeForce RTX 2080 SUPER Mobile / Max-Q] 1eab TU104M 1eae TU104M 1eb0 TU104GL [Quadro RTX 5000] @@ -11955,25 +11986,35 @@ 1ec2 TU104 [GeForce RTX 2070 SUPER] 1ec7 TU104 [GeForce RTX 2070 SUPER] 1ed0 TU104BM [GeForce RTX 2080 Mobile] + 1ed1 TU104BM [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1ed3 TU104BM [GeForce RTX 2080 SUPER Mobile / Max-Q] 1f02 TU106 [GeForce RTX 2070] 1043 8673 TURBO RTX 2070 1f04 TU106 1f06 TU106 [GeForce RTX 2060 SUPER] 1f07 TU106 [GeForce RTX 2070 Rev. A] 1f08 TU106 [GeForce RTX 2060 Rev. A] + 1f09 TU106 [GeForce GTX 1660 SUPER] 1f10 TU106M [GeForce RTX 2070 Mobile] 1f11 TU106M [GeForce RTX 2060 Mobile] + 1f12 TU106M [GeForce RTX 2060 Max-Q] + 1f14 TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh] + 1f15 TU106M [GeForce RTX 2060 Mobile] 1f2e TU106M 1f36 TU106GLM [Quadro RTX 3000 Mobile / Max-Q] 1f42 TU106 [GeForce RTX 2060 SUPER] 1f47 TU106 [GeForce RTX 2060 SUPER] - 1f50 TU106BM [GeForce RTX 2070 Mobile] + 1f50 TU106BM [GeForce RTX 2070 Mobile / Max-Q] 1f51 TU106BM [GeForce RTX 2060 Mobile] + 1f54 TU106BM [GeForce RTX 2070 Mobile] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f92 TU117M [GeForce GTX 1650 Mobile] + 1f94 TU117M + 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] + 1f99 TU117M 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] @@ -11983,6 +12024,7 @@ 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] 2191 TU116M [GeForce GTX 1660 Ti Mobile] + 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL 21bf TU116GL 21c4 TU116 [GeForce GTX 1660 SUPER] @@ -12201,17 +12243,20 @@ 522a RTS522A PCI Express Card Reader 103c 8079 EliteBook 840 G3 103c 825b OMEN-17-w001nv + 17aa 5124 ThinkPad E595 5249 RTS5249 PCI Express Card Reader 103c 1909 ZBook 15 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 17aa 224f ThinkPad X1 Carbon 5th Gen 5260 RTS5260 PCI Express Card Reader 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader + 1025 1094 Acer Aspire E5-575G 5288 RTS5288 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader 1043 1457 K55A Laptop @@ -12294,11 +12339,13 @@ 1462 236c 945P Neo3-F motherboard 8168 RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 1019 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller + 1025 1094 Acer Aspire E5-575G 1028 0283 Vostro 220 1028 04b2 Vostro 3350 1028 04da Vostro 3750 1028 06f2 Latitude 3470 1028 06f3 Latitude 3570 + 1028 0869 Vostro 3470 103c 1611 Pavilion DM1Z-3000 103c 1950 ProBook 450/455 103c 2a6f Asus IPIBL-LB Motherboard @@ -12323,6 +12370,8 @@ 1462 7c37 X570-A PRO motherboard 1775 11cc CC11/CL11 17aa 3814 Z50-75 + 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL + 17aa 5124 ThinkPad E595 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter 8086 2055 NUC Kit DN2820FYKH @@ -12376,6 +12425,8 @@ 17aa b736 Z50-75 b822 RTL8822BE 802.11a/b/g/n/ac WiFi adapter 103c 831b Realtek RTL8822BE 802.11ac 2 × 2 Wi-Fi + Bluetooth 4.2 Combo Adapter (MU-MIMO supported) + 17aa 5124 ThinkPad E595 + 17aa b023 ThinkPad E595 c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter c822 RTL8822CE 802.11ac PCIe Wireless Network Adapter d723 RTL8723DE 802.11b/g/n PCIe Adapter @@ -12485,6 +12536,9 @@ 1102 8071 SB0150 SoundBlaster PCI512 # EMU8008 PCI version of emu8000 chip 0003 SB AWE64(D) + 1102 0010 CT4600 AWE64D + 1102 0030 CT4650 AWE64D + 1102 0031 CT4655 AWE64D 0004 EMU10k2/CA0100/CA0102/CA10200 [Sound Blaster Audigy Series] 1102 0040 SB0090 Audigy Player # Probably an early engineering sample @@ -12526,7 +12580,11 @@ 1102 0021 X-Fi Platinum 1102 002c X-Fi XtremeGamer FATAL1TY PRO 1102 1003 X-Fi XtremeMusic - 0006 EMU10k1X [SB Live! Value/OEM Series] +# This chip is also known as CA0103 on Sound Blaster 5.1 SB0680 card. + 0006 EMU10k1X / CA0103 [SB Live! OEM / SB 5.1 / Ectiva 5.1] + 1102 1001 SB0680 Sound Blaster 5.1 + 1102 1003 SB0203 SB Live! 5.1 (Dell) + 1102 1004 TP0033 Ectiva Audio 5.1 0007 CA0106/CA0111 [SB Live!/Audigy/X-Fi Series] 1102 0007 SBLive! 24bit 1102 1001 SB0310 Audigy LS @@ -16224,6 +16282,10 @@ # acquired by Diodes Inc. 12d8 Pericom Semiconductor 01a7 7C21P100 2-port PCI-X to PCI-X Bridge +# 3Port-3Lane PCI Express Switch GreenPacket Family + 0303 PCI Express Switch 3-3 +# PI7C9X20508GP 5Port-8Lane PCI Express Switch GreenPacket Family + 0508 PI7C9X20508GP PCI Express Switch 5Port-8Lane 2304 PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch 2404 PI7C9X2G404 EL/SL PCIe2 4-Port/4-Lane Packet Switch 2608 PI7C9X2G608GP PCIe2 6-Port/8-Lane Packet Switch @@ -18118,6 +18180,30 @@ 1028 1ff9 Express Flash PM1725b 6.4TB AIC 1028 1ffa Express Flash PM1725b 12.8TB AIC a824 NVMe SSD Controller PM173X + 1028 2040 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 1.6TB + 1028 2041 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 3.2TB + 1028 2042 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 6.4TB + 1028 2043 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 12.8TB + 1028 2044 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 1.6TB + 1028 2045 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 3.2TB + 1028 2046 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 6.4TB + 1028 2070 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 1.92TB + 1028 2071 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 3.84TB + 1028 2072 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 7.68TB + 1028 2073 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 15.36TB + 1028 2074 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 1.92TB + 1028 2075 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 3.84TB + 1028 2076 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 7.68TB + 1028 2090 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 1.6TB + 1028 2091 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 3.2TB + 1028 2092 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 6.4TB + 1028 2093 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 12.8TB + 1028 2094 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 1.6TB + 1028 2095 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 3.2TB + 1028 2096 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 6.4TB + 1028 2097 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 1.92TB + 1028 2098 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 3.84TB + 1028 2099 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 7.68TB 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -19817,6 +19903,12 @@ 0215 MT42822 Family [BlueField-2 Secure Flash Recovery] 0216 MT2894 Family [ConnectX-6 Lx Flash Recovery] 0217 MT2894 Family [ConnectX-6 Lx Secure Flash Recovery] + 0218 MT2910 Family [ConnectX-7 Flash Recovery] + 0219 MT2910 Family [ConnectX-7 Secure Flash Recovery] + 021a MT43162 Family [BlueField-3 Lx SoC Flash Recovery] + 021b MT43162 Family [BlueField-3 Lx Secure Flash Recovery] + 021c MT43244 Family [BlueField-3 SoC Flash Recovery] + 021d MT43244 Family [BlueField-3 Secure Flash Recovery] 024e MT53100 [Spectrum-2, Flash recovery mode] 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0250 Spectrum-3, Flash recovery mode @@ -19830,8 +19922,6 @@ 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image 0281 NPS-600 Flash Recovery - 0538 MT2910 Family [ConnectX-7 Flash Recovery] - 0539 MT2910 Family [ConnectX-7 Secure Flash Recovery] 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -19922,9 +20012,12 @@ 1976 MT28908 Family [ConnectX-6 PCIe Bridge] 1977 MT2892 Family [ConnectX-6 Dx PCIe Bridge] 1978 MT42822 Family [BlueField-2 SoC PCIe Bridge] + 1979 MT2910 Family [ConnectX-7 PCIe Bridge] + 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] + 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 - 1bd4 003a 10G SFP28 SP EO251FM9 Adapter + 1bd4 003a 25G SFP28 SP EO251FM9 Adapter 1bd4 004d SN10XMP2P25,YZPC-01191-101 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost @@ -19976,8 +20069,16 @@ a2d4 MT42822 BlueField-2 SoC Crypto enabled a2d5 MT42822 BlueField-2 SoC Crypto disabled a2d6 MT42822 BlueField-2 integrated ConnectX-6 Dx network controller + a2d7 MT43162 BlueField-3 Lx SoC Crypto enabled + a2d8 MT43162 BlueField-3 Lx SoC Crypto disabled + a2d9 MT43162 BlueField-3 Lx integrated ConnectX-7 network controller + a2da MT43244 BlueField-3 SoC Crypto enabled + a2db MT43244 BlueField-3 SoC Crypto disabled + a2dc MT43244 BlueField-3 integrated ConnectX-7 network controller c2d2 MT416842 BlueField SoC management interfac c2d3 MT42822 BlueField-2 SoC Management Interface + c2d4 MT43162 BlueField-3 Lx SoC Management Interface + c2d5 MT43244 BlueField-3 SoC Management Interface # SwitchX-2, 40GbE switch c738 MT51136 c739 MT51136 GW @@ -20541,6 +20642,7 @@ 1028 0300 Wireless 1802 802.11abgn Adapter 1a56 2003 Killer Wireless-N 1202 Half-size Mini PCIe Card 0036 QCA9565 / AR9565 Wireless Network Adapter + 1028 020e Vostro 3470 0037 AR9485 Wireless Network Adapter # Also used as Gigabyte GC-WB150 on a PCIe-to-mini-PCIe converter 1a3b 2100 AW-NB100H 802.11n Wireless Mini PCIe Card @@ -20551,6 +20653,7 @@ 0040 QCA9980/9990 802.11ac Wireless Network Adapter 0041 QCA6164 802.11ac Wireless Network Adapter 0042 QCA9377 802.11ac Wireless Network Adapter + 11ad 08a6 Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter 0046 QCA9984 802.11ac Wave 2 Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20778,11 +20881,22 @@ 0121 PCT-7303A PC card with IRC counters 0122 PCT-7408A PC card with counters and timers 0123 PCT-7424 PCI card with standard counters + 0141 PCA7208AL - Analog Inputs/Outputs + 0142 PCA7208AS - Analog inputs/Outputs + 0143 PCA7408AL - Analog Inputs/Outputs + 0144 PCA7408AS - Analog Inputs/Outputs 0214 PCT-7424C (F0) PC card with standard counters 0215 PCT-7424C (F1) PC card with standard counters 0216 PCT-7424E (F0) PC card with standard counters 0217 PCT-7424E (F1) PC card with standard counters + 0240 PCA7428CL_F0 - analog Inputs + 0241 PCA7428CL_F1 - analog Inputs + 0242 PCA7428CS_F0 - Analog Inputs/Outputs non isolated + 0243 PCA7428CS_F1 - Analog Inputs/Outputs non isolated + 0244 PCA7428CE_F0 - Analog Inputs isolated + 0245 PCA7428CE_F1 - Analog Inputs isolated 0303 PCD-7006C Digital Input & Output PCI Card + 0800 PCD8006 - PCIe digital Inputs/Outputs ff00 CTU CAN FD PCIe Card 1761 Pickering Interfaces Ltd 1771 InnoVISION Multimedia Ltd. @@ -21126,11 +21240,35 @@ 1011 R1011 IDE Controller 1012 R1012 IDE Controller 1031 PCI/PCI-X to PCI-E Bridge +# Integrated in Vortex86EX, Vortex86EX2 SoC + 1070 CAN Bus Controller +# Integrated in Vortex86EX, Vortex86EX2 SoCs + 1331 Motion Control Interface +# Found in the Vortex86EX2 SoC + 1930 Hybrid Function Control Register +# IGP = on-chip integrated in the MSTI-PMX-1000 (Vortex86MX). + 2010 RDC M2010 VGA-compatible graphics adapter 2012 M2012/R3308 VGA-compatible graphics adapter +# IGP = on-chip integrated in the Vortex86DX3. Basic 2D accel. UMA architecture. + 2015 RDC M2015 VGA-compatible graphics adapter +# Found in the Vortex86EX SoC + 6011 R6011 ISA Bridge +# Found in the Vortex86EX2 SoC + 6013 R6013 ISA Bridge 6020 R6020 North Bridge 6021 R6021 Host Bridge +# Found in the Vortex86DX3 SoC + 6023 R6023 Host Bridge +# Found in the Vortex86EX SoC + 6025 R6025 Host Bridge +# Found in the Vortex86EX2 SoC + 6026 R6026 Host Bridge 6030 R6030 ISA Bridge 6031 R6031 ISA Bridge +# Found in the Vortex86DX3 SoC + 6035 R6035 ISA Bridge +# Found in MSTI-PMX-1000 (Vortex86MX) SoC. + 6036 R6036 ISA Bridge 6040 R6040 MAC Controller 6060 R6060 USB 1.1 Controller 6061 R6061 USB 2.0 Controller @@ -21860,6 +21998,7 @@ 1987 Phison Electronics Corporation 5007 E7 NVMe Controller 5012 E12 NVMe Controller + 5013 PS5013 E13 NVMe Controller 5016 E16 PCIe4 NVMe Controller 1989 Montilio Inc. 0001 RapidFile Bridge @@ -21944,16 +22083,22 @@ 19e5 3036 NVMe SSD ES3600C V3 3200GB HHHL AIC 0200 Hi1822 Family (2*100GE) 19e5 d139 Hi1822 SP572 (2*100GE) + 19e5 d13d Hi1822 SC371 (2*100GE) + 19e5 d147 Hi1822 SP573 (2*100GE) 0202 Hi1822 Family (2*32G FC) + 19e5 d149 Hi1822 SP528 (2*32G FC) 19e5 d302 Hi1822 SP521 (2*32G FC) 19e5 d304 Hi1822 SP526 (2*32G FC) 0203 Hi1822 Family (2*16G FC) + 19e5 d148 Hi1822 SP527 (2*16G FC) 19e5 d301 Hi1822 SP520 (2*16G FC) 19e5 d305 Hi1822 SP525 (2*16G FC) 0205 Hi1822 Family (2*100GE) 19e5 df27 Hi1822 MZ731 MEZZ (2*100GE) 0206 Hi1822 Family (2*25GE) 19e5 d138 Hi1822 SP582 (2*25GE) + 19e5 d13a Hi1822 SC381 (2*25GE) + 19e5 d145 Hi1822 SP586 (2*25GE) 0210 Hi1822 Family (4*25GE) 19e5 df2e Hi1822 MZ532 MEZZ (4*25GE) 0211 Hi1822 Family (4*25GE) @@ -21969,6 +22114,7 @@ 19e5 d129 Hi1822 SP570 (4*25GE) 19e5 d136 Hi1822 SP580 (4*25GE) 19e5 d141 Hi1822 SP583 (4*25GE) + 19e5 d146 Hi1822 SP585 (4*25GE) 371e Hi1822 Family Virtual Bridge 375e Hi1822 Family Virtual Function 379e Hi1822 Family Virtual Function @@ -21982,6 +22128,10 @@ a12a HiSilicon Add-on PCI-PCI Bridge a220 HNS GE Network Controller a221 HNS GE/10GE/25GE Network Controller + 19e5 0454 TM280 + 19e5 04cc TM210 + 19e5 d14a TM280 4*25G + 19e5 d14b TM210 4*GE a222 HNS GE/10GE/25GE RDMA Network Controller a224 HNS GE/10GE/25GE/50GE RDMA Network Controller a226 HNS GE/10GE/25GE/50GE/100GE RDMA Network Controller @@ -22337,6 +22487,7 @@ 0007 DELTA-3G-elp-d 1b6f Etron Technology, Inc. 7023 EJ168 USB 3.0 Host Controller + 1458 5007 GA-880GMA-USB3 7052 EJ188/EJ198 USB 3.0 Host Controller 1849 7052 QC5000-ITX/PH 1b73 Fresco Logic @@ -22442,6 +22593,7 @@ 1102 OmniBusBox II Multi-Protocol Interface Core 1103 OmniBus II cPCIe/PXIe Multi-Protocol Interface Card 1bd4 Inspur Electronic Information Industry Co., Ltd. + 0911 Arria10_PCIe_F10A1150 1bee IXXAT Automation GmbH 0003 CAN-IB200/PCIe 1bef Lantiq @@ -22466,6 +22618,12 @@ 1c1c Symphony 0001 82C101 1c1f SoftLab-NSK + 0015 FD842 + 0019 FD722 + 001a FD788 + 001b FD720 + 001c FD922 + 001d Vega 1c28 Lite-On IT Corp. / Plextor 0122 M6e PCI Express SSD [Marvell 88SS9183] # previously Fiberblaze @@ -22495,8 +22653,12 @@ a00a FBC2CGG3 Capture 8x10Gb [Mango] a00e FB2CG Capture 2x100Gb [Savona] a00f FB2CG Capture 2x40Gb [Savona] + a010 FB2CGHH Capture 2x40Gb [Tivoli] a011 FB2CG Capture 2x25Gb [Savona] a012 FB2CG Capture 8x10Gb [Savona] + a013 FB2CGHH Capture 2x25Gb [Tivoli] + a014 FB2CGHH Capture 8x10Gb [Tivoli] + a015 FB2CGHH Capture 2x100Gb [Tivoli] # Used on V120 VME Crate Controller 1c32 Highland Technology, Inc. 1c33 Daktronics, Inc @@ -22521,6 +22683,7 @@ 1283 PC300 NVMe Solid State Drive 256GB 1284 PC300 NVMe Solid State Drive 512GB 1285 PC300 NVMe Solid State Drive 1TB + 1327 BC501 NVMe Solid State Drive 512GB 1504 SC300 512GB M.2 2280 SATA Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. 000d PBlaze5 520/526 AIC @@ -22577,6 +22740,10 @@ 0010 Pro Capture Endpoint 0014 PRO CAPTURE AIO 4K PLUS 0017 PRO CAPTURE AIO 4K + 0051 Eco Capture Dual HDMI M.2 + 0052 Eco Capture HDMI 4K M.2 + 0053 Eco Capture Dual SDI M.2 + 0054 Eco Capture Quad SDI M.2 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -22691,6 +22858,7 @@ 04de Taurus/McKinley 1d6a Aquantia Corp. 0001 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 00b1 AQC100 10G Ethernet MAC controller [AQtion] 07b1 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 08b1 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 11b1 AQC111 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] @@ -22787,26 +22955,32 @@ 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1001 DSC Virtual Downstream Port 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1002 DSC Ethernet Controller 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1003 DSC Ethernet Controller VF 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1004 DSC Management Controller 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1007 DSC Storage Accelerator 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1de0 Groq 0000 Q100 Tensor Streaming Processor 1de1 Tekram Technology Co.,Ltd. @@ -22849,6 +23023,8 @@ 0003 alst4x 1dfc JSC NT-COM 1181 TDM 8 Port E1/T1/J1 Adapter +1e0f KIOXIA Corporation + 0007 NVMe SSD Controller Cx6 1e17 Arnold & Richter Cine Technik GmbH & Co. Betriebs KG 1e24 Squirrels Research Labs 0101 Acorn CLE-101 @@ -22862,6 +23038,8 @@ # JungleCat VU35P Module 1635 JCM35 1e26 Fujitsu Client Computing Limited +1e36 Shanghai Enflame Technology Co. Ltd + 0001 T10 [CloudBlazer] # nee Thinci, Inc 1e38 Blaize, Inc 1e3d Burlywood, Inc @@ -22874,11 +23052,13 @@ 0100 The device has already been deleted. 0000 0100 PY8800 64GB Accelerator 1e6b Axiado Corp. +1e85 Heitec AG 1e89 ID Quantique SA 0002 Quantis-PCIe-40M 0003 Quantis-PCIe-240M # aka SED Systems 1e94 Calian SED +1e95 Solid State Storage Technology Corporation # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -23793,6 +23973,7 @@ 02d3 Comet Lake SATA AHCI Controller 02e0 Comet Lake Management Engine Interface 02e8 Serial IO I2C Host Controller + 02e9 Comet Lake Serial IO I2C Host Controller 02f0 Wireless-AC 9462 02f9 Comet Lake Thermal Subsytem 02fc Comet Lake Integrated Sensor Solution @@ -23875,6 +24056,27 @@ 8086 01f7 SCRU32 # uninitialized SRCU32 RAID Controller 061f 80303 I/O Processor + 068d Comet Lake LPC Controller + 06a3 Comet Lake PCH SMBus Controller + 06a4 Comet Lake PCH SPI Controller + 06a8 Comet Lake PCH Serial IO UART Host Controller #0 + 06a9 Comet Lake PCH Serial IO UART Host Controller #1 + 06aa Comet Lake PCH Serial IO SPI Controller #0 + 06ab Comet Lake PCH Serial IO SPI Controller #1 + 06ac Comet Lake PCI Express Root Port #21 + 06b0 Comet Lake PCI Express Root Port #9 + 06c0 Comet Lake PCI Express Root Port #17 + 06c8 Comet Lake PCH cAVS + 06e0 Comet Lake HECI Controller + 06e8 Comet Lake PCH Serial IO I2C Controller #0 + 06e9 Comet Lake PCH Serial IO I2C Controller #1 + 06ea Comet Lake PCH Serial IO I2C Controller #2 + 06eb Comet Lake PCH Serial IO I2C Controller #3 + 06ed Comet Lake USB 3.1 xHCI Host Controller + 06ef Comet Lake PCH Shared SRAM + 06f0 Wi-Fi 6 AX201 + 06f9 Comet Lake PCH Thermal Controller + 06fb Comet Lake PCH Serial IO SPI Controller #2 0700 CE Media Processor A/V Bridge 0701 CE Media Processor NAND Flash Controller 0703 CE Media Processor Media Control Unit 1 @@ -24345,6 +24547,13 @@ 1028 1fe7 Express Flash NVMe 3.2TB 2.5" U.2 (P4600) 1028 1fe8 Express Flash NVMe 2.0TB HHHL AIC (P4600) 1028 1fe9 Express Flash NVMe 4.0TB HHHL AIC (P4600) + 0b60 NVMe DC SSD [3DNAND, Beta Rock Controller] + 1028 2064 NVMe SED RI U.2 1.92TB (P5500) + 1028 2065 NVMe SED RI U.2 3.84TB (P5500) + 1028 2066 NVMe SED RI U.2 7.68TB (P5500) + 1028 2101 NVMe RI U.2 1.92TB (P5500) + 1028 2102 NVMe RI U.2 3.84TB (P5500) + 1028 2103 NVMe RI U.2 7.68TB (P5500) 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -24440,6 +24649,7 @@ 0d58 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking 8086 0000 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking 8086 0001 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking + 0d9f Ethernet Controller (2) I225-IT 0e00 Xeon E7 v2/Xeon E5 v2/Core i7 DMI2 1028 04f7 Xeon E5 v2 on PowerEdge R320 server 15d9 066b X9SRL-F @@ -24756,6 +24966,7 @@ 1014 0549 Thinkpad 1179 0001 PRO/1000 MT Mobile Connection 8086 101e PRO/1000 MT Mobile Connection + 101f Ethernet Controller V710 for 5GBASE-T 1026 82545GM Gigabit Ethernet Controller 1028 0168 Precision Workstation 670 Mainboard 1028 0169 Precision 470 @@ -25499,6 +25710,7 @@ 108e 7b15 Sun Dual Port 10 GbE PCIe 2.0 Low Profile Adapter, Base-T 1137 00bf Ethernet Converged Network Adapter X540-T2 1170 0052 Ethernet Controller 10-Gigabit X540-AT2 + 15d9 0734 AOC-STG-I2T 17aa 1073 ThinkServer X540-T2 AnyFabric 17aa 4006 Ethernet Controller 10-Gigabit X540-AT2 1bd4 001a 10G base-T DP ER102Ti3 Rack Adapter @@ -25743,21 +25955,35 @@ 8086 0008 Ethernet Network Adapter OCP XXV710-1 8086 0009 Ethernet 25G 2P XXV710 Adapter 8086 000a Ethernet 25G 2P XXV710 OCP + 8086 000c Ethernet Network Adapter XXV710-DA2 for OCP 3.0 8086 4001 Ethernet Network Adapter XXV710-2 1591 Ethernet Controller E810-C for backplane 1592 Ethernet Controller E810-C for QSFP + 1137 02bf E810CQDA2 2x100 GbE QSFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-C-Q2 8086 0004 Ethernet Network Adapter E810-C-Q2 8086 0005 Ethernet Network Adapter E810-C-Q1 for OCP3.0 8086 0006 Ethernet Network Adapter E810-C-Q2 for OCP3.0 8086 0009 Ethernet Network Adapter E810-C-Q1 + 8086 000a Ethernet Network Adapter E810-C-Q1 for OCP 1593 Ethernet Controller E810-C for SFP + 1137 02c3 E810XXVDA4 4x25/10 GbE SFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-L-2 8086 0005 Ethernet Network Adapter E810-XXV-4 8086 0006 Ethernet Network Adapter E810-XXV-4 8086 0007 Ethernet Network Adapter E810-XXV-4 8086 0008 Ethernet Network Adapter E810-XXV-2 8086 0009 Ethernet Network Adapter E810-XXV-2 for OCP 2.0 + 1599 Ethernet Controller E810-XXV for backplane + 159a Ethernet Controller E810-XXV for QSFP + 159b Ethernet Controller E810-XXV for SFP + 1137 02be E810XXVDA2 2x25/10 GbE SFP28 PCIe NIC + 8086 0001 Ethernet 25G 2P E810-XXV OCP + 8086 0002 Ethernet 25G 2P E810-XXV Adapter + 8086 0003 Ethernet Network Adapter E810-XXV-2 + 8086 0005 Ethernet Network Adapter E810-XXV-2 for OCP 3.0 + 8086 4001 Ethernet Network Adapter E810-XXV-2 + 8086 4002 Ethernet Network Adapter E810-XXV-2 for OCP 3.0 15a0 Ethernet Connection (2) I218-LM 15a1 Ethernet Connection (2) I218-V 15a2 Ethernet Connection (3) I218-LM @@ -25834,6 +26060,8 @@ 15ec JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] 15ef JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] 15f0 JHL7540 Thunderbolt 3 USB Controller [Titan Ridge DD 2018] + 15f2 Intel(R) Ethernet Controller I225-LM + 15f3 Intel(R) Ethernet Controller I225-V 15f4 Ethernet Connection (15) I219-LM 15f5 Ethernet Connection (15) I219-V 15f6 I210 Gigabit Ethernet Connection @@ -25904,6 +26132,7 @@ 1901 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) 1902 HD Graphics 510 1903 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv @@ -25919,11 +26148,13 @@ 1908 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1909 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x4) 190c Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1028 06d6 Latitude 7275 tablet 190f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1910 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv 1911 Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model + 1028 0869 Vostro 3470 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 225d ThinkPad T480 @@ -25934,11 +26165,13 @@ 103c 8079 EliteBook 840 G3 1918 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1919 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit + 1028 06d6 Latitude 7275 tablet 191b HD Graphics 530 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv 191d HD Graphics P530 191e HD Graphics 515 + 1028 06d6 Latitude 7275 tablet 191f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1921 HD Graphics 520 1926 Iris Graphics 540 @@ -29252,6 +29485,7 @@ # Stone Peak 1x1 8086 4210 Dual Band Wireless AC 3165 3166 Dual Band Wireless-AC 3165 Plus Bluetooth + 8086 4210 Dual Band Wireless-AC 3165 3184 UHD Graphics 605 3185 UHD Graphics 605 318c Celeron/Pentium Silver Processor Dynamic Platform and Thermal Framework Processor Participant @@ -29986,6 +30220,7 @@ 3e89 8th Gen Core Processor PCIe Controller (x4) 3e91 8th Gen Core Processor Gaussian Mixture Model 3e92 UHD Graphics 630 (Desktop) + 1028 0869 Vostro 3470 3e93 UHD Graphics 610 3e96 HD Graphics P630 3e98 UHD Graphics 630 (Desktop 9 Series) @@ -29994,6 +30229,7 @@ 1028 089e Inspiron 5482 3ea5 Iris Plus Graphics 655 3ec2 8th Gen Core Processor Host Bridge/DRAM Registers + 1028 0869 Vostro 3470 1043 8694 PRIME H310M-D 3ec4 8th Gen Core Processor Host Bridge/DRAM Registers 3ec6 8th Gen Core Processor Host Bridge/DRAM Registers @@ -30175,12 +30411,14 @@ 5201 EtherExpress PRO/100 Intelligent Server Fast Ethernet Controller 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter 530d 80310 (IOP) IO Processor + 5502 Ethernet Controller (2) I225-LMvP 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5900 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5901 Xeon E3-1200 v6/7th Gen Core Processor PCIe Controller (x16) 5902 HD Graphics 610 5904 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers + 1025 115f Aspire E5-575G 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 5905 Xeon E3-1200 v6/7th Gen Core Processor PCIe Controller (x8) @@ -30194,6 +30432,7 @@ 5914 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 17aa 225d ThinkPad T480 5916 HD Graphics 620 + 1025 1094 Aspire E5-575G 17aa 2248 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 5917 UHD Graphics 620 @@ -30604,7 +30843,11 @@ 8a1f Ice Lake Thunderbolt 3 PCI Express Root Port #1 8a21 Ice Lake Thunderbolt 3 PCI Express Root Port #2 8a23 Ice Lake Thunderbolt 3 PCI Express Root Port #3 + 8a51 Intel Iris Plus Graphics G7 (Ice Lake) 8a52 Iris Plus Graphics G7 + 8a56 Iris Plus Graphics G1 (Ice Lake) + 8a5a Iris Plus Graphics G4 (Ice Lake) + 8a5c Intel Iris Plus Graphics G4 (Ice Lake) 8c00 8 Series/C220 Series Chipset Family 4-port SATA Controller 1 [IDE mode] 8c01 8 Series Chipset Family 4-port SATA Controller 1 [IDE mode] - Mobile 8c02 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] @@ -30621,6 +30864,7 @@ 8c0e 8 Series/C220 Series Chipset Family SATA Controller 1 [RAID mode] 8c0f 8 Series/C220 Series Chipset Family SATA Controller 1 [RAID mode] 8c10 8 Series/C220 Series Chipset Family PCI Express Root Port #1 + 1043 8534 ASUS H81I-PLUS 17aa 220e ThinkPad T440p 8c11 8 Series/C220 Series Chipset Family PCI Express Root Port #1 8c12 8 Series/C220 Series Chipset Family PCI Express Root Port #2 @@ -30822,8 +31066,23 @@ 9622 Integrated RAID 9641 Integrated RAID 96a1 Integrated RAID + 9a09 11th Gen Core Processor PCIe Controller 9a0b Volume Management Device NVMe RAID Controller + 9a13 Tiger Lake-LP Thunderbolt USB Controller + 9a14 11th Gen Core Processor Host Bridge/DRAM Registers + 9a1b Tiger Lake-LP Thunderbolt NHI #0 + 9a1d Tiger Lake-LP Thunderbolt NHI #1 + 9a23 Tiger Lake-LP Thunderbolt PCI Express Root Port #0 + 9a25 Tiger Lake-LP Thunderbolt PCI Express Root Port #1 + 9a27 Tiger Lake-LP Thunderbolt PCI Express Root Port #2 + 9a29 Tiger Lake-LP Thunderbolt PCI Express Root Port #3 + 9a33 Tiger Lake Trace Hub + 9a49 UHD Graphics 9b41 UHD Graphics + 9b44 10th Gen Core Processor Host Bridge/DRAM Registers + 9b54 10th Gen Core Processor Host Bridge/DRAM Registers + 9b64 10th Gen Core Processor Host Bridge/DRAM Registers + 9bc4 UHD Graphics 9c00 8 Series SATA Controller 1 [IDE mode] 9c01 8 Series SATA Controller 1 [IDE mode] 9c02 8 Series SATA Controller 1 [AHCI mode] @@ -30930,6 +31189,7 @@ 9ce5 Wildcat Point-LP Serial IO GSPI Controller #0 9ce6 Wildcat Point-LP Serial IO GSPI Controller #1 9d03 Sunrise Point-LP SATA Controller [AHCI mode] + 1025 115f Acer Aspire E5-575G 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30950,6 +31210,8 @@ 9d19 Sunrise Point-LP PCI Express Root Port #10 9d1a Sunrise Point-LP PCI Express Root Port #11 9d21 Sunrise Point-LP PMC + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30957,6 +31219,8 @@ 17aa 225d ThinkPad T480 17aa 382a B51-80 Laptop 9d23 Sunrise Point-LP SMBus + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30970,6 +31234,8 @@ 9d2a Sunrise Point-LP Serial IO SPI Controller #1 9d2d Sunrise Point-LP Secure Digital IO Controller 9d2f Sunrise Point-LP USB 3.0 xHCI Controller + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri May 22 10:50:30 2020 Return-Path: Delivered-To: svn-src-head@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 8B3BB32CDF0; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T3DQ2rsGz47gB; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576E71CF79; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MAoUu6084247; Fri, 22 May 2020 10:50:30 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MAoUMV084246; Fri, 22 May 2020 10:50:30 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005221050.04MAoUMV084246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Fri, 22 May 2020 10:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361362 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 10:50:30 -0000 Author: whu Date: Fri May 22 10:50:29 2020 New Revision: 361362 URL: https://svnweb.freebsd.org/changeset/base/361362 Log: Bump __FreeBSD_version after r361275, HyperV socket support Sponsored by: Microsoft Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 22 09:38:44 2020 (r361361) +++ head/sys/sys/param.h Fri May 22 10:50:29 2020 (r361362) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300094 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300095 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri May 22 11:20:25 2020 Return-Path: Delivered-To: svn-src-head@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 4B36E32D8B4; Fri, 22 May 2020 11:20:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T3tx1GFSz491K; Fri, 22 May 2020 11:20:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267901DE8A; Fri, 22 May 2020 11:20:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MBKOOE003195; Fri, 22 May 2020 11:20:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBKOiH003190; Fri, 22 May 2020 11:20:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221120.04MBKOiH003190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361363 - in head/lib/libprocstat: . zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/lib/libprocstat: . zfs X-SVN-Commit-Revision: 361363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 11:20:25 -0000 Author: avg Date: Fri May 22 11:20:23 2020 New Revision: 361363 URL: https://svnweb.freebsd.org/changeset/base/361363 Log: libprocstat: fix ZFS support First of all, znode_phys_t hasn't been used for storing file attributes for a long time now. Modern ZFS versions use a System Attribute table with a flexible layout. But more importantly all the required information is available in znode_t itself. It's not easy to include zfs_znode.h in userland without breaking code because the most interesting parts of the header are kernel-only. And hardcoding field offsets is too fragile. So, I created a new compilation unit that includes zfs_znode.h using some mild kludges to get it and its dependencies to compile in userland. The compilation unit exports interesting field offsets and does not have any other code. PR: 194117 Reviewed by: markj MFC after: 2 weeks Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D24941 Added: head/lib/libprocstat/zfs_defs.c (contents, props changed) head/lib/libprocstat/zfs_defs.h (contents, props changed) Modified: head/lib/libprocstat/Makefile head/lib/libprocstat/zfs.c head/lib/libprocstat/zfs/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/Makefile Fri May 22 11:20:23 2020 (r361363) @@ -57,16 +57,17 @@ MLINKS+=libprocstat.3 procstat_close.3 \ # XXX This is a hack. .if ${MK_CDDL} != "no" CFLAGS+= -DLIBPROCSTAT_ZFS -OBJS+= zfs/zfs.o -SOBJS+= zfs/zfs.pico -POBJS+= zfs/zfs.po +SRCS+= zfs.c +OBJS+= zfs/zfs_defs.o +SOBJS+= zfs/zfs_defs.pico +POBJS+= zfs/zfs_defs.po SUBDIR= zfs -zfs/zfs.o: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.o -zfs/zfs.pico: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.pico -zfs/zfs.po: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.po +zfs/zfs_defs.o: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o +zfs/zfs_defs.pico: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico +zfs/zfs_defs.po: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po .endif .include Modified: head/lib/libprocstat/zfs.c ============================================================================== --- head/lib/libprocstat/zfs.c Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/zfs.c Fri May 22 11:20:23 2020 (r361363) @@ -31,22 +31,13 @@ #include #define _KERNEL #include -#include #undef _KERNEL +#include +#include #include +#include +#include -#undef lbolt -#undef lbolt64 -#undef gethrestime_sec -#include -#include -#include -#include -#include -#include -#include -#include - #include #include @@ -57,24 +48,15 @@ #define ZFS #include "libprocstat.h" #include "common_kvm.h" +#include "zfs_defs.h" -/* - * Offset calculations that are used to get data from znode without having the - * definition. - */ -#define LOCATION_ZID (2 * sizeof(void *)) -#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task))) - int zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) { - znode_phys_t zphys; struct mount mount, *mountptr; - uint64_t *zid; - void *znodeptr, *vnodeptr; + void *znodeptr; char *dataptr; - void *zphys_addr; size_t len; int size; @@ -83,33 +65,27 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta warnx("error getting sysctl"); return (1); } - znodeptr = malloc(size); - if (znodeptr == NULL) { + dataptr = malloc(size); + if (dataptr == NULL) { warnx("error allocating memory for znode storage"); return (1); } - /* Since we have problems including vnode.h, we'll use the wrappers. */ - vnodeptr = getvnodedata(vp); - if (!kvm_read_all(kd, (unsigned long)vnodeptr, znodeptr, - (size_t)size)) { - warnx("can't read znode at %p", (void *)vnodeptr); + + if ((size_t)size < offsetof_z_id + sizeof(uint64_t) || + (size_t)size < offsetof_z_mode + sizeof(mode_t) || + (size_t)size < offsetof_z_size + sizeof(uint64_t)) { + warnx("znode_t size is too small"); goto bad; } - /* - * z_id field is stored in the third pointer. We therefore skip the two - * first bytes. - * - * Pointer to the z_phys structure is the next last pointer. Therefore - * go back two bytes from the end. - */ - dataptr = znodeptr; - zid = (uint64_t *)(dataptr + LOCATION_ZID); - zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size)); + if ((size_t)size != sizeof_znode_t) + warnx("znode_t size mismatch, data could be wrong"); - if (!kvm_read_all(kd, (unsigned long)zphys_addr, &zphys, - sizeof(zphys))) { - warnx("can't read znode_phys at %p", zphys_addr); + /* Since we have problems including vnode.h, we'll use the wrappers. */ + znodeptr = getvnodedata(vp); + if (!kvm_read_all(kd, (unsigned long)znodeptr, dataptr, + (size_t)size)) { + warnx("can't read znode at %p", (void *)znodeptr); goto bad; } @@ -119,18 +95,18 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta warnx("can't read mount at %p", (void *)mountptr); goto bad; } - vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; - vn->vn_fileid = *zid; + /* - * XXX: Shows up wrong in output, but UFS has this error too. Could - * be that we're casting mode-variables from 64-bit to 8-bit or simply - * error in the mode-to-string function. + * XXX Assume that this is a znode, but it can be a special node + * under .zfs/. */ - vn->vn_mode = (mode_t)zphys.zp_mode; - vn->vn_size = (u_long)zphys.zp_size; - free(znodeptr); + vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; + vn->vn_fileid = *(uint64_t *)(void *)(dataptr + offsetof_z_id); + vn->vn_mode = *(mode_t *)(void *)(dataptr + offsetof_z_mode); + vn->vn_size = *(uint64_t *)(void *)(dataptr + offsetof_z_size); + free(dataptr); return (0); bad: - free(znodeptr); + free(dataptr); return (1); } Modified: head/lib/libprocstat/zfs/Makefile ============================================================================== --- head/lib/libprocstat/zfs/Makefile Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/zfs/Makefile Fri May 22 11:20:23 2020 (r361363) @@ -2,20 +2,20 @@ .PATH: ${.CURDIR:H} -SRCS= zfs.c -OBJS= zfs.o +SRCS= zfs_defs.c +OBJS= zfs_defs.o WARNS?= 1 CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR:H} CFLAGS+= -DNEED_SOLARIS_BOOLEAN +CFLAGS+= -fno-builtin -nostdlib all: ${OBJS} CLEANFILES= ${OBJS} Added: head/lib/libprocstat/zfs_defs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/zfs_defs.c Fri May 22 11:20:23 2020 (r361363) @@ -0,0 +1,59 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* Pretend we are kernel to get the same binary layout. */ +#define _KERNEL + +/* A hack to deal with kpilite.h. */ +#define KLD_MODULE + +/* + * Prevent some headers from getting included and fake some types + * in order to allow this file to compile without bringing in + * too many kernel build dependencies. + */ +#define _OPENSOLARIS_SYS_PATHNAME_H_ +#define _OPENSOLARIS_SYS_POLICY_H_ +#define _OPENSOLARIS_SYS_VNODE_H_ +#define _VNODE_PAGER_ + +typedef struct vnode vnode_t; +typedef struct vattr vattr_t; +typedef struct xvattr xvattr_t; +typedef struct vsecattr vsecattr_t; +typedef enum vtype vtype_t; + +#include +#include + +size_t sizeof_znode_t = sizeof(znode_t); +size_t offsetof_z_id = offsetof(znode_t, z_id); +size_t offsetof_z_size = offsetof(znode_t, z_size); +size_t offsetof_z_mode = offsetof(znode_t, z_mode); Added: head/lib/libprocstat/zfs_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/zfs_defs.h Fri May 22 11:20:23 2020 (r361363) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBPROCSTAT_ZFS_DEFS_H +#define _LIBPROCSTAT_ZFS_DEFS_H + +extern size_t sizeof_znode_t; +extern size_t offsetof_z_id; +extern size_t offsetof_z_size; +extern size_t offsetof_z_mode; + +#endif /* _LIBPROCSTAT_ZFS_DEFS_H */ From owner-svn-src-head@freebsd.org Fri May 22 11:25:46 2020 Return-Path: Delivered-To: svn-src-head@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 A841032D7F7; Fri, 22 May 2020 11:25:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T4163ymhz49SP; Fri, 22 May 2020 11:25:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65D591DDBF; Fri, 22 May 2020 11:25:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MBPk4G009307; Fri, 22 May 2020 11:25:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBPj7r009305; Fri, 22 May 2020 11:25:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221125.04MBPj7r009305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361364 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 361364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 11:25:46 -0000 Author: avg Date: Fri May 22 11:25:45 2020 New Revision: 361364 URL: https://svnweb.freebsd.org/changeset/base/361364 Log: net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING This is useful when a wireless driver is stopped or started in response to events like an RF Kill button press. Applications like wpa_supplicant depend on such events to have a correct view of interface state. Reviewed by: adrian, cy, melifaro MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24925 Modified: head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_freebsd.c Fri May 22 11:25:45 2020 (r361364) @@ -963,6 +963,19 @@ ieee80211_notify_radio(struct ieee80211com *ic, int st } void +ieee80211_notify_ifnet_change(struct ieee80211vap *vap) +{ + struct ifnet *ifp = vap->iv_ifp; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG, "%s\n", + "interface state change"); + + CURVNET_SET(ifp->if_vnet); + rt_ifmsg(ifp); + CURVNET_RESTORE(); +} + +void ieee80211_load_module(const char *modname) { Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_proto.c Fri May 22 11:25:45 2020 (r361364) @@ -1511,6 +1511,8 @@ ieee80211_start_locked(struct ieee80211vap *vap) * back in here and complete the work. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; + ieee80211_notify_ifnet_change(vap); + /* * We are not running; if this we are the first vap * to be brought up auto-up the parent if necessary. @@ -1624,6 +1626,7 @@ ieee80211_stop_locked(struct ieee80211vap *vap) ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* mark us stopped */ + ieee80211_notify_ifnet_change(vap); if (--ic->ic_nrunning == 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_proto.h Fri May 22 11:25:45 2020 (r361364) @@ -455,4 +455,5 @@ void ieee80211_notify_node_auth(struct ieee80211_node void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [], const uint8_t cc[2]); void ieee80211_notify_radio(struct ieee80211com *, int); +void ieee80211_notify_ifnet_change(struct ieee80211vap *); #endif /* _NET80211_IEEE80211_PROTO_H_ */ From owner-svn-src-head@freebsd.org Fri May 22 14:46:24 2020 Return-Path: Delivered-To: svn-src-head@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 826642CAD02; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T8Sc2g9Vz4P1J; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56DE22003F; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MEkONq033250; Fri, 22 May 2020 14:46:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MEkO7f033249; Fri, 22 May 2020 14:46:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005221446.04MEkO7f033249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 22 May 2020 14:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361384 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 361384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 14:46:24 -0000 Author: jilles Date: Fri May 22 14:46:23 2020 New Revision: 361384 URL: https://svnweb.freebsd.org/changeset/base/361384 Log: sh: Remove a comment that was obsoleted by r358152 Since r358152, the read builtin has used a buffer. Also, remove a space at the end of the line in a comment. No functional change is intended. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Fri May 22 13:27:02 2020 (r361383) +++ head/bin/sh/miscbltin.c Fri May 22 14:46:23 2020 (r361384) @@ -124,7 +124,7 @@ fdctx_destroy(struct fdctx *fdc) * Reposition the file offset. Here is the layout of buf: * * | off - * v + * v * |*****************|-------| * buf ep buf+buflen * |<- residue ->| @@ -142,8 +142,6 @@ fdctx_destroy(struct fdctx *fdc) /* * The read builtin. The -r option causes backslashes to be treated like * ordinary characters. - * - * This uses unbuffered input, which may be avoidable in some cases. * * Note that if IFS=' :' then read x y should work so that: * 'a b' x='a', y='b' From owner-svn-src-head@freebsd.org Fri May 22 15:11:14 2020 Return-Path: Delivered-To: svn-src-head@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 1F5082CB35F; Fri, 22 May 2020 15:11:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 49T91F4t9Nz4QSl; Fri, 22 May 2020 15:11:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04MFAxtE077205 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 May 2020 18:11:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04MFAxtE077205 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04MFAx27077204; Fri, 22 May 2020 18:10:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 22 May 2020 18:10:59 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20200522151059.GK64045@kib.kiev.ua> References: <202005220118.04M1ItwO032876@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005220118.04M1ItwO032876@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49T91F4t9Nz4QSl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:11:14 -0000 On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: > Author: markj > Date: Fri May 22 01:18:55 2020 > New Revision: 361352 > URL: https://svnweb.freebsd.org/changeset/base/361352 > > Log: > Fix the build after r361033 when ACPI is disabled. What is the sense in doing this for amd64 ? I doubt that we can boot with ACPI disabled. > > Reported by: Herbert J. Skuhra > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/i386/i386/mp_machdep.c > > Modified: head/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) > +++ head/sys/amd64/amd64/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) > @@ -29,6 +29,7 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_acpi.h" > #include "opt_cpu.h" > #include "opt_ddb.h" > #include "opt_kstack_pages.h" > @@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DEV_ACPI > #include > #include > +#endif > > #define WARMBOOT_TARGET 0 > #define WARMBOOT_OFF (KERNBASE + 0x0467) > @@ -265,7 +268,9 @@ cpu_mp_start(void) > > set_interrupt_apic_ids(); > > +#if defined(DEV_ACPI) && MAXMEMDOM > 1 > acpi_pxm_set_cpu_locality(); > +#endif > } > > /* > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) > +++ head/sys/i386/i386/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) > @@ -28,6 +28,7 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_acpi.h" > #include "opt_apic.h" > #include "opt_cpu.h" > #include "opt_kstack_pages.h" > @@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DEV_ACPI > #include > #include > +#endif > > #define WARMBOOT_TARGET 0 > #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) > @@ -202,7 +205,7 @@ cpu_mp_start(void) > > set_interrupt_apic_ids(); > > -#if MAXMEMDOM > 1 > +#if defined(DEV_ACPI) && MAXMEMDOM > 1 > acpi_pxm_set_cpu_locality(); > #endif > } From owner-svn-src-head@freebsd.org Fri May 22 15:15:43 2020 Return-Path: Delivered-To: svn-src-head@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 E982C2CB51F; Fri, 22 May 2020 15:15:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T96R4nlGz4Qs7; Fri, 22 May 2020 15:15:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f42.google.com with SMTP id h7so8492140otr.3; Fri, 22 May 2020 08:15:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=e1/Dmks/v/RA9RP/XSf7ki7g1Ee51JEZmUdsDTZXj0w=; b=VZVvPx2tEHZLblsbdVvFo8WhUnfoi2raRaUg0rXJ+r/aDu9fKgHJcDoyTporKSCNss ZBmMsqx1JK8xgsMQOk2h5Tg0j9sN7zAnbOmtZLpNvnhexD8YtajQRFURmcZnOvXXaW9T X3cqbY0zT89v5CLahl+BJzNJ3ksYTE1/VIKnZPJr1hToJMP2SpUDYdl01YZ6lgs7nZuD x9fGjKWL1W5tQpGMDg7tcmNp/jqDe/9E8cEdtwuvmkVdkMQIyk2Adkubr7iU5DLpgZgI iqAw/uj+QPJl222I98TFv2MJ0Eg+ceIkcbzTal9NUklIZ1pJVLdGGcjJDhqw0YJsIuA5 /P/Q== X-Gm-Message-State: AOAM5321/oe233nMR0eYL1g7vQYQ3WSkV+xlWDXSRQNr2/vSpm91mEAi qtzDJVeOhpth69eQfT/+LU/dgqce X-Google-Smtp-Source: ABdhPJxcG9Kom0l9f1S9jHKPQmHZeqr+rMJhlQE/M8Id++zSKvXop4ETOoB3lw7SSOolMjpe8k928w== X-Received: by 2002:a9d:70d4:: with SMTP id w20mr11469684otj.179.1590160541458; Fri, 22 May 2020 08:15:41 -0700 (PDT) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com. [209.85.167.181]) by smtp.gmail.com with ESMTPSA id p67sm2646568oic.46.2020.05.22.08.15.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:15:41 -0700 (PDT) Received: by mail-oi1-f181.google.com with SMTP id l6so9569517oic.9; Fri, 22 May 2020 08:15:41 -0700 (PDT) X-Received: by 2002:aca:eb96:: with SMTP id j144mr2746581oih.48.1590160540784; Fri, 22 May 2020 08:15:40 -0700 (PDT) MIME-Version: 1.0 References: <202005221120.04MBKOiH003190@repo.freebsd.org> In-Reply-To: <202005221120.04MBKOiH003190@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 22 May 2020 08:15:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Andriy Gapon Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49T96R4nlGz4Qs7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:15:44 -0000 Hi Andriy, Would it make sense to also export sizes of those members? Currently the code assumes the members may be relocated in the struct, but never changed in size. If they can be moved around, maybe they might be enlarged or shrunk at some time too? Maybe not; I am not very familiar with ZFS. Best, Conrad On Fri, May 22, 2020 at 4:20 AM Andriy Gapon wrote: > > Author: avg > Date: Fri May 22 11:20:23 2020 > New Revision: 361363 > URL: https://svnweb.freebsd.org/changeset/base/361363 > > Log: > libprocstat: fix ZFS support > > First of all, znode_phys_t hasn't been used for storing file attributes > for a long time now. Modern ZFS versions use a System Attribute table > with a flexible layout. But more importantly all the required > information is available in znode_t itself. > > It's not easy to include zfs_znode.h in userland without breaking code > because the most interesting parts of the header are kernel-only. And > hardcoding field offsets is too fragile. So, I created a new > compilation unit that includes zfs_znode.h using some mild kludges to > get it and its dependencies to compile in userland. The compilation > unit exports interesting field offsets and does not have any other code. > > PR: 194117 > Reviewed by: markj > MFC after: 2 weeks > Sponsored by: Panzura > Differential Revision: https://reviews.freebsd.org/D24941 > > Added: > head/lib/libprocstat/zfs_defs.c (contents, props changed) > head/lib/libprocstat/zfs_defs.h (contents, props changed) > Modified: > head/lib/libprocstat/Makefile > head/lib/libprocstat/zfs.c > head/lib/libprocstat/zfs/Makefile > > Modified: head/lib/libprocstat/Makefile > ============================================================================== > --- head/lib/libprocstat/Makefile Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/Makefile Fri May 22 11:20:23 2020 (r361363) > @@ -57,16 +57,17 @@ MLINKS+=libprocstat.3 procstat_close.3 \ > # XXX This is a hack. > .if ${MK_CDDL} != "no" > CFLAGS+= -DLIBPROCSTAT_ZFS > -OBJS+= zfs/zfs.o > -SOBJS+= zfs/zfs.pico > -POBJS+= zfs/zfs.po > +SRCS+= zfs.c > +OBJS+= zfs/zfs_defs.o > +SOBJS+= zfs/zfs_defs.pico > +POBJS+= zfs/zfs_defs.po > SUBDIR= zfs > -zfs/zfs.o: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.o > -zfs/zfs.pico: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.pico > -zfs/zfs.po: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.po > +zfs/zfs_defs.o: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o > +zfs/zfs_defs.pico: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico > +zfs/zfs_defs.po: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po > .endif > > .include > > Modified: head/lib/libprocstat/zfs.c > ============================================================================== > --- head/lib/libprocstat/zfs.c Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/zfs.c Fri May 22 11:20:23 2020 (r361363) > @@ -31,22 +31,13 @@ > #include > #define _KERNEL > #include > -#include > #undef _KERNEL > +#include > +#include > #include > +#include > +#include > > -#undef lbolt > -#undef lbolt64 > -#undef gethrestime_sec > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > #include > > #include > @@ -57,24 +48,15 @@ > #define ZFS > #include "libprocstat.h" > #include "common_kvm.h" > +#include "zfs_defs.h" > > -/* > - * Offset calculations that are used to get data from znode without having the > - * definition. > - */ > -#define LOCATION_ZID (2 * sizeof(void *)) > -#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task))) > - > int > zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) > { > > - znode_phys_t zphys; > struct mount mount, *mountptr; > - uint64_t *zid; > - void *znodeptr, *vnodeptr; > + void *znodeptr; > char *dataptr; > - void *zphys_addr; > size_t len; > int size; > > @@ -83,33 +65,27 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta > warnx("error getting sysctl"); > return (1); > } > - znodeptr = malloc(size); > - if (znodeptr == NULL) { > + dataptr = malloc(size); > + if (dataptr == NULL) { > warnx("error allocating memory for znode storage"); > return (1); > } > - /* Since we have problems including vnode.h, we'll use the wrappers. */ > - vnodeptr = getvnodedata(vp); > - if (!kvm_read_all(kd, (unsigned long)vnodeptr, znodeptr, > - (size_t)size)) { > - warnx("can't read znode at %p", (void *)vnodeptr); > + > + if ((size_t)size < offsetof_z_id + sizeof(uint64_t) || > + (size_t)size < offsetof_z_mode + sizeof(mode_t) || > + (size_t)size < offsetof_z_size + sizeof(uint64_t)) { > + warnx("znode_t size is too small"); > goto bad; > } > > - /* > - * z_id field is stored in the third pointer. We therefore skip the two > - * first bytes. > - * > - * Pointer to the z_phys structure is the next last pointer. Therefore > - * go back two bytes from the end. > - */ > - dataptr = znodeptr; > - zid = (uint64_t *)(dataptr + LOCATION_ZID); > - zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size)); > + if ((size_t)size != sizeof_znode_t) > + warnx("znode_t size mismatch, data could be wrong"); > > - if (!kvm_read_all(kd, (unsigned long)zphys_addr, &zphys, > - sizeof(zphys))) { > - warnx("can't read znode_phys at %p", zphys_addr); > + /* Since we have problems including vnode.h, we'll use the wrappers. */ > + znodeptr = getvnodedata(vp); > + if (!kvm_read_all(kd, (unsigned long)znodeptr, dataptr, > + (size_t)size)) { > + warnx("can't read znode at %p", (void *)znodeptr); > goto bad; > } > > @@ -119,18 +95,18 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta > warnx("can't read mount at %p", (void *)mountptr); > goto bad; > } > - vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; > - vn->vn_fileid = *zid; > + > /* > - * XXX: Shows up wrong in output, but UFS has this error too. Could > - * be that we're casting mode-variables from 64-bit to 8-bit or simply > - * error in the mode-to-string function. > + * XXX Assume that this is a znode, but it can be a special node > + * under .zfs/. > */ > - vn->vn_mode = (mode_t)zphys.zp_mode; > - vn->vn_size = (u_long)zphys.zp_size; > - free(znodeptr); > + vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; > + vn->vn_fileid = *(uint64_t *)(void *)(dataptr + offsetof_z_id); > + vn->vn_mode = *(mode_t *)(void *)(dataptr + offsetof_z_mode); > + vn->vn_size = *(uint64_t *)(void *)(dataptr + offsetof_z_size); > + free(dataptr); > return (0); > bad: > - free(znodeptr); > + free(dataptr); > return (1); > } > > Modified: head/lib/libprocstat/zfs/Makefile > ============================================================================== > --- head/lib/libprocstat/zfs/Makefile Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/zfs/Makefile Fri May 22 11:20:23 2020 (r361363) > @@ -2,20 +2,20 @@ > > .PATH: ${.CURDIR:H} > > -SRCS= zfs.c > -OBJS= zfs.o > +SRCS= zfs_defs.c > +OBJS= zfs_defs.o > WARNS?= 1 > > CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris > CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include > CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem > -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common > CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head > CFLAGS+= -I${.CURDIR:H} > CFLAGS+= -DNEED_SOLARIS_BOOLEAN > +CFLAGS+= -fno-builtin -nostdlib > > all: ${OBJS} > CLEANFILES= ${OBJS} > > Added: head/lib/libprocstat/zfs_defs.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libprocstat/zfs_defs.c Fri May 22 11:20:23 2020 (r361363) > @@ -0,0 +1,59 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Andriy Gapon > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* Pretend we are kernel to get the same binary layout. */ > +#define _KERNEL > + > +/* A hack to deal with kpilite.h. */ > +#define KLD_MODULE > + > +/* > + * Prevent some headers from getting included and fake some types > + * in order to allow this file to compile without bringing in > + * too many kernel build dependencies. > + */ > +#define _OPENSOLARIS_SYS_PATHNAME_H_ > +#define _OPENSOLARIS_SYS_POLICY_H_ > +#define _OPENSOLARIS_SYS_VNODE_H_ > +#define _VNODE_PAGER_ > + > +typedef struct vnode vnode_t; > +typedef struct vattr vattr_t; > +typedef struct xvattr xvattr_t; > +typedef struct vsecattr vsecattr_t; > +typedef enum vtype vtype_t; > + > +#include > +#include > + > +size_t sizeof_znode_t = sizeof(znode_t); > +size_t offsetof_z_id = offsetof(znode_t, z_id); > +size_t offsetof_z_size = offsetof(znode_t, z_size); > +size_t offsetof_z_mode = offsetof(znode_t, z_mode); > > Added: head/lib/libprocstat/zfs_defs.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libprocstat/zfs_defs.h Fri May 22 11:20:23 2020 (r361363) > @@ -0,0 +1,38 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Andriy Gapon > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LIBPROCSTAT_ZFS_DEFS_H > +#define _LIBPROCSTAT_ZFS_DEFS_H > + > +extern size_t sizeof_znode_t; > +extern size_t offsetof_z_id; > +extern size_t offsetof_z_size; > +extern size_t offsetof_z_mode; > + > +#endif /* _LIBPROCSTAT_ZFS_DEFS_H */ From owner-svn-src-head@freebsd.org Fri May 22 15:23:19 2020 Return-Path: Delivered-To: svn-src-head@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 879AB2CB938; Fri, 22 May 2020 15:23:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9HB3nHFz4RDp; Fri, 22 May 2020 15:23:18 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f67.google.com with SMTP id u13so258983wml.1; Fri, 22 May 2020 08:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=CEaXavwen6NvHtINPVOH+44ASWzhFXHuhQW4CJat4a0=; b=gGWsetJjNKBPth7ckmlB5oDsb1M0DtlDQ/PpKlRBrDkSp3M2Ir4TDBpoVg5EVOaDNH yKhyYfO1tdPkwT0uLuhmczvhM8zhZVqcLNc6Xu2iA68UNK+GvKEqRLy+4E5FLU/Oq2Sj 4+EYfrczOpLUsULzfucONsCOuWxtFwwxmKAN3TJ3dhqocJrm2ELN15EKZ5zjp92PZtWJ NUCuFsaxwANvSEf5Aa3E6xh2FO1GTRv/05ytXRzLdsOElx6pLVVdqzwaqyaiIT7ITZXi iNIdZUkRURdRAc99gdzKi4Ri9RjfIQYb4j21wJiJBX3Tbq0szCcCfOyMQILZXyW1R9Ak AEdA== X-Gm-Message-State: AOAM5321QiVqmi3omhLM58/eBQBaGJVruXs/k2izce10J1OmGz8ydqEj K7FNtLZQPnAQn8R3n3nd3hLJ3ORo X-Google-Smtp-Source: ABdhPJxNY7is1KMmTi+qXV2g/iPCbfP0eGJBzhhXNueQTtYuqkrZJ8pcL/lv2RsaFZDoosfZ46WpeA== X-Received: by 2002:a1c:5541:: with SMTP id j62mr12891740wmb.64.1590160996821; Fri, 22 May 2020 08:23:16 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 128sm10679429wme.39.2020.05.22.08.23.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:23:16 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <202005221120.04MBKOiH003190@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Date: Fri, 22 May 2020 18:23:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49T9HB3nHFz4RDp X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.45 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.64)[-0.643]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.83)[-0.828]; NEURAL_SPAM_SHORT(0.02)[0.018]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.67:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:23:19 -0000 On 22/05/2020 18:15, Conrad Meyer wrote: > Hi Andriy, > > Would it make sense to also export sizes of those members? Currently > the code assumes the members may be relocated in the struct, but never > changed in size. If they can be moved around, maybe they might be > enlarged or shrunk at some time too? Maybe not; I am not very > familiar with ZFS. I think that's less likely to happen. I mean, moving around may be as simple as adding a new field in the middle of the struct and people typically don't give much thought to such changes. Changing a member's type is more likely to prompt a check of possible uses. But less likely does not equal will never happen, of course. So, I think that this is a good suggestion. > On Fri, May 22, 2020 at 4:20 AM Andriy Gapon wrote: >> >> Author: avg >> Date: Fri May 22 11:20:23 2020 >> New Revision: 361363 >> URL: https://svnweb.freebsd.org/changeset/base/361363 >> >> Log: >> libprocstat: fix ZFS support >> >> First of all, znode_phys_t hasn't been used for storing file attributes >> for a long time now. Modern ZFS versions use a System Attribute table >> with a flexible layout. But more importantly all the required >> information is available in znode_t itself. >> >> It's not easy to include zfs_znode.h in userland without breaking code >> because the most interesting parts of the header are kernel-only. And >> hardcoding field offsets is too fragile. So, I created a new >> compilation unit that includes zfs_znode.h using some mild kludges to >> get it and its dependencies to compile in userland. The compilation >> unit exports interesting field offsets and does not have any other code. >> >> PR: 194117 >> Reviewed by: markj >> MFC after: 2 weeks >> Sponsored by: Panzura -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri May 22 15:26:28 2020 Return-Path: Delivered-To: svn-src-head@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 938992CBC2B; Fri, 22 May 2020 15:26:28 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9Lq5Z8Gz4RWl; Fri, 22 May 2020 15:26:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id u1so9004833wmn.3; Fri, 22 May 2020 08:26:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=X4NCHjQo4b9SLBB3tFXhZhD7P+0JtB3AgPEZyCpEvG0=; b=UMC8apMthgSG4CCyhzb59SE+wbekscza1Dmj+51qs+RJRq6CMLPC5wzjhrSMtuoTNU 0qWKo4qcSSIH80qiHyO7dPd1fxAkw0TWIbQ6W5trEqtS0BohiZsRX7lcd9VJDH8Zo+q5 hcYpCinGVxUgPCyudeXY+5XEqJTJ7mnk1JoMzt4082VNsZiYSjSVfLKrBUmOCg0Bun1I eExhNQX3aM6Vhhr3aYxW4t2pG56zhI98OFAqEs54gNPXR9YMXWrCxVQJYUegvx/+lOYr yxUCnT+OynWXfb2QKCGjsIhP6SwIrq/e5PlxTX4hVJQHPzDHT03hNLPF18Pi3U4Cqt0u mcvg== X-Gm-Message-State: AOAM5336Wbpv5h1EBlgZ/g7mPK0I66E0CS+Py818NvCf/RENhuXwDHcS 5xNdWmlwQEkd5xMdyUCkP6Nt0bhj X-Google-Smtp-Source: ABdhPJyvVBfh12GFR2iHEPUVOR4bTA6EwtG9wWFusIpNpB0WkTJnmlQ8ETQra2wRGMHUcmeoIS8z1A== X-Received: by 2002:a1c:ed04:: with SMTP id l4mr13976397wmh.93.1590161185924; Fri, 22 May 2020 08:26:25 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id m13sm9552368wmi.42.2020.05.22.08.26.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:26:25 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs From: Andriy Gapon To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <202005221120.04MBKOiH003190@repo.freebsd.org> <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <89c8638a-ed49-3fbd-ee36-175fd7ede15c@FreeBSD.org> Date: Fri, 22 May 2020 18:26:24 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49T9Lq5Z8Gz4RWl X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.39 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.60)[-0.599]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.83)[-0.832]; NEURAL_SPAM_SHORT(0.04)[0.040]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.54:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.54:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:26:28 -0000 On 22/05/2020 18:23, Andriy Gapon wrote: > On 22/05/2020 18:15, Conrad Meyer wrote: >> Hi Andriy, >> >> Would it make sense to also export sizes of those members? Currently >> the code assumes the members may be relocated in the struct, but never >> changed in size. If they can be moved around, maybe they might be >> enlarged or shrunk at some time too? Maybe not; I am not very >> familiar with ZFS. > I think that's less likely to happen. I mean, moving around may be as simple as > adding a new field in the middle of the struct and people typically don't give > much thought to such changes. Changing a member's type is more likely to prompt > a check of possible uses. > But less likely does not equal will never happen, of course. > So, I think that this is a good suggestion. > OTOH, z_id and z_size probably won't grow larger than 64-bit soon. Size of mode_t has been pretty stable over the years as well. So, this is not a priority for now. -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri May 22 15:30:14 2020 Return-Path: Delivered-To: svn-src-head@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 C0DF42CBE97; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9RB4jt5z4S0K; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D0E220BB3; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MFUErL058019; Fri, 22 May 2020 15:30:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MFUEMt058018; Fri, 22 May 2020 15:30:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005221530.04MFUEMt058018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 May 2020 15:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361385 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 361385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:30:14 -0000 Author: cem Date: Fri May 22 15:30:14 2020 New Revision: 361385 URL: https://svnweb.freebsd.org/changeset/base/361385 Log: ctime.3: Use ASCII asterisks for C, not special unicode math glyphs PR: 246656 Reported by: danfe Modified: head/contrib/tzcode/stdtime/ctime.3 Modified: head/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- head/contrib/tzcode/stdtime/ctime.3 Fri May 22 14:46:23 2020 (r361384) +++ head/contrib/tzcode/stdtime/ctime.3 Fri May 22 15:30:14 2020 (r361385) @@ -30,7 +30,7 @@ .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 2, 1999 +.Dd May 22, 2020 .Dt CTIME 3 .Os .Sh NAME @@ -266,17 +266,17 @@ External declarations as well as the tm structure defi include file. The tm structure includes at least the following fields: .Bd -literal -offset indent -int tm_sec; /\(** seconds (0 - 60) \(**/ -int tm_min; /\(** minutes (0 - 59) \(**/ -int tm_hour; /\(** hours (0 - 23) \(**/ -int tm_mday; /\(** day of month (1 - 31) \(**/ -int tm_mon; /\(** month of year (0 - 11) \(**/ -int tm_year; /\(** year \- 1900 \(**/ -int tm_wday; /\(** day of week (Sunday = 0) \(**/ -int tm_yday; /\(** day of year (0 - 365) \(**/ -int tm_isdst; /\(** is summer time in effect? \(**/ -char \(**tm_zone; /\(** abbreviation of timezone name \(**/ -long tm_gmtoff; /\(** offset from UTC in seconds \(**/ +int tm_sec; /* seconds (0 - 60) */ +int tm_min; /* minutes (0 - 59) */ +int tm_hour; /* hours (0 - 23) */ +int tm_mday; /* day of month (1 - 31) */ +int tm_mon; /* month of year (0 - 11) */ +int tm_year; /* year \- 1900 */ +int tm_wday; /* day of week (Sunday = 0) */ +int tm_yday; /* day of year (0 - 365) */ +int tm_isdst; /* is summer time in effect? */ +char *tm_zone; /* abbreviation of timezone name */ +long tm_gmtoff; /* offset from UTC in seconds */ .Ed .Pp The From owner-svn-src-head@freebsd.org Fri May 22 15:37:47 2020 Return-Path: Delivered-To: svn-src-head@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 8C6932CC17B; Fri, 22 May 2020 15:37:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9bt6GZxz4Sq1; Fri, 22 May 2020 15:37:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x744.google.com with SMTP id f189so11098126qkd.5; Fri, 22 May 2020 08:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hutpUQxRPprtmDkFAkKWrZMwDEgflfpBu0uespJU2w0=; b=t16oXTRy4nBrHweWBaR+/mTVcHwqL6fmBxEskWGDzt6A8bv6RZBJVg22jJoeVu2Tns GWl0IiD7mzmiLilhVotxMq75lNvmu9yrX/sa6FUkxNLjt2sk87+T9F5hoRxQiH9EWtIo b89Qqh6ZLeHaoTp5YOQVA6k/lRPW5zcyCNktsSX3vp/VBNP/0bW0U5t5lJsNnkoyelfx jggrrw2BG4+xia3iG5k/P6Ooi1ujE7MIF0jieNVZjrvyw2tUnIT6PTJQgSiJ0klBUbrQ a4/NvDGi6YA4M7bzi1U8W66jiPBbHz0n7UMklLVH0KE7QPLWyxGsWDtFmGMLotBJAOBj LNyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=hutpUQxRPprtmDkFAkKWrZMwDEgflfpBu0uespJU2w0=; b=W6UsBQpLJmj5k0F8FGos7UML8q3W8Nzyn5NYaO6sYpAekYB2OtC032pVL4xLWYgrig bW+vmU/rnDZSi0khjVr5i7qL/bEsPlgo2KXRS9vRqWAt3EXULzKtrnl3w1UpfYPcZjx3 aj/jaZj3jQDslMf2niNswFYPiDzZI9mZ0+wAR1hrEo05B2rnvZbK9ibguk/dfUKdtZQy 5IpqUHbjTkftGNZuy8WpuzRY8GdB7BA+VJsAJUgnw+lFsJlw8+dpc4Yh3J2efd5u98VF ptBRiq0CQ6meXfbCvX3A/mqcCUMiA+nwgRyAmocFKomGbjpeULyp+alyEk+iAR3i1JqF 5bxQ== X-Gm-Message-State: AOAM532mqSigMRQ4wSMWqapfr9qk3PFNaIUNyPGnIP/YzhTB2l6uBfaL sUpdCDIbsZ3EY5Lsqk1dqe8= X-Google-Smtp-Source: ABdhPJxHfWhB4dmEubBaL7ClamA0alLVWVPa9tqWl+avISgxjNFcNqyyv4ocSpZdggCemA6LiNsvYQ== X-Received: by 2002:a05:620a:64f:: with SMTP id a15mr9228992qka.10.1590161865868; Fri, 22 May 2020 08:37:45 -0700 (PDT) Received: from raichu (toroon0560w-lp130-11-70-50-21-250.dsl.bell.ca. [70.50.21.250]) by smtp.gmail.com with ESMTPSA id n20sm7851705qtk.89.2020.05.22.08.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 08:37:44 -0700 (PDT) Sender: Mark Johnston Date: Fri, 22 May 2020 11:37:43 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20200522153743.GC2512@raichu> References: <202005220118.04M1ItwO032876@repo.freebsd.org> <20200522151059.GK64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200522151059.GK64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49T9bt6GZxz4Sq1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=t16oXTRy; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::744 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.84 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.001]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.98)[-0.980]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.16)[-0.159]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::744:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:37:47 -0000 On Fri, May 22, 2020 at 06:10:59PM +0300, Konstantin Belousov wrote: > On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: > > Author: markj > > Date: Fri May 22 01:18:55 2020 > > New Revision: 361352 > > URL: https://svnweb.freebsd.org/changeset/base/361352 > > > > Log: > > Fix the build after r361033 when ACPI is disabled. > What is the sense in doing this for amd64 ? I doubt that we can boot > with ACPI disabled. It is possible to boot in virtualized environments without ACPI. I'm not sure why it is especially useful, but I wanted to avoid regressing a stable branch since at least one person noticed the breakage fairly quickly, and it is easy to fix. From owner-svn-src-head@freebsd.org Fri May 22 15:51:36 2020 Return-Path: Delivered-To: svn-src-head@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 CBFFB2CC773; Fri, 22 May 2020 15:51:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9vr548nz4Tkv; Fri, 22 May 2020 15:51:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A2BFA24C67; Fri, 22 May 2020 15:51:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id i5so11077655qkl.12; Fri, 22 May 2020 08:51:36 -0700 (PDT) X-Gm-Message-State: AOAM532Q8ptJlIEQMFHUDX8YEo9CETMbY2NEbMxj31hG0shmqe2T0SKk LCgoGkH4dBpme8GSGr9xK1SDzLHbcC+xW31DkXA= X-Google-Smtp-Source: ABdhPJzhH1t4bRAbjrQUNNEJoXVXDen7p0Iz6JZzWJiKIaARwVA7GYJva6Zm7VmImiVUSctEX/rpXngemvR5EEIwEow= X-Received: by 2002:a37:2711:: with SMTP id n17mr15676461qkn.430.1590162696094; Fri, 22 May 2020 08:51:36 -0700 (PDT) MIME-Version: 1.0 References: <202005220917.04M9H7oE028708@repo.freebsd.org> In-Reply-To: <202005220917.04M9H7oE028708@repo.freebsd.org> From: Kyle Evans Date: Fri, 22 May 2020 10:51:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361360 - head/sys/dev/hyperv/hvsock To: Wei Hu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:51:36 -0000 On Fri, May 22, 2020 at 4:17 AM Wei Hu wrote: > > Author: whu > Date: Fri May 22 09:17:07 2020 > New Revision: 361360 > URL: https://svnweb.freebsd.org/changeset/base/361360 > > Log: > Socket AF_HYPERV should return failure when it is not running on HyperV > > [... snip ...] > @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, struct > { > struct hvs_pcb *pcb = so2hvspcb(so); > > + if (vm_guest != VM_GUEST_HV) > + return (ESOCKTNOSUPPORT); > + > HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > "%s: HyperV Socket hvs_trans_attach called\n", __func__); > This one may be OK, but none of these other methods should be able to be invoked if the attach failed. See this comment at around ^/sys/kern/uipc_socket.c#50: 50 * pru_detach() disassociates protocol layer state from an attached socket, 51 * and will be called exactly once for sockets in which pru_attach() has 52 * been successfully called. If pru_attach() returned an error, 53 * pru_detach() will not be called. Socket layer private. That said, I wonder if VNET_DOMAIN_SET provides the correct semantics here at all. You can't fail domain_init, but I don't think there's any value in this domain actually getting registered on non-HyperV guests, a fact which presumably won't change at runtime. I have some concerns about how hvsock works out with vnets, but I'll drop those on the initial commit thread. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri May 22 15:56:53 2020 Return-Path: Delivered-To: svn-src-head@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 36B992CC9DA; Fri, 22 May 2020 15:56:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TB1x0jmkz4V22; Fri, 22 May 2020 15:56:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:112f:d17b:daab:c6ca]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 88C0525073; Fri, 22 May 2020 15:56:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 To: Mark Johnston , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005220118.04M1ItwO032876@repo.freebsd.org> <20200522151059.GK64045@kib.kiev.ua> <20200522153743.GC2512@raichu> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <1e73eb03-a734-64df-f1c8-9fccc85a3bf0@FreeBSD.org> Date: Fri, 22 May 2020 08:56:50 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200522153743.GC2512@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 15:56:53 -0000 On 5/22/20 8:37 AM, Mark Johnston wrote: > On Fri, May 22, 2020 at 06:10:59PM +0300, Konstantin Belousov wrote: >> On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: >>> Author: markj >>> Date: Fri May 22 01:18:55 2020 >>> New Revision: 361352 >>> URL: https://svnweb.freebsd.org/changeset/base/361352 >>> >>> Log: >>> Fix the build after r361033 when ACPI is disabled. >> What is the sense in doing this for amd64 ? I doubt that we can boot >> with ACPI disabled. > > It is possible to boot in virtualized environments without ACPI. I'm > not sure why it is especially useful, but I wanted to avoid regressing a > stable branch since at least one person noticed the breakage fairly > quickly, and it is easy to fix. I agree it mostly seems dubious. I believe at one point that NetApp at least was using FreeBSD/amd64 on gear that didn't have a "real" BIOS and didn't have ACPI. That was probably 10 years ago though when I last heard that, so it may no longer be true. That said, even the !ACPI code we have now is a runtime check so it should still fallback if ACPI isn't detected at runtime or is disabled via a hint. I'm not sure how much we should go out of our way to permit compiling without ACPI. On any modern consumer hardware you are going to want ACPI. -- John Baldwin From owner-svn-src-head@freebsd.org Fri May 22 16:12:35 2020 Return-Path: Delivered-To: svn-src-head@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 DBCD12CCDD3; Fri, 22 May 2020 16:12:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TBN35bCGz4WFf; Fri, 22 May 2020 16:12:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id BB28625495; Fri, 22 May 2020 16:12:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f170.google.com with SMTP id w3so5705223qkb.6; Fri, 22 May 2020 09:12:35 -0700 (PDT) X-Gm-Message-State: AOAM531EDtgYrnprKzK8trjZSK43Unlath3u4hI1nykysdImzfRXYlmW vT9AWZjL9+d3p+istvM5q+rzh8RGwESD9N2oxyw= X-Google-Smtp-Source: ABdhPJy2IDbJ0vNtwYPCInXwtMTgkmqZzuSO5BSJJVmSllznLoq/64tpdaYzNazQu2ulAqT3qVDXIK/WOl4ufoo7QXI= X-Received: by 2002:a37:a20c:: with SMTP id l12mr7805847qke.34.1590163955375; Fri, 22 May 2020 09:12:35 -0700 (PDT) MIME-Version: 1.0 References: <202005201103.04KB3xTp013965@repo.freebsd.org> In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> From: Kyle Evans Date: Fri, 22 May 2020 11:12:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys To: Wei Hu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 16:12:35 -0000 On Wed, May 20, 2020 at 6:04 AM Wei Hu wrote: > > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 > > Log: > HyperV socket implementation for FreeBSD > > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > > [... snip ...] > +void > +hvs_trans_init(void) > +{ > + /* Skip initialization of globals for non-default instances. */ > + if (!IS_DEFAULT_VNET(curvnet)) > + return; > + > + if (vm_guest != VM_GUEST_HV) > + return; > + > + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > + "%s: HyperV Socket hvs_trans_init called\n", __func__); > + > + /* Initialize Globals */ > + previous_auto_bound_port = MAX_PORT; > + sx_init(&hvs_trans_socks_sx, "hvs_trans_sock_sx"); > + mtx_init(&hvs_trans_socks_mtx, > + "hvs_trans_socks_mtx", NULL, MTX_DEF); > + LIST_INIT(&hvs_trans_bound_socks); > + LIST_INIT(&hvs_trans_connected_socks); > +} > + I have a suspicion that all of these should really be per-vnet for correct semantics with VIMAGE, with the IS_DEFAULT_VNET check earlier dropped completely. I haven't read around the rest all that much, but this would at least seem to prevent port re-use by a different vnet, which is perhaps "good enough" but I think this is something that should be fixed in the mid-term. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri May 22 16:29:10 2020 Return-Path: Delivered-To: svn-src-head@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 9AB682CD898; Fri, 22 May 2020 16:29:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TBlB3Z6Sz4XGb; Fri, 22 May 2020 16:29:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 716BE2152A; Fri, 22 May 2020 16:29:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MGTAwV095016; Fri, 22 May 2020 16:29:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGT9fx095011; Fri, 22 May 2020 16:29:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221629.04MGT9fx095011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 16:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361390 - in head: share/man/man7 sys/crypto/chacha20 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man7 sys/crypto/chacha20 sys/opencrypto X-SVN-Commit-Revision: 361390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 16:29:10 -0000 Author: jhb Date: Fri May 22 16:29:09 2020 New Revision: 361390 URL: https://svnweb.freebsd.org/changeset/base/361390 Log: Improve support for stream ciphers in the software encryption interface. Add a 'native_blocksize' member to 'struct enc_xform' that ciphers can use if they support a partial final block. This is particular useful for stream ciphers, but can also apply to other ciphers. cryptosoft will only pass in native blocks to the encrypt and decrypt hooks. For the final partial block, 'struct enc_xform' now has new encrypt_last/decrypt_last hooks which accept the length of the final block. The multi_block methods are also retired. Mark AES-ICM (AES-CTR) as a stream cipher. This has some interesting effects on IPsec in that FreeBSD can now properly receive all packets sent by Linux when using AES-CTR, but FreeBSD can no longer interoperate with OpenBSD and older verisons of FreeBSD which assume AES-CTR packets have a payload padded to a 16-byte boundary. Kornel has offered to work on a patch to add a compatiblity sysctl to enforce additional padding for AES-CTR in esp_output to permit compatibility with OpenBSD and older versions of FreeBSD. AES-XTS continues to use a block size of a single AES block length. It is possible to adjust it to support partial final blocks by implementing cipher text stealing via encrypt_last/decrypt_last hooks, but I have not done so. Reviewed by: cem (earlier version) Tested by: Kornel Dulęba (AES-CTR with IPsec) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24906 Modified: head/share/man/man7/crypto.7 head/sys/crypto/chacha20/chacha-sw.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_aes_icm.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man7/crypto.7 ============================================================================== --- head/share/man/man7/crypto.7 Fri May 22 16:22:01 2020 (r361389) +++ head/share/man/man7/crypto.7 Fri May 22 16:29:09 2020 (r361390) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2020 +.Dd May 22, 2020 .Dt CRYPTO 7 .Os .Sh NAME @@ -82,7 +82,7 @@ Note: You must provide an IV on every call. .It IV size : 16 .It Block size : -1 (aesni), 16 (software) +1 .It Key size : 16, 24 or 32 .El Modified: head/sys/crypto/chacha20/chacha-sw.c ============================================================================== --- head/sys/crypto/chacha20/chacha-sw.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/crypto/chacha20/chacha-sw.c Fri May 22 16:29:09 2020 (r361390) @@ -28,11 +28,11 @@ static void chacha20_xform_crypt(void *ctx, const uint8_t *in, uint8_t *out) { - chacha_encrypt_bytes(ctx, in, out, 1); + chacha_encrypt_bytes(ctx, in, out, CHACHA_BLOCKLEN); } static void -chacha20_xform_crypt_multi(void *ctx, const uint8_t *in, uint8_t *out, +chacha20_xform_crypt_last(void *ctx, const uint8_t *in, uint8_t *out, size_t len) { @@ -44,6 +44,7 @@ struct enc_xform enc_xform_chacha20 = { .name = "chacha20", .ctxsize = sizeof(struct chacha_ctx), .blocksize = 1, + .native_blocksize = CHACHA_BLOCKLEN, .ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN, .minkey = CHACHA_MINKEYLEN, .maxkey = 32, @@ -51,6 +52,6 @@ struct enc_xform enc_xform_chacha20 = { .decrypt = chacha20_xform_crypt, .setkey = chacha20_xform_setkey, .reinit = chacha20_xform_reinit, - .encrypt_multi = chacha20_xform_crypt_multi, - .decrypt_multi = chacha20_xform_crypt_multi, + .encrypt_last = chacha20_xform_crypt_last, + .decrypt_last = chacha20_xform_crypt_last, }; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/cryptosoft.c Fri May 22 16:29:09 2020 (r361390) @@ -117,13 +117,17 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * sw = &ses->swcr_encdec; exf = sw->sw_exf; - blks = exf->blocksize; ivlen = exf->ivsize; - /* Check for non-padded data */ - if ((crp->crp_payload_length % blks) != 0) - return EINVAL; + if (exf->native_blocksize == 0) { + /* Check for non-padded data */ + if ((crp->crp_payload_length % exf->blocksize) != 0) + return (EINVAL); + blks = exf->blocksize; + } else + blks = exf->native_blocksize; + if (exf == &enc_xform_aes_icm && (crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); @@ -182,7 +186,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * i = crp->crp_payload_length; encrypting = CRYPTO_OP_IS_ENCRYPT(crp->crp_op); - while (i > 0) { + while (i >= blks) { /* * If there's insufficient data at the end of * an iovec, we have to do some copying. @@ -249,31 +253,18 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * break; } - while (uio->uio_iov[ind].iov_len >= k + blks && i > 0) { + while (uio->uio_iov[ind].iov_len >= k + blks && i >= blks) { uint8_t *idat; - size_t nb, rem; - nb = blks; - rem = MIN((size_t)i, - uio->uio_iov[ind].iov_len - (size_t)k); idat = (uint8_t *)uio->uio_iov[ind].iov_base + k; if (exf->reinit) { - if (encrypting && exf->encrypt_multi == NULL) + if (encrypting) exf->encrypt(sw->sw_kschedule, idat, idat); - else if (encrypting) { - nb = rounddown(rem, blks); - exf->encrypt_multi(sw->sw_kschedule, - idat, idat, nb); - } else if (exf->decrypt_multi == NULL) + else exf->decrypt(sw->sw_kschedule, idat, idat); - else { - nb = rounddown(rem, blks); - exf->decrypt_multi(sw->sw_kschedule, - idat, idat, nb); - } } else if (encrypting) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) @@ -298,9 +289,9 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * ivp = nivp; } - count += nb; - k += nb; - i -= nb; + count += blks; + k += blks; + i -= blks; } /* @@ -319,6 +310,25 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * } } + /* Handle trailing partial block for stream ciphers. */ + if (i > 0) { + KASSERT(exf->native_blocksize != 0, + ("%s: partial block of %d bytes for cipher %s", + __func__, i, exf->name)); + KASSERT(exf->reinit != NULL, + ("%s: partial block cipher %s without reinit hook", + __func__, exf->name)); + KASSERT(i < blks, ("%s: partial block too big", __func__)); + + cuio_copydata(uio, count, i, blk); + if (encrypting) { + exf->encrypt_last(sw->sw_kschedule, blk, blk, i); + } else { + exf->decrypt_last(sw->sw_kschedule, blk, blk, i); + } + cuio_copyback(uio, count, i, blk); + } + out: if (iovalloc) free(iov, M_CRYPTO_DATA); @@ -512,6 +522,8 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp swe = &ses->swcr_encdec; exf = swe->sw_exf; + KASSERT(axf->blocksize == exf->native_blocksize, + ("%s: blocksize mismatch", __func__)); if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); @@ -665,6 +677,8 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp swe = &ses->swcr_encdec; exf = swe->sw_exf; + KASSERT(axf->blocksize == exf->native_blocksize, + ("%s: blocksize mismatch", __func__)); if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); Modified: head/sys/opencrypto/xform_aes_icm.c ============================================================================== --- head/sys/opencrypto/xform_aes_icm.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/xform_aes_icm.c Fri May 22 16:29:09 2020 (r361390) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); static int aes_icm_setkey(void *, const uint8_t *, int); static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); +static void aes_icm_crypt_last(void *, const uint8_t *, uint8_t *, size_t); static void aes_icm_reinit(void *, const uint8_t *); static void aes_gcm_reinit(void *, const uint8_t *); static void aes_ccm_reinit(void *, const uint8_t *); @@ -63,7 +64,8 @@ struct enc_xform enc_xform_aes_icm = { .type = CRYPTO_AES_ICM, .name = "AES-ICM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_BLOCK_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, .ivsize = AES_BLOCK_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, @@ -71,13 +73,16 @@ struct enc_xform enc_xform_aes_icm = { .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_icm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; struct enc_xform enc_xform_aes_nist_gcm = { .type = CRYPTO_AES_NIST_GCM_16, .name = "AES-GCM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_ICM_BLOCK_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, .ivsize = AES_GCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, @@ -85,18 +90,24 @@ struct enc_xform enc_xform_aes_nist_gcm = { .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_gcm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; struct enc_xform enc_xform_ccm = { .type = CRYPTO_AES_CCM_16, .name = "AES-CCM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_ICM_BLOCK_LEN, .ivsize = AES_CCM_IV_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, + .ivsize = AES_CCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, .encrypt = aes_icm_crypt, .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_ccm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; /* @@ -143,20 +154,30 @@ static void aes_icm_crypt(void *key, const uint8_t *in, uint8_t *out) { struct aes_icm_ctx *ctx; - uint8_t keystream[AESICM_BLOCKSIZE]; int i; ctx = key; - rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); - for (i = 0; i < AESICM_BLOCKSIZE; i++) - out[i] = in[i] ^ keystream[i]; - explicit_bzero(keystream, sizeof(keystream)); + aes_icm_crypt_last(key, in, out, AESICM_BLOCKSIZE); /* increment counter */ for (i = AESICM_BLOCKSIZE - 1; i >= 0; i--) if (++ctx->ac_block[i]) /* continue on overflow */ break; +} + +static void +aes_icm_crypt_last(void *key, const uint8_t *in, uint8_t *out, size_t len) +{ + struct aes_icm_ctx *ctx; + uint8_t keystream[AESICM_BLOCKSIZE]; + int i; + + ctx = key; + rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); + for (i = 0; i < len; i++) + out[i] = in[i] ^ keystream[i]; + explicit_bzero(keystream, sizeof(keystream)); } static int Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/xform_enc.h Fri May 22 16:29:09 2020 (r361390) @@ -51,20 +51,25 @@ struct enc_xform { char *name; size_t ctxsize; u_int16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ + uint16_t native_blocksize; /* Used for stream ciphers. */ u_int16_t ivsize; u_int16_t minkey, maxkey; + + /* + * Encrypt/decrypt a single block. For stream ciphers this + * encrypts/decrypts a single "native" block. + */ void (*encrypt) (void *, const uint8_t *, uint8_t *); void (*decrypt) (void *, const uint8_t *, uint8_t *); int (*setkey) (void *, const uint8_t *, int len); void (*reinit) (void *, const u_int8_t *); + /* - * Encrypt/decrypt 1+ blocks of input -- total size is 'len' bytes. - * Len is guaranteed to be a multiple of the defined 'blocksize'. - * Optional interface -- most useful for stream ciphers with a small - * blocksize (1). + * For stream ciphers, encrypt/decrypt the final partial block + * of 'len' bytes. */ - void (*encrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); - void (*decrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); + void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); + void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); }; From owner-svn-src-head@freebsd.org Fri May 22 16:53:40 2020 Return-Path: Delivered-To: svn-src-head@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 A99812CE538; Fri, 22 May 2020 16:53:40 +0000 (UTC) (envelope-from gordon@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCHS2vWsz4ZBj; Fri, 22 May 2020 16:53:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E6F22194C; Fri, 22 May 2020 16:53:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MGre8B013697; Fri, 22 May 2020 16:53:40 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGre6i013696; Fri, 22 May 2020 16:53:40 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005221653.04MGre6i013696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Fri, 22 May 2020 16:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361392 - head/secure/lib/libcrypto X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/secure/lib/libcrypto X-SVN-Commit-Revision: 361392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 16:53:40 -0000 Author: gordon Date: Fri May 22 16:53:39 2020 New Revision: 361392 URL: https://svnweb.freebsd.org/changeset/base/361392 Log: Remove support for SSLv3 from the OpenSSL build. This is the default configuration in OpenSSL 1.1.1 already. This moves to align with that default. Reported by: jmg Approved by: jkim, cem, emaste, philip Differential Revision: https://reviews.freebsd.org/D24945 Modified: head/secure/lib/libcrypto/opensslconf.h.in Modified: head/secure/lib/libcrypto/opensslconf.h.in ============================================================================== --- head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:51:00 2020 (r361391) +++ head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:53:39 2020 (r361392) @@ -76,6 +76,12 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif From owner-svn-src-head@freebsd.org Fri May 22 17:21:22 2020 Return-Path: Delivered-To: svn-src-head@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 AD5A32CEED5; Fri, 22 May 2020 17:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCvQ45Q7z4bNY; Fri, 22 May 2020 17:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87F7421F99; Fri, 22 May 2020 17:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHLMo7027279; Fri, 22 May 2020 17:21:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHLM8Z027278; Fri, 22 May 2020 17:21:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221721.04MHLM8Z027278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 17:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361393 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 361393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:21:22 -0000 Author: jhb Date: Fri May 22 17:21:22 2020 New Revision: 361393 URL: https://svnweb.freebsd.org/changeset/base/361393 Log: Correct the minimum key length for Camellia to 16 bytes (128 bits). MFC after: 1 week Modified: head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri May 22 16:53:39 2020 (r361392) +++ head/sys/opencrypto/cryptodev.h Fri May 22 17:21:22 2020 (r361393) @@ -134,7 +134,7 @@ #define AES_MAX_KEY RIJNDAEL_MAX_KEY #define AES_XTS_MIN_KEY (2 * AES_MIN_KEY) #define AES_XTS_MAX_KEY (2 * AES_MAX_KEY) -#define CAMELLIA_MIN_KEY 8 +#define CAMELLIA_MIN_KEY 16 #define CAMELLIA_MAX_KEY 32 /* Maximum hash algorithm result length */ From owner-svn-src-head@freebsd.org Fri May 22 17:23:09 2020 Return-Path: Delivered-To: svn-src-head@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 B06692CEEDE; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCxT4Dbcz4bS1; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72F1822480; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHN953032116; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHN9dx032115; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221723.04MHN9dx032115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 17:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361394 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 361394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:23:09 -0000 Author: kib Date: Fri May 22 17:23:09 2020 New Revision: 361394 URL: https://svnweb.freebsd.org/changeset/base/361394 Log: Convert linkmap_add() and linkmap_delete() to style(8). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 22 17:21:22 2020 (r361393) +++ head/libexec/rtld-elf/rtld.c Fri May 22 17:23:09 2020 (r361394) @@ -4028,49 +4028,50 @@ rtld_dirname_abs(const char *path, char *base) static void linkmap_add(Obj_Entry *obj) { - struct link_map *l = &obj->linkmap; - struct link_map *prev; + struct link_map *l, *prev; - obj->linkmap.l_name = obj->path; - obj->linkmap.l_base = obj->mapbase; - obj->linkmap.l_ld = obj->dynamic; - obj->linkmap.l_addr = obj->relocbase; + l = &obj->linkmap; + l->l_name = obj->path; + l->l_base = obj->mapbase; + l->l_ld = obj->dynamic; + l->l_addr = obj->relocbase; - if (r_debug.r_map == NULL) { - r_debug.r_map = l; - return; - } + if (r_debug.r_map == NULL) { + r_debug.r_map = l; + return; + } - /* - * Scan to the end of the list, but not past the entry for the - * dynamic linker, which we want to keep at the very end. - */ - for (prev = r_debug.r_map; - prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap; - prev = prev->l_next) - ; + /* + * Scan to the end of the list, but not past the entry for the + * dynamic linker, which we want to keep at the very end. + */ + for (prev = r_debug.r_map; + prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap; + prev = prev->l_next) + ; - /* Link in the new entry. */ - l->l_prev = prev; - l->l_next = prev->l_next; - if (l->l_next != NULL) - l->l_next->l_prev = l; - prev->l_next = l; + /* Link in the new entry. */ + l->l_prev = prev; + l->l_next = prev->l_next; + if (l->l_next != NULL) + l->l_next->l_prev = l; + prev->l_next = l; } static void linkmap_delete(Obj_Entry *obj) { - struct link_map *l = &obj->linkmap; + struct link_map *l; - if (l->l_prev == NULL) { - if ((r_debug.r_map = l->l_next) != NULL) - l->l_next->l_prev = NULL; - return; - } + l = &obj->linkmap; + if (l->l_prev == NULL) { + if ((r_debug.r_map = l->l_next) != NULL) + l->l_next->l_prev = NULL; + return; + } - if ((l->l_prev->l_next = l->l_next) != NULL) - l->l_next->l_prev = l->l_prev; + if ((l->l_prev->l_next = l->l_next) != NULL) + l->l_next->l_prev = l->l_prev; } /* From owner-svn-src-head@freebsd.org Fri May 22 17:23:43 2020 Return-Path: Delivered-To: svn-src-head@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 EFA042CEFD4; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCy75Z1rz4bkq; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA6AD2229F; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHNhTL032197; Fri, 22 May 2020 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHNhUF032196; Fri, 22 May 2020 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221723.04MHNhUF032196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361395 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 361395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:23:44 -0000 Author: jhb Date: Fri May 22 17:23:43 2020 New Revision: 361395 URL: https://svnweb.freebsd.org/changeset/base/361395 Log: Update name of description of vfs.ffs.setsize in comment. Previously it used the name 'adjsize' instead of 'setsize'. Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri May 22 17:23:09 2020 (r361394) +++ head/sys/ufs/ffs/ffs_alloc.c Fri May 22 17:23:43 2020 (r361395) @@ -3065,7 +3065,7 @@ ffs_fserr(fs, inum, cp) * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. - * adjsize(inode, size) - set the size of the inode to the + * setsize(inode, size) - set the size of the inode to the * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - * adjust the superblock summary. From owner-svn-src-head@freebsd.org Fri May 22 17:45:08 2020 Return-Path: Delivered-To: svn-src-head@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 6412D2CFA1B; Fri, 22 May 2020 17:45:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TDQr25Dvz4d0r; Fri, 22 May 2020 17:45:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43062225A6; Fri, 22 May 2020 17:45:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHj8uN044443; Fri, 22 May 2020 17:45:08 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHj7Pv044441; Fri, 22 May 2020 17:45:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202005221745.04MHj7Pv044441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 22 May 2020 17:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361397 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:45:08 -0000 Author: brooks Date: Fri May 22 17:45:07 2020 New Revision: 361397 URL: https://svnweb.freebsd.org/changeset/base/361397 Log: Add an unprivileged mode where calls to install are passed appropriate flags. For ease of integration, use the same flags as install: -U unprivileged mode -D Specify DESTDIR (overrides the environment) -M Full path to METALOG file Reviewed by: kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24932 Modified: head/usr.sbin/certctl/certctl.8 head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.8 ============================================================================== --- head/usr.sbin/certctl/certctl.8 Fri May 22 17:30:36 2020 (r361396) +++ head/usr.sbin/certctl/certctl.8 Fri May 22 17:45:07 2020 (r361397) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2019 +.Dd May 22, 2020 .Dt CERTCTL 8 .Os .Sh NAME @@ -40,7 +40,9 @@ .Op Fl v .Ic blacklisted .Nm -.Op Fl nv +.Op Fl nUv +.Op Fl D Ar destdir +.Op Fl M Ar metalog .Ic rehash .Nm .Op Fl nv @@ -56,10 +58,17 @@ applications that use OpenSSL. .Pp Flags: .Bl -tag -width 4n +.It Fl D Ar destdir +Specify the DESTDIR (overriding values from the environment). +.It Fl M Ar metalog +Specify the path of the METALOG file (default: $DESTDIR/METALOG). .It Fl n No-Op mode, do not actually perform any actions. .It Fl v be verbose, print details about actions before performing them. +.It Fl U +Unprivileged mode, do not change the ownership of created links. +Do record the ownership in the METALOG file. .El .Pp Primary command functions: Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Fri May 22 17:30:36 2020 (r361396) +++ head/usr.sbin/certctl/certctl.sh Fri May 22 17:45:07 2020 (r361397) @@ -30,10 +30,6 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} -: ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} -: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} -: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} : ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} @@ -42,6 +38,7 @@ SCRIPTNAME="${0##*/}" ERRORS=0 NOOP=0 +UNPRIV=0 ############################################################ FUNCTIONS @@ -69,7 +66,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -88,7 +85,7 @@ create_blacklisted() return fi [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" - [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" + [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() @@ -105,7 +102,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" ] || continue + [ -e "$CPATH/$CFILE" && $UNPRIV -eq 0 ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -209,7 +206,7 @@ usage() echo " List trusted certificates" echo " $SCRIPTNAME [-v] blacklisted" echo " List blacklisted certificates" - echo " $SCRIPTNAME [-nv] rehash" + echo " $SCRIPTNAME [-nUv] [-D ] [-M ] rehash" echo " Generate hash links for all certificates" echo " $SCRIPTNAME [-nv] blacklist " echo " Add to the list of blacklisted certificates" @@ -220,13 +217,24 @@ usage() ############################################################ MAIN -while getopts nv flag; do +while getopts D:M:nUv flag; do case "$flag" in + D) DESTDIR=${OPTARG} ;; + M) METALOG=${OPTARG} ;; n) NOOP=1 ;; + U) UNPRIV=1 ;; v) VERBOSE=$(( $VERBOSE + 1 )) ;; esac done shift $(( $OPTIND - 1 )) + +: ${METALOG:=${DESTDIR}/METALOG} +INSTALLFLAGS= +[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +: ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} +: ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} +: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} +: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} [ $# -gt 0 ] || usage case "$1" in From owner-svn-src-head@freebsd.org Fri May 22 17:52:10 2020 Return-Path: Delivered-To: svn-src-head@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 4DCDD2CF159; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TDZy1Rv7z4dNN; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F702282A; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHq9Hl050209; Fri, 22 May 2020 17:52:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHq9cv050207; Fri, 22 May 2020 17:52:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221752.04MHq9cv050207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361398 - in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:52:10 -0000 Author: kib Date: Fri May 22 17:52:09 2020 New Revision: 361398 URL: https://svnweb.freebsd.org/changeset/base/361398 Log: Implement Solaris-like link_map l_refname member. The implementation is based on the public documentation, in particular dlinfo(3) from Solaris. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Fri May 22 17:45:07 2020 (r361397) +++ head/lib/libc/gen/dlinfo.3 Fri May 22 17:52:09 2020 (r361398) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2020 +.Dd May 21, 2020 .Dt DLINFO 3 .Os .Sh NAME @@ -111,6 +111,7 @@ const void *l_ld; /* Pointer to .dynamic in m struct link_map *l_next, /* linked list of mapped libs */ *l_prev; caddr_t l_addr; /* Load Offset of library */ +const char *l_refname; /* Object this one filters for */ .Ed .Bl -tag -width ".Va l_addr" .It Va l_base @@ -133,6 +134,11 @@ structure on the link-map list. The load offset of the object, that is, the difference between the actual load address and the base virtual address the object was linked at. +.It Va l_refname +A name of the object this object filters for, if any. +If there are more then one filtee, a name from the first +.Dv DT_FILTER +dynamic entry is supplied. .El .It Dv RTLD_DI_SERINFO Retrieve the library search paths associated with the given Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 22 17:45:07 2020 (r361397) +++ head/libexec/rtld-elf/rtld.c Fri May 22 17:52:09 2020 (r361398) @@ -1207,6 +1207,9 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *needed_filtees_tail = nep; needed_filtees_tail = &nep->next; + + if (obj->linkmap.l_refname == NULL) + obj->linkmap.l_refname = (char *)dynp->d_un.d_val; } break; @@ -1402,6 +1405,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D } obj->dynsymcount += obj->symndx_gnu; } + + if (obj->linkmap.l_refname != NULL) + obj->linkmap.l_refname = obj->strtab + (unsigned long)obj-> + linkmap.l_refname; } static bool Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Fri May 22 17:45:07 2020 (r361397) +++ head/sys/sys/link_elf.h Fri May 22 17:52:09 2020 (r361398) @@ -65,6 +65,7 @@ typedef struct link_map { const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, *l_prev; /* linked list of of mapped libs */ caddr_t l_addr; /* Load Offset of library */ + const char *l_refname; /* object we are filtering for */ } Link_map; struct r_debug { From owner-svn-src-head@freebsd.org Fri May 22 18:03:15 2020 Return-Path: Delivered-To: svn-src-head@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 7AF202CFDB0; Fri, 22 May 2020 18:03:15 +0000 (UTC) (envelope-from asomers@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TDql1PPjz4f7m; Fri, 22 May 2020 18:03:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B67E22A18; Fri, 22 May 2020 18:03:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MI3FmL056892; Fri, 22 May 2020 18:03:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MI3Fvu056891; Fri, 22 May 2020 18:03:15 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005221803.04MI3Fvu056891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 18:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361399 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 361399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 18:03:15 -0000 Author: asomers Date: Fri May 22 18:03:14 2020 New Revision: 361399 URL: https://svnweb.freebsd.org/changeset/base/361399 Log: Disable nullfs cacheing on top of fusefs Nullfs cacheing can keep a large number of vnodes active. That results in more active FUSE file handles, causing some FUSE servers to use extra resources. Disable nullfs cacheing for fusefs, just like we already do for NFSv4. PR: 245688 Reported by: MooseFS FreeBSD Team MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Fri May 22 17:52:09 2020 (r361398) +++ head/sys/fs/fuse/fuse_vfsops.c Fri May 22 18:03:14 2020 (r361399) @@ -425,6 +425,11 @@ fuse_vfsop_mount(struct mount *mp) */ mp->mnt_flag &= ~MNT_LOCAL; mp->mnt_kern_flag |= MNTK_USES_BCACHE; + /* + * Disable nullfs cacheing because it can consume too many resources in + * the FUSE server. + */ + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ mp->mnt_stat.f_iosize = maxbcachebuf; From owner-svn-src-head@freebsd.org Fri May 22 18:10:47 2020 Return-Path: Delivered-To: svn-src-head@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 16CA22D8012; Fri, 22 May 2020 18:10:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TF0Q6vlQz4fSc; Fri, 22 May 2020 18:10:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6F3A227E0; Fri, 22 May 2020 18:10:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MIAksX060357; Fri, 22 May 2020 18:10:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIAkHv060356; Fri, 22 May 2020 18:10:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005221810.04MIAkHv060356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 22 May 2020 18:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361400 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 361400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 18:10:47 -0000 Author: mav Date: Fri May 22 18:10:46 2020 New Revision: 361400 URL: https://svnweb.freebsd.org/changeset/base/361400 Log: Do not try to fill socket send buffer to the last byte. Setting so_snd.sb_lowat to at least 1/8 of the socket buffer size allows send thread more actively use PDUs coalescing, that dramatically reduces TCP lock congestion and number of context switches, when the socket is full and PDUs are small. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Fri May 22 18:03:14 2020 (r361399) +++ head/sys/dev/iscsi/icl_soft.c Fri May 22 18:10:46 2020 (r361400) @@ -914,7 +914,8 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu "have %ld, need %ld", available, size); #endif - so->so_snd.sb_lowat = size; + so->so_snd.sb_lowat = max(size, + so->so_snd.sb_hiwat / 8); SOCKBUF_UNLOCK(&so->so_snd); return; } From owner-svn-src-head@freebsd.org Fri May 22 18:11:20 2020 Return-Path: Delivered-To: svn-src-head@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 38CD72D8045; Fri, 22 May 2020 18:11:20 +0000 (UTC) (envelope-from asomers@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TF14190Wz4fJh; Fri, 22 May 2020 18:11:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0989722CCB; Fri, 22 May 2020 18:11:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MIBKUb060461; Fri, 22 May 2020 18:11:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIBILR060451; Fri, 22 May 2020 18:11:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005221811.04MIBILR060451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 18:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361401 - in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 361401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 18:11:20 -0000 Author: asomers Date: Fri May 22 18:11:17 2020 New Revision: 361401 URL: https://svnweb.freebsd.org/changeset/base/361401 Log: Fix issues with FUSE_ACCESS when default_permissions is disabled This patch fixes two issues relating to FUSE_ACCESS when the default_permissions mount option is disabled: * VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent of VADMIN, so we must evaluate such things kernel-side, regardless of the default_permissions setting. * The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes: for the access(2) syscall and to check directory permissions for searchability during lookup. FreeBSD sends it much more frequently, due to differences between our VFS and Linux's, for which FUSE was designed. But this patch does eliminate several cases not required by the FUSE protocol: * for any FUSE_*XATTR operation * when creating a new file * when deleting a file * when setting timestamps, such as by utimensat(2). * Additionally, when default_permissions is disabled, this patch removes one FUSE_GETATTR operation when deleting a file. PR: 245689 Reported by: MooseFS FreeBSD Team Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24777 Modified: head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_vnops.c head/tests/sys/fs/fusefs/access.cc head/tests/sys/fs/fusefs/rename.cc head/tests/sys/fs/fusefs/rmdir.cc head/tests/sys/fs/fusefs/unlink.cc head/tests/sys/fs/fusefs/utils.cc head/tests/sys/fs/fusefs/utils.hh head/tests/sys/fs/fusefs/xattr.cc Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri May 22 18:10:46 2020 (r361400) +++ head/sys/fs/fuse/fuse_internal.c Fri May 22 18:11:17 2020 (r361401) @@ -158,6 +158,7 @@ fuse_internal_get_cached_vnode(struct mount* mp, ino_t return 0; } +SDT_PROBE_DEFINE0(fusefs, , internal, access_vadmin); /* Synchronously send a FUSE_ACCESS operation */ int fuse_internal_access(struct vnode *vp, @@ -210,10 +211,18 @@ fuse_internal_access(struct vnode *vp, va.va_gid, mode, cred, NULL); } + if (mode & VADMIN) { + /* + * The FUSE protocol doesn't have an equivalent of VADMIN, so + * it's a bug if we ever reach this point with that bit set. + */ + SDT_PROBE0(fusefs, , internal, access_vadmin); + } + if (!fsess_isimpl(mp, FUSE_ACCESS)) return 0; - if ((mode & (VWRITE | VAPPEND | VADMIN)) != 0) + if ((mode & (VWRITE | VAPPEND)) != 0) mask |= W_OK; if ((mode & VREAD) != 0) mask |= R_OK; Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri May 22 18:10:46 2020 (r361400) +++ head/sys/fs/fuse/fuse_vnops.c Fri May 22 18:11:17 2020 (r361401) @@ -235,6 +235,7 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru { struct mount *mp = vnode_mount(vp); struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; /* * Kernel-invoked always succeeds. @@ -248,12 +249,15 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru */ switch (ns) { case EXTATTR_NAMESPACE_SYSTEM: - if (data->dataflags & FSESS_DEFAULT_PERMISSIONS) { + if (default_permissions) { return (priv_check_cred(cred, PRIV_VFS_EXTATTR_SYSTEM)); } - /* FALLTHROUGH */ + return (0); case EXTATTR_NAMESPACE_USER: - return (fuse_internal_access(vp, accmode, td, cred)); + if (default_permissions) { + return (fuse_internal_access(vp, accmode, td, cred)); + } + return (0); default: return (EPERM); } @@ -985,6 +989,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) int wantparent = flags & (LOCKPARENT | WANTPARENT); int islastcn = flags & ISLASTCN; struct mount *mp = vnode_mount(dvp); + struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; int err = 0; int lookup_err = 0; @@ -1108,7 +1114,11 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) if (lookup_err) { /* Entry not found */ if ((nameiop == CREATE || nameiop == RENAME) && islastcn) { - err = fuse_internal_access(dvp, VWRITE, td, cred); + if (default_permissions) + err = fuse_internal_access(dvp, VWRITE, td, + cred); + else + err = 0; if (!err) { /* * Set the SAVENAME flag to hold onto the @@ -1191,7 +1201,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) &fvdat->entry_cache_timeout); if ((nameiop == DELETE || nameiop == RENAME) && - islastcn) + islastcn && default_permissions) { struct vattr dvattr; @@ -1828,7 +1838,11 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) if (vfs_isrdonly(mp)) return EROFS; - err = fuse_internal_access(vp, accmode, td, cred); + if (checkperm) { + err = fuse_internal_access(vp, accmode, td, cred); + } else { + err = 0; + } if (err) return err; else Modified: head/tests/sys/fs/fusefs/access.cc ============================================================================== --- head/tests/sys/fs/fusefs/access.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/access.cc Fri May 22 18:11:17 2020 (r361401) @@ -31,6 +31,9 @@ */ extern "C" { +#include +#include + #include #include } @@ -42,10 +45,33 @@ using namespace testing; class Access: public FuseTest { public: +virtual void SetUp() { + FuseTest::SetUp(); + // Clear the default FUSE_ACCESS expectation + Mock::VerifyAndClearExpectations(m_mock); +} + void expect_lookup(const char *relpath, uint64_t ino) { FuseTest::expect_lookup(relpath, ino, S_IFREG | 0644, 0, 1); } + +/* + * Expect tha FUSE_ACCESS will never be called for the given inode, with any + * bits in the supplied access_mask set + */ +void expect_noaccess(uint64_t ino, mode_t access_mask) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino && + in.body.access.mask & access_mask); + }, Eq(true)), + _) + ).Times(0); +} + }; class RofsAccess: public Access { @@ -56,6 +82,68 @@ virtual void SetUp() { } }; +/* + * Change the mode of a file. + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, chmod) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t newmode = 0644; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_SETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.mode = S_IFREG | newmode; + }))); + + EXPECT_EQ(0, chmod(FULLPATH, newmode)) << strerror(errno); +} + +/* + * Create a new file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, create) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + mode_t mode = S_IFREG | 0755; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, R_OK | W_OK); + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke(ReturnErrno(ENOENT))); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_CREATE); + }, Eq(true)), + _) + ).WillOnce(ReturnErrno(EPERM)); + + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(EPERM, errno); +} + /* The error case of FUSE_ACCESS. */ TEST_F(Access, eaccess) { @@ -105,6 +193,33 @@ TEST_F(RofsAccess, erofs) ASSERT_EQ(EROFS, errno); } + +/* + * Lookup an extended attribute + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, Getxattr) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + char data[80]; + int ns = EXTATTR_NAMESPACE_USER; + ssize_t r; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + expect_getxattr(ino, "user.foo", ReturnErrno(ENOATTR)); + + r = extattr_get_file(FULLPATH, ns, "foo", data, sizeof(data)); + ASSERT_EQ(-1, r); + ASSERT_EQ(ENOATTR, errno); +} + /* The successful case of FUSE_ACCESS. */ TEST_F(Access, ok) { @@ -118,4 +233,71 @@ TEST_F(Access, ok) expect_access(ino, access_mode, 0); ASSERT_EQ(0, access(FULLPATH, access_mode)) << strerror(errno); +} + +/* + * Unlink a file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + expect_lookup(RELPATH, ino); + expect_unlink(1, RELPATH, EPERM); + + ASSERT_NE(0, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); +} + +/* + * Unlink a file whose parent diretory's sticky bit is set + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink_sticky_directory) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) + { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = FUSE_ROOT_ID; + out.body.attr.attr.mode = S_IFDIR | 01777; + out.body.attr.attr.uid = 0; + out.body.attr.attr_valid = UINT64_MAX; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(0); + expect_lookup(RELPATH, ino); + expect_unlink(FUSE_ROOT_ID, RELPATH, EPERM); + + ASSERT_EQ(-1, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); } Modified: head/tests/sys/fs/fusefs/rename.cc ============================================================================== --- head/tests/sys/fs/fusefs/rename.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/rename.cc Fri May 22 18:11:17 2020 (r361401) @@ -53,24 +53,6 @@ class Rename: public FuseTest { FuseTest::TearDown(); } - - void expect_getattr(uint64_t ino, mode_t mode) - { - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke( - ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); - } - }; // EINVAL, dst is subdir of src @@ -82,7 +64,6 @@ TEST_F(Rename, einval) const char RELSRC[] = "src"; uint64_t src_ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, src_ino, S_IFDIR | 0755, 0, 2); EXPECT_LOOKUP(src_ino, RELDST).WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -123,7 +104,6 @@ TEST_F(Rename, entry_cache_negative) */ struct timespec entry_valid = {.tv_sec = 0, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -158,7 +138,6 @@ TEST_F(Rename, entry_cache_negative_purge) uint64_t ino = 42; struct timespec entry_valid = {.tv_sec = TIME_T_MAX, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -196,7 +175,6 @@ TEST_F(Rename, exdev) tmpfd = mkstemp(tmpfile); ASSERT_LE(0, tmpfd) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELB, b_ino, S_IFREG | 0644, 0, 2); ASSERT_NE(0, rename(tmpfile, FULLB)); @@ -215,7 +193,6 @@ TEST_F(Rename, ok) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) .WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -251,7 +228,6 @@ TEST_F(Rename, parent) struct stat sb; expect_lookup(RELSRC, ino, S_IFDIR | 0755, 0, 1); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDSTDIR) .WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { SET_OUT_HEADER_LEN(out, entry); @@ -303,7 +279,6 @@ TEST_F(Rename, overwrite) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); expect_lookup(RELDST, dst_ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( Modified: head/tests/sys/fs/fusefs/rmdir.cc ============================================================================== --- head/tests/sys/fs/fusefs/rmdir.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/rmdir.cc Fri May 22 18:11:17 2020 (r361401) @@ -42,22 +42,6 @@ using namespace testing; class Rmdir: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -95,25 +79,34 @@ TEST_F(Rmdir, parent_attr_cache) struct stat sb; sem_t sem; uint64_t ino = 42; + Sequence seq; ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_RMDIR && + 0 == strcmp(RELPATH, in.body.rmdir) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + expect_forget(ino, 1, &sem); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - expect_lookup(RELPATH, ino); - expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); - expect_forget(ino, 1, &sem); ASSERT_EQ(0, rmdir(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -127,7 +120,6 @@ TEST_F(Rmdir, enotempty) const char RELPATH[] = "some_dir"; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, ENOTEMPTY); @@ -143,7 +135,6 @@ TEST_F(Rmdir, entry_cache) sem_t sem; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -163,7 +154,6 @@ TEST_F(Rmdir, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); Modified: head/tests/sys/fs/fusefs/unlink.cc ============================================================================== --- head/tests/sys/fs/fusefs/unlink.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/unlink.cc Fri May 22 18:11:17 2020 (r361401) @@ -41,22 +41,6 @@ using namespace testing; class Unlink: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times, int nlink=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -89,7 +73,6 @@ TEST_F(Unlink, attr_cache) struct stat sb_old, sb_new; int fd1; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_lookup(RELPATH1, ino, 1, 2); expect_open(ino, 0, 1); @@ -117,23 +100,32 @@ TEST_F(Unlink, parent_attr_cache) const char RELPATH[] = "some_file.txt"; struct stat sb; uint64_t ino = 42; + Sequence seq; + /* Use nlink=2 so we don't get a FUSE_FORGET */ + expect_lookup(RELPATH, ino, 1, 2); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_UNLINK && + 0 == strcmp(RELPATH, in.body.unlink) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - /* Use nlink=2 so we don't get a FUSE_FORGET */ - expect_lookup(RELPATH, ino, 1, 2); - expect_unlink(1, RELPATH, 0); ASSERT_EQ(0, unlink(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -145,7 +137,6 @@ TEST_F(Unlink, eperm) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, EPERM); @@ -162,7 +153,6 @@ TEST_F(Unlink, entry_cache) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2, 2); expect_unlink(1, RELPATH, 0); @@ -182,7 +172,6 @@ TEST_F(Unlink, multiply_linked) const char RELPATH1[] = "other_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_unlink(1, RELPATH0, 0); EXPECT_CALL(*m_mock, process( @@ -213,7 +202,6 @@ TEST_F(Unlink, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -233,7 +221,6 @@ TEST_F(Unlink, open_but_deleted) uint64_t ino = 42; int fd; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 2); expect_open(ino, 0, 1); expect_unlink(1, RELPATH0, 0); Modified: head/tests/sys/fs/fusefs/utils.cc ============================================================================== --- head/tests/sys/fs/fusefs/utils.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/utils.cc Fri May 22 18:11:17 2020 (r361401) @@ -273,6 +273,20 @@ void FuseTest::expect_getattr(uint64_t ino, uint64_t s }))); } +void FuseTest::expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + const char *a = (const char*)in.body.bytes + + sizeof(fuse_getxattr_in); + return (in.header.opcode == FUSE_GETXATTR && + in.header.nodeid == ino && + 0 == strcmp(attr, a)); + }, Eq(true)), + _) + ).WillOnce(Invoke(r)); +} + void FuseTest::expect_lookup(const char *relpath, uint64_t ino, mode_t mode, uint64_t size, int times, uint64_t attr_valid, uid_t uid, gid_t gid) { Modified: head/tests/sys/fs/fusefs/utils.hh ============================================================================== --- head/tests/sys/fs/fusefs/utils.hh Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/utils.hh Fri May 22 18:11:17 2020 (r361401) @@ -133,6 +133,12 @@ class FuseTest : public ::testing::Test { void expect_getattr(uint64_t ino, uint64_t size); /* + * Create an expectation that FUSE_GETXATTR will be called once for the + * given inode. + */ + void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r); + + /* * Create an expectation that FUSE_LOOKUP will be called for the given * path exactly times times and cache validity period. It will respond * with inode ino, mode mode, filesize size. Modified: head/tests/sys/fs/fusefs/xattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/xattr.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/xattr.cc Fri May 22 18:11:17 2020 (r361401) @@ -62,20 +62,6 @@ void* killer(void* target) { class Xattr: public FuseTest { public: -void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - const char *a = (const char*)in.body.bytes + - sizeof(fuse_getxattr_in); - return (in.header.opcode == FUSE_GETXATTR && - in.header.nodeid == ino && - 0 == strcmp(attr, a)); - }, Eq(true)), - _) - ).WillOnce(Invoke(r)); -} - void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, Sequence *seq = NULL) { From owner-svn-src-head@freebsd.org Fri May 22 18:54:56 2020 Return-Path: Delivered-To: svn-src-head@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 B3AD82D963B; Fri, 22 May 2020 18:54:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TFzN4J58z3T13; Fri, 22 May 2020 18:54:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDF92339C; Fri, 22 May 2020 18:54:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MIsuFr088262; Fri, 22 May 2020 18:54:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIsuns088261; Fri, 22 May 2020 18:54:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202005221854.04MIsuns088261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 22 May 2020 18:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361402 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 361402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 18:54:56 -0000 Author: mhorne Date: Fri May 22 18:54:56 2020 New Revision: 361402 URL: https://svnweb.freebsd.org/changeset/base/361402 Log: Simplify the RISC-V kernel linker invocation Remove our custom SYSTEM_LD definition. This generates program headers that are more consistent with other architectures, and more importantly, are in line with what loader(8) expects when loading a kernel. As noted in https://reviews.freebsd.org/D22920, there is no apparent reason why the kernel would need a writable text segment, so removal of the -N flag isn't likely to cause issue. Reviewed by: kp, br MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24909 Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv ============================================================================== --- head/sys/conf/Makefile.riscv Fri May 22 18:11:17 2020 (r361401) +++ head/sys/conf/Makefile.riscv Fri May 22 18:54:56 2020 (r361402) @@ -35,12 +35,7 @@ INCLUDES+= -I$S/contrib/libfdt # We set this value using --defsym rather than hardcoding it in ldscript.riscv # so that different kernel configs can override the load address. KERNEL_LMA?= 0x80200000 - -SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ - --no-warn-mismatch --warn-common --export-dynamic \ - --defsym='kernel_lma=${KERNEL_LMA}' \ - --dynamic-linker /red/herring \ - -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o +LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}' .if !empty(DDB_ENABLED) CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls From owner-svn-src-head@freebsd.org Fri May 22 20:52:37 2020 Return-Path: Delivered-To: svn-src-head@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 90A0A2DC652; Fri, 22 May 2020 20:52:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TJb93Gkwz3cPc; Fri, 22 May 2020 20:52:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52E1E2457B; Fri, 22 May 2020 20:52:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MKqbTM065913; Fri, 22 May 2020 20:52:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MKqbJW065912; Fri, 22 May 2020 20:52:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005222052.04MKqbJW065912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 20:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361404 - head/sys/crypto/ccp X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/crypto/ccp X-SVN-Commit-Revision: 361404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 20:52:37 -0000 Author: jhb Date: Fri May 22 20:52:36 2020 New Revision: 361404 URL: https://svnweb.freebsd.org/changeset/base/361404 Log: Remove a workaround for GCM requests with an empty payload. This was copied from ccr(4) (which does require the workaround), but is reportedly not needed for ccp(4). Discussed with: cem Sponsored by: Netflix Modified: head/sys/crypto/ccp/ccp.c Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Fri May 22 19:09:43 2020 (r361403) +++ head/sys/crypto/ccp/ccp.c Fri May 22 20:52:36 2020 (r361404) @@ -113,67 +113,6 @@ ccp_populate_sglist(struct sglist *sg, struct cryptop return (error); } -/* - * Handle a GCM request with an empty payload by performing the - * operation in software. - */ -static void -ccp_gcm_soft(struct ccp_session *s, struct cryptop *crp) -{ - struct aes_gmac_ctx gmac_ctx; - char block[GMAC_BLOCK_LEN]; - char digest[GMAC_DIGEST_LEN]; - char iv[AES_BLOCK_LEN]; - int i, len; - - /* - * This assumes a 12-byte IV from the crp. See longer comment - * above in ccp_gcm() for more details. - */ - if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) { - crp->crp_etype = EINVAL; - goto out; - } - memcpy(iv, crp->crp_iv, 12); - *(uint32_t *)&iv[12] = htobe32(1); - - /* Initialize the MAC. */ - AES_GMAC_Init(&gmac_ctx); - AES_GMAC_Setkey(&gmac_ctx, s->blkcipher.enckey, s->blkcipher.key_len); - AES_GMAC_Reinit(&gmac_ctx, iv, sizeof(iv)); - - /* MAC the AAD. */ - for (i = 0; i < crp->crp_aad_length; i += sizeof(block)) { - len = imin(crp->crp_aad_length - i, sizeof(block)); - crypto_copydata(crp, crp->crp_aad_start + i, len, block); - bzero(block + len, sizeof(block) - len); - AES_GMAC_Update(&gmac_ctx, block, sizeof(block)); - } - - /* Length block. */ - bzero(block, sizeof(block)); - ((uint32_t *)block)[1] = htobe32(crp->crp_aad_length * 8); - AES_GMAC_Update(&gmac_ctx, block, sizeof(block)); - AES_GMAC_Final(digest, &gmac_ctx); - - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - crypto_copyback(crp, crp->crp_digest_start, sizeof(digest), - digest); - crp->crp_etype = 0; - } else { - char digest2[GMAC_DIGEST_LEN]; - - crypto_copydata(crp, crp->crp_digest_start, sizeof(digest2), - digest2); - if (timingsafe_bcmp(digest, digest2, sizeof(digest)) == 0) - crp->crp_etype = 0; - else - crp->crp_etype = EBADMSG; - } -out: - crypto_done(crp); -} - static int ccp_probe(device_t dev) { @@ -643,11 +582,6 @@ ccp_process(device_t dev, struct cryptop *crp, int hin error = ccp_authenc(qp, s, crp); break; case GCM: - if (crp->crp_payload_length == 0) { - mtx_unlock(&qp->cq_lock); - ccp_gcm_soft(s, crp); - return (0); - } if (s->pending != 0) { error = EAGAIN; break; From owner-svn-src-head@freebsd.org Sat May 23 10:21:05 2020 Return-Path: Delivered-To: svn-src-head@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 181902FE134; Sat, 23 May 2020 10:21:05 +0000 (UTC) (envelope-from melifaro@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TfX10BSKz3RkM; Sat, 23 May 2020 10:21:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01A63E2C1; Sat, 23 May 2020 10:21:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NAL4uS063868; Sat, 23 May 2020 10:21:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NAL2SU063855; Sat, 23 May 2020 10:21:02 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231021.04NAL2SU063855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 10:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361409 - in head/sys: fs/nfsclient net net/route netinet6 nfs X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: fs/nfsclient net net/route netinet6 nfs X-SVN-Commit-Revision: 361409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 10:21:05 -0000 Author: melifaro Date: Sat May 23 10:21:02 2020 New Revision: 361409 URL: https://svnweb.freebsd.org/changeset/base/361409 Log: Use epoch(9) for rtentries to simplify control plane operations. Currently the only reason of refcounting rtentries is the need to report the rtable operation details immediately after the execution. Delaying rtentry reclamation allows to stop refcounting and simplify the code. Additionally, this change allows to reimplement rib_lookup_info(), which is used by some of the customers to get the matching prefix along with nexthops, in more efficient way. The change keeps per-vnet rtzone uma zone. It adds nh_vnet field to nhop_priv to be able to reliably set curvnet even during vnet teardown. Rest of the reference counting code will be removed in the D24867 . Differential Revision: https://reviews.freebsd.org/D24866 Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/net/route/nhop.h head/sys/net/route/nhop_ctl.c head/sys/net/route/nhop_var.h head/sys/net/route/route_var.h head/sys/net/rtsock.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/nfs/bootp_subr.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sat May 23 10:21:02 2020 (r361409) @@ -465,18 +465,21 @@ nfs_mountroot(struct mount *mp) if (nd->mygateway.sin_len != 0 && nd->mygateway.sin_addr.s_addr != 0) { struct sockaddr_in mask, sin; + struct epoch_tracker et; bzero((caddr_t)&mask, sizeof(mask)); sin = mask; sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ + NET_EPOCH_ENTER(et); CURVNET_SET(TD_TO_VNET(td)); error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/if.c Sat May 23 10:21:02 2020 (r361409) @@ -1854,18 +1854,17 @@ ifa_maintain_loopback_route(int cmd, const char *otype ifp = ifa->ifa_ifp; + NET_EPOCH_ENTER(et); bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; if (cmd == RTM_ADD) { /* explicitly specify (loopback) ifa */ if (info.rti_ifp != NULL) { - NET_EPOCH_ENTER(et); rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); if (rti_ifa != NULL) ifa_ref(rti_ifa); info.rti_ifa = rti_ifa; - NET_EPOCH_EXIT(et); } } info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; @@ -1874,6 +1873,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); + NET_EPOCH_EXIT(et); if (rti_ifa != NULL) ifa_free(rti_ifa); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route.c Sat May 23 10:21:02 2020 (r361409) @@ -120,10 +120,7 @@ VNET_PCPUSTAT_SYSUNINIT(rtstat); VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) -VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ -#define V_rttrash VNET(rttrash) - /* * Convert a 'struct radix_node *' to a 'struct rtentry *'. * The operation can be done safely (in this code) because a @@ -148,6 +145,7 @@ static int rt_ifdelroute(const struct rtentry *rt, con static struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror); static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); +static void destroy_rtentry_epoch(epoch_context_t ctx); #ifdef RADIX_MPATH static struct radix_node *rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror); @@ -332,6 +330,16 @@ vnet_route_uninit(const void *unused __unused) } } + /* + * dom_rtdetach calls rt_table_destroy(), which + * schedules deletion for all rtentries, nexthops and control + * structures. Wait for the destruction callbacks to fire. + * Note that this should result in freeing all rtentries, but + * nexthops deletions will be scheduled for the next epoch run + * and will be completed after vnet teardown. + */ + epoch_drain_callbacks(net_epoch_preempt); + free(V_rt_tables, M_RTABLE); uma_zdestroy(V_rtzone); } @@ -449,41 +457,54 @@ rtfree(struct rtentry *rt) if ((rt->rt_flags & RTF_UP) == 0) { if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT)) panic("rtfree 2"); - /* - * the rtentry must have been removed from the routing table - * so it is represented in rttrash.. remove that now. - */ - V_rttrash--; #ifdef DIAGNOSTIC if (rt->rt_refcnt < 0) { printf("rtfree: %p not freed (neg refs)\n", rt); goto done; } #endif + epoch_call(net_epoch_preempt, destroy_rtentry_epoch, + &rt->rt_epoch_ctx); - /* Unreference nexthop */ - nhop_free(rt->rt_nhop); - /* - * and the rtentry itself of course + * FALLTHROUGH to RT_UNLOCK() so the reporting functions + * have consistent behaviour of operating on unlocked entry. */ - uma_zfree(V_rtzone, rt); - return; } done: RT_UNLOCK(rt); } +static void +destroy_rtentry(struct rtentry *rt) +{ + + /* + * At this moment rnh, nh_control may be already freed. + * nhop interface may have been migrated to a different vnet. + * Use vnet stored in the nexthop to delete the entry. + */ + CURVNET_SET(nhop_get_vnet(rt->rt_nhop)); + + /* Unreference nexthop */ + nhop_free(rt->rt_nhop); + + uma_zfree(V_rtzone, rt); + + CURVNET_RESTORE(); +} + /* - * Temporary RTFREE() function wrapper. - * Intended to use in control plane code to - * avoid exposing internal layout of 'struct rtentry'. + * Epoch callback indicating rtentry is safe to destroy */ -void -rtfree_func(struct rtentry *rt) +static void +destroy_rtentry_epoch(epoch_context_t ctx) { + struct rtentry *rt; - RTFREE(rt); + rt = __containerof(ctx, struct rtentry, rt_epoch_ctx); + + destroy_rtentry(rt); } /* @@ -546,7 +567,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s RT_LOCK(rt); flags = rt->rt_flags; - RTFREE_LOCKED(rt); + RT_UNLOCK(rt); RTSTAT_INC(rts_dynamic); @@ -1112,13 +1133,6 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo ifa = rt->rt_nhop->nh_ifa; if (ifa != NULL && ifa->ifa_rtrequest != NULL) ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info); - - /* - * One more rtentry floating around that is not - * linked to the routing table. rttrash will be decremented - * when RTFREE(rt) is eventually called. - */ - V_rttrash++; } @@ -1386,6 +1400,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); + NET_EPOCH_ASSERT(); dst = info->rti_info[RTAX_DST]; @@ -1580,13 +1595,10 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); /* - * actually return a resultant rtentry and - * give the caller a single reference. + * actually return a resultant rtentry */ - if (ret_nrt) { + if (ret_nrt) *ret_nrt = rt; - RT_ADDREF(rt); - } rnh->rnh_gen++; /* Routing table updated */ RT_UNLOCK(rt); @@ -1622,15 +1634,13 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in /* * If the caller wants it, then it can have it, - * but it's up to it to free the rtentry as we won't be - * doing it. + * the entry will be deleted after the end of the current epoch. */ - if (ret_nrt) { + if (ret_nrt) *ret_nrt = rt; - RT_UNLOCK(rt); - } else - RTFREE_LOCKED(rt); - + + RTFREE_LOCKED(rt); + return (0); } @@ -1736,10 +1746,8 @@ change_route_one(struct rib_head *rnh, struct rt_addri if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - if (ret_nrt != NULL) { + if (ret_nrt != NULL) *ret_nrt = rt; - RT_ADDREF(rt); - } RT_UNLOCK(rt); @@ -1757,7 +1765,6 @@ static int change_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry **ret_nrt) { - struct epoch_tracker et; int error; /* Check if updated gateway exists */ @@ -1765,8 +1772,6 @@ change_route(struct rib_head *rnh, struct rt_addrinfo (info->rti_info[RTAX_GATEWAY] == NULL)) return (EINVAL); - NET_EPOCH_ENTER(et); - /* * route change is done in multiple steps, with dropping and * reacquiring lock. In the situations with multiple processes @@ -1779,7 +1784,6 @@ change_route(struct rib_head *rnh, struct rt_addrinfo if (error != EAGAIN) break; } - NET_EPOCH_EXIT(et); return (error); } @@ -1825,6 +1829,7 @@ static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { RIB_RLOCK_TRACKER; + struct epoch_tracker et; struct sockaddr *dst; struct sockaddr *netmask; struct rtentry *rt = NULL; @@ -1957,38 +1962,18 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi else info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; + NET_EPOCH_ENTER(et); error = rtrequest1_fib(cmd, &info, &rt, fibnum); if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change */ - RT_LOCK(rt); /* TODO: interface routes/aliases */ - RT_ADDREF(rt); - RT_UNLOCK(rt); rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); - RT_LOCK(rt); - RT_REMREF(rt); - if (cmd == RTM_DELETE) { - /* - * If we are deleting, and we found an entry, - * then it's been removed from the tree.. - * now throw it away. - */ - RTFREE_LOCKED(rt); - } else { - if (cmd == RTM_ADD) { - /* - * We just wanted to add it.. - * we don't actually need a reference. - */ - RT_REMREF(rt); - } - RT_UNLOCK(rt); - } didwork = 1; } + NET_EPOCH_EXIT(et); if (error) a_failure = error; } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route.h Sat May 23 10:21:02 2020 (r361409) @@ -332,8 +332,6 @@ struct rt_addrinfo { #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ || (ifp)->if_link_state == LINK_STATE_UP) -#define RTFREE_FUNC(_rt) rtfree_func(_rt) - #define RO_NHFREE(_ro) do { \ if ((_ro)->ro_nh) { \ NH_FREE((_ro)->ro_nh); \ Modified: head/sys/net/route/nhop.h ============================================================================== --- head/sys/net/route/nhop.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop.h Sat May 23 10:21:02 2020 (r361409) @@ -176,6 +176,7 @@ struct rib_head; uint32_t nhop_get_idx(const struct nhop_object *nh); enum nhop_type nhop_get_type(const struct nhop_object *nh); int nhop_get_rtflags(const struct nhop_object *nh); +struct vnet *nhop_get_vnet(const struct nhop_object *nh); #endif /* _KERNEL */ Modified: head/sys/net/route/nhop_ctl.c ============================================================================== --- head/sys/net/route/nhop_ctl.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop_ctl.c Sat May 23 10:21:02 2020 (r361409) @@ -500,6 +500,9 @@ finalize_nhop(struct nh_control *ctl, struct rt_addrin return (ENOMEM); } + /* Save vnet to ease destruction */ + nh_priv->nh_vnet = curvnet; + /* Reference external objects and calculate (referenced) ifa */ if_ref(nh->nh_ifp); ifa_ref(nh->nh_ifa); @@ -696,6 +699,13 @@ nhop_set_rtflags(struct nhop_object *nh, int rt_flags) { nh->nh_priv->rt_flags = rt_flags; +} + +struct vnet * +nhop_get_vnet(const struct nhop_object *nh) +{ + + return (nh->nh_priv->nh_vnet); } void Modified: head/sys/net/route/nhop_var.h ============================================================================== --- head/sys/net/route/nhop_var.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop_var.h Sat May 23 10:21:02 2020 (r361409) @@ -78,6 +78,7 @@ struct nhop_priv { struct nhop_object *nh; /* backreference to the dataplane nhop */ struct nh_control *nh_control; /* backreference to the rnh */ struct nhop_priv *nh_next; /* hash table membership */ + struct vnet *nh_vnet; /* vnet nhop belongs to */ struct epoch_context nh_epoch_ctx; /* epoch data for nhop */ }; Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/route_var.h Sat May 23 10:21:02 2020 (r361409) @@ -35,6 +35,7 @@ #ifndef RNF_NORMAL #include #endif +#include #include /* struct sockaddr_in */ #include @@ -148,6 +149,7 @@ struct rtentry { #define rt_endzero rt_mtx struct mtx rt_mtx; /* mutex for routing entry */ struct rtentry *rt_chain; /* pointer to next rtentry to delete */ + struct epoch_context rt_epoch_ctx; /* net epoch tracker */ }; #define RT_LOCK_INIT(_rt) \ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/rtsock.c Sat May 23 10:21:02 2020 (r361409) @@ -742,7 +742,6 @@ handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, } } RT_LOCK(rt); - RT_ADDREF(rt); RIB_RUNLOCK(rnh); *ret_nrt = rt; @@ -930,7 +929,6 @@ route_output(struct mbuf *m, struct socket *so, ...) #endif RT_LOCK(saved_nrt); rtm->rtm_index = saved_nrt->rt_nhop->nh_ifp->if_index; - RT_REMREF(saved_nrt); RT_UNLOCK(saved_nrt); } break; @@ -987,8 +985,7 @@ report: flush: NET_EPOCH_EXIT(et); - if (rt != NULL) - RTFREE(rt); + rt = NULL; #ifdef INET6 if (rtm != NULL) { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/netinet6/nd6.c Sat May 23 10:21:02 2020 (r361409) @@ -1566,14 +1566,17 @@ nd6_free_redirect(const struct llentry *ln) int fibnum; struct sockaddr_in6 sin6; struct rt_addrinfo info; + struct epoch_tracker et; lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6); memset(&info, 0, sizeof(info)); info.rti_info[RTAX_DST] = (struct sockaddr *)&sin6; info.rti_filter = nd6_isdynrte; + NET_EPOCH_ENTER(et); for (fibnum = 0; fibnum < rt_numfibs; fibnum++) rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); + NET_EPOCH_EXIT(et); } /* Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/netinet6/nd6_rtr.c Sat May 23 10:21:02 2020 (r361409) @@ -690,10 +690,8 @@ defrouter_addreq(struct nd_defrouter *new) error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def, (struct sockaddr *)&gate, (struct sockaddr *)&mask, RTF_GATEWAY, &newrt, fibnum); - if (newrt) { + if (newrt != NULL) rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum); - RTFREE_FUNC(newrt); - } if (error == 0) new->installed = 1; } @@ -708,6 +706,7 @@ defrouter_delreq(struct nd_defrouter *dr) { struct sockaddr_in6 def, mask, gate; struct rtentry *oldrt = NULL; + struct epoch_tracker et; unsigned int fibnum; bzero(&def, sizeof(def)); @@ -720,13 +719,13 @@ defrouter_delreq(struct nd_defrouter *dr) gate.sin6_addr = dr->rtaddr; fibnum = dr->ifp->if_fib; + NET_EPOCH_ENTER(et); in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def, (struct sockaddr *)&gate, (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, fibnum); - if (oldrt) { + if (oldrt != NULL) rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum); - RTFREE_FUNC(oldrt); - } + NET_EPOCH_EXIT(et); dr->installed = 0; } @@ -1022,6 +1021,7 @@ defrouter_select_fib(int fibnum) } ND6_RUNLOCK(); + NET_EPOCH_ENTER(et); /* * If we selected a router for this FIB and it's different * than the installed one, remove the installed router and @@ -1037,6 +1037,7 @@ defrouter_select_fib(int fibnum) } if (selected_dr != NULL) defrouter_rele(selected_dr); + NET_EPOCH_EXIT(et); } static struct nd_defrouter * @@ -2064,7 +2065,6 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru pr->ndpr_stateflags |= NDPRF_ONLINK; rt_routemsg(RTM_ADD, rt, pr->ndpr_ifp, 0, fibnum); - RTFREE_FUNC(rt); } /* Return the last error we got. */ @@ -2132,7 +2132,6 @@ nd6_prefix_onlink(struct nd_prefix *pr) } /* should we care about ia6_flags? */ } - NET_EPOCH_EXIT(et); if (ifa == NULL) { /* * This can still happen, when, for example, we receive an RA @@ -2145,14 +2144,13 @@ nd6_prefix_onlink(struct nd_prefix *pr) "prefix(%s/%d) on %s\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp))); - return (0); + error = 0; + } else { + error = nd6_prefix_onlink_rtrequest(pr, ifa); + ifa_free(ifa); } + NET_EPOCH_EXIT(et); - error = nd6_prefix_onlink_rtrequest(pr, ifa); - - if (ifa != NULL) - ifa_free(ifa); - return (error); } @@ -2167,6 +2165,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) char ip6buf[INET6_ADDRSTRLEN]; uint64_t genid; int fibnum, maxfib, a_failure; + struct epoch_tracker et; ND6_ONLINK_LOCK_ASSERT(); ND6_UNLOCK_ASSERT(); @@ -2193,6 +2192,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) } a_failure = 0; + NET_EPOCH_ENTER(et); for (; fibnum < maxfib; fibnum++) { rt = NULL; error = in6_rtrequest(RTM_DELETE, (struct sockaddr *)&sa6, NULL, @@ -2205,8 +2205,8 @@ nd6_prefix_offlink(struct nd_prefix *pr) /* report route deletion to the routing socket. */ rt_routemsg(RTM_DELETE, rt, ifp, 0, fibnum); - RTFREE_FUNC(rt); } + NET_EPOCH_EXIT(et); error = a_failure; a_failure = 1; if (error == 0) { Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/nfs/bootp_subr.c Sat May 23 10:21:02 2020 (r361409) @@ -1664,14 +1664,17 @@ retry: goto out; if (gctx->gotrootpath != 0) { + struct epoch_tracker et; kern_setenv("boot.netif.name", ifctx->ifp->if_xname); + NET_EPOCH_ENTER(et); bootpc_add_default_route(ifctx); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); bootpc_remove_default_route(ifctx); + NET_EPOCH_EXIT(et); if (error != 0) { if (gctx->any_root_overrides == 0) panic("nfs_boot: mount root, error=%d", error); From owner-svn-src-head@freebsd.org Sat May 23 10:32:24 2020 Return-Path: Delivered-To: svn-src-head@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 CFB3B2FE2A8; Sat, 23 May 2020 10:32:24 +0000 (UTC) (envelope-from dim@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Tfn45JWbz3Shn; Sat, 23 May 2020 10:32:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0874E631; Sat, 23 May 2020 10:32:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NAWOfp072630; Sat, 23 May 2020 10:32:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NAWJJg072601; Sat, 23 May 2020 10:32:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005231032.04NAWJJg072601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 23 May 2020 10:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361410 - in head: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/lib/AST contrib/llvm-pro... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/lib/AST contrib/llvm-project/clang/lib/CodeGen co... X-SVN-Commit-Revision: 361410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 10:32:24 -0000 Author: dim Date: Sat May 23 10:32:18 2020 New Revision: 361410 URL: https://svnweb.freebsd.org/changeset/base/361410 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1). MFC after: 3 weeks Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/llvm-project/FREEBSD-Xlist head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h head/contrib/llvm-project/clang/include/clang/Basic/Attr.td head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c head/contrib/llvm-project/lld/COFF/MarkLive.cpp head/contrib/llvm-project/lld/ELF/Driver.cpp head/contrib/llvm-project/lld/ELF/InputSection.cpp head/contrib/llvm-project/lld/ELF/InputSection.h head/contrib/llvm-project/lld/ELF/OutputSections.cpp head/contrib/llvm-project/lld/ELF/Writer.cpp head/contrib/llvm-project/llvm/include/llvm/Analysis/ValueLattice.h head/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h head/contrib/llvm-project/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm-project/llvm/lib/Analysis/ValueLattice.cpp head/contrib/llvm-project/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm-project/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectBranchTracking.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.h head/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp head/contrib/llvm-project/llvm/tools/llvm-objcopy/llvm-objcopy.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/headers/Makefile head/lib/clang/include/VCSVersion.inc head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/libclang_rt/Makefile.inc head/sys/sys/param.h head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat May 23 10:21:02 2020 (r361409) +++ head/ObsoleteFiles.inc Sat May 23 10:32:18 2020 (r361410) @@ -36,6 +36,257 @@ # xargs -n1 | sort | uniq -d; # done +# 20200523: new clang import which bumps version from 10.0.0 to 10.0.1.s +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.0/include/profile +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/xray +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/10.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/10.0.0/lib +OLD_DIRS+=usr/lib/clang/10.0.0 + # 20200515: libalias cuseeme protocol support retired OLD_LIBS+=lib/libalias_cuseeme.so OLD_FILES+=usr/lib/libalias_cuseeme.a Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat May 23 10:21:02 2020 (r361409) +++ head/UPDATING Sat May 23 10:32:18 2020 (r361410) @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200523: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 10.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20200424: closefrom(2) has been moved under COMPAT12, and replaced in libc with a stub that calls close_range(2). If using a custom kernel configuration, Modified: head/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- head/contrib/llvm-project/FREEBSD-Xlist Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/FREEBSD-Xlist Sat May 23 10:32:18 2020 (r361410) @@ -3,6 +3,7 @@ .clang-format .clang-tidy .git-blame-ignore-revs +.github/ .gitignore CONTRIBUTING.md README.md @@ -264,6 +265,7 @@ lldb/.clang-format lldb/.gitignore lldb/CMakeLists.txt lldb/CODE_OWNERS.txt +lldb/bindings/CMakeLists.txt lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt Modified: head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Sat May 23 10:32:18 2020 (r361410) @@ -856,14 +856,15 @@ class alignas(8) Decl { (public) return getParentFunctionOrMethod() == nullptr; } - /// Returns true if this declaration lexically is inside a function. - /// It recognizes non-defining declarations as well as members of local - /// classes: + /// Returns true if this declaration is lexically inside a function or inside + /// a variable initializer. It recognizes non-defining declarations as well + /// as members of local classes: /// \code /// void foo() { void bar(); } /// void foo2() { class ABC { void bar(); }; } + /// inline int x = [](){ return 0; }; /// \endcode - bool isLexicallyWithinFunctionOrMethod() const; + bool isInLocalScope() const; /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. Modified: head/contrib/llvm-project/clang/include/clang/Basic/Attr.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Sat May 23 10:32:18 2020 (r361410) @@ -685,7 +685,7 @@ def XRayLogArgs : InheritableAttr { def PatchableFunctionEntry : InheritableAttr, - TargetSpecificAttr> { + TargetSpecificAttr> { let Spellings = [GCC<"patchable_function_entry">]; let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>]; Modified: head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Sat May 23 10:32:18 2020 (r361410) @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, De } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; + if (const auto *CRD = dyn_cast(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; Modified: head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Sat May 23 10:32:18 2020 (r361410) @@ -8593,6 +8593,10 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This, APValue &Result, const InitListExpr *ILE, QualType AllocType); +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType); bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) { if (!Info.getLangOpts().CPlusPlus2a) @@ -8642,6 +8646,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe const Expr *Init = E->getInitializer(); const InitListExpr *ResizedArrayILE = nullptr; + const CXXConstructExpr *ResizedArrayCCE = nullptr; QualType AllocType = E->getAllocatedType(); if (Optional ArraySize = E->getArraySize()) { @@ -8685,7 +8690,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // -- the new-initializer is a braced-init-list and the number of // array elements for which initializers are provided [...] // exceeds the number of elements to initialize - if (Init) { + if (Init && !isa(Init)) { auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType()); assert(CAT && "unexpected type for array initializer"); @@ -8708,6 +8713,8 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // special handling for this case when we initialize. if (InitBound != AllocBound) ResizedArrayILE = cast(Init); + } else if (Init) { + ResizedArrayCCE = cast(Init); } AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr, @@ -8772,6 +8779,10 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe if (!EvaluateArrayNewInitList(Info, Result, *Val, ResizedArrayILE, AllocType)) return false; + } else if (ResizedArrayCCE) { + if (!EvaluateArrayNewConstructExpr(Info, Result, *Val, ResizedArrayCCE, + AllocType)) + return false; } else if (Init) { if (!EvaluateInPlace(*Val, Info, Result, Init)) return false; @@ -9595,6 +9606,16 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, L "not an array rvalue"); return ArrayExprEvaluator(Info, This, Result) .VisitInitListExpr(ILE, AllocType); +} + +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType) { + assert(CCE->isRValue() && CCE->getType()->isArrayType() && + "not an array rvalue"); + return ArrayExprEvaluator(Info, This, Result) + .VisitCXXConstructExpr(CCE, This, &Result, AllocType); } // Return true iff the given array filler may depend on the element index. Modified: head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Sat May 23 10:32:18 2020 (r361410) @@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceM }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (!Str.empty() && Str.back() == '\n') Str.pop_back(); }; Modified: head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1847,9 +1847,16 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl G else if (const auto *SA = FD->getAttr()) F->setSection(SA->getName()); + // If we plan on emitting this inline builtin, we can't treat it as a builtin. if (FD->isInlineBuiltinDeclaration()) { - F->addAttribute(llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoBuiltin); + const FunctionDecl *FDBody; + bool HasBody = FD->hasBody(FDBody); + (void)HasBody; + assert(HasBody && "Inline builtin declarations should always have an " + "available body!"); + if (shouldEmitFunction(FDBody)) + F->addAttribute(llvm::AttributeList::FunctionIndex, + llvm::Attribute::NoBuiltin); } if (FD->isReplaceableGlobalAllocationFunction()) { Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1146,6 +1146,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args, addExportedSymbol(CmdArgs, "___gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } else { addExportedSymbol(CmdArgs, "___llvm_profile_filename"); addExportedSymbol(CmdArgs, "___llvm_profile_raw_version"); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Sat May 23 10:32:18 2020 (r361410) @@ -309,7 +309,7 @@ static const char *getLDMOption(const llvm::Triple &T, } } -static bool getPIE(const ArgList &Args, const toolchains::Linux &ToolChain) { +static bool getPIE(const ArgList &Args, const ToolChain &TC) { if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie)) return false; @@ -317,17 +317,16 @@ static bool getPIE(const ArgList &Args, const toolchai Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie, options::OPT_nopie); if (!A) - return ToolChain.isPIEDefault(); + return TC.isPIEDefault(); return A->getOption().matches(options::OPT_pie); } -static bool getStaticPIE(const ArgList &Args, - const toolchains::Linux &ToolChain) { +static bool getStaticPIE(const ArgList &Args, const ToolChain &TC) { bool HasStaticPIE = Args.hasArg(options::OPT_static_pie); // -no-pie is an alias for -nopie. So, handling -nopie takes care of // -no-pie as well. if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) { - const Driver &D = ToolChain.getDriver(); + const Driver &D = TC.getDriver(); const llvm::opt::OptTable &Opts = D.getOpts(); const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie); const char *NoPIEName = Opts.getOptionName(options::OPT_nopie); @@ -346,8 +345,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { - const toolchains::Linux &ToolChain = - static_cast(getToolChain()); + // FIXME: The Linker class constructor takes a ToolChain and not a + // Generic_ELF, so the static_cast might return a reference to a invalid + // instance (see PR45061). Ideally, the Linker constructor needs to take a + // Generic_ELF instead. + const toolchains::Generic_ELF &ToolChain = + static_cast(getToolChain()); const Driver &D = ToolChain.getDriver(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); @@ -418,8 +421,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation if (isAndroid) CmdArgs.push_back("--warn-shared-textrel"); - for (const auto &Opt : ToolChain.ExtraOpts) - CmdArgs.push_back(Opt.c_str()); + ToolChain.addExtraOpts(CmdArgs); CmdArgs.push_back("--eh-frame-hdr"); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Sat May 23 10:32:18 2020 (r361410) @@ -356,6 +356,12 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Gen void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override; + + virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const { + return {}; + } + + virtual void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {} }; } // end namespace toolchains Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Sat May 23 10:32:18 2020 (r361410) @@ -61,8 +61,7 @@ static StringRef getOSLibDir(const llvm::Triple &Tripl return Triple.isArch32Bit() ? "lib" : "lib64"; } -Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) +Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { std::string SysRoot = computeSysRoot(); path_list &Paths = getFilePaths(); @@ -169,4 +168,9 @@ void Hurd::AddClangSystemIncludeArgs(const ArgList &Dr addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); +} + +void Hurd::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); } Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Sat May 23 10:32:18 2020 (r361410) @@ -27,9 +27,11 @@ class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_EL AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - virtual std::string computeSysRoot() const; + std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Sat May 23 10:32:18 2020 (r361410) @@ -986,3 +986,8 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList Twine("-u", llvm::getInstrProfRuntimeHookVarName()))); ToolChain::addProfileRTLibs(Args, CmdArgs); } + +void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); +} Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Sat May 23 10:32:18 2020 (r361410) @@ -42,7 +42,9 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_E llvm::opt::ArgStringList &CmdArgs) const override; virtual std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Sat May 23 10:32:18 2020 (r361410) @@ -2176,6 +2176,10 @@ static bool isFunctionDeclarationName(const FormatToke Next = Next->Next; continue; } + if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { + Next = Next->MatchingParen; + continue; + } break; } @@ -2705,20 +2709,40 @@ bool TokenAnnotator::spaceRequiredBetween(const Annota tok::l_square)); if (Right.is(tok::star) && Left.is(tok::l_paren)) return false; - if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) && - (Left.is(tok::identifier) || Left.isSimpleTypeSpecifier()) && - // Space between the type and the * in: - // operator void*() - // operator char*() - // operator /*comment*/ const char*() - // operator volatile /*comment*/ char*() - // operator Foo*() - // dependent on PointerAlignment style. - Left.Previous && - (Left.Previous->endsSequence(tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_const, tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) - return (Style.PointerAlignment != FormatStyle::PAS_Left); + if (Right.is(tok::star) && Left.is(tok::star)) + return false; + if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { + const FormatToken *Previous = &Left; + while (Previous && !Previous->is(tok::kw_operator)) { + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { + Previous = Previous->getPreviousNonComment(); + continue; + } + if (Previous->is(TT_TemplateCloser) && Previous->MatchingParen) { + Previous = Previous->MatchingParen->getPreviousNonComment(); + continue; + } + if (Previous->is(tok::coloncolon)) { + Previous = Previous->getPreviousNonComment(); + continue; + } + break; + } + // Space between the type and the * in: + // operator void*() + // operator char*() + // operator /*comment*/ const char*() + // operator volatile /*comment*/ char*() + // operator Foo*() + // operator C*() + // operator std::Foo*() + // operator C::D*() + // dependent on PointerAlignment style. + if (Previous && (Previous->endsSequence(tok::kw_operator) || + Previous->endsSequence(tok::kw_const, tok::kw_operator) || + Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) + return (Style.PointerAlignment != FormatStyle::PAS_Left); + } const auto SpaceRequiredForArrayInitializerLSquare = [](const FormatToken &LSquareTok, const FormatStyle &Style) { return Style.SpacesInContainerLiterals || Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp Sat May 23 10:32:18 2020 (r361410) @@ -2343,7 +2343,7 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldPa UnparsedDefaultArgInstantiations[OldParm].push_back(NewParm); } else if (Expr *Arg = OldParm->getDefaultArg()) { FunctionDecl *OwningFunc = cast(OldParm->getDeclContext()); - if (OwningFunc->isLexicallyWithinFunctionOrMethod()) { + if (OwningFunc->isInLocalScope()) { // Instantiate default arguments for methods of local classes (DR1484) // and non-defining declarations. Sema::ContextRAII SavedContext(*this, OwningFunc); Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat May 23 10:32:18 2020 (r361410) @@ -4367,7 +4367,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(Fu EPI.ExceptionSpec.Type != EST_None && EPI.ExceptionSpec.Type != EST_DynamicNone && EPI.ExceptionSpec.Type != EST_BasicNoexcept && - !Tmpl->isLexicallyWithinFunctionOrMethod()) { + !Tmpl->isInLocalScope()) { FunctionDecl *ExceptionSpecTemplate = Tmpl; if (EPI.ExceptionSpec.Type == EST_Uninstantiated) ExceptionSpecTemplate = EPI.ExceptionSpec.SourceTemplate; Modified: head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Sat May 23 10:32:18 2020 (r361410) @@ -4022,50 +4022,8 @@ template void TreeTransform::InventTemplateArgumentLoc( const TemplateArgument &Arg, TemplateArgumentLoc &Output) { - SourceLocation Loc = getDerived().getBaseLocation(); - switch (Arg.getKind()) { - case TemplateArgument::Null: - llvm_unreachable("null template argument in TreeTransform"); - break; - - case TemplateArgument::Type: - Output = TemplateArgumentLoc(Arg, - SemaRef.Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc)); - - break; - - case TemplateArgument::Template: - case TemplateArgument::TemplateExpansion: { - NestedNameSpecifierLocBuilder Builder; - TemplateName Template = Arg.getAsTemplateOrTemplatePattern(); - if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) - Builder.MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc); - else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) - Builder.MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc); - - if (Arg.getKind() == TemplateArgument::Template) - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc); - else - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc, Loc); - - break; - } - - case TemplateArgument::Expression: - Output = TemplateArgumentLoc(Arg, Arg.getAsExpr()); - break; - - case TemplateArgument::Declaration: - case TemplateArgument::Integral: - case TemplateArgument::Pack: - case TemplateArgument::NullPtr: - Output = TemplateArgumentLoc(Arg, TemplateArgumentLocInfo()); - break; - } + Output = getSema().getTrivialTemplateArgumentLoc( + Arg, QualType(), getDerived().getBaseLocation()); } template @@ -4075,12 +4033,45 @@ bool TreeTransform::TransformTemplateArgument const TemplateArgument &Arg = Input.getArgument(); switch (Arg.getKind()) { case TemplateArgument::Null: - case TemplateArgument::Integral: case TemplateArgument::Pack: - case TemplateArgument::Declaration: - case TemplateArgument::NullPtr: llvm_unreachable("Unexpected TemplateArgument"); + case TemplateArgument::Integral: + case TemplateArgument::NullPtr: + case TemplateArgument::Declaration: { + // Transform a resolved template argument straight to a resolved template + // argument. We get here when substituting into an already-substituted + // template type argument during concept satisfaction checking. + QualType T = Arg.getNonTypeTemplateArgumentType(); + QualType NewT = getDerived().TransformType(T); + if (NewT.isNull()) + return true; + + ValueDecl *D = Arg.getKind() == TemplateArgument::Declaration + ? Arg.getAsDecl() + : nullptr; + ValueDecl *NewD = D ? cast_or_null(getDerived().TransformDecl( + getDerived().getBaseLocation(), D)) + : nullptr; + if (D && !NewD) + return true; + + if (NewT == T && D == NewD) + Output = Input; + else if (Arg.getKind() == TemplateArgument::Integral) + Output = TemplateArgumentLoc( + TemplateArgument(getSema().Context, Arg.getAsIntegral(), NewT), + TemplateArgumentLocInfo()); + else if (Arg.getKind() == TemplateArgument::NullPtr) + Output = TemplateArgumentLoc(TemplateArgument(NewT, /*IsNullPtr=*/true), + TemplateArgumentLocInfo()); + else + Output = TemplateArgumentLoc(TemplateArgument(NewD, NewT), + TemplateArgumentLocInfo()); + + return false; + } + case TemplateArgument::Type: { TypeSourceInfo *DI = Input.getTypeSourceInfo(); if (!DI) @@ -11836,19 +11827,6 @@ TreeTransform::TransformLambdaExpr(LambdaExpr NewTrailingRequiresClause.get()); LSI->CallOperator = NewCallOperator; - - for (unsigned I = 0, NumParams = NewCallOperator->getNumParams(); - I != NumParams; ++I) { - auto *P = NewCallOperator->getParamDecl(I); - if (P->hasUninstantiatedDefaultArg()) { - EnterExpressionEvaluationContext Eval( - getSema(), - Sema::ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed, P); - ExprResult R = getDerived().TransformExpr( - E->getCallOperator()->getParamDecl(I)->getDefaultArg()); - P->setDefaultArg(R.get()); - } - } getDerived().transformAttrs(E->getCallOperator(), NewCallOperator); getDerived().transformedLocalDecl(E->getCallOperator(), {NewCallOperator}); Modified: head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c ============================================================================== --- head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c Sat May 23 10:32:18 2020 (r361410) @@ -32,8 +32,10 @@ #include #include "WindowsMMap.h" #else -#include #include +#include +#include +#include #endif #if defined(__FreeBSD__) && defined(__i386__) @@ -119,6 +121,11 @@ struct fn_list writeout_fn_list; */ struct fn_list flush_fn_list; +/* + * A list of reset functions, shared between all dynamic objects. + */ +struct fn_list reset_fn_list; + static void fn_list_insert(struct fn_list* list, fn_ptr fn) { struct fn_node* new_node = malloc(sizeof(struct fn_node)); new_node->fn = fn; @@ -634,7 +641,46 @@ void llvm_delete_flush_function_list(void) { } COMPILER_RT_VISIBILITY -void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { +void llvm_register_reset_function(fn_ptr fn) { + fn_list_insert(&reset_fn_list, fn); +} + +COMPILER_RT_VISIBILITY +void llvm_delete_reset_function_list(void) { fn_list_remove(&reset_fn_list); } + +COMPILER_RT_VISIBILITY +void llvm_reset_counters(void) { + struct fn_node *curr = reset_fn_list.head; + + while (curr) { + if (curr->id == CURRENT_ID) { + curr->fn(); + } + curr = curr->next; + } +} + +#if !defined(_WIN32) +COMPILER_RT_VISIBILITY +pid_t __gcov_fork() { + pid_t parent_pid = getpid(); + pid_t pid = fork(); + + if (pid == 0) { + pid_t child_pid = getpid(); + if (child_pid != parent_pid) { + // The pid changed so we've a fork (one could have its own fork function) + // Just reset the counters for this child process + // threads. + llvm_reset_counters(); + } + } + return pid; +} +#endif + +COMPILER_RT_VISIBILITY +void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn, fn_ptr rfn) { static int atexit_ran = 0; if (wfn) @@ -643,10 +689,14 @@ void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { if (ffn) llvm_register_flush_function(ffn); + if (rfn) + llvm_register_reset_function(rfn); + if (atexit_ran == 0) { atexit_ran = 1; /* Make sure we write out the data and delete the data structures. */ + atexit(llvm_delete_reset_function_list); atexit(llvm_delete_flush_function_list); atexit(llvm_delete_writeout_function_list); atexit(llvm_writeout_files); Modified: head/contrib/llvm-project/lld/COFF/MarkLive.cpp ============================================================================== --- head/contrib/llvm-project/lld/COFF/MarkLive.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/COFF/MarkLive.cpp Sat May 23 10:32:18 2020 (r361410) @@ -28,10 +28,12 @@ void markLive(ArrayRef chunks) { // as we push, so sections never appear twice in the list. SmallVector worklist; - // COMDAT section chunks are dead by default. Add non-COMDAT chunks. + // COMDAT section chunks are dead by default. Add non-COMDAT chunks. Do not + // traverse DWARF sections. They are live, but they should not keep other + // sections alive. for (Chunk *c : chunks) if (auto *sc = dyn_cast(c)) - if (sc->live) + if (sc->live && !sc->isDWARF()) worklist.push_back(sc); auto enqueue = [&](SectionChunk *c) { Modified: head/contrib/llvm-project/lld/ELF/Driver.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/Driver.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/Driver.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1906,8 +1906,17 @@ template void LinkerDriver::link(opt::Inp // We do not want to emit debug sections if --strip-all // or -strip-debug are given. - return config->strip != StripPolicy::None && - (s->name.startswith(".debug") || s->name.startswith(".zdebug")); + if (config->strip == StripPolicy::None) + return false; + + if (isDebugSection(*s)) + return true; + if (auto *isec = dyn_cast(s)) + if (InputSectionBase *rel = isec->getRelocatedSection()) + if (isDebugSection(*rel)) + return true; + + return false; }); // Now that the number of partitions is fixed, save a pointer to the main Modified: head/contrib/llvm-project/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/InputSection.cpp Sat May 23 10:32:18 2020 (r361410) @@ -441,8 +441,7 @@ void InputSection::copyRelocations(uint8_t *buf, Array // See the comment in maybeReportUndefined for PPC32 .got2 and PPC64 .toc auto *d = dyn_cast(&sym); if (!d) { - if (!sec->name.startswith(".debug") && - !sec->name.startswith(".zdebug") && sec->name != ".eh_frame" && + if (!isDebugSection(*sec) && sec->name != ".eh_frame" && sec->name != ".gcc_except_table" && sec->name != ".got2" && sec->name != ".toc") { uint32_t secIdx = cast(sym).discardedSecIdx; Modified: head/contrib/llvm-project/lld/ELF/InputSection.h ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/InputSection.h Sat May 23 10:32:18 2020 (r361410) @@ -357,6 +357,10 @@ class InputSection : public InputSectionBase { (privat template void copyShtGroup(uint8_t *buf); }; +inline bool isDebugSection(const InputSectionBase &sec) { + return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); +} + // The list of all input sections. extern std::vector inputSections; Modified: head/contrib/llvm-project/lld/ELF/OutputSections.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/OutputSections.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/OutputSections.cpp Sat May 23 10:32:18 2020 (r361410) @@ -114,8 +114,7 @@ void OutputSection::commitSection(InputSection *isec) flags = isec->flags; } else { // Otherwise, check if new type or flags are compatible with existing ones. - unsigned mask = SHF_TLS | SHF_LINK_ORDER; - if ((flags & mask) != (isec->flags & mask)) + if ((flags ^ isec->flags) & SHF_TLS) error("incompatible section flags for " + name + "\n>>> " + toString(isec) + ": 0x" + utohexstr(isec->flags) + "\n>>> output section " + name + ": 0x" + utohexstr(flags)); @@ -367,8 +366,9 @@ void OutputSection::finalize() { // all InputSections in the OutputSection have the same dependency. if (auto *ex = dyn_cast(first)) link = ex->getLinkOrderDep()->getParent()->sectionIndex; - else if (auto *d = first->getLinkOrderDep()) - link = d->getParent()->sectionIndex; + else if (first->flags & SHF_LINK_ORDER) + if (auto *d = first->getLinkOrderDep()) + link = d->getParent()->sectionIndex; } if (type == SHT_GROUP) { Modified: head/contrib/llvm-project/lld/ELF/Writer.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/Writer.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/Writer.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1524,17 +1524,30 @@ template void Writer::resolveShfLin // but sort must consider them all at once. std::vector scriptSections; std::vector sections; + bool started = false, stopped = false; for (BaseCommand *base : sec->sectionCommands) { if (auto *isd = dyn_cast(base)) { for (InputSection *&isec : isd->sections) { - scriptSections.push_back(&isec); - sections.push_back(isec); + if (!(isec->flags & SHF_LINK_ORDER)) { + if (started) + stopped = true; + } else if (stopped) { + error(toString(isec) + ": SHF_LINK_ORDER sections in " + sec->name + + " are not contiguous"); + } else { + started = true; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat May 23 12:15:48 2020 Return-Path: Delivered-To: svn-src-head@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 389FB2CA32E; Sat, 23 May 2020 12:15:48 +0000 (UTC) (envelope-from melifaro@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Tj4N0nMXz3dwt; Sat, 23 May 2020 12:15:48 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11D2AFB8B; Sat, 23 May 2020 12:15:48 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NCFltP035788; Sat, 23 May 2020 12:15:47 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NCFlRN035787; Sat, 23 May 2020 12:15:47 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231215.04NCFlRN035787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 12:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361415 - in head/sys/net: . route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys/net: . route X-SVN-Commit-Revision: 361415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 12:15:48 -0000 Author: melifaro Date: Sat May 23 12:15:47 2020 New Revision: 361415 URL: https://svnweb.freebsd.org/changeset/base/361415 Log: Remove refcounting from rtentry. After making rtentry reclamation backed by epoch(9) in r361409, there is no reason in keeping reference counting code. Differential Revision: https://reviews.freebsd.org/D24867 Modified: head/sys/net/route.c head/sys/net/route/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 12:00:46 2020 (r361414) +++ head/sys/net/route.c Sat May 23 12:15:47 2020 (r361415) @@ -439,39 +439,8 @@ rtfree(struct rtentry *rt) RT_LOCK_ASSERT(rt); - /* - * The callers should use RTFREE_LOCKED() or RTFREE(), so - * we should come here exactly with the last reference. - */ - RT_REMREF(rt); - if (rt->rt_refcnt > 0) { - log(LOG_DEBUG, "%s: %p has %d refs\n", __func__, rt, rt->rt_refcnt); - goto done; - } - - /* - * If we are no longer "up" (and ref == 0) - * then we can free the resources associated - * with the route. - */ - if ((rt->rt_flags & RTF_UP) == 0) { - if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT)) - panic("rtfree 2"); -#ifdef DIAGNOSTIC - if (rt->rt_refcnt < 0) { - printf("rtfree: %p not freed (neg refs)\n", rt); - goto done; - } -#endif - epoch_call(net_epoch_preempt, destroy_rtentry_epoch, - &rt->rt_epoch_ctx); - - /* - * FALLTHROUGH to RT_UNLOCK() so the reporting functions - * have consistent behaviour of operating on unlocked entry. - */ - } -done: + epoch_call(net_epoch_preempt, destroy_rtentry_epoch, + &rt->rt_epoch_ctx); RT_UNLOCK(rt); } @@ -958,7 +927,7 @@ rib_walk_del(u_int fibnum, int family, rt_filter_f_t * if (report) rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0, fibnum); - RTFREE_LOCKED(rt); + rtfree(rt); } } @@ -1114,7 +1083,6 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo rt = RNTORT(rn); RT_LOCK(rt); - RT_ADDREF(rt); rt->rt_flags &= ~RTF_UP; *perror = 0; @@ -1569,8 +1537,10 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in } RIB_WUNLOCK(rnh); - if (rt_old != NULL) - RT_UNLOCK(rt_old); + if (rt_old != NULL) { + rt_notifydelete(rt_old, info); + rtfree(rt_old); + } /* * If it still failed to go into the tree, @@ -1582,11 +1552,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (EEXIST); } - if (rt_old != NULL) { - rt_notifydelete(rt_old, info); - RTFREE(rt_old); - } - /* * If this protocol has something to add to this then * allow it to do that as well. @@ -1639,7 +1604,7 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in if (ret_nrt) *ret_nrt = rt; - RTFREE_LOCKED(rt); + rtfree(rt); return (0); } Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sat May 23 12:00:46 2020 (r361414) +++ head/sys/net/route/route_var.h Sat May 23 12:15:47 2020 (r361415) @@ -143,7 +143,6 @@ struct rtentry { }; int rt_flags; /* up/down?, host/net */ - int rt_refcnt; /* # held references */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #define rt_endzero rt_mtx @@ -161,36 +160,6 @@ struct rtentry { #define RT_UNLOCK_COND(_rt) do { \ if (mtx_owned(&(_rt)->rt_mtx)) \ mtx_unlock(&(_rt)->rt_mtx); \ -} while (0) - -#define RT_ADDREF(_rt) do { \ - RT_LOCK_ASSERT(_rt); \ - KASSERT((_rt)->rt_refcnt >= 0, \ - ("negative refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt++; \ -} while (0) - -#define RT_REMREF(_rt) do { \ - RT_LOCK_ASSERT(_rt); \ - KASSERT((_rt)->rt_refcnt > 0, \ - ("bogus refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt--; \ -} while (0) - -#define RTFREE_LOCKED(_rt) do { \ - if ((_rt)->rt_refcnt <= 1) \ - rtfree(_rt); \ - else { \ - RT_REMREF(_rt); \ - RT_UNLOCK(_rt); \ - } \ - /* guard against invalid refs */ \ - _rt = 0; \ -} while (0) - -#define RTFREE(_rt) do { \ - RT_LOCK(_rt); \ - RTFREE_LOCKED(_rt); \ } while (0) /* From owner-svn-src-head@freebsd.org Sat May 23 15:46:10 2020 Return-Path: Delivered-To: svn-src-head@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 22EF02CE5AB; Sat, 23 May 2020 15:46:10 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (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 49Tnl473Y3z4C9G; Sat, 23 May 2020 15:46:08 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 49Tnkv708nz3l8C; Sat, 23 May 2020 15:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1590248608; bh=6+VK9Zyco4PUjsqvKCNg+fjf 2p9xBZnjTOpqlbOGnuw=; b=BJ3pFuuzNYrlc9b4lXGtLTFuM5Wq3wCvj+xRA5ou JOg2OXfcXewMxu6GO06VageS+jzKiWmgLFJ/hvIh34qjKROgsm95tM6Q7xdjYTNd c/V33JvuhjvDletg/8pAnLq7F7n2awrhjgmoVoES1Vy+10n4D3chh1Heglw/bQl4 j8s= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id sSano388UHYT; Sat, 23 May 2020 15:43:28 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:f46a:54c6:232d:7370]) by mail.daemonic.se (Postfix) with ESMTPSA id 49Tnh01bG0z3mPM; Sat, 23 May 2020 15:43:28 +0000 (UTC) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005221120.04MBKOiH003190@repo.freebsd.org> From: Niclas Zeising Message-ID: <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> Date: Sat, 23 May 2020 17:43:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005221120.04MBKOiH003190@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49Tnl473Y3z4C9G X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=daemonic.se header.s=20151023 header.b=BJ3pFuuz; dmarc=pass (policy=none) header.from=daemonic.se; spf=pass (mx1.freebsd.org: domain of zeising@daemonic.se designates 2607:f740:d:20::25 as permitted sender) smtp.mailfrom=zeising@daemonic.se X-Spamd-Result: default: False [-4.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[daemonic.se:s=20151023]; NEURAL_HAM_MEDIUM(-1.02)[-1.021]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.983]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[daemonic.se:+]; DMARC_POLICY_ALLOW(-0.50)[daemonic.se,none]; NEURAL_HAM_SHORT(-1.08)[-1.083]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; TAGGED_FROM(0.00)[freebsd]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 15:46:10 -0000 On 2020-05-22 13:20, Andriy Gapon wrote: > Author: avg > Date: Fri May 22 11:20:23 2020 > New Revision: 361363 > URL: https://svnweb.freebsd.org/changeset/base/361363 > > Log: > libprocstat: fix ZFS support > This might have broken a couple of ports. The build is still going, but at least three ports have failed to link, all with the same error: /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to `__start_set_pcpu' /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to `__stop_set_pcpu' c++: error: linker command failed with exit code 1 (use -v to see invocation) See for instance http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/errors/gnuradio-3.8.1.0_1.log and http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/octave-5.2.0_2.log Or, if you're on IPv4 only: http://www.ipv6proxy.net/go.php?u=http%3A%2F%2Fbeefy18.nyi.freebsd.org%2Fdata%2Fhead-amd64-default%2Fp536258_s361404%2Flogs%2Foctave-5.2.0_2.log&b=0&f=norefer Regards -- Niclas From owner-svn-src-head@freebsd.org Sat May 23 17:51:07 2020 Return-Path: Delivered-To: svn-src-head@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 14D962D9726; Sat, 23 May 2020 17:51:07 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TrWG6t85z4NnR; Sat, 23 May 2020 17:51:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E74FE13BCB; Sat, 23 May 2020 17:51:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NHp6ST043059; Sat, 23 May 2020 17:51:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NHp6xY043056; Sat, 23 May 2020 17:51:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231751.04NHp6xY043056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 17:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361418 - in head/sys: conf libkern sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf libkern sys X-SVN-Commit-Revision: 361418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 17:51:07 -0000 Author: manu Date: Sat May 23 17:51:06 2020 New Revision: 361418 URL: https://svnweb.freebsd.org/changeset/base/361418 Log: libkern: Add arc4random_uniform This variant get a random number up to the limit passed as the argument. This is simply a copy of the libc version. Sponsored-by: The FreeBSD Foundation Reviewed by: cem, hselasky (previous version) Differential Revision: https://reviews.freebsd.org/D24962 Added: head/sys/libkern/arc4random_uniform.c (contents, props changed) Modified: head/sys/conf/files head/sys/sys/libkern.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 23 16:42:27 2020 (r361417) +++ head/sys/conf/files Sat May 23 17:51:06 2020 (r361418) @@ -3952,6 +3952,7 @@ kgssapi/gsstest.c optional kgssapi_debug # the file should be moved to conf/files. from here. # libkern/arc4random.c standard +libkern/arc4random_uniform.c standard libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard Added: head/sys/libkern/arc4random_uniform.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/arc4random_uniform.c Sat May 23 17:51:06 2020 (r361418) @@ -0,0 +1,58 @@ +/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */ + +/* + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include +#include + +/* + * Calculate a uniformly distributed random number less than upper_bound + * avoiding "modulo bias". + * + * Uniformity is achieved by generating new random numbers until the one + * returned is outside the range [0, 2**32 % upper_bound). This + * guarantees the selected random number will be inside + * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) + * after reduction modulo upper_bound. + */ +uint32_t +arc4random_uniform(uint32_t upper_bound) +{ + uint32_t r, min; + + if (upper_bound < 2) + return 0; + + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; + + /* + * This could theoretically loop forever but each retry has + * p > 0.5 (worst case, usually far better) of selecting a + * number inside the range we need, so it should rarely need + * to re-roll. + */ + for (;;) { + r = arc4random(); + if (r >= min) + break; + } + + return r % upper_bound; +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sat May 23 16:42:27 2020 (r361417) +++ head/sys/sys/libkern.h Sat May 23 17:51:06 2020 (r361418) @@ -127,6 +127,7 @@ extern int arc4rand_iniseed_state; struct malloc_type; uint32_t arc4random(void); void arc4random_buf(void *, size_t); +uint32_t arc4random_uniform(uint32_t); void arc4rand(void *, u_int, int); int timingsafe_bcmp(const void *, const void *, size_t); void *bsearch(const void *, const void *, size_t, From owner-svn-src-head@freebsd.org Sat May 23 17:52:26 2020 Return-Path: Delivered-To: svn-src-head@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 644692D99F6; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TrXp25Kzz4Nps; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4309313A6D; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NHqQRI047118; Sat, 23 May 2020 17:52:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NHqQRC047117; Sat, 23 May 2020 17:52:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231752.04NHqQRC047117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 17:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361419 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 17:52:26 -0000 Author: manu Date: Sat May 23 17:52:25 2020 New Revision: 361419 URL: https://svnweb.freebsd.org/changeset/base/361419 Log: linuxkpi: Add prandom_u32_max This is just a wrapper around arc4random_uniform Needed by DRM v5.3 Sponsored-by: The FreeBSD Foundation Reviewed by: cem, hselasky Differential Revision: https://reviews.freebsd.org/D24961 Modified: head/sys/compat/linuxkpi/common/include/linux/random.h Modified: head/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/random.h Sat May 23 17:51:06 2020 (r361418) +++ head/sys/compat/linuxkpi/common/include/linux/random.h Sat May 23 17:52:25 2020 (r361419) @@ -62,4 +62,10 @@ get_random_long(void) return (val); } +static inline u32 +prandom_u32_max(u32 max) +{ + return (arc4random_uniform(max)); +} + #endif /* _LINUX_RANDOM_H_ */ From owner-svn-src-head@freebsd.org Sat May 23 18:11:20 2020 Return-Path: Delivered-To: svn-src-head@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 8FF002D9D68; Sat, 23 May 2020 18:11:20 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Tryb2z9bz4QCD; Sat, 23 May 2020 18:11:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id h4so11705125wmb.4; Sat, 23 May 2020 11:11:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=sr97xTSHEUyz8InzmvE7vzCw8d71pmcfBYCZef3bzGw=; b=f2DpSQT8CExAAbUpaQPwYM1rl/MqGh/difwvdrRSSc8rov5lrNknnCxuMdwwuDnTnk mxz+IuzM84iz6Eggq/Ot3q9i5oIs2vroFctaKHfc/wvnaWDzFWi+5/55Jz9xlaW2lJgc VjZ0Wq/q0o/OaP5GgKDjJ33Ag4o/17IG5/I0wUJQyy7pudlHrUkP/csW+7BS2yZaEwLD RlSPRg1ytmX0HD5KNw3ZgVXVd6eeEKFvGb1weOdRW6lE/OeooqGfTagwOqJjbSREFWEa xrniaS4iiS5EAwnVIg98ncutfaXchJiQ731YCAOQyT+QEow5rjb7zmlwkrTWvFZpzdS3 yVgQ== X-Gm-Message-State: AOAM532koddkbcBLmqsO6JKiGGxppLyhZCfVDKdSo7HTCuXRVktij+Ph iEoh9sP+DSCk7mgg9xhoVaWxO02t X-Google-Smtp-Source: ABdhPJzceCUL6m/X65rzk9Yh/WzEqOv86IHzFSr6KMMebe8HqyCuJzNYtakAC/iDq0w9Bec1lCqugA== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr19542248wmg.161.1590257477572; Sat, 23 May 2020 11:11:17 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id h137sm19081949wme.0.2020.05.23.11.11.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 May 2020 11:11:16 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Niclas Zeising , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <202005221120.04MBKOiH003190@repo.freebsd.org> <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <4a47c9af-e076-3400-0dc1-e547bee02671@FreeBSD.org> Date: Sat, 23 May 2020 21:11:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49Tryb2z9bz4QCD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.954]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.30)[-0.297]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.53:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.981]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.53:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 18:11:20 -0000 On 23/05/2020 18:43, Niclas Zeising wrote: > On 2020-05-22 13:20, Andriy Gapon wrote: >> Author: avg >> Date: Fri May 22 11:20:23 2020 >> New Revision: 361363 >> URL: https://svnweb.freebsd.org/changeset/base/361363 >> >> Log: >>    libprocstat: fix ZFS support >>    > > > This might have broken a couple of ports. > The build is still going, but at least three ports have failed to link, all with > the same error: > > /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to > `__start_set_pcpu' > /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to > `__stop_set_pcpu' > c++: error: linker command failed with exit code 1 (use -v to see invocation) > > See for instance > http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/errors/gnuradio-3.8.1.0_1.log > > and > http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/octave-5.2.0_2.log > > > Or, if you're on IPv4 only: > http://www.ipv6proxy.net/go.php?u=http%3A%2F%2Fbeefy18.nyi.freebsd.org%2Fdata%2Fhead-amd64-default%2Fp536258_s361404%2Flogs%2Foctave-5.2.0_2.log&b=0&f=norefer I cannot understand why this happens. There are several tools in base that link with libprocstat and I have not seen buildworld failure reports including from our CI cluster. -- Andriy Gapon From owner-svn-src-head@freebsd.org Sat May 23 19:06:58 2020 Return-Path: Delivered-To: svn-src-head@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 173492DB0BB; Sat, 23 May 2020 19:06:58 +0000 (UTC) (envelope-from melifaro@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TtBp07Wqz4V2k; Sat, 23 May 2020 19:06:58 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3A12146FC; Sat, 23 May 2020 19:06:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NJ6v4x090853; Sat, 23 May 2020 19:06:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NJ6vBR090849; Sat, 23 May 2020 19:06:57 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231906.04NJ6vBR090849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 19:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361421 - in head/sys: net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net net/route netinet netinet6 X-SVN-Commit-Revision: 361421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 19:06:58 -0000 Author: melifaro Date: Sat May 23 19:06:57 2020 New Revision: 361421 URL: https://svnweb.freebsd.org/changeset/base/361421 Log: Move _route() functions to route_ctl.c in preparation of multipath control plane changed described in D24141. Currently route.c contains core routing init/teardown functions, route table manipulation functions and various helper functions, resulting in >2KLOC file in total. This change moves most of the route table manipulation parts to a dedicated file, simplifying planned multipath changes and making route.c more manageable. Differential Revision: https://reviews.freebsd.org/D24870 Modified: head/sys/net/if_var.h head/sys/net/route.c head/sys/net/route/route_ctl.c head/sys/net/route/route_var.h head/sys/net/route/shared.h head/sys/netinet/in_fib.c head/sys/netinet6/in6_fib.c Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/if_var.h Sat May 23 19:06:57 2020 (r361421) @@ -686,8 +686,8 @@ int ifa_ifwithaddr_check(const struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(const struct sockaddr *, int); struct ifaddr *ifa_ifwithdstaddr(const struct sockaddr *, int); struct ifaddr *ifa_ifwithnet(const struct sockaddr *, int, int); -struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *, struct sockaddr *, - u_int); +struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *, + const struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(const struct sockaddr *, struct ifnet *); int ifa_preferred(struct ifaddr *, struct ifaddr *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/route.c Sat May 23 19:06:57 2020 (r361421) @@ -121,45 +121,17 @@ VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) -/* - * Convert a 'struct radix_node *' to a 'struct rtentry *'. - * The operation can be done safely (in this code) because a - * 'struct rtentry' starts with two 'struct radix_node''s, the first - * one representing leaf nodes in the routing tree, which is - * what the code in radix.c passes us as a 'struct radix_node'. - * - * But because there are a lot of assumptions in this conversion, - * do not cast explicitly, but always use the macro below. - */ -#define RNTORT(p) ((struct rtentry *)(p)) - -VNET_DEFINE_STATIC(uma_zone_t, rtzone); /* Routing table UMA zone. */ +VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) EVENTHANDLER_LIST_DEFINE(rt_addrmsg); -static int rt_getifa_fib(struct rt_addrinfo *, u_int); -static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *, void *arg); -static struct rtentry *rt_unlinkrte(struct rib_head *rnh, - struct rt_addrinfo *info, int *perror); -static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); static void destroy_rtentry_epoch(epoch_context_t ctx); -#ifdef RADIX_MPATH -static struct radix_node *rt_mpath_unlink(struct rib_head *rnh, - struct rt_addrinfo *info, struct rtentry *rto, int *perror); -#endif static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags); -static int add_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt); -static int del_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt); -static int change_route(struct rib_head *, struct rt_addrinfo *, - struct rtentry **); - /* * handler for net.my_fibnum */ @@ -572,8 +544,8 @@ rtioctl_fib(u_long req, caddr_t data, u_int fibnum) } struct ifaddr * -ifa_ifwithroute(int flags, const struct sockaddr *dst, struct sockaddr *gateway, - u_int fibnum) +ifa_ifwithroute(int flags, const struct sockaddr *dst, + const struct sockaddr *gateway, u_int fibnum) { struct ifaddr *ifa; @@ -839,99 +811,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_ } } -struct rt_delinfo -{ - struct rt_addrinfo info; - struct rib_head *rnh; - struct rtentry *head; -}; - /* - * Conditionally unlinks @rn from radix tree based - * on info data passed in @arg. - */ -static int -rt_checkdelroute(struct radix_node *rn, void *arg) -{ - struct rt_delinfo *di; - struct rt_addrinfo *info; - struct rtentry *rt; - int error; - - di = (struct rt_delinfo *)arg; - rt = (struct rtentry *)rn; - info = &di->info; - error = 0; - - info->rti_info[RTAX_DST] = rt_key(rt); - info->rti_info[RTAX_NETMASK] = rt_mask(rt); - info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; - - rt = rt_unlinkrte(di->rnh, info, &error); - if (rt == NULL) { - /* Either not allowed or not matched. Skip entry */ - return (0); - } - - /* Entry was unlinked. Add to the list and return */ - rt->rt_chain = di->head; - di->head = rt; - - return (0); -} - -/* - * Iterates over a routing table specified by @fibnum and @family and - * deletes elements marked by @filter_f. - * @fibnum: rtable id - * @family: AF_ address family - * @filter_f: function returning non-zero value for items to delete - * @arg: data to pass to the @filter_f function - * @report: true if rtsock notification is needed. - */ -void -rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, void *arg, bool report) -{ - struct rib_head *rnh; - struct rt_delinfo di; - struct rtentry *rt; - - rnh = rt_tables_get_rnh(fibnum, family); - if (rnh == NULL) - return; - - bzero(&di, sizeof(di)); - di.info.rti_filter = filter_f; - di.info.rti_filterdata = arg; - di.rnh = rnh; - - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, rt_checkdelroute, &di); - RIB_WUNLOCK(rnh); - - if (di.head == NULL) - return; - - /* We might have something to reclaim. */ - while (di.head != NULL) { - rt = di.head; - di.head = rt->rt_chain; - rt->rt_chain = NULL; - - /* TODO std rt -> rt_addrinfo export */ - di.info.rti_info[RTAX_DST] = rt_key(rt); - di.info.rti_info[RTAX_NETMASK] = rt_mask(rt); - - rt_notifydelete(rt, &di.info); - - if (report) - rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0, - fibnum); - rtfree(rt); - } -} - -/* * Iterates over all existing fibs in system and deletes each element * for which @filter_f function returns non-zero value. * If @family is not AF_UNSPEC, iterates over fibs in particular @@ -1018,104 +898,6 @@ rt_flushifroutes(struct ifnet *ifp) } /* - * Conditionally unlinks rtentry matching data inside @info from @rnh. - * Returns unlinked, locked and referenced @rtentry on success, - * Returns NULL and sets @perror to: - * ESRCH - if prefix was not found, - * EADDRINUSE - if trying to delete PINNED route without appropriate flag. - * ENOENT - if supplied filter function returned 0 (not matched). - */ -static struct rtentry * -rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) -{ - struct sockaddr *dst, *netmask; - struct rtentry *rt; - struct radix_node *rn; - - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; - - rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); - if (rt == NULL) { - *perror = ESRCH; - return (NULL); - } - - if ((info->rti_flags & RTF_PINNED) == 0) { - /* Check if target route can be deleted */ - if (rt->rt_flags & RTF_PINNED) { - *perror = EADDRINUSE; - return (NULL); - } - } - - if (info->rti_filter != NULL) { - if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){ - /* Not matched */ - *perror = ENOENT; - return (NULL); - } - - /* - * Filter function requested rte deletion. - * Ease the caller work by filling in remaining info - * from that particular entry. - */ - info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; - } - - /* - * Remove the item from the tree and return it. - * Complain if it is not there and do no more processing. - */ - *perror = ESRCH; -#ifdef RADIX_MPATH - if (rt_mpath_capable(rnh)) - rn = rt_mpath_unlink(rnh, info, rt, perror); - else -#endif - rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); - if (rn == NULL) - return (NULL); - - if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) - panic ("rtrequest delete"); - - rt = RNTORT(rn); - RT_LOCK(rt); - rt->rt_flags &= ~RTF_UP; - - *perror = 0; - - return (rt); -} - -static void -rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info) -{ - struct ifaddr *ifa; - - /* - * give the protocol a chance to keep things in sync. - */ - ifa = rt->rt_nhop->nh_ifa; - if (ifa != NULL && ifa->ifa_rtrequest != NULL) - ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info); -} - - -/* - * These (questionable) definitions of apparent local variables apply - * to the next two functions. XXXXXX!!! - */ -#define dst info->rti_info[RTAX_DST] -#define gateway info->rti_info[RTAX_GATEWAY] -#define netmask info->rti_info[RTAX_NETMASK] -#define ifaaddr info->rti_info[RTAX_IFA] -#define ifpaddr info->rti_info[RTAX_IFP] -#define flags info->rti_flags - -/* * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, * it will be referenced so the caller must free it. * @@ -1125,9 +907,16 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) { + const struct sockaddr *dst, *gateway, *ifpaddr, *ifaaddr; struct epoch_tracker et; - int needref, error; + int needref, error, flags; + dst = info->rti_info[RTAX_DST]; + gateway = info->rti_info[RTAX_GATEWAY]; + ifpaddr = info->rti_info[RTAX_IFP]; + ifaaddr = info->rti_info[RTAX_IFA]; + flags = info->rti_flags; + /* * ifp may be specified by sockaddr_dl * when protocol address is ambiguous. @@ -1150,7 +939,7 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) if (info->rti_ifa == NULL && ifaaddr != NULL) info->rti_ifa = ifa_ifwithaddr(ifaaddr); if (info->rti_ifa == NULL) { - struct sockaddr *sa; + const struct sockaddr *sa; /* * Most common use case for the userland-supplied routes. @@ -1282,7 +1071,7 @@ rt_print(char *buf, int buflen, struct rtentry *rt) * Returnes unlinked entry. In case of failure, returns NULL * and sets @perror to ESRCH. */ -static struct radix_node * +struct radix_node * rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror) { @@ -1335,7 +1124,9 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin * use the normal delete code to remove * the first entry */ - rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); + rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], + &rnh->head); *perror = 0; return (rn); } @@ -1351,13 +1142,6 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif -#undef dst -#undef gateway -#undef netmask -#undef ifaaddr -#undef ifpaddr -#undef flags - int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) @@ -1369,7 +1153,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); NET_EPOCH_ASSERT(); - + dst = info->rti_info[RTAX_DST]; switch (dst->sa_family) { @@ -1420,341 +1204,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru return (error); } -static int -add_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - struct sockaddr *dst, *ndst, *gateway, *netmask; - struct rtentry *rt, *rt_old; - struct nhop_object *nh; - struct radix_node *rn; - struct ifaddr *ifa; - int error, flags; - struct epoch_tracker et; - - dst = info->rti_info[RTAX_DST]; - gateway = info->rti_info[RTAX_GATEWAY]; - netmask = info->rti_info[RTAX_NETMASK]; - flags = info->rti_flags; - - if ((flags & RTF_GATEWAY) && !gateway) - return (EINVAL); - if (dst && gateway && (dst->sa_family != gateway->sa_family) && - (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) - return (EINVAL); - - if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) - return (EINVAL); - - if (info->rti_ifa == NULL) { - error = rt_getifa_fib(info, rnh->rib_fibnum); - if (error) - return (error); - } else { - ifa_ref(info->rti_ifa); - } - - NET_EPOCH_ENTER(et); - error = nhop_create_from_info(rnh, info, &nh); - NET_EPOCH_EXIT(et); - if (error != 0) { - ifa_free(info->rti_ifa); - return (error); - } - - rt = uma_zalloc(V_rtzone, M_NOWAIT); - if (rt == NULL) { - ifa_free(info->rti_ifa); - nhop_free(nh); - return (ENOBUFS); - } - rt->rt_flags = RTF_UP | flags; - rt->rt_nhop = nh; - - /* Fill in dst */ - memcpy(&rt->rt_dst, dst, dst->sa_len); - rt_key(rt) = &rt->rt_dst; - - /* - * point to the (possibly newly malloc'd) dest address. - */ - ndst = (struct sockaddr *)rt_key(rt); - - /* - * make sure it contains the value we want (masked if needed). - */ - if (netmask) { - rt_maskedcopy(dst, ndst, netmask); - } else - bcopy(dst, ndst, dst->sa_len); - - /* - * We use the ifa reference returned by rt_getifa_fib(). - * This moved from below so that rnh->rnh_addaddr() can - * examine the ifa and ifa->ifa_ifp if it so desires. - */ - ifa = info->rti_ifa; - rt->rt_weight = 1; - - rt_setmetrics(info, rt); - - RIB_WLOCK(rnh); - RT_LOCK(rt); -#ifdef RADIX_MPATH - /* do not permit exactly the same dst/mask/gw pair */ - if (rt_mpath_capable(rnh) && - rt_mpath_conflict(rnh, rt, netmask)) { - RIB_WUNLOCK(rnh); - - nhop_free(nh); - uma_zfree(V_rtzone, rt); - return (EEXIST); - } -#endif - - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); - - if (rn != NULL && rt->rt_expire > 0) - tmproutes_update(rnh, rt); - - rt_old = NULL; - if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { - - /* - * Force removal and re-try addition - * TODO: better multipath&pinned support - */ - struct sockaddr *info_dst = info->rti_info[RTAX_DST]; - info->rti_info[RTAX_DST] = ndst; - /* Do not delete existing PINNED(interface) routes */ - info->rti_flags &= ~RTF_PINNED; - rt_old = rt_unlinkrte(rnh, info, &error); - info->rti_flags |= RTF_PINNED; - info->rti_info[RTAX_DST] = info_dst; - if (rt_old != NULL) - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, - rt->rt_nodes); - } - RIB_WUNLOCK(rnh); - - if (rt_old != NULL) { - rt_notifydelete(rt_old, info); - rtfree(rt_old); - } - - /* - * If it still failed to go into the tree, - * then un-make it (this should be a function) - */ - if (rn == NULL) { - nhop_free(nh); - uma_zfree(V_rtzone, rt); - return (EEXIST); - } - - /* - * If this protocol has something to add to this then - * allow it to do that as well. - */ - if (ifa->ifa_rtrequest) - ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); - - /* - * actually return a resultant rtentry - */ - if (ret_nrt) - *ret_nrt = rt; - rnh->rnh_gen++; /* Routing table updated */ - RT_UNLOCK(rt); - - return (0); -} - -static int -del_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - struct sockaddr *dst, *netmask; - struct sockaddr_storage mdst; - struct rtentry *rt; - int error; - - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; - - if (netmask) { - if (dst->sa_len > sizeof(mdst)) - return (EINVAL); - rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); - dst = (struct sockaddr *)&mdst; - } - - RIB_WLOCK(rnh); - rt = rt_unlinkrte(rnh, info, &error); - RIB_WUNLOCK(rnh); - if (error != 0) - return (error); - - rt_notifydelete(rt, info); - - /* - * If the caller wants it, then it can have it, - * the entry will be deleted after the end of the current epoch. - */ - if (ret_nrt) - *ret_nrt = rt; - - rtfree(rt); - - return (0); -} - -static int -change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - RIB_RLOCK_TRACKER; - struct rtentry *rt = NULL; - int error = 0; - int free_ifa = 0; - struct nhop_object *nh, *nh_orig; - - RIB_RLOCK(rnh); - rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], &rnh->head); - - if (rt == NULL) { - RIB_RUNLOCK(rnh); - return (ESRCH); - } - -#ifdef RADIX_MPATH - /* - * If we got multipath routes, - * we require users to specify a matching RTAX_GATEWAY. - */ - if (rt_mpath_capable(rnh)) { - rt = rt_mpath_matchgate(rt, info->rti_info[RTAX_GATEWAY]); - if (rt == NULL) { - RIB_RUNLOCK(rnh); - return (ESRCH); - } - } -#endif - nh_orig = rt->rt_nhop; - - RIB_RUNLOCK(rnh); - - rt = NULL; - nh = NULL; - - /* - * New gateway could require new ifaddr, ifp; - * flags may also be different; ifp may be specified - * by ll sockaddr when protocol address is ambiguous - */ - if (((nh_orig->nh_flags & NHF_GATEWAY) && - info->rti_info[RTAX_GATEWAY] != NULL) || - info->rti_info[RTAX_IFP] != NULL || - (info->rti_info[RTAX_IFA] != NULL && - !sa_equal(info->rti_info[RTAX_IFA], nh_orig->nh_ifa->ifa_addr))) { - error = rt_getifa_fib(info, rnh->rib_fibnum); - if (info->rti_ifa != NULL) - free_ifa = 1; - - if (error != 0) { - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } - - return (error); - } - } - - error = nhop_create_from_nhop(rnh, nh_orig, info, &nh); - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } - if (error != 0) - return (error); - - RIB_WLOCK(rnh); - - /* Lookup rtentry once again and check if nexthop is still the same */ - rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], &rnh->head); - - if (rt == NULL) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (ESRCH); - } - - if (rt->rt_nhop != nh_orig) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (EAGAIN); - } - - /* Proceed with the update */ - RT_LOCK(rt); - - /* Provide notification to the protocols.*/ - if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) - nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - - rt->rt_nhop = nh; - rt_setmetrics(info, rt); - - if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) - nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - - if (ret_nrt != NULL) - *ret_nrt = rt; - - RT_UNLOCK(rt); - - /* Update generation id to reflect rtable change */ - rnh->rnh_gen++; - - RIB_WUNLOCK(rnh); - - nhop_free(nh_orig); - - return (0); -} - -static int -change_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - int error; - - /* Check if updated gateway exists */ - if ((info->rti_flags & RTF_GATEWAY) && - (info->rti_info[RTAX_GATEWAY] == NULL)) - return (EINVAL); - - /* - * route change is done in multiple steps, with dropping and - * reacquiring lock. In the situations with multiple processes - * changes the same route in can lead to the case when route - * is changed between the steps. Address it by retrying the operation - * multiple times before failing. - */ - for (int i = 0; i < RIB_MAX_RETRIES; i++) { - error = change_route_one(rnh, info, ret_nrt); - if (error != EAGAIN) - break; - } - - return (error); -} - - -static void +void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/route/route_ctl.c Sat May 23 19:06:57 2020 (r361421) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_mpath.h" #include #include @@ -53,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RADIX_MPATH +#include +#endif + #include @@ -61,5 +66,519 @@ __FBSDID("$FreeBSD$"); * * All functions assumes they are called in net epoch. */ + +static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); + +int +add_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + struct sockaddr *dst, *ndst, *gateway, *netmask; + struct rtentry *rt, *rt_old; + struct nhop_object *nh; + struct radix_node *rn; + struct ifaddr *ifa; + int error, flags; + struct epoch_tracker et; + + dst = info->rti_info[RTAX_DST]; + gateway = info->rti_info[RTAX_GATEWAY]; + netmask = info->rti_info[RTAX_NETMASK]; + flags = info->rti_flags; + + if ((flags & RTF_GATEWAY) && !gateway) + return (EINVAL); + if (dst && gateway && (dst->sa_family != gateway->sa_family) && + (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) + return (EINVAL); + + if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) + return (EINVAL); + + if (info->rti_ifa == NULL) { + error = rt_getifa_fib(info, rnh->rib_fibnum); + if (error) + return (error); + } else { + ifa_ref(info->rti_ifa); + } + + NET_EPOCH_ENTER(et); + error = nhop_create_from_info(rnh, info, &nh); + NET_EPOCH_EXIT(et); + if (error != 0) { + ifa_free(info->rti_ifa); + return (error); + } + + rt = uma_zalloc(V_rtzone, M_NOWAIT); + if (rt == NULL) { + ifa_free(info->rti_ifa); + nhop_free(nh); + return (ENOBUFS); + } + rt->rt_flags = RTF_UP | flags; + rt->rt_nhop = nh; + + /* Fill in dst */ + memcpy(&rt->rt_dst, dst, dst->sa_len); + rt_key(rt) = &rt->rt_dst; + + /* + * point to the (possibly newly malloc'd) dest address. + */ + ndst = (struct sockaddr *)rt_key(rt); + + /* + * make sure it contains the value we want (masked if needed). + */ + if (netmask) { + rt_maskedcopy(dst, ndst, netmask); + } else + bcopy(dst, ndst, dst->sa_len); + + /* + * We use the ifa reference returned by rt_getifa_fib(). + * This moved from below so that rnh->rnh_addaddr() can + * examine the ifa and ifa->ifa_ifp if it so desires. + */ + ifa = info->rti_ifa; + rt->rt_weight = 1; + + rt_setmetrics(info, rt); + + RIB_WLOCK(rnh); + RT_LOCK(rt); +#ifdef RADIX_MPATH + /* do not permit exactly the same dst/mask/gw pair */ + if (rt_mpath_capable(rnh) && + rt_mpath_conflict(rnh, rt, netmask)) { + RIB_WUNLOCK(rnh); + + nhop_free(nh); + uma_zfree(V_rtzone, rt); + return (EEXIST); + } +#endif + + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); + + if (rn != NULL && rt->rt_expire > 0) + tmproutes_update(rnh, rt); + + rt_old = NULL; + if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { + + /* + * Force removal and re-try addition + * TODO: better multipath&pinned support + */ + struct sockaddr *info_dst = info->rti_info[RTAX_DST]; + info->rti_info[RTAX_DST] = ndst; + /* Do not delete existing PINNED(interface) routes */ + info->rti_flags &= ~RTF_PINNED; + rt_old = rt_unlinkrte(rnh, info, &error); + info->rti_flags |= RTF_PINNED; + info->rti_info[RTAX_DST] = info_dst; + if (rt_old != NULL) + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, + rt->rt_nodes); + } + RIB_WUNLOCK(rnh); + + if (rt_old != NULL) { + rt_notifydelete(rt_old, info); + rtfree(rt_old); + } + + /* + * If it still failed to go into the tree, + * then un-make it (this should be a function) + */ + if (rn == NULL) { + nhop_free(nh); + uma_zfree(V_rtzone, rt); + return (EEXIST); + } + + /* + * If this protocol has something to add to this then + * allow it to do that as well. + */ + if (ifa->ifa_rtrequest) + ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); + + /* + * actually return a resultant rtentry + */ + if (ret_nrt) + *ret_nrt = rt; + rnh->rnh_gen++; /* Routing table updated */ + RT_UNLOCK(rt); + + return (0); +} + + +/* + * Conditionally unlinks rtentry matching data inside @info from @rnh. + * Returns unlinked, locked and referenced @rtentry on success, + * Returns NULL and sets @perror to: + * ESRCH - if prefix was not found, + * EADDRINUSE - if trying to delete PINNED route without appropriate flag. + * ENOENT - if supplied filter function returned 0 (not matched). + */ +struct rtentry * +rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) +{ + struct sockaddr *dst, *netmask; + struct rtentry *rt; + struct radix_node *rn; + + dst = info->rti_info[RTAX_DST]; + netmask = info->rti_info[RTAX_NETMASK]; + + rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); + if (rt == NULL) { + *perror = ESRCH; + return (NULL); + } + + if ((info->rti_flags & RTF_PINNED) == 0) { + /* Check if target route can be deleted */ + if (rt->rt_flags & RTF_PINNED) { + *perror = EADDRINUSE; + return (NULL); + } + } + + if (info->rti_filter != NULL) { + if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){ + /* Not matched */ + *perror = ENOENT; + return (NULL); + } + + /* + * Filter function requested rte deletion. + * Ease the caller work by filling in remaining info + * from that particular entry. + */ + info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; + } + + /* + * Remove the item from the tree and return it. + * Complain if it is not there and do no more processing. + */ + *perror = ESRCH; +#ifdef RADIX_MPATH + if (rt_mpath_capable(rnh)) + rn = rt_mpath_unlink(rnh, info, rt, perror); + else +#endif + rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); + if (rn == NULL) + return (NULL); + + if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) + panic ("rtrequest delete"); + + rt = RNTORT(rn); + RT_LOCK(rt); + rt->rt_flags &= ~RTF_UP; + + *perror = 0; + + return (rt); +} + +int +del_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + struct sockaddr *dst, *netmask; + struct sockaddr_storage mdst; + struct rtentry *rt; + int error; + + dst = info->rti_info[RTAX_DST]; + netmask = info->rti_info[RTAX_NETMASK]; + + if (netmask) { + if (dst->sa_len > sizeof(mdst)) + return (EINVAL); + rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); + dst = (struct sockaddr *)&mdst; + } + + RIB_WLOCK(rnh); + rt = rt_unlinkrte(rnh, info, &error); + RIB_WUNLOCK(rnh); + if (error != 0) + return (error); + + rt_notifydelete(rt, info); + + /* + * If the caller wants it, then it can have it, + * the entry will be deleted after the end of the current epoch. + */ + if (ret_nrt) + *ret_nrt = rt; + + rtfree(rt); + + return (0); +} + +static int +change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + RIB_RLOCK_TRACKER; + struct rtentry *rt = NULL; + int error = 0; + int free_ifa = 0; + struct nhop_object *nh, *nh_orig; + + RIB_RLOCK(rnh); + rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], &rnh->head); + + if (rt == NULL) { + RIB_RUNLOCK(rnh); + return (ESRCH); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat May 23 19:52:21 2020 Return-Path: Delivered-To: svn-src-head@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 552312DC4B6; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TvC911Hfz4YkV; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DFBA15364; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NJqKkC022016; Sat, 23 May 2020 19:52:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NJqKHa022015; Sat, 23 May 2020 19:52:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231952.04NJqKHa022015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 19:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361422 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 361422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 19:52:21 -0000 Author: manu Date: Sat May 23 19:52:20 2020 New Revision: 361422 URL: https://svnweb.freebsd.org/changeset/base/361422 Log: bbr: Use arc4random_uniform from libkern. This unbreak LINT build Reported by: jenkins, melifaro Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Sat May 23 19:06:57 2020 (r361421) +++ head/sys/netinet/tcp_stacks/bbr.c Sat May 23 19:52:20 2020 (r361422) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef TCP_HHOOK #include #endif @@ -3095,43 +3096,6 @@ bbr_lt_bw_samp_done(struct tcp_bbr *bbr, uint64_t bw, bbr->r_ctl.rc_lt_bw = bw; bbr_reset_lt_bw_interval(bbr, cts); bbr_log_type_ltbw(bbr, cts, 5, 0, (uint32_t)bw, 0, timin); -} - -/* - * RRS: Copied from user space! - * Calculate a uniformly distributed random number less than upper_bound - * avoiding "modulo bias". - * - * Uniformity is achieved by generating new random numbers until the one - * returned is outside the range [0, 2**32 % upper_bound). This - * guarantees the selected random number will be inside - * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) - * after reduction modulo upper_bound. - */ -static uint32_t -arc4random_uniform(uint32_t upper_bound) -{ - uint32_t r, min; - - if (upper_bound < 2) - return 0; - - /* 2**32 % x == (2**32 - x) % x */ - min = -upper_bound % upper_bound; - - /* - * This could theoretically loop forever but each retry has - * p > 0.5 (worst case, usually far better) of selecting a - * number inside the range we need, so it should rarely need - * to re-roll. - */ - for (;;) { - r = arc4random(); - if (r >= min) - break; - } - - return r % upper_bound; } static void From owner-svn-src-head@freebsd.org Sat May 23 20:39:37 2020 Return-Path: Delivered-To: svn-src-head@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 2D2ED2DD993; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TwFj0Jpcz4dCq; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0555915BAD; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NKdasb047170; Sat, 23 May 2020 20:39:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NKdaNi047169; Sat, 23 May 2020 20:39:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232039.04NKdaNi047169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 20:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361425 - head/sys/contrib/zstd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd X-SVN-Commit-Revision: 361425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 20:39:37 -0000 Author: cem Date: Sat May 23 20:39:36 2020 New Revision: 361425 URL: https://svnweb.freebsd.org/changeset/base/361425 Log: contrib/zstd: Revise Xlist for 1.4.5 import Modified: head/sys/contrib/zstd/FREEBSD-Xlist Modified: head/sys/contrib/zstd/FREEBSD-Xlist ============================================================================== --- head/sys/contrib/zstd/FREEBSD-Xlist Sat May 23 20:38:30 2020 (r361424) +++ head/sys/contrib/zstd/FREEBSD-Xlist Sat May 23 20:39:36 2020 (r361425) @@ -2,11 +2,11 @@ $FreeBSD$ .circleci .cirrus.yml +.github .gitignore .travis.yml build -contrib/linux-kernel -contrib/single_file_decoder -contrib/VS2005 +contrib lib/dll programs/windres +tests From owner-svn-src-head@freebsd.org Sat May 23 21:23:49 2020 Return-Path: Delivered-To: svn-src-head@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 91D4B2DE7A0; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TxDj2Bwdz3SqL; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F7F165CD; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NLNnuA078960; Sat, 23 May 2020 21:23:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NLNkG4078947; Sat, 23 May 2020 21:23:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232123.04NLNkG4078947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 21:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361426 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilde... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder sys/contrib/zstd/contri... X-SVN-Commit-Revision: 361426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 21:23:49 -0000 Author: cem Date: Sat May 23 21:23:46 2020 New Revision: 361426 URL: https://svnweb.freebsd.org/changeset/base/361426 Log: Update to Zstandard 1.4.5 As usual, the full release notes are found on Github: https://github.com/facebook/zstd/releases/tag/v1.4.5 Notable changes include: * Improved decompress performance on amd64 and arm (5-10% and 15-50%, respectively). * '--patch-from' zstd(1) CLI option, which provides something like a very fast version of bspatch(1) with slightly worse compression. See release notes. In this update, I dropped the 3-year old -O0 workaround for an LLVM ARM bug; the bug was fixed in LLVM SVN in 2017, but we didn't remove this workaround from our tree until now. MFC after: I won't, but feel free Relnotes: yes Added: head/sys/contrib/zstd/lib/compress/zstd_compress_superblock.c - copied unchanged from r361425, vendor/zstd/dist/lib/compress/zstd_compress_superblock.c head/sys/contrib/zstd/lib/compress/zstd_compress_superblock.h - copied unchanged from r361425, vendor/zstd/dist/lib/compress/zstd_compress_superblock.h Deleted: head/sys/contrib/zstd/contrib/cleanTabs head/sys/contrib/zstd/contrib/docker/Dockerfile head/sys/contrib/zstd/contrib/docker/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/dictBuilder.h head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/test.sh head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/fastCover.c head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/fastCover.h head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/main.c head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/test.sh head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/io.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/io.h head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/main.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/random.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/random.h head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/test.sh head/sys/contrib/zstd/contrib/gen_html/Makefile head/sys/contrib/zstd/contrib/gen_html/README.md head/sys/contrib/zstd/contrib/gen_html/gen-zstd-manual.sh head/sys/contrib/zstd/contrib/gen_html/gen_html.cpp head/sys/contrib/zstd/contrib/largeNbDicts/Makefile head/sys/contrib/zstd/contrib/largeNbDicts/README.md head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c head/sys/contrib/zstd/contrib/premake/premake4.lua head/sys/contrib/zstd/contrib/premake/zstd.lua head/sys/contrib/zstd/contrib/pzstd/BUCK head/sys/contrib/zstd/contrib/pzstd/ErrorHolder.h head/sys/contrib/zstd/contrib/pzstd/Logging.h head/sys/contrib/zstd/contrib/pzstd/Makefile head/sys/contrib/zstd/contrib/pzstd/Options.cpp head/sys/contrib/zstd/contrib/pzstd/Options.h head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp head/sys/contrib/zstd/contrib/pzstd/Pzstd.h head/sys/contrib/zstd/contrib/pzstd/README.md head/sys/contrib/zstd/contrib/pzstd/SkippableFrame.cpp head/sys/contrib/zstd/contrib/pzstd/SkippableFrame.h head/sys/contrib/zstd/contrib/pzstd/images/Cspeed.png head/sys/contrib/zstd/contrib/pzstd/images/Dspeed.png head/sys/contrib/zstd/contrib/pzstd/main.cpp head/sys/contrib/zstd/contrib/pzstd/test/BUCK head/sys/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp head/sys/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp head/sys/contrib/zstd/contrib/pzstd/test/RoundTrip.h head/sys/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/BUCK head/sys/contrib/zstd/contrib/pzstd/utils/Buffer.h head/sys/contrib/zstd/contrib/pzstd/utils/FileSystem.h head/sys/contrib/zstd/contrib/pzstd/utils/Likely.h head/sys/contrib/zstd/contrib/pzstd/utils/Range.h head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h head/sys/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h head/sys/contrib/zstd/contrib/pzstd/utils/ThreadPool.h head/sys/contrib/zstd/contrib/pzstd/utils/WorkQueue.h head/sys/contrib/zstd/contrib/pzstd/utils/test/BUCK head/sys/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_compression.c head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable_compression_format.md head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/contrib/snap/snapcraft.yaml head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/README.md head/sys/contrib/zstd/tests/bigdict.c head/sys/contrib/zstd/tests/checkTag.c head/sys/contrib/zstd/tests/datagencli.c head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/Makefile head/sys/contrib/zstd/tests/fuzz/README.md head/sys/contrib/zstd/tests/fuzz/block_decompress.c head/sys/contrib/zstd/tests/fuzz/block_round_trip.c head/sys/contrib/zstd/tests/fuzz/dictionary_decompress.c head/sys/contrib/zstd/tests/fuzz/dictionary_loader.c head/sys/contrib/zstd/tests/fuzz/dictionary_round_trip.c head/sys/contrib/zstd/tests/fuzz/fuzz.h head/sys/contrib/zstd/tests/fuzz/fuzz.py head/sys/contrib/zstd/tests/fuzz/fuzz_data_producer.c head/sys/contrib/zstd/tests/fuzz/fuzz_data_producer.h head/sys/contrib/zstd/tests/fuzz/fuzz_helpers.h head/sys/contrib/zstd/tests/fuzz/regression_driver.c head/sys/contrib/zstd/tests/fuzz/simple_compress.c head/sys/contrib/zstd/tests/fuzz/simple_decompress.c head/sys/contrib/zstd/tests/fuzz/simple_round_trip.c head/sys/contrib/zstd/tests/fuzz/stream_decompress.c head/sys/contrib/zstd/tests/fuzz/stream_round_trip.c head/sys/contrib/zstd/tests/fuzz/zstd_frame_info.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.h head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/golden-compression/huffman-compressed-larger head/sys/contrib/zstd/tests/golden-decompression/rle-first-block.zst head/sys/contrib/zstd/tests/gzip/Makefile head/sys/contrib/zstd/tests/gzip/gzip-env.sh head/sys/contrib/zstd/tests/gzip/helin-segv.sh head/sys/contrib/zstd/tests/gzip/help-version.sh head/sys/contrib/zstd/tests/gzip/hufts-segv.gz head/sys/contrib/zstd/tests/gzip/hufts.sh head/sys/contrib/zstd/tests/gzip/init.cfg head/sys/contrib/zstd/tests/gzip/init.sh head/sys/contrib/zstd/tests/gzip/keep.sh head/sys/contrib/zstd/tests/gzip/list.sh head/sys/contrib/zstd/tests/gzip/memcpy-abuse.sh head/sys/contrib/zstd/tests/gzip/mixed.sh head/sys/contrib/zstd/tests/gzip/null-suffix-clobber.sh head/sys/contrib/zstd/tests/gzip/stdin.sh head/sys/contrib/zstd/tests/gzip/test-driver.sh head/sys/contrib/zstd/tests/gzip/trailing-nul.sh head/sys/contrib/zstd/tests/gzip/unpack-invalid.sh head/sys/contrib/zstd/tests/gzip/z-suffix.sh head/sys/contrib/zstd/tests/gzip/zdiff.sh head/sys/contrib/zstd/tests/gzip/zgrep-context.sh head/sys/contrib/zstd/tests/gzip/zgrep-f.sh head/sys/contrib/zstd/tests/gzip/zgrep-signal.sh head/sys/contrib/zstd/tests/gzip/znew-k.sh head/sys/contrib/zstd/tests/invalidDictionaries.c head/sys/contrib/zstd/tests/legacy.c head/sys/contrib/zstd/tests/libzstd_partial_builds.sh head/sys/contrib/zstd/tests/longmatch.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/poolTests.c head/sys/contrib/zstd/tests/rateLimiter.py head/sys/contrib/zstd/tests/regression/Makefile head/sys/contrib/zstd/tests/regression/config.c head/sys/contrib/zstd/tests/regression/config.h head/sys/contrib/zstd/tests/regression/data.c head/sys/contrib/zstd/tests/regression/data.h head/sys/contrib/zstd/tests/regression/levels.h head/sys/contrib/zstd/tests/regression/method.c head/sys/contrib/zstd/tests/regression/method.h head/sys/contrib/zstd/tests/regression/result.c head/sys/contrib/zstd/tests/regression/result.h head/sys/contrib/zstd/tests/regression/results.csv head/sys/contrib/zstd/tests/regression/test.c head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/seqgen.c head/sys/contrib/zstd/tests/seqgen.h head/sys/contrib/zstd/tests/symbols.c head/sys/contrib/zstd/tests/test-zstd-speed.py head/sys/contrib/zstd/tests/test-zstd-versions.py head/sys/contrib/zstd/tests/zbufftest.c head/sys/contrib/zstd/tests/zstreamtest.c Modified: head/lib/libzstd/Makefile head/sys/conf/files head/sys/contrib/zstd/CHANGELOG head/sys/contrib/zstd/CONTRIBUTING.md head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/README.md head/sys/contrib/zstd/TESTING.md head/sys/contrib/zstd/appveyor.yml head/sys/contrib/zstd/doc/educational_decoder/Makefile head/sys/contrib/zstd/doc/educational_decoder/README.md head/sys/contrib/zstd/doc/educational_decoder/harness.c head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/examples/Makefile head/sys/contrib/zstd/examples/common.h head/sys/contrib/zstd/examples/dictionary_compression.c head/sys/contrib/zstd/examples/dictionary_decompression.c head/sys/contrib/zstd/examples/multiple_simple_compression.c head/sys/contrib/zstd/examples/multiple_streaming_compression.c head/sys/contrib/zstd/examples/simple_compression.c head/sys/contrib/zstd/examples/simple_decompression.c head/sys/contrib/zstd/examples/streaming_compression.c head/sys/contrib/zstd/examples/streaming_decompression.c head/sys/contrib/zstd/examples/streaming_memory_usage.c head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/cpu.h head/sys/contrib/zstd/lib/common/debug.c head/sys/contrib/zstd/lib/common/debug.h head/sys/contrib/zstd/lib/common/entropy_common.c head/sys/contrib/zstd/lib/common/error_private.c head/sys/contrib/zstd/lib/common/error_private.h head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/fse_decompress.c head/sys/contrib/zstd/lib/common/huf.h head/sys/contrib/zstd/lib/common/mem.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/pool.h head/sys/contrib/zstd/lib/common/threading.c head/sys/contrib/zstd/lib/common/threading.h head/sys/contrib/zstd/lib/common/xxhash.c head/sys/contrib/zstd/lib/common/xxhash.h head/sys/contrib/zstd/lib/common/zstd_common.c head/sys/contrib/zstd/lib/common/zstd_errors.h head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_compress.c head/sys/contrib/zstd/lib/compress/hist.c head/sys/contrib/zstd/lib/compress/hist.h head/sys/contrib/zstd/lib/compress/huf_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_compress_literals.c head/sys/contrib/zstd/lib/compress/zstd_compress_literals.h head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.c head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.h head/sys/contrib/zstd/lib/compress/zstd_cwksp.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.h head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.h head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/huf_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_ddict.c head/sys/contrib/zstd/lib/decompress/zstd_ddict.h head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.h head/sys/contrib/zstd/lib/decompress/zstd_decompress_internal.h head/sys/contrib/zstd/lib/deprecated/zbuff.h head/sys/contrib/zstd/lib/deprecated/zbuff_common.c head/sys/contrib/zstd/lib/deprecated/zbuff_compress.c head/sys/contrib/zstd/lib/deprecated/zbuff_decompress.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/cover.h head/sys/contrib/zstd/lib/dictBuilder/fastcover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/legacy/zstd_legacy.h head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v01.h head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v02.h head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v03.h head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v04.h head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v05.h head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v06.h head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/legacy/zstd_v07.h head/sys/contrib/zstd/lib/libzstd.pc.in head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/benchfn.c head/sys/contrib/zstd/programs/benchfn.h head/sys/contrib/zstd/programs/benchzstd.c head/sys/contrib/zstd/programs/benchzstd.h head/sys/contrib/zstd/programs/datagen.c head/sys/contrib/zstd/programs/datagen.h head/sys/contrib/zstd/programs/dibio.c head/sys/contrib/zstd/programs/dibio.h head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/timefn.c head/sys/contrib/zstd/programs/timefn.h head/sys/contrib/zstd/programs/util.c head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/programs/zstdgrep head/sys/contrib/zstd/programs/zstdgrep.1 head/sys/contrib/zstd/programs/zstdless.1 head/sys/contrib/zstd/zlibWrapper/Makefile head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/gzcompatibility.h head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h Directory Properties: head/sys/contrib/zstd/ (props changed) Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/lib/libzstd/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -13,6 +13,7 @@ SRCS= entropy_common.c \ zstd_compress.c \ zstd_compress_literals.c \ zstd_compress_sequences.c \ + zstd_compress_superblock.c \ zstdmt_compress.c \ huf_decompress.c \ zstd_ddict.c \ @@ -54,13 +55,6 @@ ZSTDDIR= ${SRCTOP}/sys/contrib/zstd # turning off vectorization, which is why there were both." .if ${COMPILER_TYPE} == "gcc" CFLAGS.zstd_decompress_block.c+= -fno-tree-vectorize -.endif - -# Work around for LLVM bug 35023, https://bugs.llvm.org/show_bug.cgi?id=35023 -# Fixed in https://reviews.llvm.org/rL349935 ; not sure if we have that version -# in our LLVM or not yet. -.if ${MACHINE_ARCH:Marm*} != "" -CFLAGS.zstd_compress.c+= -O0 .endif # Work around lack of __bswap[sd]i2() intrinsics on riscv. Probably should be Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 23 20:39:36 2020 (r361425) +++ head/sys/conf/files Sat May 23 21:23:46 2020 (r361426) @@ -659,6 +659,7 @@ contrib/zstd/lib/common/xxhash.c optional zstdio comp contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress_literals.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress_sequences.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_superblock.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/contrib/zstd/CHANGELOG ============================================================================== --- head/sys/contrib/zstd/CHANGELOG Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/CHANGELOG Sat May 23 21:23:46 2020 (r361426) @@ -1,3 +1,29 @@ +v1.4.5 +fix : Compression ratio regression on huge files (> 3 GB) using high levels (--ultra) and multithreading, by @terrelln +perf: Improved decompression speed: x64 : +10% (clang) / +5% (gcc); ARM : from +15% to +50%, depending on SoC, by @terrelln +perf: Automatically downsizes ZSTD_DCtx when too large for too long (#2069, by @bimbashreshta) +perf: Improved fast compression speed on aarch64 (#2040, ~+3%, by @caoyzh) +perf: Small level 1 compression speed gains (depending on compiler) +cli : New --patch-from command, create and apply patches from files, by @bimbashreshta +cli : New --filelist= : Provide a list of files to operate upon from a file +cli : -b -d command can now benchmark decompression on multiple files +cli : New --no-content-size command +cli : New --show-default-cparams information command +api : ZDICT_finalizeDictionary() is promoted to stable (#2111) +api : new experimental parameter ZSTD_d_stableOutBuffer (#2094) +build: Generate a single-file libzstd library (#2065, by @cwoffenden) +build: Relative includes no longer require -I compiler flags for zstd lib subdirs (#2103, by @felixhandte) +build: zstd now compiles cleanly under -pedantic (#2099) +build: zstd now compiles with make-4.3 +build: Support mingw cross-compilation from Linux, by @Ericson2314 +build: Meson multi-thread build fix on windows +build: Some misc icc fixes backed by new ci test on travis +misc: bitflip analyzer tool, by @felixhandte +misc: Extend largeNbDicts benchmark to compression +misc: Edit-distance match finder in contrib/ +doc : Improved beginner CONTRIBUTING.md docs +doc : New issue templates for zstd + v1.4.4 perf: Improved decompression speed, by > 10%, by @terrelln perf: Better compression speed when re-using a context, by @felixhandte @@ -14,7 +40,8 @@ cli: commands --stream-size=# and --size-hint=#, by @n cli: command --exclude-compressed, by @shashank0791 cli: faster `-t` test mode cli: improved some error messages, by @vangyzen -cli: rare deadlock condition within dictionary builder, by @terrelln +cli: fix command `-D dictionary` on Windows, reported by @artyompetrov +cli: fix rare deadlock condition within dictionary builder, by @terrelln build: single-file decoder with emscripten compilation script, by @cwoffenden build: fixed zlibWrapper compilation on Visual Studio, reported by @bluenlive build: fixed deprecation warning for certain gcc version, reported by @jasonma163 Modified: head/sys/contrib/zstd/CONTRIBUTING.md ============================================================================== --- head/sys/contrib/zstd/CONTRIBUTING.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/CONTRIBUTING.md Sat May 23 21:23:46 2020 (r361426) @@ -26,6 +26,356 @@ to do this once to work on any of Facebook's open sour Complete your CLA here: +## Workflow +Zstd uses a branch-based workflow for making changes to the codebase. Typically, zstd +will use a new branch per sizable topic. For smaller changes, it is okay to lump multiple +related changes into a branch. + +Our contribution process works in three main stages: +1. Local development + * Update: + * Checkout your fork of zstd if you have not already + ``` + git checkout https://github.com//zstd + cd zstd + ``` + * Update your local dev branch + ``` + git pull https://github.com/facebook/zstd dev + git push origin dev + ``` + * Topic and development: + * Make a new branch on your fork about the topic you're developing for + ``` + # branch names should be consise but sufficiently informative + git checkout -b + git push origin + ``` + * Make commits and push + ``` + # make some changes = + git add -u && git commit -m + git push origin + ``` + * Note: run local tests to ensure that your changes didn't break existing functionality + * Quick check + ``` + make shortest + ``` + * Longer check + ``` + make test + ``` +2. Code Review and CI tests + * Ensure CI tests pass: + * Before sharing anything to the community, make sure that all CI tests pass on your local fork. + See our section on setting up your CI environment for more information on how to do this. + * Ensure that static analysis passes on your development machine. See the Static Analysis section + below to see how to do this. + * Create a pull request: + * When you are ready to share you changes to the community, create a pull request from your branch + to facebook:dev. You can do this very easily by clicking 'Create Pull Request' on your fork's home + page. + * From there, select the branch where you made changes as your source branch and facebook:dev + as the destination. + * Examine the diff presented between the two branches to make sure there is nothing unexpected. + * Write a good pull request description: + * While there is no strict template that our contributors follow, we would like them to + sufficiently summarize and motivate the changes they are proposing. We recommend all pull requests, + at least indirectly, address the following points. + * Is this pull request important and why? + * Is it addressing an issue? If so, what issue? (provide links for convenience please) + * Is this a new feature? If so, why is it useful and/or necessary? + * Are there background references and documents that reviewers should be aware of to properly assess this change? + * Note: make sure to point out any design and architectural decisions that you made and the rationale behind them. + * Note: if you have been working with a specific user and would like them to review your work, make sure you mention them using (@) + * Submit the pull request and iterate with feedback. +3. Merge and Release + * Getting approval: + * You will have to iterate on your changes with feedback from other collaborators to reach a point + where your pull request can be safely merged. + * To avoid too many comments on style and convention, make sure that you have a + look at our style section below before creating a pull request. + * Eventually, someone from the zstd team will approve your pull request and not long after merge it into + the dev branch. + * Housekeeping: + * Most PRs are linked with one or more Github issues. If this is the case for your PR, make sure + the corresponding issue is mentioned. If your change 'fixes' or completely addresses the + issue at hand, then please indicate this by requesting that an issue be closed by commenting. + * Just because your changes have been merged does not mean the topic or larger issue is complete. Remember + that the change must make it to an official zstd release for it to be meaningful. We recommend + that contributers track the activity on their pull request and corresponding issue(s) page(s) until + their change makes it to the next release of zstd. Users will often discover bugs in your code or + suggest ways to refine and improve your initial changes even after the pull request is merged. + +## Static Analysis +Static analysis is a process for examining the correctness or validity of a program without actually +executing it. It usually helps us find many simple bugs. Zstd uses clang's `scan-build` tool for +static analysis. You can install it by following the instructions for your OS on https://clang-analyzer.llvm.org/scan-build. + +Once installed, you can ensure that our static analysis tests pass on your local development machine +by running: +``` +make staticAnalyze +``` + +In general, you can use `scan-build` to static analyze any build script. For example, to static analyze +just `contrib/largeNbDicts` and nothing else, you can run: + +``` +scan-build make -C contrib/largeNbDicts largeNbDicts +``` + +## Performance +Performance is extremely important for zstd and we only merge pull requests whose performance +landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented. +This high bar for performance means that every PR which has the potential to +impact performance takes a very long time for us to properly review. That being said, we +always welcome contributions to improve performance (or worsen performance for the trade-off of +something else). Please keep the following in mind before submitting a performance related PR: + +1. Zstd isn't as old as gzip but it has been around for time now and its evolution is +very well documented via past Github issues and pull requests. It may be the case that your +particular performance optimization has already been considered in the past. Please take some +time to search through old issues and pull requests using keywords specific to your +would-be PR. Of course, just because a topic has already been discussed (and perhaps rejected +on some grounds) in the past, doesn't mean it isn't worth bringing up again. But even in that case, +it will be helpful for you to have context from that topic's history before contributing. +2. The distinction between noise and actual performance gains can unfortunately be very subtle +especially when microbenchmarking extremely small wins or losses. The only remedy to getting +something subtle merged is extensive benchmarking. You will be doing us a great favor if you +take the time to run extensive, long-duration, and potentially cross-(os, platform, process, etc) +benchmarks on your end before submitting a PR. Of course, you will not be able to benchmark +your changes on every single processor and os out there (and neither will we) but do that best +you can:) We've adding some things to think about when benchmarking below in the Benchmarking +Performance section which might be helpful for you. +3. Optimizing performance for a certain OS, processor vendor, compiler, or network system is a perfectly +legitimate thing to do as long as it does not harm the overall performance health of Zstd. +This is a hard balance to strike but please keep in mind other aspects of Zstd when +submitting changes that are clang-specific, windows-specific, etc. + +## Benchmarking Performance +Performance microbenchmarking is a tricky subject but also essential for Zstd. We value empirical +testing over theoretical speculation. This guide it not perfect but for most scenarios, it +is a good place to start. + +### Stability +Unfortunately, the most important aspect in being able to benchmark reliably is to have a stable +benchmarking machine. A virtual machine, a machine with shared resources, or your laptop +will typically not be stable enough to obtain reliable benchmark results. If you can get your +hands on a desktop, this is usually a better scenario. + +Of course, benchmarking can be done on non-hyper-stable machines as well. You will just have to +do a little more work to ensure that you are in fact measuring the changes you've made not and +noise. Here are some things you can do to make your benchmarks more stable: + +1. The most simple thing you can do to drastically improve the stability of your benchmark is +to run it multiple times and then aggregate the results of those runs. As a general rule of +thumb, the smaller the change you are trying to measure, the more samples of benchmark runs +you will have to aggregate over to get reliable results. Here are some additional things to keep in +mind when running multiple trials: + * How you aggregate your samples are important. You might be tempted to use the mean of your + results. While this is certainly going to be a more stable number than a raw single sample + benchmark number, you might have more luck by taking the median. The mean is not robust to + outliers whereas the median is. Better still, you could simply take the fastest speed your + benchmark achieved on each run since that is likely the fastest your process will be + capable of running your code. In our experience, this (aggregating by just taking the sample + with the fastest running time) has been the most stable approach. + * The more samples you have, the more stable your benchmarks should be. You can verify + your improved stability by looking at the size of your confidence intervals as you + increase your sample count. These should get smaller and smaller. Eventually hopefully + smaller than the performance win you are expecting. + * Most processors will take some time to get `hot` when running anything. The observations + you collect during that time period will very different from the true performance number. Having + a very large number of sample will help alleviate this problem slightly but you can also + address is directly by simply not including the first `n` iterations of your benchmark in + your aggregations. You can determine `n` by simply looking at the results from each iteration + and then hand picking a good threshold after which the variance in results seems to stabilize. +2. You cannot really get reliable benchmarks if your host machine is simultaneously running +another cpu/memory-intensive application in the background. If you are running benchmarks on your +personal laptop for instance, you should close all applications (including your code editor and +browser) before running your benchmarks. You might also have invisible background applications +running. You can see what these are by looking at either Activity Monitor on Mac or Task Manager +on Windows. You will get more stable benchmark results of you end those processes as well. + * If you have multiple cores, you can even run your benchmark on a reserved core to prevent + pollution from other OS and user processes. There are a number of ways to do this depending + on your OS: + * On linux boxes, you have use https://github.com/lpechacek/cpuset. + * On Windows, you can "Set Processor Affinity" using https://www.thewindowsclub.com/processor-affinity-windows + * On Mac, you can try to use their dedicated affinity API https://developer.apple.com/library/archive/releasenotes/Performance/RN-AffinityAPI/#//apple_ref/doc/uid/TP40006635-CH1-DontLinkElementID_2 +3. To benchmark, you will likely end up writing a separate c/c++ program that will link libzstd. +Dynamically linking your library will introduce some added variation (not a large amount but +definitely some). Statically linking libzstd will be more stable. Static libraries should +be enabled by default when building zstd. +4. Use a profiler with a good high resolution timer. See the section below on profiling for +details on this. +5. Disable frequency scaling, turbo boost and address space randomization (this will vary by OS) +6. Try to avoid storage. On some systems you can use tmpfs. Putting the program, inputs and outputs on +tmpfs avoids touching a real storage system, which can have a pretty big variability. + +Also check our LLVM's guide on benchmarking here: https://llvm.org/docs/Benchmarking.html + +### Zstd benchmark +The fastest signal you can get regarding your performance changes is via the in-build zstd cli +bench option. You can run Zstd as you typically would for your scenario using some set of options +and then additionally also specify the `-b#` option. Doing this will run our benchmarking pipeline +for that options you have just provided. If you want to look at the internals of how this +benchmarking script works, you can check out programs/benchzstd.c + +For example: say you have made a change that you believe improves the speed of zstd level 1. The +very first thing you should use to asses whether you actually achieved any sort of improvement +is `zstd -b`. You might try to do something like this. Note: you can use the `-i` option to +specify a running time for your benchmark in seconds (default is 3 seconds). +Usually, the longer the running time, the more stable your results will be. + +``` +$ git checkout +$ make && cp zstd zstd-old +$ git checkout +$ make && cp zstd zstd-new +$ zstd-old -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.6 MB/s , 626.4 MB/s +$ zstd-new -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.8 MB/s , 628.4 MB/s +``` + +Unless your performance win is large enough to be visible despite the intrinsic noise +on your computer, benchzstd alone will likely not be enough to validate the impact of your +changes. For example, the results of the example above indicate that effectively nothing +changed but there could be a small <3% improvement that the noise on the host machine +obscured. So unless you see a large performance win (10-15% consistently) using just +this method of evaluation will not be sufficient. + +### Profiling +There are a number of great profilers out there. We're going to briefly mention how you can +profile your code using `instruments` on mac, `perf` on linux and `visual studio profiler` +on windows. + +Say you have an idea for a change that you think will provide some good performance gains +for level 1 compression on Zstd. Typically this means, you have identified a section of +code that you think can be made to run faster. + +The first thing you will want to do is make sure that the piece of code is actually taking up +a notable amount of time to run. It is usually not worth optimzing something which accounts for less than +0.0001% of the total running time. Luckily, there are tools to help with this. +Profilers will let you see how much time your code spends inside a particular function. +If your target code snippit is only part of a function, it might be worth trying to +isolate that snippit by moving it to its own function (this is usually not necessary but +might be). + +Most profilers (including the profilers dicusssed below) will generate a call graph of +functions for you. Your goal will be to find your function of interest in this call grapch +and then inspect the time spent inside of it. You might also want to to look at the +annotated assembly which most profilers will provide you with. + +#### Instruments +We will once again consider the scenario where you think you've identified a piece of code +whose performance can be improved upon. Follow these steps to profile your code using +Instruments. + +1. Open Instruments +2. Select `Time Profiler` from the list of standard templates +3. Close all other applications except for your instruments window and your terminal +4. Run your benchmarking script from your terminal window + * You will want a benchmark that runs for at least a few seconds (5 seconds will + usually be long enough). This way the profiler will have something to work with + and you will have ample time to attach your profiler to this process:) + * I will just use benchzstd as my bencharmking script for this example: +``` +$ zstd -b1 -i5 # this will run for 5 seconds +``` +5. Once you run your benchmarking script, switch back over to instruments and attach your +process to the time profiler. You can do this by: + * Clicking on the `All Processes` drop down in the top left of the toolbar. + * Selecting your process from the dropdown. In my case, it is just going to be labled + `zstd` + * Hitting the bright red record circle button on the top left of the toolbar +6. You profiler will now start collecting metrics from your bencharking script. Once +you think you have collected enough samples (usually this is the case after 3 seconds of +recording), stop your profiler. +7. Make sure that in toolbar of the bottom window, `profile` is selected. +8. You should be able to see your call graph. + * If you don't see the call graph or an incomplete call graph, make sure you have compiled + zstd and your benchmarking scripg using debug flags. On mac and linux, this just means + you will have to supply the `-g` flag alone with your build script. You might also + have to provide the `-fno-omit-frame-pointer` flag +9. Dig down the graph to find your function call and then inspect it by double clicking +the list item. You will be able to see the annotated source code and the assembly side by +side. + +#### Perf + +This wiki has a pretty detailed tutorial on getting started working with perf so we'll +leave you to check that out of you're getting started: + +https://perf.wiki.kernel.org/index.php/Tutorial + +Some general notes on perf: +* Use `perf stat -r # ` to quickly get some relevant timing and +counter statistics. Perf uses a high resolution timer and this is likely one +of the first things your team will run when assessing your PR. +* Perf has a long list of hardware counters that can be viewed with `perf --list`. +When measuring optimizations, something worth trying is to make sure the handware +counters you expect to be impacted by your change are in fact being so. For example, +if you expect the L1 cache misses to decrease with your change, you can look at the +counter `L1-dcache-load-misses` +* Perf hardware counters will not work on a virtual machine. + +#### Visual Studio + +TODO + + +## Setting up continuous integration (CI) on your fork +Zstd uses a number of different continuous integration (CI) tools to ensure that new changes +are well tested before they make it to an official release. Specifically, we use the platforms +travis-ci, circle-ci, and appveyor. + +Changes cannot be merged into the main dev branch unless they pass all of our CI tests. +The easiest way to run these CI tests on your own before submitting a PR to our dev branch +is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find +instructions for doing this. + +### travis-ci +Follow these steps to link travis-ci with your github fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://travis-ci.org/ +3. Click 'Sign in with Github' on the top right +4. Click 'Authorize travis-ci' +5. Click 'Activate all repositories using Github Apps' +6. Select 'Only select repositories' and select your fork of zstd from the drop down +7. Click 'Approve and Install' +8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard) +9. Click 'Authorize travis-pro' +10. You should have travis set up on your fork now. + +### circle-ci +TODO + +### appveyor +Follow these steps to link circle-ci with your girhub fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://www.appveyor.com/ +3. Click 'Sign in' on the top right +4. Select 'Github' on the left panel +5. Click 'Authorize appveyor' +6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted +7. You should have appveyor set up on your fork now. + +### General notes on CI +CI tests run every time a pull request (PR) is created or updated. The exact tests +that get run will depend on the destination branch you specify. Some tests take +longer to run than others. Currently, our CI is set up to run a short +series of tests when creating a PR to the dev branch and a longer series of tests +when creating a PR to the master branch. You can look in the configuration files +of the respective CI platform for more information on what gets run when. + +Most people will just want to create a PR with the destination set to their local dev +branch of zstd. You can then find the status of the tests on the PR's page. You can also +re-run tests and cancel running tests from the PR page or from the respective CI's dashboard. + ## Issues We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue. @@ -34,7 +384,7 @@ Facebook has a [bounty program](https://www.facebook.c disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. -## Coding Style +## Coding Style * 4 spaces for indentation rather than tabs ## License Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ PRGDIR = programs @@ -17,7 +18,16 @@ FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null -ifneq (,$(filter Windows%,$(OS))) +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) EXT =.exe else EXT = @@ -35,7 +45,7 @@ allmost: allzstd zlibwrapper # skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd -allzstd: lib +allzstd: lib-all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -45,7 +55,7 @@ all32: $(MAKE) -C $(TESTDIR) all32 .PHONY: lib lib-release libzstd.a -lib lib-release : +lib lib-release lib-all : @$(MAKE) -C $(ZSTDDIR) $@ .PHONY: zstd zstd-release @@ -80,6 +90,13 @@ shortest: .PHONY: check check: shortest +.PHONY: automated_benchmarking +automated_benchmarking: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: benchmarking +benchmarking: automated_benchmarking + ## examples: build all examples in `/examples` directory .PHONY: examples examples: lib @@ -101,7 +118,8 @@ contrib: lib $(MAKE) -C contrib/pzstd all $(MAKE) -C contrib/seekable_format/examples all $(MAKE) -C contrib/largeNbDicts all - cd contrib/single_file_decoder/ ; ./build_test.sh + cd contrib/single_file_libs/ ; ./build_decoder_test.sh + cd contrib/single_file_libs/ ; ./build_library_test.sh .PHONY: cleanTabs cleanTabs: @@ -337,7 +355,7 @@ endif ifneq (,$(filter MSYS%,$(shell uname))) HOST_OS = MSYS -CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON endif @@ -349,11 +367,15 @@ cmakebuild: cmake --version $(RM) -r $(BUILDIR)/cmake/build mkdir $(BUILDIR)/cmake/build - cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. + $(MAKE) -C $(BUILDIR)/cmake/build -j4; + $(MAKE) -C $(BUILDIR)/cmake/build install; + $(MAKE) -C $(BUILDIR)/cmake/build uninstall; + cd $(BUILDIR)/cmake/build; ctest -V -L Medium -c90build: clean +c89build: clean $(CC) -v - CFLAGS="-std=c90 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` + CFLAGS="-std=c89 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean $(CC) -v Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/README.md Sat May 23 21:23:46 2020 (r361426) @@ -31,10 +31,10 @@ a list of known ports and bindings is provided on [Zst ## Benchmarks For reference, several fast compression algorithms were tested and compared -on a server running Arch Linux (`Linux version 5.0.5-arch1-1`), +on a server running Arch Linux (`Linux version 5.5.11-arch1-1`), with a Core i9-9900K CPU @ 5.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with [gcc] 8.2.1, +compiled with [gcc] 9.3.0, on the [Silesia compression corpus]. [lzbench]: https://github.com/inikep/lzbench @@ -43,18 +43,26 @@ on the [Silesia compression corpus]. | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | -| **zstd 1.4.0 -1** | 2.884 | 530 MB/s | 1360 MB/s | -| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 440 MB/s | -| brotli 1.0.7 -0 | 2.701 | 430 MB/s | 470 MB/s | -| quicklz 1.5.0 -1 | 2.238 | 600 MB/s | 800 MB/s | -| lzo1x 2.09 -1 | 2.106 | 680 MB/s | 950 MB/s | -| lz4 1.8.3 | 2.101 | 800 MB/s | 4220 MB/s | -| snappy 1.1.4 | 2.073 | 580 MB/s | 2020 MB/s | -| lzf 3.6 -1 | 2.077 | 440 MB/s | 930 MB/s | +| **zstd 1.4.5 -1** | 2.884 | 500 MB/s | 1660 MB/s | +| zlib 1.2.11 -1 | 2.743 | 90 MB/s | 400 MB/s | +| brotli 1.0.7 -0 | 2.703 | 400 MB/s | 450 MB/s | +| **zstd 1.4.5 --fast=1** | 2.434 | 570 MB/s | 2200 MB/s | +| **zstd 1.4.5 --fast=3** | 2.312 | 640 MB/s | 2300 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 560 MB/s | 710 MB/s | +| **zstd 1.4.5 --fast=5** | 2.178 | 700 MB/s | 2420 MB/s | +| lzo1x 2.10 -1 | 2.106 | 690 MB/s | 820 MB/s | +| lz4 1.9.2 | 2.101 | 740 MB/s | 4530 MB/s | +| **zstd 1.4.5 --fast=7** | 2.096 | 750 MB/s | 2480 MB/s | +| lzf 3.6 -1 | 2.077 | 410 MB/s | 860 MB/s | +| snappy 1.1.8 | 2.073 | 560 MB/s | 1790 MB/s | [zlib]: http://www.zlib.net/ [LZ4]: http://www.lz4.org/ +The negative compression levels, specified with `--fast=#`, +offer faster compression and decompression speed in exchange for some loss in +compression ratio compared to level 1, as seen in the table above. + Zstd can also offer stronger compression ratios at the cost of compression speed. Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, @@ -142,6 +150,18 @@ You can also take a look at [`.travis.yml`](.travis.ym example about how Meson is used to build this project. Note that default build type is **release**. + +### VCPKG +You can build and install zstd [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install zstd + +The zstd port in vcpkg is kept up to date by Microsoft team members and community contributors. +If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ### Visual Studio (Windows) Modified: head/sys/contrib/zstd/TESTING.md ============================================================================== --- head/sys/contrib/zstd/TESTING.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/TESTING.md Sat May 23 21:23:46 2020 (r361426) @@ -11,7 +11,7 @@ They consist of the following tests: - Compilation on all supported targets (x86, x86_64, ARM, AArch64, PowerPC, and PowerPC64) - Compilation on various versions of gcc, clang, and g++ - `tests/playTests.sh` on x86_64, without the tests on long data (CLI tests) -- Small tests (`tests/legacy.c`, `tests/longmatch.c`, `tests/symbols.c`) on x64_64 +- Small tests (`tests/legacy.c`, `tests/longmatch.c`) on x64_64 Medium Tests ------------ @@ -19,7 +19,7 @@ Medium tests run on every commit and pull request to ` They consist of the following tests: - The following tests run with UBsan and Asan on x86_64 and x86, as well as with Msan on x86_64 - - `tests/playTests.sh --test-long-data` + - `tests/playTests.sh --test-large-data` - Fuzzer tests: `tests/fuzzer.c`, `tests/zstreamtest.c`, and `tests/decodecorpus.c` - `tests/zstreamtest.c` under Tsan (streaming mode, including multithreaded mode) - Valgrind Test (`make -C tests valgrindTest`) (testing CLI and fuzzer under valgrind) Modified: head/sys/contrib/zstd/appveyor.yml ============================================================================== --- head/sys/contrib/zstd/appveyor.yml Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/appveyor.yml Sat May 23 21:23:46 2020 (r361426) @@ -14,7 +14,7 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" @@ -169,7 +169,8 @@ - SET "FUZZERTEST=-T30s" - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( CD tests && - SET ZSTD=./zstd.exe && + SET ZSTD_BIN=./zstd.exe&& + SET DATAGEN_BIN=./datagen.exe&& sh -e playTests.sh --test-large-data && fullbench.exe -i1 && fullbench.exe -i1 -P0 && @@ -188,6 +189,9 @@ environment: matrix: - COMPILER: "gcc" + HOST: "cygwin" + PLATFORM: "x64" + - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" SCRIPT: "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2" @@ -220,6 +224,14 @@ install: - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION% - SET PATH_ORIGINAL=%PATH% + - if [%HOST%]==[cygwin] ( + ECHO Installing Cygwin Packages && + C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^ + gcc-g++,^ + gcc,^ + cmake,^ + make + ) - if [%HOST%]==[mingw] ( SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" && SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" && @@ -232,6 +244,17 @@ build_script: - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION% + - if [%HOST%]==[cygwin] ( + set CHERE_INVOKING=yes && + set CC=%COMPILER% && + C:\cygwin64\bin\bash --login -c " + set -e; + cd build/cmake; + CFLAGS='-Werror' cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_FUZZER_FLAGS=-T30s -DZSTD_ZSTREAM_FLAGS=-T30s .; + make -j4; + ctest -V -L Medium; + " + ) - if [%HOST%]==[mingw] ( ( if [%PLATFORM%]==[x64] ( SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%" Modified: head/sys/contrib/zstd/doc/educational_decoder/Makefile ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ ZSTD ?= zstd # note: requires zstd installation on local system @@ -36,7 +37,7 @@ harness: $(HARNESS_FILES) $(CC) $(FLAGS) $^ -o $@ clean: - @$(RM) harness + @$(RM) harness *.o @$(RM) -rf harness.dSYM # MacOS specific test: harness @@ -59,4 +60,3 @@ test: harness @./harness tmp.zst tmp dictionary @$(DIFF) -s tmp README.md @$(RM) tmp* dictionary - @$(MAKE) clean Modified: head/sys/contrib/zstd/doc/educational_decoder/README.md ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/README.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/README.md Sat May 23 21:23:46 2020 (r361426) @@ -13,6 +13,13 @@ It also contains implementations of Huffman and FSE ta [Zstandard format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md [format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md +While the library's primary objective is code clarity, +it also happens to compile into a small object file. +The object file can be made even smaller by removing error messages, +using the macro directive `ZDEC_NO_MESSAGE` at compilation time. +This can be reduced even further by foregoing dictionary support, +by defining `ZDEC_NO_DICTIONARY`. + `harness.c` provides a simple test harness around the decoder: harness [dictionary] Modified: head/sys/contrib/zstd/doc/educational_decoder/harness.c ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/harness.c Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/harness.c Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #include @@ -21,108 +22,98 @@ typedef unsigned char u8; // Protect against allocating too much memory for output #define MAX_OUTPUT_SIZE ((size_t)1024 * 1024 * 1024) -static size_t read_file(const char *path, u8 **ptr) +// Error message then exit +#define ERR_OUT(...) { fprintf(stderr, __VA_ARGS__); exit(1); } + + +typedef struct { + u8* address; + size_t size; +} buffer_s; + +static void freeBuffer(buffer_s b) { free(b.address); } + +static buffer_s read_file(const char *path) { FILE* const f = fopen(path, "rb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); fseek(f, 0L, SEEK_END); size_t const size = (size_t)ftell(f); rewind(f); - *ptr = malloc(size); - if (!ptr) { - fprintf(stderr, "failed to allocate memory to hold %s \n", path); - exit(1); - } + void* const ptr = malloc(size); + if (!ptr) ERR_OUT("failed to allocate memory to hold %s \n", path); - size_t const read = fread(*ptr, 1, size, f); - if (read != size) { /* must read everything in one pass */ - fprintf(stderr, "error while reading file %s \n", path); - exit(1); - } + size_t const read = fread(ptr, 1, size, f); + if (read != size) ERR_OUT("error while reading file %s \n", path); fclose(f); - - return read; + buffer_s const b = { ptr, size }; + return b; } -static void write_file(const char *path, const u8 *ptr, size_t size) +static void write_file(const char* path, const u8* ptr, size_t size) { FILE* const f = fopen(path, "wb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); size_t written = 0; while (written < size) { written += fwrite(ptr+written, 1, size, f); - if (ferror(f)) { - fprintf(stderr, "error while writing file %s\n", path); - exit(1); - } } + if (ferror(f)) ERR_OUT("error while writing file %s\n", path); + } fclose(f); } int main(int argc, char **argv) { - if (argc < 3) { - fprintf(stderr, "usage: %s [dictionary] \n", - argv[0]); + if (argc < 3) + ERR_OUT("usage: %s [dictionary] \n", argv[0]); - return 1; - } + buffer_s const input = read_file(argv[1]); - u8* input; - size_t const input_size = read_file(argv[1], &input); - - u8* dict = NULL; - size_t dict_size = 0; + buffer_s dict = { NULL, 0 }; if (argc >= 4) { - dict_size = read_file(argv[3], &dict); + dict = read_file(argv[3]); } - size_t out_capacity = ZSTD_get_decompressed_size(input, input_size); + size_t out_capacity = ZSTD_get_decompressed_size(input.address, input.size); if (out_capacity == (size_t)-1) { - out_capacity = MAX_COMPRESSION_RATIO * input_size; + out_capacity = MAX_COMPRESSION_RATIO * input.size; fprintf(stderr, "WARNING: Compressed data does not contain " "decompressed size, going to assume the compression " "ratio is at most %d (decompressed size of at most " "%u) \n", MAX_COMPRESSION_RATIO, (unsigned)out_capacity); } - if (out_capacity > MAX_OUTPUT_SIZE) { - fprintf(stderr, - "Required output size too large for this implementation \n"); - return 1; - } + if (out_capacity > MAX_OUTPUT_SIZE) + ERR_OUT("Required output size too large for this implementation \n"); u8* const output = malloc(out_capacity); - if (!output) { - fprintf(stderr, "failed to allocate memory \n"); - return 1; - } + if (!output) ERR_OUT("failed to allocate memory \n"); dictionary_t* const parsed_dict = create_dictionary(); - if (dict) { - parse_dictionary(parsed_dict, dict, dict_size); + if (dict.size) { +#if defined (ZDEC_NO_DICTIONARY) + printf("dict.size = %zu \n", dict.size); + ERR_OUT("no dictionary support \n"); +#else + parse_dictionary(parsed_dict, dict.address, dict.size); +#endif } size_t const decompressed_size = ZSTD_decompress_with_dict(output, out_capacity, - input, input_size, + input.address, input.size, parsed_dict); free_dictionary(parsed_dict); write_file(argv[2], output, decompressed_size); - free(input); + freeBuffer(input); + freeBuffer(dict); free(output); - free(dict); return 0; } Modified: head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Sat May 23 21:23:46 2020 (r361426) @@ -1,34 +1,52 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /// Zstandard educational decoder implementation /// See https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md -#include -#include -#include -#include +#include // uint8_t, etc. +#include // malloc, free, exit +#include // fprintf +#include // memset, memcpy #include "zstd_decompress.h" -/******* UTILITY MACROS AND TYPES *********************************************/ -// Max block size decompressed size is 128 KB and literal blocks can't be -// larger than their block -#define MAX_LITERALS_SIZE ((size_t)128 * 1024) +/******* IMPORTANT CONSTANTS *********************************************/ + +// Zstandard frame +// "Magic_Number +// 4 Bytes, little-endian format. Value : 0xFD2FB528" +#define ZSTD_MAGIC_NUMBER 0xFD2FB528U + +// The size of `Block_Content` is limited by `Block_Maximum_Size`, +#define ZSTD_BLOCK_SIZE_MAX ((size_t)128 * 1024) + +// literal blocks can't be larger than their block +#define MAX_LITERALS_SIZE ZSTD_BLOCK_SIZE_MAX + + +/******* UTILITY MACROS AND TYPES *********************************************/ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#if defined(ZDEC_NO_MESSAGE) +#define MESSAGE(...) +#else +#define MESSAGE(...) fprintf(stderr, "" __VA_ARGS__) +#endif + /// This decoder calls exit(1) when it encounters an error, however a production /// library should propagate error codes #define ERROR(s) \ do { \ - fprintf(stderr, "Error: %s\n", s); \ + MESSAGE("Error: %s\n", s); \ exit(1); \ } while (0) #define INP_SIZE() \ @@ -39,12 +57,12 @@ #define BAD_ALLOC() ERROR("Memory allocation error") #define IMPOSSIBLE() ERROR("An impossibility has occurred") -typedef uint8_t u8; +typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int8_t i8; +typedef int8_t i8; typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; @@ -176,10 +194,6 @@ static void HUF_init_dtable_usingweights(HUF_dtable *c /// Free the malloc'ed parts of a decoding table static void HUF_free_dtable(HUF_dtable *const dtable); - -/// Deep copy a decoding table, so that it can be used and free'd without -/// impacting the source table. -static void HUF_copy_dtable(HUF_dtable *const dst, const HUF_dtable *const src); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat May 23 23:10:04 2020 Return-Path: Delivered-To: svn-src-head@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 55A082F0261; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TzbJ0vb7z3Zsg; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19B5E1763A; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NNA3XJ040505; Sat, 23 May 2020 23:10:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NNA3fb040504; Sat, 23 May 2020 23:10:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232310.04NNA3fb040504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 23:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361427 - head/sys/contrib/zstd/lib/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/common X-SVN-Commit-Revision: 361427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 23:10:04 -0000 Author: cem Date: Sat May 23 23:10:03 2020 New Revision: 361427 URL: https://svnweb.freebsd.org/changeset/base/361427 Log: Unbreak ARM64 kernel build after r361426 X-MFC-With: r361426 Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h ============================================================================== --- head/sys/contrib/zstd/lib/common/zstd_internal.h Sat May 23 21:23:46 2020 (r361426) +++ head/sys/contrib/zstd/lib/common/zstd_internal.h Sat May 23 23:10:03 2020 (r361427) @@ -19,7 +19,7 @@ /*-************************************* * Dependencies ***************************************/ -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) #include #endif #include "compiler.h" @@ -228,7 +228,7 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG * Shared functions to include for inlining *********************************************/ static void ZSTD_copy8(void* dst, const void* src) { -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src)); #else memcpy(dst, src, 8); @@ -237,7 +237,7 @@ static void ZSTD_copy8(void* dst, const void* src) { #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } static void ZSTD_copy16(void* dst, const void* src) { -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src)); #else memcpy(dst, src, 16);