From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:27:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36F52642CA8; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvNH15zyz4qYK; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E3D14FD3; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570RwOc045622; Mon, 7 Jun 2021 00:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570RwYK045621; Mon, 7 Jun 2021 00:27:58 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:27:58 GMT Message-Id: <202106070027.1570RwYK045621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 920d813451e8 - stable/13 - vfs: fix MNT_SYNCHRONOUS check in vn_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 920d813451e80c1566fe6bc76a9a9989914bb52a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:27:59 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=920d813451e80c1566fe6bc76a9a9989914bb52a commit 920d813451e80c1566fe6bc76a9a9989914bb52a Author: Rich Ercolani AuthorDate: 2021-06-02 13:00:29 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:27:37 +0000 vfs: fix MNT_SYNCHRONOUS check in vn_write ca1ce50b2b5ef11d ("vfs: add more safety against concurrent forced unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS if O_FSYNC is set. Reviewed By: mjg Differential Revision: https://reviews.freebsd.org/D30610 (cherry picked from commit a19ae1b099ad4d43588f15ef19b8506f606b27cb) --- sys/kern/vfs_vnops.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6bf798cd73c5..4ce4678f292f 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1122,11 +1122,12 @@ vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - if (fp->f_flag & O_FSYNC) { - mp = atomic_load_ptr(&vp->v_mount); - if (mp != NULL && mp->mnt_flag & MNT_SYNCHRONOUS) - ioflag |= IO_SYNC; - } + + mp = atomic_load_ptr(&vp->v_mount); + if ((fp->f_flag & O_FSYNC) || + (mp != NULL && (mp->mnt_flag & MNT_SYNCHRONOUS))) + ioflag |= IO_SYNC; + /* * For O_DSYNC we set both IO_SYNC and IO_DATASYNC, so that VOP_WRITE() * implementations that don't understand IO_DATASYNC fall back to full From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:30:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ABDD643006; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvQc40Zlz4qq8; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 719264CDB; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570U0NT046276; Mon, 7 Jun 2021 00:30:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570U0w7046265; Mon, 7 Jun 2021 00:30:00 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:30:00 GMT Message-Id: <202106070030.1570U0w7046265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 033820ace724 - stable/13 - nfs: even up value returned by nfsrv_parsename with copyinstr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 033820ace7241fce49066a88c622d15a194fac00 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:30:00 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=033820ace7241fce49066a88c622d15a194fac00 commit 033820ace7241fce49066a88c622d15a194fac00 Author: Mateusz Guzik AuthorDate: 2021-05-31 16:32:04 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:29:38 +0000 nfs: even up value returned by nfsrv_parsename with copyinstr Reported by: dim Reviewed by: rmacklem (cherry picked from commit 68c254426467e3f900f9a19de4dd9a234ea75388) --- sys/fs/nfsserver/nfs_nfsdsubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index 49c5cac999c7..d407dad8367d 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -2064,7 +2064,7 @@ nfsrv_parsename(struct nfsrv_descript *nd, char *bufp, u_long *hashp, } } *tocp = '\0'; - *outlenp = (size_t)outlen; + *outlenp = (size_t)outlen + 1; if (hashp != NULL) *hashp = hash; nfsmout: From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:30:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D040D642F6C; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvQd4qmTz4qh2; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5DD539E; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570U1jI047557; Mon, 7 Jun 2021 00:30:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570U1CK047546; Mon, 7 Jun 2021 00:30:01 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:30:01 GMT Message-Id: <202106070030.1570U1CK047546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 997332f9cda6 - stable/13 - ext2: add missing uio_td initialization to ext2_htree_append_block MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 997332f9cda66d7c42d51daac92e6e8ca83ed7a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:30:01 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=997332f9cda66d7c42d51daac92e6e8ca83ed7a0 commit 997332f9cda66d7c42d51daac92e6e8ca83ed7a0 Author: Mateusz Guzik AuthorDate: 2021-05-30 17:14:02 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:29:49 +0000 ext2: add missing uio_td initialization to ext2_htree_append_block Reported by: pho (cherry picked from commit 284cf3f18b5395e29e128702d50342d706813773) --- sys/fs/ext2fs/ext2_htree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/ext2fs/ext2_htree.c b/sys/fs/ext2fs/ext2_htree.c index 44120940236a..84f3d26d252a 100644 --- a/sys/fs/ext2fs/ext2_htree.c +++ b/sys/fs/ext2fs/ext2_htree.c @@ -439,6 +439,7 @@ ext2_htree_append_block(struct vnode *vp, char *data, auio.uio_iovcnt = 1; auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = NULL; error = VOP_WRITE(vp, &auio, IO_SYNC, cnp->cn_cred); if (!error) dp->i_size = newsize; From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76642643391; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfL2k6cz4r7h; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B21570D; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eAER062027; Mon, 7 Jun 2021 00:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eAKW062024; Mon, 7 Jun 2021 00:40:10 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:10 GMT Message-Id: <202106070040.1570eAKW062024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0917d91b3344 - stable/13 - umtx: convert umtxq_lock to a macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0917d91b33444ca55b132954cc33f0d409f5a4cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:10 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0917d91b33444ca55b132954cc33f0d409f5a4cc commit 0917d91b33444ca55b132954cc33f0d409f5a4cc Author: Mateusz Guzik AuthorDate: 2021-05-22 20:51:37 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:52 +0000 umtx: convert umtxq_lock to a macro Then LOCK_PROFILING starts reporting callers instead of the inline. (cherry picked from commit 138f78e94bf83a8a92987d8be81f1e2c6c277cf8) --- sys/kern/kern_umtx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 784c10cb97ac..a1dca77fe991 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -272,7 +272,6 @@ static void umtx_shm_init(void); static void umtxq_sysinit(void *); static void umtxq_hash(struct umtx_key *key); static struct umtxq_chain *umtxq_getchain(struct umtx_key *key); -static void umtxq_lock(struct umtx_key *key); static void umtxq_unlock(struct umtx_key *key); static void umtxq_busy(struct umtx_key *key); static void umtxq_unbusy(struct umtx_key *key); @@ -501,15 +500,16 @@ umtxq_getchain(struct umtx_key *key) /* * Lock a chain. + * + * The code is a macro so that file/line information is taken from the caller. */ -static inline void -umtxq_lock(struct umtx_key *key) -{ - struct umtxq_chain *uc; - - uc = umtxq_getchain(key); - mtx_lock(&uc->uc_lock); -} +#define umtxq_lock(key) do { \ + struct umtx_key *_key = (key); \ + struct umtxq_chain *_uc; \ + \ + _uc = umtxq_getchain(_key); \ + mtx_lock(&_uc->uc_lock); \ +} while (0) /* * Unlock a chain. From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B722643439; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfM31T5z4rM0; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51142570E; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eB8k062288; Mon, 7 Jun 2021 00:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eBUK062285; Mon, 7 Jun 2021 00:40:11 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:11 GMT Message-Id: <202106070040.1570eBUK062285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 5d745b399d31 - stable/13 - vfs: elide vnode locking when it is only needed for audit if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d745b399d31c0a48b634e7eae6786ba2675194b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:11 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d745b399d31c0a48b634e7eae6786ba2675194b commit 5d745b399d31c0a48b634e7eae6786ba2675194b Author: Mateusz Guzik AuthorDate: 2021-05-23 19:28:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:52 +0000 vfs: elide vnode locking when it is only needed for audit if possible (cherry picked from commit a269183875f6d5141c81277d41b552871e2171e5) --- sys/kern/vfs_syscalls.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 26a8d31e4456..c18bb56fc632 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2802,9 +2802,11 @@ sys_fchflags(struct thread *td, struct fchflags_args *uap) if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setfflags(td, fp->f_vnode, uap->flags); fdrop(fp, td); @@ -3303,9 +3305,11 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); fdrop(fp, td); @@ -3337,9 +3341,11 @@ kern_futimens(struct thread *td, int fd, struct timespec *tptr, if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setutimes(td, fp->f_vnode, ts, 2, flags & UTIMENS_NULL); fdrop(fp, td); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 010B66431B0; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfN4R1Bz4rM5; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 706A1536F; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eClk062777; Mon, 7 Jun 2021 00:40:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eC6A062772; Mon, 7 Jun 2021 00:40:12 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:12 GMT Message-Id: <202106070040.1570eC6A062772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 666584a04da8 - stable/13 - proc: add PROC_WAIT_UNLOCKED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 666584a04da84b6dae7a19b7525b23effd5060b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:13 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=666584a04da84b6dae7a19b7525b23effd5060b6 commit 666584a04da84b6dae7a19b7525b23effd5060b6 Author: Mateusz Guzik AuthorDate: 2021-05-27 14:29:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:53 +0000 proc: add PROC_WAIT_UNLOCKED (cherry picked from commit 528f8f38953d92aa917cbe70d3c72d89440624ca) --- sys/sys/proc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 05fdc83fd1e2..7a2210778a39 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -901,6 +901,7 @@ extern pid_t pid_max; #define PROC_TRYLOCK(p) mtx_trylock(&(p)->p_mtx) #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) #define PROC_LOCKED(p) mtx_owned(&(p)->p_mtx) +#define PROC_WAIT_UNLOCKED(p) mtx_wait_unlocked(&(p)->p_mtx) #define PROC_LOCK_ASSERT(p, type) mtx_assert(&(p)->p_mtx, (type)) /* Lock and unlock a process group. */ From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCC0564343A; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfP4nb9z4r7s; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891CD53C4; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eDFf063286; Mon, 7 Jun 2021 00:40:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eD36063282; Mon, 7 Jun 2021 00:40:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:13 GMT Message-Id: <202106070040.1570eD36063282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: b1203ecc7bb5 - stable/13 - vfs: retire unused vn_seqc_write_begin_unheld* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1203ecc7bb520b9ea2d4fac97439948317e4768 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:14 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b1203ecc7bb520b9ea2d4fac97439948317e4768 commit b1203ecc7bb520b9ea2d4fac97439948317e4768 Author: Mateusz Guzik AuthorDate: 2021-05-29 02:26:19 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:54 +0000 vfs: retire unused vn_seqc_write_begin_unheld* (cherry picked from commit 3cf75ca220fb6a9006fa0481b97e154602f6f554) --- sys/kern/vfs_subr.c | 21 ++------------------- sys/sys/vnode.h | 2 -- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3e6d11624197..bd4413edcb40 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6824,25 +6824,17 @@ vn_dir_check_exec(struct vnode *vp, struct componentname *cnp) * to prevent the vnode from getting freed. */ void -vn_seqc_write_begin_unheld_locked(struct vnode *vp) +vn_seqc_write_begin_locked(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); + VNPASS(vp->v_holdcnt > 0, vp); VNPASS(vp->v_seqc_users >= 0, vp); vp->v_seqc_users++; if (vp->v_seqc_users == 1) seqc_sleepable_write_begin(&vp->v_seqc); } -void -vn_seqc_write_begin_locked(struct vnode *vp) -{ - - ASSERT_VI_LOCKED(vp, __func__); - VNPASS(vp->v_holdcnt > 0, vp); - vn_seqc_write_begin_unheld_locked(vp); -} - void vn_seqc_write_begin(struct vnode *vp) { @@ -6852,15 +6844,6 @@ vn_seqc_write_begin(struct vnode *vp) VI_UNLOCK(vp); } -void -vn_seqc_write_begin_unheld(struct vnode *vp) -{ - - VI_LOCK(vp); - vn_seqc_write_begin_unheld_locked(vp); - VI_UNLOCK(vp); -} - void vn_seqc_write_end_locked(struct vnode *vp) { diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index d26c8aa70d8e..f492b3389d0e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -785,8 +785,6 @@ int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, struct uio *uio); -void vn_seqc_write_begin_unheld_locked(struct vnode *vp); -void vn_seqc_write_begin_unheld(struct vnode *vp); void vn_seqc_write_begin_locked(struct vnode *vp); void vn_seqc_write_begin(struct vnode *vp); void vn_seqc_write_end_locked(struct vnode *vp); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84C9F6430AF; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfQ6nGjz4r5r; Mon, 7 Jun 2021 00:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99F2456E5; Mon, 7 Jun 2021 00:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eE8Q063797; Mon, 7 Jun 2021 00:40:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eE0i063790; Mon, 7 Jun 2021 00:40:14 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:14 GMT Message-Id: <202106070040.1570eE0i063790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2c2035ca3d12 - stable/13 - fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c2035ca3d125a1fc8b62d9942993a7d9803f236 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:15 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2c2035ca3d125a1fc8b62d9942993a7d9803f236 commit 2c2035ca3d125a1fc8b62d9942993a7d9803f236 Author: Mateusz Guzik AuthorDate: 2021-05-27 14:29:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:55 +0000 fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd (cherry picked from commit 9bfddb3ac4ce8a2fbd5bb212a263747343a931e7) --- sys/kern/kern_descrip.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 168bddda9c45..585f2124eab1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2200,13 +2200,28 @@ pdinit(struct pwddesc *pdp, bool keeplock) return (newpdp); } +/* + * Hold either filedesc or pwddesc of the passed process. + * + * The process lock is used to synchronize against the target exiting and + * freeing the data. + * + * Clearing can be ilustrated in 3 steps: + * 1. set the pointer to NULL. Either routine can race against it, hence + * atomic_load_ptr. + * 2. observe the process lock as not taken. Until then fdhold/pdhold can + * race to either still see the pointer or find NULL. It is still safe to + * grab a reference as clearing is stalled. + * 3. after the lock is observed as not taken, any fdhold/pdhold calls are + * guaranteed to see NULL, making it safe to finish clearing + */ static struct filedesc * fdhold(struct proc *p) { struct filedesc *fdp; PROC_LOCK_ASSERT(p, MA_OWNED); - fdp = p->p_fd; + fdp = atomic_load_ptr(&p->p_fd); if (fdp != NULL) refcount_acquire(&fdp->fd_holdcnt); return (fdp); @@ -2218,7 +2233,7 @@ pdhold(struct proc *p) struct pwddesc *pdp; PROC_LOCK_ASSERT(p, MA_OWNED); - pdp = p->p_pd; + pdp = atomic_load_ptr(&p->p_pd); if (pdp != NULL) refcount_acquire(&pdp->pd_refcount); return (pdp); @@ -2584,9 +2599,12 @@ fdescfree(struct thread *td) if (p->p_fdtol != NULL) fdclearlocks(td); - PROC_LOCK(p); - p->p_fd = NULL; - PROC_UNLOCK(p); + /* + * Check fdhold for an explanation. + */ + atomic_store_ptr(&p->p_fd, NULL); + atomic_thread_fence_seq_cst(); + PROC_WAIT_UNLOCKED(p); if (refcount_release(&fdp->fd_refcnt) == 0) return; @@ -2604,9 +2622,12 @@ pdescfree(struct thread *td) pdp = p->p_pd; MPASS(pdp != NULL); - PROC_LOCK(p); - p->p_pd = NULL; - PROC_UNLOCK(p); + /* + * Check pdhold for an explanation. + */ + atomic_store_ptr(&p->p_pd, NULL); + atomic_thread_fence_seq_cst(); + PROC_WAIT_UNLOCKED(p); pddrop(pdp); } From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3909B6433A5; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfS0Ckvz4rS2; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13C35517; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eFaJ064307; Mon, 7 Jun 2021 00:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eFrv064301; Mon, 7 Jun 2021 00:40:15 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:15 GMT Message-Id: <202106070040.1570eFrv064301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a1ef0386c94f - stable/13 - Fix up macro use in lim_cur MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:16 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff commit a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff Author: Mateusz Guzik AuthorDate: 2021-05-29 17:46:37 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:55 +0000 Fix up macro use in lim_cur (cherry picked from commit dde5c031ed0d93d080442b26133e9ea800bbcd22) --- sys/sys/resourcevar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h index e83b170ca291..d1c9e6d4985f 100644 --- a/sys/sys/resourcevar.h +++ b/sys/sys/resourcevar.h @@ -135,7 +135,7 @@ rlim_t lim_cur(struct thread *td, int which); int _which = (which); \ if (__builtin_constant_p(which) && which != RLIMIT_DATA && \ which != RLIMIT_STACK && which != RLIMIT_VMEM) { \ - _rlim = td->td_limit->pl_rlimit[which].rlim_cur; \ + _rlim = _td->td_limit->pl_rlimit[_which].rlim_cur; \ } else { \ _rlim = lim_cur(_td, _which); \ } \ From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09A41643490; Mon, 7 Jun 2021 00:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfS6Xqdz4r61; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3369570F; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eGjV064821; Mon, 7 Jun 2021 00:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eGqG064815; Mon, 7 Jun 2021 00:40:16 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:16 GMT Message-Id: <202106070040.1570eGqG064815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a138a50c75e4 - stable/13 - vfs: use the sentinel trick in locked lookup path parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a138a50c75e4d4c92ca09d098a6d660551beaae0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:17 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a138a50c75e4d4c92ca09d098a6d660551beaae0 commit a138a50c75e4d4c92ca09d098a6d660551beaae0 Author: Mateusz Guzik AuthorDate: 2021-05-25 17:34:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:56 +0000 vfs: use the sentinel trick in locked lookup path parsing (cherry picked from commit d81aefa8b7dd8cbeffeda541fca9962802404983) --- sys/kern/vfs_lookup.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 5336bf87ec68..e0b98c9f5661 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -850,6 +850,7 @@ lookup(struct nameidata *ndp) { char *cp; /* pointer into pathname argument */ char *prev_ni_next; /* saved ndp->ni_next */ + char *nulchar; /* location of '\0' in cn_pnbuf */ struct vnode *dp = NULL; /* the directory we are searching */ struct vnode *tdp; /* saved dp */ struct mount *mp; /* mount table entry */ @@ -909,9 +910,23 @@ dirloop: * cnp->cn_nameptr for callers that need the name. Callers needing * the name set the SAVENAME flag. When done, they assume * responsibility for freeing the pathname buffer. + * + * Store / as a temporary sentinel so that we only have one character + * to test for. Pathnames tend to be short so this should not be + * resulting in cache misses. */ - for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++) + nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; + KASSERT(*nulchar == '\0', + ("%s: expected nul at %p; string [%s]\n", __func__, nulchar, + cnp->cn_pnbuf)); + *nulchar = '/'; + for (cp = cnp->cn_nameptr; *cp != '/'; cp++) { + KASSERT(*cp != '\0', + ("%s: encountered unexpected nul; string [%s]\n", __func__, + cnp->cn_nameptr)); continue; + } + *nulchar = '\0'; cnp->cn_namelen = cp - cnp->cn_nameptr; if (cnp->cn_namelen > NAME_MAX) { error = ENAMETOOLONG; From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA93C6430C9; Mon, 7 Jun 2021 00:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfW2KTVz4r6M; Mon, 7 Jun 2021 00:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B8E5370; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eIc2065875; Mon, 7 Jun 2021 00:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eI1Y065869; Mon, 7 Jun 2021 00:40:18 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:18 GMT Message-Id: <202106070040.1570eI1Y065869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 32e5616359e5 - stable/13 - tmpfs: drop a redundant NULL check in tmpfs_alloc_vp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32e5616359e5e7551e7a97ec54ee110d4af7e250 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:19 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=32e5616359e5e7551e7a97ec54ee110d4af7e250 commit 32e5616359e5e7551e7a97ec54ee110d4af7e250 Author: Mateusz Guzik AuthorDate: 2021-05-29 01:10:53 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:58 +0000 tmpfs: drop a redundant NULL check in tmpfs_alloc_vp (cherry picked from commit 439d942b9e7ab4df2bb7a628602069d31788df17) --- sys/fs/tmpfs/tmpfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index df5bc12047be..322641b5b853 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -831,7 +831,7 @@ loop: * Make sure the vnode is still there after * getting the interlock to avoid racing a free. */ - if (node->tn_vnode == NULL || node->tn_vnode != vp) { + if (node->tn_vnode != vp) { vput(vp); TMPFS_NODE_LOCK(node); goto loop; From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 923226433E4; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfY2GNDz4r8Q; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CAD2517E; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eL1m066874; Mon, 7 Jun 2021 00:40:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eLjK066869; Mon, 7 Jun 2021 00:40:21 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:21 GMT Message-Id: <202106070040.1570eLjK066869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 4ece00cd403a - stable/13 - tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ece00cd403ac27ad304974f619cbdadf82d3c70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:21 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4ece00cd403ac27ad304974f619cbdadf82d3c70 commit 4ece00cd403ac27ad304974f619cbdadf82d3c70 Author: Mateusz Guzik AuthorDate: 2021-05-27 08:57:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:59 +0000 tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked (cherry picked from commit f4aa64528e4557cd18cdb376b0f88f4a34d69912) --- sys/fs/tmpfs/tmpfs_subr.c | 51 +++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 322641b5b853..b7dae82a71b4 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -578,53 +578,66 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, if (!last) return (false); + TMPFS_NODE_UNLOCK(node); + #ifdef INVARIANTS MPASS(node->tn_vnode == NULL); MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); -#endif - TMPFS_NODE_UNLOCK(node); - TMPFS_UNLOCK(tmp); + /* + * Make sure this is a node type we can deal with. Everything is explicitly + * enumerated without the 'default' clause so the the compiler can throw an + * error in case a new type is added. + */ switch (node->tn_type) { case VBLK: - /* FALLTHROUGH */ case VCHR: - /* FALLTHROUGH */ case VDIR: - /* FALLTHROUGH */ case VFIFO: - /* FALLTHROUGH */ case VSOCK: - break; - case VLNK: - symlink = node->tn_link_target; - atomic_store_ptr(&node->tn_link_target, NULL); - if (atomic_load_char(&node->tn_link_smr)) { - cache_symlink_free(symlink, node->tn_size + 1); - } else { - free(symlink, M_TMPFSNAME); - } + case VREG: break; + case VNON: + case VBAD: + case VMARKER: + panic("%s: bad type %d for node %p", __func__, (int)node->tn_type, node); + } +#endif + switch (node->tn_type) { case VREG: uobj = node->tn_reg.tn_aobj; if (uobj != NULL) { if (uobj->size != 0) atomic_subtract_long(&tmp->tm_pages_used, uobj->size); + } + + tmpfs_free_tmp(tmp); + + if (uobj != NULL) { KASSERT((uobj->flags & OBJ_TMPFS) == 0, ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); vm_object_deallocate(uobj); } break; + case VLNK: + tmpfs_free_tmp(tmp); + symlink = node->tn_link_target; + atomic_store_ptr(&node->tn_link_target, NULL); + if (atomic_load_char(&node->tn_link_smr)) { + cache_symlink_free(symlink, node->tn_size + 1); + } else { + free(symlink, M_TMPFSNAME); + } + break; default: - panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); + tmpfs_free_tmp(tmp); + break; } uma_zfree_smr(tmpfs_node_pool, node); - TMPFS_LOCK(tmp); - tmpfs_free_tmp(tmp); return (true); } From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 905D96430C2; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfV0WFhz4r6F; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEBF855A0; Mon, 7 Jun 2021 00:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eHCN065345; Mon, 7 Jun 2021 00:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eHU5065339; Mon, 7 Jun 2021 00:40:17 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:17 GMT Message-Id: <202106070040.1570eHU5065339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 71622a3518c4 - stable/13 - tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71622a3518c4350140ec4c19326e4ed9288b1092 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:18 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=71622a3518c4350140ec4c19326e4ed9288b1092 commit 71622a3518c4350140ec4c19326e4ed9288b1092 Author: Mateusz Guzik AuthorDate: 2021-05-29 15:38:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:57 +0000 tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent The id field is immutable until the node gets freed. (cherry picked from commit 7fbeaf33b8e1a5e69af42a77c78a6fcb3029f1ca) --- sys/fs/tmpfs/tmpfs_subr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 8b75c58d69a2..df5bc12047be 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1436,10 +1436,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct tmpfs_node *node, if (parent == NULL) return (ENOENT); - TMPFS_NODE_LOCK(parent); dent.d_fileno = parent->tn_id; - TMPFS_NODE_UNLOCK(parent); - dent.d_off = next; dent.d_type = DT_DIR; dent.d_namlen = 2; From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:40:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1831664336C; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfX1trrz4rMR; Mon, 7 Jun 2021 00:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1784B5518; Mon, 7 Jun 2021 00:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eJEB066374; Mon, 7 Jun 2021 00:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eJ7D066368; Mon, 7 Jun 2021 00:40:19 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:19 GMT Message-Id: <202106070040.1570eJ7D066368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 56687b27b87c - stable/13 - tmpfs: save on common case relocking in tmpfs_reclaim MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56687b27b87c6fcd3516e56595b0d153225cddd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:21 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=56687b27b87c6fcd3516e56595b0d153225cddd2 commit 56687b27b87c6fcd3516e56595b0d153225cddd2 Author: Mateusz Guzik AuthorDate: 2021-05-29 01:36:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:59 +0000 tmpfs: save on common case relocking in tmpfs_reclaim (cherry picked from commit 331a7601c9c21c1e55c57c5338e7affced9c7b7c) --- sys/fs/tmpfs/tmpfs_vnops.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 43a2aa77dbbb..5d0d80639046 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1525,26 +1525,18 @@ tmpfs_reclaim(struct vop_reclaim_args *v) struct vnode *vp; struct tmpfs_mount *tmp; struct tmpfs_node *node; - bool unlock, tm_locked; + bool unlock; vp = v->a_vp; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - tm_locked = false; if (vp->v_type == VREG) tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); vp->v_object = NULL; -relock: + TMPFS_LOCK(tmp); TMPFS_NODE_LOCK(node); - if (!tm_locked && node->tn_links == 0 && - (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { - TMPFS_NODE_UNLOCK(node); - TMPFS_LOCK(tmp); - tm_locked = true; - goto relock; - } tmpfs_free_vp(vp); /* @@ -1552,19 +1544,16 @@ relock: * we must free its associated data structures (now that the vnode * is being reclaimed). */ + unlock = true; if (node->tn_links == 0 && (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { - MPASS(tm_locked); node->tn_vpstate = TMPFS_VNODE_DOOMED; unlock = !tmpfs_free_node_locked(tmp, node, true); - } else { - unlock = true; } if (unlock) { TMPFS_NODE_UNLOCK(node); - if (tm_locked) - TMPFS_UNLOCK(tmp); + TMPFS_UNLOCK(tmp); } MPASS(vp->v_data == NULL); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED35A643AE6; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyvh06RzWz4rjK; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C61DD5723; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570fa71071212; Mon, 7 Jun 2021 00:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570faLK071211; Mon, 7 Jun 2021 00:41:36 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:41:36 GMT Message-Id: <202106070041.1570faLK071211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b556a0eebf4d - stable/13 - arm64: correct END() copy-pasteo for generic_bs_fault MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b556a0eebf4dd3179d744acdab276f77f61da30f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:41:37 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b556a0eebf4dd3179d744acdab276f77f61da30f commit b556a0eebf4dd3179d744acdab276f77f61da30f Author: Ed Maste AuthorDate: 2021-05-28 00:10:26 +0000 Commit: Ed Maste CommitDate: 2021-06-07 00:41:17 +0000 arm64: correct END() copy-pasteo for generic_bs_fault PR: 256197 Reported by: Nick Reilly MFC after: 1 week Fixes: 95a85c125d0e67 ("Add NetBSD compatible bus_space...") Sponsored by: The FreeBSD Foundation (cherry picked from commit d097687b315671191b16494c938d3ceecd3eca4f) --- sys/arm64/arm64/bus_space_asm.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/bus_space_asm.S b/sys/arm64/arm64/bus_space_asm.S index 53e104c7fb4f..1fac678df971 100644 --- a/sys/arm64/arm64/bus_space_asm.S +++ b/sys/arm64/arm64/bus_space_asm.S @@ -400,7 +400,7 @@ END(generic_bs_wr_8) ENTRY(generic_bs_fault) mov x0, #-1 ret -END(bus_fault) +END(generic_bs_fault) ENTRY(generic_bs_peek_1) .globl generic_bs_peek_1f From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 00:49:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24753643B5C; Mon, 7 Jun 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvsX0LRGz4rwR; Mon, 7 Jun 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E830B5734; Mon, 7 Jun 2021 00:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570npfh072799; Mon, 7 Jun 2021 00:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570npFM072798; Mon, 7 Jun 2021 00:49:51 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:49:51 GMT Message-Id: <202106070049.1570npFM072798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 70aba9512b53 - stable/13 - kqueue: replace kq_ncallouts loop with atomic_fetchadd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70aba9512b534a4b1a6601b8cbba1988da5b3718 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:49:52 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=70aba9512b534a4b1a6601b8cbba1988da5b3718 commit 70aba9512b534a4b1a6601b8cbba1988da5b3718 Author: Mateusz Guzik AuthorDate: 2021-06-02 15:14:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:49:46 +0000 kqueue: replace kq_ncallouts loop with atomic_fetchadd (cherry picked from commit c9f8dcda856c50325190326a618dc251311bc43a) --- sys/kern/kern_event.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 6b8ab11cb2dc..c277ac085d62 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -206,7 +206,7 @@ static struct filterops user_filtops = { }; static uma_zone_t knote_zone; -static unsigned int kq_ncallouts = 0; +static unsigned int __exclusive_cache_line kq_ncallouts; static unsigned int kq_calloutmax = 4 * 1024; SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW, &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue"); @@ -813,18 +813,16 @@ filt_timerattach(struct knote *kn) { struct kq_timer_cb_data *kc; sbintime_t to; - unsigned int ncallouts; int error; error = filt_timervalidate(kn, &to); if (error != 0) return (error); - do { - ncallouts = kq_ncallouts; - if (ncallouts >= kq_calloutmax) - return (ENOMEM); - } while (!atomic_cmpset_int(&kq_ncallouts, ncallouts, ncallouts + 1)); + if (atomic_fetchadd_int(&kq_ncallouts, 1) + 1 > kq_calloutmax) { + atomic_subtract_int(&kq_ncallouts, 1); + return (ENOMEM); + } if ((kn->kn_sfflags & NOTE_ABSTIME) == 0) kn->kn_flags |= EV_CLEAR; /* automatically set */ From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0ED66440A2; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8v456Qz4sKG; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750D95BBC; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713BII099076; Mon, 7 Jun 2021 01:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713BQZ099075; Mon, 7 Jun 2021 01:03:11 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:11 GMT Message-Id: <202106070103.15713BQZ099075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d330127c17ec - stable/13 - x86: Fix lapic_ipi_alloc() on i386 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d330127c17ecc2360916d3125d310b4bac17866c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:11 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d330127c17ecc2360916d3125d310b4bac17866c commit d330127c17ecc2360916d3125d310b4bac17866c Author: Mark Johnston AuthorDate: 2021-05-31 22:51:14 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:00:18 +0000 x86: Fix lapic_ipi_alloc() on i386 The loop which checks to see if "dynamic" IDT entries are allocated needs to compare with the trampoline address of the reserved ISR. Otherwise it will never succeed. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9) --- sys/x86/x86/local_apic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 65ea602c0101..28443c43cfc9 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2115,6 +2115,10 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ +#ifdef __i386__ +extern uintptr_t setidt_disp; +#endif + /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. @@ -2143,6 +2147,9 @@ native_lapic_ipi_alloc(inthand_t *ipifunc) for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) { ip = &idt[idx]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif if ((!pti && func == (uintptr_t)&IDTVEC(rsvd)) || (pti && func == (uintptr_t)&IDTVEC(rsvd_pti))) { vector = idx; @@ -2166,6 +2173,9 @@ native_lapic_ipi_free(int vector) mtx_lock_spin(&icu_lock); ip = &idt[vector]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif KASSERT(func != (uintptr_t)&IDTVEC(rsvd) && func != (uintptr_t)&IDTVEC(rsvd_pti), ("invalid idtfunc %#lx", func)); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DECBE643BF5; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8w58dkz4sWT; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D3F5946; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713CoR099097; Mon, 7 Jun 2021 01:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713Cgt099096; Mon, 7 Jun 2021 01:03:12 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:12 GMT Message-Id: <202106070103.15713Cgt099096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 10e697949ada - stable/13 - amd64: Avoid enabling interrupts when handling kernel mode prot faults MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10e697949adaf82070c67f375712b73c099e2017 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:13 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10e697949adaf82070c67f375712b73c099e2017 commit 10e697949adaf82070c67f375712b73c099e2017 Author: Mark Johnston AuthorDate: 2021-05-31 22:49:33 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:02:27 +0000 amd64: Avoid enabling interrupts when handling kernel mode prot faults When PTI is enabled, we may have been on the trampoline stack when iret faults. So, we have to switch back to the regular stack before re-entering trap(). trap() has the somewhat strange behaviour of re-enabling interrupts when handling certain kernel-mode execeptions. In particular, it was doing this for exceptions raised during execution of iret. When switching away from the trampoline stack, however, the thread must not be migrated to a different CPU. Fix the problem by simply leaving interrupts disabled during the window. Reported by: syzbot+6cfa544fd86ad4647ffc@syzkaller.appspotmail.com Reported by: syzbot+cfdfc9e5a8f28f11a7f5@syzkaller.appspotmail.com Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 4a59cbc1253266ea70d6fa43b1a7c77cc33ec6cd) --- sys/amd64/amd64/trap.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 4ce31ce47a45..cc0b8fcf6c17 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -236,25 +236,31 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (TRAPF_USERMODE(frame)) + if (TRAPF_USERMODE(frame)) { uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); - else if (type != T_NMI && type != T_BPTFLT && - type != T_TRCTRAP) { - /* - * XXX not quite right, since this may be for a - * multiple fault in user mode. - */ - printf("kernel trap %d with interrupts disabled\n", - type); - - /* - * We shouldn't enable interrupts while holding a - * spin lock. - */ - if (td->td_md.md_spinlock_count == 0) - enable_intr(); + } else { + switch (type) { + case T_NMI: + case T_BPTFLT: + case T_TRCTRAP: + case T_PROTFLT: + case T_SEGNPFLT: + case T_STKFLT: + break; + default: + printf( + "kernel trap %d with interrupts disabled\n", + type); + + /* + * We shouldn't enable interrupts while holding a + * spin lock. + */ + if (td->td_md.md_spinlock_count == 0) + enable_intr(); + } } } @@ -444,6 +450,8 @@ trap(struct trapframe *frame) * Magic '5' is the number of qwords occupied by * the hardware trap frame. */ + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); if (frame->tf_rip == (long)doreti_iret) { frame->tf_rip = (long)doreti_iret_fault; if ((PCPU_GET(curpmap)->pm_ucr3 != From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C8A4643BF7; Mon, 7 Jun 2021 01:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8x61Spz4sN1; Mon, 7 Jun 2021 01:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22DB5D91; Mon, 7 Jun 2021 01:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713DpF099125; Mon, 7 Jun 2021 01:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713D4H099124; Mon, 7 Jun 2021 01:03:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:13 GMT Message-Id: <202106070103.15713D4H099124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2a87d7c0139c - stable/13 - amd64: Relax the assertion added in commit 4a59cbc12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:14 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 commit 2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 Author: Mark Johnston AuthorDate: 2021-06-01 23:38:09 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:02:38 +0000 amd64: Relax the assertion added in commit 4a59cbc12 We only need to ensure that interrupts are disabled when handling a fault from iret. Otherwise it's possible to trigger the assertion legitimately, e.g., by copying in from an invalid address. Fixes: 4a59cbc12 Reported by: pho Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 6cda62755612d706f30a99f70ff13ffa0f3f2422) --- sys/amd64/amd64/trap.c | 70 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index cc0b8fcf6c17..e67e188bb4fd 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -172,6 +172,39 @@ SYSCTL_INT(_machdep, OID_AUTO, nmi_flush_l1d_sw, CTLFLAG_RWTUN, &nmi_flush_l1d_sw, 0, "Flush L1 Data Cache on NMI exit, software bhyve L1TF mitigation assist"); +/* + * Table of handlers for various segment load faults. + */ +static const struct { + uintptr_t faddr; + uintptr_t fhandler; +} sfhandlers[] = { + { + .faddr = (uintptr_t)ld_ds, + .fhandler = (uintptr_t)ds_load_fault, + }, + { + .faddr = (uintptr_t)ld_es, + .fhandler = (uintptr_t)es_load_fault, + }, + { + .faddr = (uintptr_t)ld_fs, + .fhandler = (uintptr_t)fs_load_fault, + }, + { + .faddr = (uintptr_t)ld_gs, + .fhandler = (uintptr_t)gs_load_fault, + }, + { + .faddr = (uintptr_t)ld_gsbase, + .fhandler = (uintptr_t)gsbase_load_fault + }, + { + .faddr = (uintptr_t)ld_fsbase, + .fhandler = (uintptr_t)fsbase_load_fault, + }, +}; + /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -186,6 +219,7 @@ trap(struct trapframe *frame) struct thread *td; struct proc *p; register_t addr, dr6; + size_t i; int pf, signo, ucode; u_int type; @@ -450,9 +484,9 @@ trap(struct trapframe *frame) * Magic '5' is the number of qwords occupied by * the hardware trap frame. */ - KASSERT((read_rflags() & PSL_I) == 0, - ("interrupts enabled")); if (frame->tf_rip == (long)doreti_iret) { + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); frame->tf_rip = (long)doreti_iret_fault; if ((PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3) && @@ -463,30 +497,16 @@ trap(struct trapframe *frame) } return; } - if (frame->tf_rip == (long)ld_ds) { - frame->tf_rip = (long)ds_load_fault; - return; - } - if (frame->tf_rip == (long)ld_es) { - frame->tf_rip = (long)es_load_fault; - return; - } - if (frame->tf_rip == (long)ld_fs) { - frame->tf_rip = (long)fs_load_fault; - return; - } - if (frame->tf_rip == (long)ld_gs) { - frame->tf_rip = (long)gs_load_fault; - return; - } - if (frame->tf_rip == (long)ld_gsbase) { - frame->tf_rip = (long)gsbase_load_fault; - return; - } - if (frame->tf_rip == (long)ld_fsbase) { - frame->tf_rip = (long)fsbase_load_fault; - return; + + for (i = 0; i < nitems(sfhandlers); i++) { + if (frame->tf_rip == sfhandlers[i].faddr) { + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); + frame->tf_rip = sfhandlers[i].fhandler; + return; + } } + if (curpcb->pcb_onfault != NULL) { frame->tf_rip = (long)curpcb->pcb_onfault; return; From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 487B9643FC3; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw931ZJvz4sNM; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F3415D6E; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713JPE099246; Mon, 7 Jun 2021 01:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713JAD099245; Mon, 7 Jun 2021 01:03:19 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:19 GMT Message-Id: <202106070103.15713JAD099245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cbced258dee4 - stable/12 - x86: Fix lapic_ipi_alloc() on i386 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cbced258dee43b4f65e62572aa2fcd67225eca20 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:19 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cbced258dee43b4f65e62572aa2fcd67225eca20 commit cbced258dee43b4f65e62572aa2fcd67225eca20 Author: Mark Johnston AuthorDate: 2021-05-31 22:51:14 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:00:32 +0000 x86: Fix lapic_ipi_alloc() on i386 The loop which checks to see if "dynamic" IDT entries are allocated needs to compare with the trampoline address of the reserved ISR. Otherwise it will never succeed. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9) --- sys/x86/x86/local_apic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 2a1c3ad56148..a34cfbb8b1c9 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2113,6 +2113,10 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ +#ifdef __i386__ +extern uintptr_t setidt_disp; +#endif + /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. @@ -2141,6 +2145,9 @@ native_lapic_ipi_alloc(inthand_t *ipifunc) for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) { ip = &idt[idx]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif if ((!pti && func == (uintptr_t)&IDTVEC(rsvd)) || (pti && func == (uintptr_t)&IDTVEC(rsvd_pti))) { vector = idx; @@ -2164,6 +2171,9 @@ native_lapic_ipi_free(int vector) mtx_lock_spin(&icu_lock); ip = &idt[vector]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif KASSERT(func != (uintptr_t)&IDTVEC(rsvd) && func != (uintptr_t)&IDTVEC(rsvd_pti), ("invalid idtfunc %#lx", func)); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 440796442E3; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw9k1KXLz4sl9; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CB85D92; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713rmX099394; Mon, 7 Jun 2021 01:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713rZc099393; Mon, 7 Jun 2021 01:03:53 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:53 GMT Message-Id: <202106070103.15713rZc099393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d1b7ff3dac57 - stable/13 - ffs: Correct the input size check in sysctl_ffs_fsck() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1b7ff3dac5727fba692e7de999e9b6834b72659 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:54 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d1b7ff3dac5727fba692e7de999e9b6834b72659 commit d1b7ff3dac5727fba692e7de999e9b6834b72659 Author: Mark Johnston AuthorDate: 2021-05-31 22:56:34 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:03:49 +0000 ffs: Correct the input size check in sysctl_ffs_fsck() Make sure we return an error if no input was specified, since SYSCTL_IN() will report success in that case. Reported by: KMSAN Reviewed by: mckusick Sponsored by: The FreeBSD Foundation (cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index c7a1e2dec15e..c895c8c7bf07 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3211,9 +3211,9 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) cap_rights_t rights; int filetype, error; - if (req->newlen > sizeof cmd) + if (req->newptr == NULL || req->newlen > sizeof(cmd)) return (EBADRPC); - if ((error = SYSCTL_IN(req, &cmd, sizeof cmd)) != 0) + if ((error = SYSCTL_IN(req, &cmd, sizeof(cmd))) != 0) return (error); if (cmd.version != FFS_CMD_VERSION) return (ERPCMISMATCH); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 01:03:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E780464407E; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw9n4cg5z4swS; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C475D6F; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713vri099512; Mon, 7 Jun 2021 01:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713vBP099511; Mon, 7 Jun 2021 01:03:57 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:57 GMT Message-Id: <202106070103.15713vBP099511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f9b3922257ba - stable/12 - ffs: Correct the input size check in sysctl_ffs_fsck() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f9b3922257ba343c824784f727da1805e71ce8d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f9b3922257ba343c824784f727da1805e71ce8d8 commit f9b3922257ba343c824784f727da1805e71ce8d8 Author: Mark Johnston AuthorDate: 2021-05-31 22:56:34 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:03:38 +0000 ffs: Correct the input size check in sysctl_ffs_fsck() Make sure we return an error if no input was specified, since SYSCTL_IN() will report success in that case. Reported by: KMSAN Reviewed by: mckusick Sponsored by: The FreeBSD Foundation (cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6d9b459ccfd7..842b88ec178c 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3153,9 +3153,9 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) int filetype, error; static struct fileops *origops, bufferedops; - if (req->newlen > sizeof cmd) + if (req->newptr == NULL || req->newlen > sizeof(cmd)) return (EBADRPC); - if ((error = SYSCTL_IN(req, &cmd, sizeof cmd)) != 0) + if ((error = SYSCTL_IN(req, &cmd, sizeof(cmd))) != 0) return (error); if (cmd.version != FFS_CMD_VERSION) return (ERPCMISMATCH); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 05:49:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B36364829B; Mon, 7 Jun 2021 05:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2Wj6zT9z3hqT; Mon, 7 Jun 2021 05:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC99115C1; Mon, 7 Jun 2021 05:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575nriQ072170; Mon, 7 Jun 2021 05:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575nrKL072169; Mon, 7 Jun 2021 05:49:53 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:49:53 GMT Message-Id: <202106070549.1575nrKL072169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: fc2d7fb643f8 - stable/13 - libalias: Remove unused function LibAliasCheckNewLink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc2d7fb643f83fff73b1038734b934fdafa946c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:49:54 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=fc2d7fb643f83fff73b1038734b934fdafa946c3 commit fc2d7fb643f83fff73b1038734b934fdafa946c3 Author: Lutz Donnerhacke AuthorDate: 2021-05-15 13:24:12 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-07 05:48:07 +0000 libalias: Remove unused function LibAliasCheckNewLink The functionality to detect a newly created link after processing a single packet is decoupled from the packet processing. Every new packet is processed asynchronously and will reset the indicator, hence the function is unusable. I made a Google search for third party code, which uses the function, and failed to find one. That's why the function should be removed: It unusable and unused. A much simplified API/ABI will remain in anything below 14. Discussed with: kp Reviewed by: manpages (bcr) Differential Revision: https://reviews.freebsd.org/D30275 (cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b) --- sys/netinet/libalias/alias.c | 2 -- sys/netinet/libalias/alias.h | 4 +++- sys/netinet/libalias/alias_db.c | 17 +++-------------- sys/netinet/libalias/alias_local.h | 4 ---- sys/netinet/libalias/libalias.3 | 12 +----------- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 0e2756affcb4..39e9b060623d 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1330,7 +1330,6 @@ LibAliasInLocked(struct libalias *la, struct ip *pip, int maxpacketsize) goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); alias_addr = pip->ip_dst; /* Defense against mangled packets */ @@ -1461,7 +1460,6 @@ LibAliasOutLocked(struct libalias *la, goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); /* Defense against mangled packets */ if (ntohs(pip->ip_len) > maxpacketsize diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 36f1ca168823..558a750b4fd8 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -120,10 +120,12 @@ void *LibAliasGetFragment(struct libalias *, void *_ptr); int LibAliasSaveFragment(struct libalias *, void *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); unsigned short LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); +/* never used and never worked, to be removed in FreeBSD 14 */ +int LibAliasCheckNewLink(struct libalias *); + /* Transparent proxying routines. */ int LibAliasProxyRule(struct libalias *, const char *_cmd); diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 7a84cf310d5a..0273cc84773d 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1675,7 +1675,6 @@ FindOriginalAddress(struct libalias *la, struct in_addr alias_addr) lnk = FindLinkIn(la, ANY_ADDR, alias_addr, 0, 0, LINK_ADDR, 0); if (lnk == NULL) { - la->newDefaultLink = 1; if (la->targetAddress.s_addr == INADDR_ANY) return (alias_addr); else if (la->targetAddress.s_addr == INADDR_NONE) @@ -2052,13 +2051,6 @@ SetExpire(struct alias_link *lnk, int expire) } } -void -ClearCheckNewLink(struct libalias *la) -{ - LIBALIAS_LOCK_ASSERT(la); - la->newDefaultLink = 0; -} - void SetProtocolFlags(struct alias_link *lnk, int pflags) { @@ -2548,15 +2540,12 @@ getout: return (res); } +/* never used and never worked, to be removed in FreeBSD 14 */ int LibAliasCheckNewLink(struct libalias *la) { - int res; - - LIBALIAS_LOCK(la); - res = la->newDefaultLink; - LIBALIAS_UNLOCK(la); - return (res); + (void)la; + return (0); } #ifndef NO_FW_PUNCH diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 63bfd857f14f..61cd30737ce5 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -118,9 +118,6 @@ struct libalias { #else FILE *logDesc; #endif - /* Indicates if a new aliasing link has been created - * after a call to PacketAliasIn/Out(). */ - int newDefaultLink; #ifndef NO_FW_PUNCH /* File descriptor to be able to control firewall. @@ -323,7 +320,6 @@ int GetDeltaSeqOut(u_long, struct alias_link *lnk); void AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off); void SetExpire (struct alias_link *_lnk, int _expire); -void ClearCheckNewLink(struct libalias *la); void SetProtocolFlags(struct alias_link *_lnk, int _pflags); int GetProtocolFlags(struct alias_link *_lnk); void SetDestCallId(struct alias_link *_lnk, u_int16_t _cid); diff --git a/sys/netinet/libalias/libalias.3 b/sys/netinet/libalias/libalias.3 index beef2ff7fca5..85ebe55f527c 100644 --- a/sys/netinet/libalias/libalias.3 +++ b/sys/netinet/libalias/libalias.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 2020 +.Dd May 31, 2021 .Dt LIBALIAS 3 .Os .Sh NAME @@ -863,16 +863,6 @@ This allows external machines to talk directly to internal machines if they can route packets to the machine in question. .Ed .Pp -.Ft int -.Fn LibAliasCheckNewLink "struct libalias *" -.Bd -ragged -offset indent -This function returns a non-zero value when a new aliasing link is created. -In circumstances where incoming traffic is being sequentially sent to -different local servers, this function can be used to trigger when -.Fn LibAliasSetTarget -is called to change the default target address. -.Ed -.Pp .Ft u_short .Fn LibAliasInternetChecksum "struct libalias *" "u_short *buffer" "int nbytes" .Bd -ragged -offset indent From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 05:52:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F5ED648508; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2Zz0sHFz3jCZ; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B0011A75; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575qgCr084672; Mon, 7 Jun 2021 05:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575qgWw084671; Mon, 7 Jun 2021 05:52:42 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:52:42 GMT Message-Id: <202106070552.1575qgWw084671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 09a6fc8dbe2e - stable/12 - libalias: Remove unused function LibAliasCheckNewLink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09a6fc8dbe2e96317d8f88d4179e436df73d59fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:52:43 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=09a6fc8dbe2e96317d8f88d4179e436df73d59fd commit 09a6fc8dbe2e96317d8f88d4179e436df73d59fd Author: Lutz Donnerhacke AuthorDate: 2021-05-15 13:24:12 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-07 05:51:57 +0000 libalias: Remove unused function LibAliasCheckNewLink The functionality to detect a newly created link after processing a single packet is decoupled from the packet processing. Every new packet is processed asynchronously and will reset the indicator, hence the function is unusable. I made a Google search for third party code, which uses the function, and failed to find one. That's why the function should be removed: It unusable and unused. A much simplified API/ABI will remain in anything below 14. Discussed with: kp Reviewed by: manpages (bcr) Differential Revision: https://reviews.freebsd.org/D30275 (cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b) --- sys/netinet/libalias/alias.c | 2 -- sys/netinet/libalias/alias.h | 4 +++- sys/netinet/libalias/alias_db.c | 17 +++-------------- sys/netinet/libalias/alias_local.h | 4 ---- sys/netinet/libalias/libalias.3 | 12 +----------- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 8a18c61b452e..030177eb622d 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1329,7 +1329,6 @@ LibAliasInLocked(struct libalias *la, struct ip *pip, int maxpacketsize) goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); alias_addr = pip->ip_dst; /* Defense against mangled packets */ @@ -1460,7 +1459,6 @@ LibAliasOutLocked(struct libalias *la, goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); /* Defense against mangled packets */ if (ntohs(pip->ip_len) > maxpacketsize diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 36f1ca168823..558a750b4fd8 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -120,10 +120,12 @@ void *LibAliasGetFragment(struct libalias *, void *_ptr); int LibAliasSaveFragment(struct libalias *, void *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); unsigned short LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); +/* never used and never worked, to be removed in FreeBSD 14 */ +int LibAliasCheckNewLink(struct libalias *); + /* Transparent proxying routines. */ int LibAliasProxyRule(struct libalias *, const char *_cmd); diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index ff3072473d67..7c2faa62f7fc 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1675,7 +1675,6 @@ FindOriginalAddress(struct libalias *la, struct in_addr alias_addr) lnk = FindLinkIn(la, ANY_ADDR, alias_addr, 0, 0, LINK_ADDR, 0); if (lnk == NULL) { - la->newDefaultLink = 1; if (la->targetAddress.s_addr == INADDR_ANY) return (alias_addr); else if (la->targetAddress.s_addr == INADDR_NONE) @@ -2052,13 +2051,6 @@ SetExpire(struct alias_link *lnk, int expire) } } -void -ClearCheckNewLink(struct libalias *la) -{ - LIBALIAS_LOCK_ASSERT(la); - la->newDefaultLink = 0; -} - void SetProtocolFlags(struct alias_link *lnk, int pflags) { @@ -2548,15 +2540,12 @@ getout: return (res); } +/* never used and never worked, to be removed in FreeBSD 14 */ int LibAliasCheckNewLink(struct libalias *la) { - int res; - - LIBALIAS_LOCK(la); - res = la->newDefaultLink; - LIBALIAS_UNLOCK(la); - return (res); + (void)la; + return (0); } #ifndef NO_FW_PUNCH diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 63bfd857f14f..61cd30737ce5 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -118,9 +118,6 @@ struct libalias { #else FILE *logDesc; #endif - /* Indicates if a new aliasing link has been created - * after a call to PacketAliasIn/Out(). */ - int newDefaultLink; #ifndef NO_FW_PUNCH /* File descriptor to be able to control firewall. @@ -323,7 +320,6 @@ int GetDeltaSeqOut(u_long, struct alias_link *lnk); void AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off); void SetExpire (struct alias_link *_lnk, int _expire); -void ClearCheckNewLink(struct libalias *la); void SetProtocolFlags(struct alias_link *_lnk, int _pflags); int GetProtocolFlags(struct alias_link *_lnk); void SetDestCallId(struct alias_link *_lnk, u_int16_t _cid); diff --git a/sys/netinet/libalias/libalias.3 b/sys/netinet/libalias/libalias.3 index 79b0dd15db97..7876c650ccf5 100644 --- a/sys/netinet/libalias/libalias.3 +++ b/sys/netinet/libalias/libalias.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 2020 +.Dd May 31, 2021 .Dt LIBALIAS 3 .Os .Sh NAME @@ -863,16 +863,6 @@ This allows external machines to talk directly to internal machines if they can route packets to the machine in question. .Ed .Pp -.Ft int -.Fn LibAliasCheckNewLink "struct libalias *" -.Bd -ragged -offset indent -This function returns a non-zero value when a new aliasing link is created. -In circumstances where incoming traffic is being sequentially sent to -different local servers, this function can be used to trigger when -.Fn LibAliasSetTarget -is called to change the default target address. -.Ed -.Pp .Ft u_short .Fn LibAliasInternetChecksum "struct libalias *" "u_short *buffer" "int nbytes" .Bd -ragged -offset indent From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 09:01:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E40F64A3FF; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6nC3KhFz4YRS; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E3A1328D; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15791ptj008295; Mon, 7 Jun 2021 09:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15791pUX008294; Mon, 7 Jun 2021 09:01:51 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:01:51 GMT Message-Id: <202106070901.15791pUX008294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 1ceefa271e57 - stable/13 - sctp: fix another locking bug in COOKIE handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ceefa271e5759a1888cb6d153b85642bdf85984 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:01:51 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1ceefa271e5759a1888cb6d153b85642bdf85984 commit 1ceefa271e5759a1888cb6d153b85642bdf85984 Author: Michael Tuexen AuthorDate: 2021-05-12 21:02:31 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:01:28 +0000 sctp: fix another locking bug in COOKIE handling Thanks to Tolya Korniltsev for reporting the issue for the userland stack and testing the fix. (cherry picked from commit eec6aed5b8c848841ae8d25940e0a333e5039ce9) --- sys/netinet/sctp_input.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f066cc100ac2..442e58afd0ff 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1752,17 +1752,23 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctpasochead *head; if (asoc->peer_supports_nat) { + struct sctp_tcb *local_stcb; + /* * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + local_stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, mflowtype, mflowid, - vrf_id, port)); + vrf_id, port); + if (local_stcb == NULL) { + SCTP_TCB_UNLOCK(stcb); + } + return (local_stcb); } /* * case A in Section 5.2.4 Table 2: XXMM (peer restarted) From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 09:01:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13DF364AB00; Mon, 7 Jun 2021 09:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6nD40rkz4Yj3; Mon, 7 Jun 2021 09:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 709DB1322A; Mon, 7 Jun 2021 09:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15791q8n008410; Mon, 7 Jun 2021 09:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15791qUa008332; Mon, 7 Jun 2021 09:01:52 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:01:52 GMT Message-Id: <202106070901.15791qUa008332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fa50e98328b4 - stable/13 - mend MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa50e98328b48da4fa8dbd97d0a787962cf249f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:01:53 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fa50e98328b48da4fa8dbd97d0a787962cf249f5 commit fa50e98328b48da4fa8dbd97d0a787962cf249f5 Author: Michael Tuexen AuthorDate: 2021-04-18 14:08:08 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:01:28 +0000 mend --- share/man/man4/tcp.4 | 15 +- sys/netinet/tcp.h | 1 + sys/netinet/tcp_input.c | 48 ++++- sys/netinet/tcp_output.c | 80 ++++++-- sys/netinet/tcp_stacks/bbr.c | 38 +--- sys/netinet/tcp_stacks/rack.c | 26 +-- sys/netinet/tcp_subr.c | 462 ++++++++++++++++++++++++++++++++++++++++-- sys/netinet/tcp_syncache.c | 127 +++++++++--- sys/netinet/tcp_syncache.h | 12 +- sys/netinet/tcp_timewait.c | 84 ++++++-- sys/netinet/tcp_usrreq.c | 30 +++ sys/netinet/tcp_var.h | 27 ++- sys/netinet/toecore.c | 4 +- sys/netinet6/tcp6_var.h | 2 + sys/sys/mbuf.h | 1 + usr.bin/netstat/inet.c | 4 + usr.bin/sockstat/sockstat.1 | 6 +- usr.bin/sockstat/sockstat.c | 13 +- 18 files changed, 822 insertions(+), 158 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index d01505e58427..b5735a40b320 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 8, 2021 +.Dd April 18, 2021 .Dt TCP 4 .Os .Sh NAME @@ -329,6 +329,9 @@ currently executing. This is typically used after a process or thread inherits a listen socket from its parent, and sets its CPU affinity to a particular core. .El +.It Dv TCP_REMOTE_UDP_ENCAPS_PORT +Set and get the remote UDP encapsulation port. +It can only be set on a closed TCP socket. .El .Pp The option level for the @@ -752,6 +755,16 @@ A CSV list of template_spec=percent key-value pairs which controls the per template sampling rates when .Xr stats 3 sampling is enabled. +.It Va udp_tunneling_port +The local UDP encapsulation port. +A value of 0 indicates that UDP encapsulation is disabled. +The default is 0. +.It Va udp_tunneling_overhead +The overhead taken into account when using UDP encapsulation. +Since MSS clamping by middleboxes will most likely not work, values larger than +8 (the size of the UDP header) are also supported. +Supported values are between 8 and 1024. +The default is 8. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 0b71bd4658f8..d2bf1f8431fd 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -183,6 +183,7 @@ struct tcphdr { #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ +#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ #define TCP_DELACK 72 /* socket option for delayed ack */ #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a RST */ #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log */ diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 397cbc5084e6..d36f9566ffba 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include #endif +#include #include @@ -573,7 +574,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) */ #ifdef INET6 int -tcp6_input(struct mbuf **mp, int *offp, int proto) +tcp6_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) { struct mbuf *m; struct in6_ifaddr *ia6; @@ -603,12 +604,19 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) } *mp = m; - return (tcp_input(mp, offp, proto)); + return (tcp_input_with_port(mp, offp, proto, port)); +} + +int +tcp6_input(struct mbuf **mp, int *offp, int proto) +{ + + return(tcp6_input_with_port(mp, offp, proto, 0)); } #endif /* INET6 */ int -tcp_input(struct mbuf **mp, int *offp, int proto) +tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) { struct mbuf *m = *mp; struct tcphdr *th = NULL; @@ -664,6 +672,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip6 = mtod(m, struct ip6_hdr *); th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; + if (port) + goto skip6_csum; if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; @@ -677,7 +687,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - + skip6_csum: /* * Be proactive about unspecified IPv6 address in source. * As we use all-zero to indicate unbounded/unconnected pcb, @@ -718,6 +728,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) tlen = ntohs(ip->ip_len) - off0; iptos = ip->ip_tos; + if (port) + goto skip_csum; if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; @@ -747,8 +759,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip->ip_v = IPVERSION; ip->ip_hl = off0 >> 2; } - - if (th->th_sum) { + skip_csum: + if (th->th_sum && (port == 0)) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } @@ -1006,6 +1018,11 @@ findpcb: goto dropwithreset; } + if ((tp->t_port != port) && (tp->t_state > TCPS_LISTEN)) { + rstreason = BANDLIM_RST_CLOSEDPORT; + goto dropwithreset; + } + #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) { tcp_offload_input(tp, m); @@ -1077,7 +1094,7 @@ findpcb: * NB: syncache_expand() doesn't unlock * inp and tcpinfo locks. */ - rstreason = syncache_expand(&inc, &to, th, &so, m); + rstreason = syncache_expand(&inc, &to, th, &so, m, port); if (rstreason < 0) { /* * A failing TCP MD5 signature comparison @@ -1157,7 +1174,7 @@ tfo_socket_result: * causes. */ if (thflags & TH_RST) { - syncache_chkrst(&inc, th, m); + syncache_chkrst(&inc, th, m, port); goto dropunlock; } /* @@ -1179,7 +1196,7 @@ tfo_socket_result: log(LOG_DEBUG, "%s; %s: Listen socket: " "SYN|ACK invalid, segment rejected\n", s, __func__); - syncache_badack(&inc); /* XXX: Not needed! */ + syncache_badack(&inc, port); /* XXX: Not needed! */ TCPSTAT_INC(tcps_badsyn); rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; @@ -1336,7 +1353,8 @@ tfo_socket_result: #endif TCP_PROBE3(debug__input, tp, th, m); tcp_dooptions(&to, optp, optlen, TO_SYN); - if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, iptos)) + if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, iptos, + port)) goto tfo_socket_result; /* @@ -1467,6 +1485,12 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, return (newsize); } +int +tcp_input(struct mbuf **mp, int *offp, int proto) +{ + return(tcp_input_with_port(mp, offp, proto, 0)); +} + void tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) { @@ -3671,11 +3695,13 @@ tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer, sizeof (struct ip6_hdr) + sizeof (struct tcphdr) : sizeof (struct tcpiphdr); #else - const size_t min_protoh = sizeof(struct tcpiphdr); + size_t min_protoh = sizeof(struct tcpiphdr); #endif INP_WLOCK_ASSERT(tp->t_inpcb); + if (tp->t_port) + min_protoh += V_tcp_udp_tunneling_overhead; if (mtuoffer != -1) { KASSERT(offer == -1, ("%s: conflict", __func__)); offer = mtuoffer - min_protoh; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index e23cdc749e98..5bda2be14df0 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -207,7 +209,7 @@ tcp_output(struct tcpcb *tp) #endif struct tcphdr *th; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; + unsigned ipoptlen, optlen, hdrlen, ulen; #if defined(IPSEC) || defined(IPSEC_SUPPORT) unsigned ipsec_optlen = 0; #endif @@ -216,6 +218,7 @@ tcp_output(struct tcpcb *tp) struct sackhole *p; int tso, mtu; struct tcpopt to; + struct udphdr *udp = NULL; unsigned int wanted_cookie = 0; unsigned int dont_sendalot = 0; #if 0 @@ -558,6 +561,7 @@ after_sack_rexmit: #endif if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && + (tp->t_port == 0) && ((tp->t_flags & TF_SIGNATURE) == 0) && tp->rcv_numsacks == 0 && sack_rxmit == 0 && ipoptlen == 0 && !(flags & TH_SYN)) @@ -800,6 +804,8 @@ send: /* Maximum segment size. */ if (flags & TH_SYN) { to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); + if (tp->t_port) + to.to_mss -= V_tcp_udp_tunneling_overhead; to.to_flags |= TOF_MSS; /* @@ -887,7 +893,14 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } - + if (tp->t_port) { + if (V_tcp_udp_tunneling_port == 0) { + /* The port was removed?? */ + SOCKBUF_UNLOCK(&so->so_snd); + return (EHOSTUNREACH); + } + hdrlen += sizeof(struct udphdr); + } /* * Adjust data length if insertion of options will * bump the packet length beyond the t_maxseg length. @@ -1140,8 +1153,17 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); - th = (struct tcphdr *)(ip6 + 1); - tcpip_fillheaders(tp->t_inpcb, ip6, th); + if (tp->t_port) { + udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp->uh_sport = htons(V_tcp_udp_tunneling_port); + udp->uh_dport = tp->t_port; + ulen = hdrlen + len - sizeof(struct ip6_hdr); + udp->uh_ulen = htons(ulen); + th = (struct tcphdr *)(udp + 1); + } else { + th = (struct tcphdr *)(ip6 + 1); + } + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -1149,8 +1171,16 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif - th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(tp->t_inpcb, ip, th); + if (tp->t_port) { + udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp->uh_sport = htons(V_tcp_udp_tunneling_port); + udp->uh_dport = tp->t_port; + ulen = hdrlen + len - sizeof(struct ip); + udp->uh_ulen = htons(ulen); + th = (struct tcphdr *)(udp + 1); + } else + th = (struct tcphdr *)(ip + 1); + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip, th); } /* @@ -1309,7 +1339,6 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) if (to.to_flags & TOF_SIGNATURE) { @@ -1336,9 +1365,19 @@ send: * There is no need to fill in ip6_plen right now. * It will be filled later by ip6_output. */ - m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; - th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + - optlen + len, IPPROTO_TCP, 0); + if (tp->t_port) { + m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + udp->uh_sum = in6_cksum_pseudo(ip6, ulen, IPPROTO_UDP, 0); + th->th_sum = htons(0); + UDPSTAT_INC(udps_opackets); + } else { + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + th->th_sum = in6_cksum_pseudo(ip6, + sizeof(struct tcphdr) + optlen + len, IPPROTO_TCP, + 0); + } } #endif #if defined(INET6) && defined(INET) @@ -1346,9 +1385,20 @@ send: #endif #ifdef INET { - m->m_pkthdr.csum_flags = CSUM_TCP; - th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); + if (tp->t_port) { + m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + udp->uh_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(ulen + IPPROTO_UDP)); + th->th_sum = htons(0); + UDPSTAT_INC(udps_opackets); + } else { + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + + IPPROTO_TCP + len + optlen)); + } /* IP version must be set here for ipv4/ipv6 checking later */ KASSERT(ip->ip_v == IPVERSION, @@ -1473,8 +1523,10 @@ send: * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { - ip->ip_off |= htons(IP_DF); tp->t_flags2 |= TF2_PLPMTU_PMTUD; + if (tp->t_port == 0 || len < V_tcp_minmss) { + ip->ip_off |= htons(IP_DF); + } } else { tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index cc20d6bf52ca..1ee8d26446fd 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -11969,14 +11969,10 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) #endif struct tcp_bbr *bbr; struct tcphdr *th; -#ifdef NETFLIX_TCPOUDP struct udphdr *udp = NULL; -#endif u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen; -#ifdef NETFLIX_TCPOUDP unsigned ulen; -#endif uint32_t bbr_seq; uint32_t delay_calc=0; uint8_t doing_tlp = 0; @@ -12991,10 +12987,8 @@ send: /* Maximum segment size. */ if (flags & TH_SYN) { to.to_mss = tcp_mssopt(&inp->inp_inc); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) to.to_mss -= V_tcp_udp_tunneling_overhead; -#endif to.to_flags |= TOF_MSS; /* * On SYN or SYN|ACK transmits on TFO connections, @@ -13063,7 +13057,6 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { if (V_tcp_udp_tunneling_port == 0) { /* The port was removed?? */ @@ -13072,7 +13065,6 @@ send: } hdrlen += sizeof(struct udphdr); } -#endif #ifdef INET6 if (isipv6) ipoptlen = ip6_optlen(tp->t_inpcb); @@ -13408,7 +13400,6 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13417,17 +13408,9 @@ send: udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); } else { -#endif th = (struct tcphdr *)(ip6 + 1); - -#ifdef NETFLIX_TCPOUDP } -#endif - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip6, th); + tcpip_fillheaders(inp, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -13435,7 +13418,6 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13443,14 +13425,10 @@ send: ulen = hdrlen + len - sizeof(struct ip); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip, th); + } + tcpip_fillheaders(inp, tp->t_port, ip, th); } /* * If we are doing retransmissions, then snd_nxt will not reflect @@ -13600,7 +13578,6 @@ send: * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); @@ -13608,14 +13585,11 @@ send: th->th_sum = htons(0); UDPSTAT_INC(udps_opackets); } else { -#endif csum_flags = m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + optlen + len, IPPROTO_TCP, 0); -#ifdef NETFLIX_TCPOUDP } -#endif } #endif #if defined(INET6) && defined(INET) @@ -13623,7 +13597,6 @@ send: #endif #ifdef INET { -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); @@ -13632,15 +13605,12 @@ send: th->th_sum = htons(0); UDPSTAT_INC(udps_opackets); } else { -#endif csum_flags = m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); -#ifdef NETFLIX_TCPOUDP } -#endif /* IP version must be set here for ipv4/ipv6 checking later */ KASSERT(ip->ip_v == IPVERSION, ("%s: IP version incorrect: %d", __func__, ip->ip_v)); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0ee73a95a6d7..12827d1699d0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -13008,10 +13008,8 @@ send: if (flags & TH_SYN) { tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&inp->inp_inc); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) to.to_mss -= V_tcp_udp_tunneling_overhead; -#endif to.to_flags |= TOF_MSS; /* @@ -13088,7 +13086,6 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { if (V_tcp_udp_tunneling_port == 0) { /* The port was removed?? */ @@ -13097,7 +13094,6 @@ send: } hdrlen += sizeof(struct udphdr); } -#endif #ifdef INET6 if (isipv6) ipoptlen = ip6_optlen(tp->t_inpcb); @@ -13372,7 +13368,6 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13380,14 +13375,10 @@ send: ulen = hdrlen + len - sizeof(struct ip6_hdr); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip6 + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip6, th); + } + tcpip_fillheaders(inp, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -13395,7 +13386,6 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13403,14 +13393,10 @@ send: ulen = hdrlen + len - sizeof(struct ip); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip, th); + } + tcpip_fillheaders(inp, tp->t_port, ip, th); } /* * Fill in fields, remembering maximum advertised window for use in diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index dff7767cd9cf..6bdeb3984aee 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -126,6 +126,8 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include #endif +#include +#include #include @@ -501,6 +503,80 @@ tcp_switch_back_to_default(struct tcpcb *tp) } } +static void +tcp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp, + const struct sockaddr *sa, void *ctx) +{ + struct ip *iph; +#ifdef INET6 + struct ip6_hdr *ip6; +#endif + struct udphdr *uh; + struct tcphdr *th; + int thlen; + uint16_t port; + + TCPSTAT_INC(tcps_tunneled_pkts); + if ((m->m_flags & M_PKTHDR) == 0) { + /* Can't handle one that is not a pkt hdr */ + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } + thlen = sizeof(struct tcphdr); + if (m->m_len < off + sizeof(struct udphdr) + thlen && + (m = m_pullup(m, off + sizeof(struct udphdr) + thlen)) == NULL) { + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } + iph = mtod(m, struct ip *); + uh = (struct udphdr *)((caddr_t)iph + off); + th = (struct tcphdr *)(uh + 1); + thlen = th->th_off << 2; + if (m->m_len < off + sizeof(struct udphdr) + thlen) { + m = m_pullup(m, off + sizeof(struct udphdr) + thlen); + if (m == NULL) { + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } else { + iph = mtod(m, struct ip *); + uh = (struct udphdr *)((caddr_t)iph + off); + th = (struct tcphdr *)(uh + 1); + } + } + m->m_pkthdr.tcp_tun_port = port = uh->uh_sport; + bcopy(th, uh, m->m_len - off); + m->m_len -= sizeof(struct udphdr); + m->m_pkthdr.len -= sizeof(struct udphdr); + /* + * We use the same algorithm for + * both UDP and TCP for c-sum. So + * the code in tcp_input will skip + * the checksum. So we do nothing + * with the flag (m->m_pkthdr.csum_flags). + */ + switch (iph->ip_v) { +#ifdef INET + case IPVERSION: + iph->ip_len = htons(ntohs(iph->ip_len) - sizeof(struct udphdr)); + tcp_input_with_port(&m, &off, IPPROTO_TCP, port); + break; +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - sizeof(struct udphdr)); + tcp6_input_with_port(&m, &off, IPPROTO_TCP, port); + break; +#endif + default: + goto out; + break; + } + return; +out: + m_freem(m); +} + static int sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) { @@ -598,6 +674,183 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, functions_available, NULL, 0, sysctl_net_inet_list_available, "A", "list available TCP Function sets"); +VNET_DEFINE(int, tcp_udp_tunneling_port) = TCP_TUNNELING_PORT_DEFAULT; + +#ifdef INET +VNET_DEFINE(struct socket *, udp4_tun_socket) = NULL; +#define V_udp4_tun_socket VNET(udp4_tun_socket) +#endif +#ifdef INET6 +VNET_DEFINE(struct socket *, udp6_tun_socket) = NULL; +#define V_udp6_tun_socket VNET(udp6_tun_socket) +#endif + +static void +tcp_over_udp_stop(void) +{ + /* + * This function assumes sysctl caller holds inp_rinfo_lock() + * for writting! + */ +#ifdef INET + if (V_udp4_tun_socket != NULL) { + soclose(V_udp4_tun_socket); + V_udp4_tun_socket = NULL; + } +#endif +#ifdef INET6 + if (V_udp6_tun_socket != NULL) { + soclose(V_udp6_tun_socket); + V_udp6_tun_socket = NULL; + } +#endif +} + +static int +tcp_over_udp_start(void) +{ + uint16_t port; + int ret; +#ifdef INET + struct sockaddr_in sin; +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; +#endif + /* + * This function assumes sysctl caller holds inp_info_rlock() + * for writting! + */ + port = V_tcp_udp_tunneling_port; + if (ntohs(port) == 0) { + /* Must have a port set */ + return (EINVAL); + } +#ifdef INET + if (V_udp4_tun_socket != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET6 + if (V_udp6_tun_socket != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET + if ((ret = socreate(PF_INET, &V_udp4_tun_socket, + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + tcp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(V_udp4_tun_socket, + tcp_recv_udp_tunneled_packet, + tcp_ctlinput_viaudp, + NULL))) { + tcp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_family = AF_INET; + sin.sin_port = htons(port); + if ((ret = sobind(V_udp4_tun_socket, + (struct sockaddr *)&sin, curthread))) { + tcp_over_udp_stop(); + return (ret); + } +#endif +#ifdef INET6 + if ((ret = socreate(PF_INET6, &V_udp6_tun_socket, + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + tcp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(V_udp6_tun_socket, + tcp_recv_udp_tunneled_packet, + tcp6_ctlinput_viaudp, + NULL))) { + tcp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_port = htons(port); + if ((ret = sobind(V_udp6_tun_socket, + (struct sockaddr *)&sin6, curthread))) { + tcp_over_udp_stop(); + return (ret); + } +#endif + return (0); +} + +static int +sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS) +{ + int error; + uint32_t old, new; + + old = V_tcp_udp_tunneling_port; + new = old; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < TCP_TUNNELING_PORT_MIN) || + (new > TCP_TUNNELING_PORT_MAX)) { + error = EINVAL; + } else { + V_tcp_udp_tunneling_port = new; + if (old != 0) { + tcp_over_udp_stop(); + } + if (new != 0) { + error = tcp_over_udp_start(); + } + } + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_port, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &VNET_NAME(tcp_udp_tunneling_port), + 0, &sysctl_net_inet_tcp_udp_tunneling_port_check, "IU", + "Tunneling port for tcp over udp"); + +VNET_DEFINE(int, tcp_udp_tunneling_overhead) = TCP_TUNNELING_OVERHEAD_DEFAULT; + +static int +sysctl_net_inet_tcp_udp_tunneling_overhead_check(SYSCTL_HANDLER_ARGS) +{ + int error, new; + + new = V_tcp_udp_tunneling_overhead; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if ((new < TCP_TUNNELING_OVERHEAD_MIN) || + (new > TCP_TUNNELING_OVERHEAD_MAX)) + error = EINVAL; + else + V_tcp_udp_tunneling_overhead = new; + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_overhead, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &VNET_NAME(tcp_udp_tunneling_overhead), + 0, &sysctl_net_inet_tcp_udp_tunneling_overhead_check, "IU", + "MSS reduction when using tcp over udp"); + /* * Exports one (struct tcp_function_info) for each alias/name. */ @@ -1305,7 +1558,7 @@ tcp_fini(void *xtp) * of the tcpcb each time to conserve mbufs. */ void -tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) +tcpip_fillheaders(struct inpcb *inp, uint16_t port, void *ip_ptr, void *tcp_ptr) { struct tcphdr *th = (struct tcphdr *)tcp_ptr; @@ -1320,7 +1573,10 @@ tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) (inp->inp_flow & IPV6_FLOWINFO_MASK); ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | (IPV6_VERSION & IPV6_VERSION_MASK); - ip6->ip6_nxt = IPPROTO_TCP; + if (port == 0) + ip6->ip6_nxt = IPPROTO_TCP; + else + ip6->ip6_nxt = IPPROTO_UDP; ip6->ip6_plen = htons(sizeof(struct tcphdr)); ip6->ip6_src = inp->in6p_laddr; ip6->ip6_dst = inp->in6p_faddr; @@ -1342,7 +1598,10 @@ tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) ip->ip_off = 0; ip->ip_ttl = inp->inp_ip_ttl; ip->ip_sum = 0; - ip->ip_p = IPPROTO_TCP; + if (port == 0) + ip->ip_p = IPPROTO_TCP; + else + ip->ip_p = IPPROTO_UDP; ip->ip_src = inp->inp_laddr; ip->ip_dst = inp->inp_faddr; } @@ -1372,7 +1631,7 @@ tcpip_maketemplate(struct inpcb *inp) t = malloc(sizeof(*t), M_TEMP, M_NOWAIT); if (t == NULL) return (NULL); - tcpip_fillheaders(inp, (void *)&t->tt_ipgen, (void *)&t->tt_t); + tcpip_fillheaders(inp, 0, (void *)&t->tt_ipgen, (void *)&t->tt_t); return (t); } @@ -1398,14 +1657,16 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, struct inpcb *inp; struct ip *ip; struct mbuf *optm; + struct udphdr *uh = NULL; struct tcphdr *nth; u_char *optp; #ifdef INET6 struct ip6_hdr *ip6; int isipv6; #endif /* INET6 */ - int optlen, tlen, win; + int optlen, tlen, win, ulen; bool incl_opts; + uint16_t port; KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL")); NET_EPOCH_ASSERT(); @@ -1423,6 +1684,19 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } else inp = NULL; + if (m != NULL) { +#ifdef INET6 + if (isipv6 && ip6 && (ip6->ip6_nxt == IPPROTO_UDP)) + port = m->m_pkthdr.tcp_tun_port; + else *** 1128 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 09:02:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD30164A9C4; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6pJ5KxNz4ZLX; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A061D132A1; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15792mxE009761; Mon, 7 Jun 2021 09:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15792mNG009760; Mon, 7 Jun 2021 09:02:48 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:02:48 GMT Message-Id: <202106070902.15792mNG009760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 95b7e4e0febd - stable/13 - tcp: fix man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:02:48 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 commit 95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 Author: Michael Tuexen AuthorDate: 2021-04-24 20:31:36 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:02:31 +0000 tcp: fix man page Reviewed by: gbe, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D29963 (cherry picked from commit 6096814d3134234d48936f557d431a793e35d8b3) --- share/man/man4/tcp.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index b5735a40b320..0b59e2ec801d 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 18, 2021 +.Dd April 24, 2021 .Dt TCP 4 .Os .Sh NAME @@ -687,6 +687,7 @@ for the connection for some defined period of time. Disable the host cache. .It 1 Enable the host cache. (default) +.El .It Va hostcache.purgenow Immediately purge all entries once set to any value. Setting this to 2 will also reseed the hash salt. @@ -701,6 +702,7 @@ Do not purge all entries when pruning the host cache. (default) Purge all entries when doing the next pruning. .It 2 Purge all entries, and also reseed the hash salt. +.El .It Va hostcache.prune Time in seconds between pruning expired host cache entries. Defaults to 300 (5 minutes). From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 12:12:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECCE364D175; Mon, 7 Jun 2021 12:12:04 +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 "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzC0h47yYz4pPP; Mon, 7 Jun 2021 12:12:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c07f:3a0d:782c:bd56]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 4EB08721E2809; Mon, 7 Jun 2021 14:11:59 +0200 (CEST) From: Michael Tuexen Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: fa50e98328b4 - stable/13 - mend Date: Mon, 7 Jun 2021 14:11:58 +0200 References: <202106070901.15791qUa008332@gitrepo.freebsd.org> To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" In-Reply-To: <202106070901.15791qUa008332@gitrepo.freebsd.org> Message-Id: <1758EB9E-F9AC-4170-ACD0-C5B609405818@freebsd.org> X-Mailer: Apple Mail (2.3654.100.0.2.22) 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: 4FzC0h47yYz4pPP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE]; local_wl_from(0.00)[freebsd.org] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 12:12:05 -0000 > On 7. Jun 2021, at 11:01, Michael Tuexen wrote: >=20 > The branch stable/13 has been updated by tuexen: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dfa50e98328b48da4fa8dbd97d0a78796= 2cf249f5 >=20 > commit fa50e98328b48da4fa8dbd97d0a787962cf249f5 > Author: Michael Tuexen > AuthorDate: 2021-04-18 14:08:08 +0000 > Commit: Michael Tuexen > CommitDate: 2021-06-07 09:01:28 +0000 >=20 > mend Not sure how the commit ended up this way, but it is MFCing = https://cgit.FreeBSD.org/src/commit/?id=3D9e644c23000c2f5028b235f6263d17ff= b24d3605 and manually resolving the merge conflicts. Best regards Michael > --- > share/man/man4/tcp.4 | 15 +- > sys/netinet/tcp.h | 1 + > sys/netinet/tcp_input.c | 48 ++++- > sys/netinet/tcp_output.c | 80 ++++++-- > sys/netinet/tcp_stacks/bbr.c | 38 +--- > sys/netinet/tcp_stacks/rack.c | 26 +-- > sys/netinet/tcp_subr.c | 462 = ++++++++++++++++++++++++++++++++++++++++-- > sys/netinet/tcp_syncache.c | 127 +++++++++--- > sys/netinet/tcp_syncache.h | 12 +- > sys/netinet/tcp_timewait.c | 84 ++++++-- > sys/netinet/tcp_usrreq.c | 30 +++ > sys/netinet/tcp_var.h | 27 ++- > sys/netinet/toecore.c | 4 +- > sys/netinet6/tcp6_var.h | 2 + > sys/sys/mbuf.h | 1 + > usr.bin/netstat/inet.c | 4 + > usr.bin/sockstat/sockstat.1 | 6 +- > usr.bin/sockstat/sockstat.c | 13 +- > 18 files changed, 822 insertions(+), 158 deletions(-) >=20 > diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 > index d01505e58427..b5735a40b320 100644 > --- a/share/man/man4/tcp.4 > +++ b/share/man/man4/tcp.4 > @@ -34,7 +34,7 @@ > .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 > .\" $FreeBSD$ > .\" > -.Dd April 8, 2021 > +.Dd April 18, 2021 > .Dt TCP 4 > .Os > .Sh NAME > @@ -329,6 +329,9 @@ currently executing. > This is typically used after a process or thread inherits a listen > socket from its parent, and sets its CPU affinity to a particular = core. > .El > +.It Dv TCP_REMOTE_UDP_ENCAPS_PORT > +Set and get the remote UDP encapsulation port. > +It can only be set on a closed TCP socket. > .El > .Pp > The option level for the > @@ -752,6 +755,16 @@ A CSV list of template_spec=3Dpercent key-value = pairs which controls the per > template sampling rates when > .Xr stats 3 > sampling is enabled. > +.It Va udp_tunneling_port > +The local UDP encapsulation port. > +A value of 0 indicates that UDP encapsulation is disabled. > +The default is 0. > +.It Va udp_tunneling_overhead > +The overhead taken into account when using UDP encapsulation. > +Since MSS clamping by middleboxes will most likely not work, values = larger than > +8 (the size of the UDP header) are also supported. > +Supported values are between 8 and 1024. > +The default is 8. > .El > .Sh ERRORS > A socket operation may fail with one of the following errors returned: > diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h > index 0b71bd4658f8..d2bf1f8431fd 100644 > --- a/sys/netinet/tcp.h > +++ b/sys/netinet/tcp.h > @@ -183,6 +183,7 @@ struct tcphdr { > #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ > #define TCP_CONGESTION 64 /* get/set congestion control = algorithm */ > #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific = options */ > +#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP = tunneling via the specified port */ > #define TCP_DELACK 72 /* socket option for delayed ack */ > #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a = RST */ > #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log = */ > diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c > index 397cbc5084e6..d36f9566ffba 100644 > --- a/sys/netinet/tcp_input.c > +++ b/sys/netinet/tcp_input.c > @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); > #ifdef TCP_OFFLOAD > #include > #endif > +#include >=20 > #include >=20 > @@ -573,7 +574,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr = *th, uint8_t iptos) > */ > #ifdef INET6 > int > -tcp6_input(struct mbuf **mp, int *offp, int proto) > +tcp6_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t = port) > { > struct mbuf *m; > struct in6_ifaddr *ia6; > @@ -603,12 +604,19 @@ tcp6_input(struct mbuf **mp, int *offp, int = proto) > } >=20 > *mp =3D m; > - return (tcp_input(mp, offp, proto)); > + return (tcp_input_with_port(mp, offp, proto, port)); > +} > + > +int > +tcp6_input(struct mbuf **mp, int *offp, int proto) > +{ > + > + return(tcp6_input_with_port(mp, offp, proto, 0)); > } > #endif /* INET6 */ >=20 > int > -tcp_input(struct mbuf **mp, int *offp, int proto) > +tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t = port) > { > struct mbuf *m =3D *mp; > struct tcphdr *th =3D NULL; > @@ -664,6 +672,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > ip6 =3D mtod(m, struct ip6_hdr *); > th =3D (struct tcphdr *)((caddr_t)ip6 + off0); > tlen =3D sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; > + if (port) > + goto skip6_csum; > if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > th->th_sum =3D m->m_pkthdr.csum_data; > @@ -677,7 +687,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > TCPSTAT_INC(tcps_rcvbadsum); > goto drop; > } > - > + skip6_csum: > /* > * Be proactive about unspecified IPv6 address in = source. > * As we use all-zero to indicate unbounded/unconnected = pcb, > @@ -718,6 +728,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > tlen =3D ntohs(ip->ip_len) - off0; >=20 > iptos =3D ip->ip_tos; > + if (port) > + goto skip_csum; > if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > th->th_sum =3D m->m_pkthdr.csum_data; > @@ -747,8 +759,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > ip->ip_v =3D IPVERSION; > ip->ip_hl =3D off0 >> 2; > } > - > - if (th->th_sum) { > + skip_csum: > + if (th->th_sum && (port =3D=3D 0)) { > TCPSTAT_INC(tcps_rcvbadsum); > goto drop; > } > @@ -1006,6 +1018,11 @@ findpcb: > goto dropwithreset; > } >=20 > + if ((tp->t_port !=3D port) && (tp->t_state > TCPS_LISTEN)) { > + rstreason =3D BANDLIM_RST_CLOSEDPORT; > + goto dropwithreset; > + } > + > #ifdef TCP_OFFLOAD > if (tp->t_flags & TF_TOE) { > tcp_offload_input(tp, m); > @@ -1077,7 +1094,7 @@ findpcb: > * NB: syncache_expand() doesn't unlock > * inp and tcpinfo locks. > */ > - rstreason =3D syncache_expand(&inc, &to, th, = &so, m); > + rstreason =3D syncache_expand(&inc, &to, th, = &so, m, port); > if (rstreason < 0) { > /* > * A failing TCP MD5 signature = comparison > @@ -1157,7 +1174,7 @@ tfo_socket_result: > * causes. > */ > if (thflags & TH_RST) { > - syncache_chkrst(&inc, th, m); > + syncache_chkrst(&inc, th, m, port); > goto dropunlock; > } > /* > @@ -1179,7 +1196,7 @@ tfo_socket_result: > log(LOG_DEBUG, "%s; %s: Listen socket: " > "SYN|ACK invalid, segment = rejected\n", > s, __func__); > - syncache_badack(&inc); /* XXX: Not needed! */ > + syncache_badack(&inc, port); /* XXX: Not = needed! */ > TCPSTAT_INC(tcps_badsyn); > rstreason =3D BANDLIM_RST_OPENPORT; > goto dropwithreset; > @@ -1336,7 +1353,8 @@ tfo_socket_result: > #endif > TCP_PROBE3(debug__input, tp, th, m); > tcp_dooptions(&to, optp, optlen, TO_SYN); > - if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, = iptos)) > + if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, = iptos, > + port)) > goto tfo_socket_result; >=20 > /* > @@ -1467,6 +1485,12 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr = *th, struct socket *so, > return (newsize); > } >=20 > +int > +tcp_input(struct mbuf **mp, int *offp, int proto) > +{ > + return(tcp_input_with_port(mp, offp, proto, 0)); > +} > + > void > tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) > { > @@ -3671,11 +3695,13 @@ tcp_mss_update(struct tcpcb *tp, int offer, = int mtuoffer, > sizeof (struct ip6_hdr) + sizeof (struct = tcphdr) : > sizeof (struct tcpiphdr); > #else > - const size_t min_protoh =3D sizeof(struct tcpiphdr); > + size_t min_protoh =3D sizeof(struct tcpiphdr); > #endif >=20 > INP_WLOCK_ASSERT(tp->t_inpcb); >=20 > + if (tp->t_port) > + min_protoh +=3D V_tcp_udp_tunneling_overhead; > if (mtuoffer !=3D -1) { > KASSERT(offer =3D=3D -1, ("%s: conflict", __func__)); > offer =3D mtuoffer - min_protoh; > diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c > index e23cdc749e98..5bda2be14df0 100644 > --- a/sys/netinet/tcp_output.c > +++ b/sys/netinet/tcp_output.c > @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); >=20 > #include >=20 > +#include > +#include > #include >=20 > #include > @@ -207,7 +209,7 @@ tcp_output(struct tcpcb *tp) > #endif > struct tcphdr *th; > u_char opt[TCP_MAXOLEN]; > - unsigned ipoptlen, optlen, hdrlen; > + unsigned ipoptlen, optlen, hdrlen, ulen; > #if defined(IPSEC) || defined(IPSEC_SUPPORT) > unsigned ipsec_optlen =3D 0; > #endif > @@ -216,6 +218,7 @@ tcp_output(struct tcpcb *tp) > struct sackhole *p; > int tso, mtu; > struct tcpopt to; > + struct udphdr *udp =3D NULL; > unsigned int wanted_cookie =3D 0; > unsigned int dont_sendalot =3D 0; > #if 0 > @@ -558,6 +561,7 @@ after_sack_rexmit: > #endif >=20 > if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg = && > + (tp->t_port =3D=3D 0) && > ((tp->t_flags & TF_SIGNATURE) =3D=3D 0) && > tp->rcv_numsacks =3D=3D 0 && sack_rxmit =3D=3D 0 && > ipoptlen =3D=3D 0 && !(flags & TH_SYN)) > @@ -800,6 +804,8 @@ send: > /* Maximum segment size. */ > if (flags & TH_SYN) { > to.to_mss =3D tcp_mssopt(&tp->t_inpcb->inp_inc); > + if (tp->t_port) > + to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > to.to_flags |=3D TOF_MSS; >=20 > /* > @@ -887,7 +893,14 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > - > + if (tp->t_port) { > + if (V_tcp_udp_tunneling_port =3D=3D 0) { > + /* The port was removed?? */ > + SOCKBUF_UNLOCK(&so->so_snd); > + return (EHOSTUNREACH); > + } > + hdrlen +=3D sizeof(struct udphdr); > + } > /* > * Adjust data length if insertion of options will > * bump the packet length beyond the t_maxseg length. > @@ -1140,8 +1153,17 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > - th =3D (struct tcphdr *)(ip6 + 1); > - tcpip_fillheaders(tp->t_inpcb, ip6, th); > + if (tp->t_port) { > + udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > + udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > + udp->uh_dport =3D tp->t_port; > + ulen =3D hdrlen + len - sizeof(struct ip6_hdr); > + udp->uh_ulen =3D htons(ulen); > + th =3D (struct tcphdr *)(udp + 1); > + } else { > + th =3D (struct tcphdr *)(ip6 + 1); > + } > + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -1149,8 +1171,16 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > - th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(tp->t_inpcb, ip, th); > + if (tp->t_port) { > + udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > + udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > + udp->uh_dport =3D tp->t_port; > + ulen =3D hdrlen + len - sizeof(struct ip); > + udp->uh_ulen =3D htons(ulen); > + th =3D (struct tcphdr *)(udp + 1); > + } else > + th =3D (struct tcphdr *)(ip + 1); > + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip, th); > } >=20 > /* > @@ -1309,7 +1339,6 @@ send: > * checksum extended header and data. > */ > m->m_pkthdr.len =3D hdrlen + len; /* in6_cksum() need this */ > - m->m_pkthdr.csum_data =3D offsetof(struct tcphdr, th_sum); >=20 > #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) > if (to.to_flags & TOF_SIGNATURE) { > @@ -1336,9 +1365,19 @@ send: > * There is no need to fill in ip6_plen right now. > * It will be filled later by ip6_output. > */ > - m->m_pkthdr.csum_flags =3D CSUM_TCP_IPV6; > - th->th_sum =3D in6_cksum_pseudo(ip6, sizeof(struct = tcphdr) + > - optlen + len, IPPROTO_TCP, 0); > + if (tp->t_port) { > + m->m_pkthdr.csum_flags =3D CSUM_UDP_IPV6; > + m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > + udp->uh_sum =3D in6_cksum_pseudo(ip6, ulen, = IPPROTO_UDP, 0); > + th->th_sum =3D htons(0); > + UDPSTAT_INC(udps_opackets); > + } else { > + m->m_pkthdr.csum_flags =3D CSUM_TCP_IPV6; > + m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > + th->th_sum =3D in6_cksum_pseudo(ip6, > + sizeof(struct tcphdr) + optlen + len, = IPPROTO_TCP, > + 0); > + } > } > #endif > #if defined(INET6) && defined(INET) > @@ -1346,9 +1385,20 @@ send: > #endif > #ifdef INET > { > - m->m_pkthdr.csum_flags =3D CSUM_TCP; > - th->th_sum =3D in_pseudo(ip->ip_src.s_addr, = ip->ip_dst.s_addr, > - htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + = optlen)); > + if (tp->t_port) { > + m->m_pkthdr.csum_flags =3D CSUM_UDP; > + m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > + udp->uh_sum =3D in_pseudo(ip->ip_src.s_addr, > + ip->ip_dst.s_addr, htons(ulen + = IPPROTO_UDP)); > + th->th_sum =3D htons(0); > + UDPSTAT_INC(udps_opackets); > + } else { > + m->m_pkthdr.csum_flags =3D CSUM_TCP; > + m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > + th->th_sum =3D in_pseudo(ip->ip_src.s_addr, > + ip->ip_dst.s_addr, htons(sizeof(struct = tcphdr) + > + IPPROTO_TCP + len + optlen)); > + } >=20 > /* IP version must be set here for ipv4/ipv6 checking = later */ > KASSERT(ip->ip_v =3D=3D IPVERSION, > @@ -1473,8 +1523,10 @@ send: > * NB: Don't set DF on small MTU/MSS to have a safe fallback. > */ > if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { > - ip->ip_off |=3D htons(IP_DF); > tp->t_flags2 |=3D TF2_PLPMTU_PMTUD; > + if (tp->t_port =3D=3D 0 || len < V_tcp_minmss) { > + ip->ip_off |=3D htons(IP_DF); > + } > } else { > tp->t_flags2 &=3D ~TF2_PLPMTU_PMTUD; > } > diff --git a/sys/netinet/tcp_stacks/bbr.c = b/sys/netinet/tcp_stacks/bbr.c > index cc20d6bf52ca..1ee8d26446fd 100644 > --- a/sys/netinet/tcp_stacks/bbr.c > +++ b/sys/netinet/tcp_stacks/bbr.c > @@ -11969,14 +11969,10 @@ bbr_output_wtime(struct tcpcb *tp, const = struct timeval *tv) > #endif > struct tcp_bbr *bbr; > struct tcphdr *th; > -#ifdef NETFLIX_TCPOUDP > struct udphdr *udp =3D NULL; > -#endif > u_char opt[TCP_MAXOLEN]; > unsigned ipoptlen, optlen, hdrlen; > -#ifdef NETFLIX_TCPOUDP > unsigned ulen; > -#endif > uint32_t bbr_seq; > uint32_t delay_calc=3D0; > uint8_t doing_tlp =3D 0; > @@ -12991,10 +12987,8 @@ send: > /* Maximum segment size. */ > if (flags & TH_SYN) { > to.to_mss =3D tcp_mssopt(&inp->inp_inc); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) > to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > -#endif > to.to_flags |=3D TOF_MSS; > /* > * On SYN or SYN|ACK transmits on TFO = connections, > @@ -13063,7 +13057,6 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > if (V_tcp_udp_tunneling_port =3D=3D 0) { > /* The port was removed?? */ > @@ -13072,7 +13065,6 @@ send: > } > hdrlen +=3D sizeof(struct udphdr); > } > -#endif > #ifdef INET6 > if (isipv6) > ipoptlen =3D ip6_optlen(tp->t_inpcb); > @@ -13408,7 +13400,6 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13417,17 +13408,9 @@ send: > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > } else { > -#endif > th =3D (struct tcphdr *)(ip6 + 1); > - > -#ifdef NETFLIX_TCPOUDP > } > -#endif > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip6, th); > + tcpip_fillheaders(inp, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -13435,7 +13418,6 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13443,14 +13425,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip, th); > } > /* > * If we are doing retransmissions, then snd_nxt will not = reflect > @@ -13600,7 +13578,6 @@ send: > * ip6_plen is not need to be filled now, and will be = filled > * in ip6_output. > */ > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > m->m_pkthdr.csum_flags =3D CSUM_UDP_IPV6; > m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > @@ -13608,14 +13585,11 @@ send: > th->th_sum =3D htons(0); > UDPSTAT_INC(udps_opackets); > } else { > -#endif > csum_flags =3D m->m_pkthdr.csum_flags =3D = CSUM_TCP_IPV6; > m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > th->th_sum =3D in6_cksum_pseudo(ip6, = sizeof(struct tcphdr) + > optlen + len, IPPROTO_TCP, 0); > -#ifdef NETFLIX_TCPOUDP > } > -#endif > } > #endif > #if defined(INET6) && defined(INET) > @@ -13623,7 +13597,6 @@ send: > #endif > #ifdef INET > { > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > m->m_pkthdr.csum_flags =3D CSUM_UDP; > m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > @@ -13632,15 +13605,12 @@ send: > th->th_sum =3D htons(0); > UDPSTAT_INC(udps_opackets); > } else { > -#endif > csum_flags =3D m->m_pkthdr.csum_flags =3D = CSUM_TCP; > m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > th->th_sum =3D in_pseudo(ip->ip_src.s_addr, > ip->ip_dst.s_addr, htons(sizeof(struct = tcphdr) + > IPPROTO_TCP + len + optlen)); > -#ifdef NETFLIX_TCPOUDP > } > -#endif > /* IP version must be set here for ipv4/ipv6 checking = later */ > KASSERT(ip->ip_v =3D=3D IPVERSION, > ("%s: IP version incorrect: %d", __func__, = ip->ip_v)); > diff --git a/sys/netinet/tcp_stacks/rack.c = b/sys/netinet/tcp_stacks/rack.c > index 0ee73a95a6d7..12827d1699d0 100644 > --- a/sys/netinet/tcp_stacks/rack.c > +++ b/sys/netinet/tcp_stacks/rack.c > @@ -13008,10 +13008,8 @@ send: > if (flags & TH_SYN) { > tp->snd_nxt =3D tp->iss; > to.to_mss =3D tcp_mssopt(&inp->inp_inc); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) > to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > -#endif > to.to_flags |=3D TOF_MSS; >=20 > /* > @@ -13088,7 +13086,6 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > if (V_tcp_udp_tunneling_port =3D=3D 0) { > /* The port was removed?? */ > @@ -13097,7 +13094,6 @@ send: > } > hdrlen +=3D sizeof(struct udphdr); > } > -#endif > #ifdef INET6 > if (isipv6) > ipoptlen =3D ip6_optlen(tp->t_inpcb); > @@ -13372,7 +13368,6 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13380,14 +13375,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip6_hdr); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip6 + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip6, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -13395,7 +13386,6 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13403,14 +13393,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip, th); > } > /* > * Fill in fields, remembering maximum advertised window for use = in > diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c > index dff7767cd9cf..6bdeb3984aee 100644 > --- a/sys/netinet/tcp_subr.c > +++ b/sys/netinet/tcp_subr.c > @@ -126,6 +126,8 @@ __FBSDID("$FreeBSD$"); > #ifdef TCP_OFFLOAD > #include > #endif > +#include > +#include >=20 > #include >=20 > @@ -501,6 +503,80 @@ tcp_switch_back_to_default(struct tcpcb *tp) > } > } >=20 > +static void > +tcp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb = *inp, > + const struct sockaddr *sa, void *ctx) > +{ > + struct ip *iph; > +#ifdef INET6 > + struct ip6_hdr *ip6; > +#endif > + struct udphdr *uh; > + struct tcphdr *th; > + int thlen; > + uint16_t port; > + > + TCPSTAT_INC(tcps_tunneled_pkts); > + if ((m->m_flags & M_PKTHDR) =3D=3D 0) { > + /* Can't handle one that is not a pkt hdr */ > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } > + thlen =3D sizeof(struct tcphdr); > + if (m->m_len < off + sizeof(struct udphdr) + thlen && > + (m =3D m_pullup(m, off + sizeof(struct udphdr) + thlen)) =3D=3D= NULL) { > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } > + iph =3D mtod(m, struct ip *); > + uh =3D (struct udphdr *)((caddr_t)iph + off); > + th =3D (struct tcphdr *)(uh + 1); > + thlen =3D th->th_off << 2; > + if (m->m_len < off + sizeof(struct udphdr) + thlen) { > + m =3D m_pullup(m, off + sizeof(struct udphdr) + thlen); > + if (m =3D=3D NULL) { > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } else { > + iph =3D mtod(m, struct ip *); > + uh =3D (struct udphdr *)((caddr_t)iph + off); > + th =3D (struct tcphdr *)(uh + 1); > + } > + } > + m->m_pkthdr.tcp_tun_port =3D port =3D uh->uh_sport; > + bcopy(th, uh, m->m_len - off); > + m->m_len -=3D sizeof(struct udphdr); > + m->m_pkthdr.len -=3D sizeof(struct udphdr); > + /* > + * We use the same algorithm for > + * both UDP and TCP for c-sum. So > + * the code in tcp_input will skip > + * the checksum. So we do nothing > + * with the flag (m->m_pkthdr.csum_flags). > + */ > + switch (iph->ip_v) { > +#ifdef INET > + case IPVERSION: > + iph->ip_len =3D htons(ntohs(iph->ip_len) - sizeof(struct = udphdr)); > + tcp_input_with_port(&m, &off, IPPROTO_TCP, port); > + break; > +#endif > +#ifdef INET6 > + case IPV6_VERSION >> 4: > + ip6 =3D mtod(m, struct ip6_hdr *); > + ip6->ip6_plen =3D htons(ntohs(ip6->ip6_plen) - = sizeof(struct udphdr)); > + tcp6_input_with_port(&m, &off, IPPROTO_TCP, port); > + break; > +#endif > + default: > + goto out; > + break; > + } > + return; > +out: > + m_freem(m); > +} > + > static int > sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) > { > @@ -598,6 +674,183 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, = functions_available, > NULL, 0, sysctl_net_inet_list_available, "A", > "list available TCP Function sets"); >=20 > +VNET_DEFINE(int, tcp_udp_tunneling_port) =3D = TCP_TUNNELING_PORT_DEFAULT; > + > +#ifdef INET > +VNET_DEFINE(struct socket *, udp4_tun_socket) =3D NULL; > +#define V_udp4_tun_socket VNET(udp4_tun_socket) > +#endif > +#ifdef INET6 > +VNET_DEFINE(struct socket *, udp6_tun_socket) =3D NULL; > +#define V_udp6_tun_socket VNET(udp6_tun_socket) > +#endif > + > +static void > +tcp_over_udp_stop(void) > +{ > + /* > + * This function assumes sysctl caller holds inp_rinfo_lock() > + * for writting! > + */ > +#ifdef INET > + if (V_udp4_tun_socket !=3D NULL) { > + soclose(V_udp4_tun_socket); > + V_udp4_tun_socket =3D NULL; > + } > +#endif > +#ifdef INET6 > + if (V_udp6_tun_socket !=3D NULL) { > + soclose(V_udp6_tun_socket); > + V_udp6_tun_socket =3D NULL; > + } > +#endif > +} > + > +static int > +tcp_over_udp_start(void) > +{ > + uint16_t port; > + int ret; > +#ifdef INET > + struct sockaddr_in sin; > +#endif > +#ifdef INET6 > + struct sockaddr_in6 sin6; > +#endif > + /* > + * This function assumes sysctl caller holds inp_info_rlock() > + * for writting! > + */ > + port =3D V_tcp_udp_tunneling_port; > + if (ntohs(port) =3D=3D 0) { > + /* Must have a port set */ > + return (EINVAL); > + } > +#ifdef INET > + if (V_udp4_tun_socket !=3D NULL) { > + /* Already running -- must stop first */ > + return (EALREADY); > + } > +#endif > +#ifdef INET6 > + if (V_udp6_tun_socket !=3D NULL) { > + /* Already running -- must stop first */ > + return (EALREADY); > + } > +#endif > +#ifdef INET > + if ((ret =3D socreate(PF_INET, &V_udp4_tun_socket, > + SOCK_DGRAM, IPPROTO_UDP, > + curthread->td_ucred, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Call the special UDP hook. */ > + if ((ret =3D udp_set_kernel_tunneling(V_udp4_tun_socket, > + tcp_recv_udp_tunneled_packet, > + tcp_ctlinput_viaudp, > + NULL))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Ok, we have a socket, bind it to the port. */ > + memset(&sin, 0, sizeof(struct sockaddr_in)); > + sin.sin_len =3D sizeof(struct sockaddr_in); > + sin.sin_family =3D AF_INET; > + sin.sin_port =3D htons(port); > + if ((ret =3D sobind(V_udp4_tun_socket, > + (struct sockaddr *)&sin, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > +#endif > +#ifdef INET6 > + if ((ret =3D socreate(PF_INET6, &V_udp6_tun_socket, > + SOCK_DGRAM, IPPROTO_UDP, > + curthread->td_ucred, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Call the special UDP hook. */ > + if ((ret =3D udp_set_kernel_tunneling(V_udp6_tun_socket, > + tcp_recv_udp_tunneled_packet, > + tcp6_ctlinput_viaudp, > + NULL))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Ok, we have a socket, bind it to the port. */ > + memset(&sin6, 0, sizeof(struct sockaddr_in6)); > + sin6.sin6_len =3D sizeof(struct sockaddr_in6); > + sin6.sin6_family =3D AF_INET6; > + sin6.sin6_port =3D htons(port); > + if ((ret =3D sobind(V_udp6_tun_socket, > + (struct sockaddr *)&sin6, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > +#endif > + return (0); > +} > + > +static int > +sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS) > +{ > + int error; > + uint32_t old, new; > + > + old =3D V_tcp_udp_tunneling_port; > + new =3D old; > + error =3D sysctl_handle_int(oidp, &new, 0, req); > + if ((error =3D=3D 0) && > + (req->newptr !=3D NULL)) { > + if ((new < TCP_TUNNELING_PORT_MIN) || > + (new > TCP_TUNNELING_PORT_MAX)) { > + error =3D EINVAL; > + } else { > + V_tcp_udp_tunneling_port =3D new; > + if (old !=3D 0) { > + tcp_over_udp_stop(); > + } > + if (new !=3D 0) { > + error =3D tcp_over_udp_start(); > + } > + } > + } > + return (error); > +} > + > +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_port, > + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > + &VNET_NAME(tcp_udp_tunneling_port), > + 0, &sysctl_net_inet_tcp_udp_tunneling_port_check, "IU", > + "Tunneling port for tcp over udp"); > + > +VNET_DEFINE(int, tcp_udp_tunneling_overhead) =3D = TCP_TUNNELING_OVERHEAD_DEFAULT; > + > +static int > +sysctl_net_inet_tcp_udp_tunneling_overhead_check(SYSCTL_HANDLER_ARGS) > +{ > + int error, new; > + > + new =3D V_tcp_udp_tunneling_overhead; > + error =3D sysctl_handle_int(oidp, &new, 0, req); > + if (error =3D=3D 0 && req->newptr) { > + if ((new < TCP_TUNNELING_OVERHEAD_MIN) || > + (new > TCP_TUNNELING_OVERHEAD_MAX)) > + error =3D EINVAL; > + else > + V_tcp_udp_tunneling_overhead =3D new; > + } > + return (error); > +} > + > +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_overhead, > + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > + &VNET_NAME(tcp_udp_tunneling_overhead), > + 0, &sysctl_net_inet_tcp_udp_tunneling_overhead_check, "IU", > + "MSS reduction when using tcp over udp"); > + > /* > * Exports one (struct tcp_function_info) for each alias/name. > */ > @@ -1305,7 +1558,7 @@ tcp_fini(void *xtp) > * of the tcpcb each time to conserve mbufs. > */ > void > -tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) > +tcpip_fillheaders(struct inpcb *inp, uint16_t port, void *ip_ptr, = void *tcp_ptr) > { > struct tcphdr *th =3D (struct tcphdr *)tcp_ptr; >=20 > @@ -1320,7 +1573,10 @@ tcpip_fillheaders(struct inpcb *inp, void = *ip_ptr, void *tcp_ptr) > (inp->inp_flow & IPV6_FLOWINFO_MASK); > ip6->ip6_vfc =3D (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | > (IPV6_VERSION & IPV6_VERSION_MASK); > - ip6->ip6_nxt =3D IPPROTO_TCP; > + if (port =3D=3D 0) > + ip6->ip6_nxt =3D IPPROTO_TCP; > + else > + ip6->ip6_nxt =3D IPPROTO_UDP; > ip6->ip6_plen =3D htons(sizeof(struct tcphdr)); > ip6->ip6_src =3D inp->in6p_laddr; > ip6->ip6_dst =3D inp->in6p_faddr; > @@ -1342,7 +1598,10 @@ tcpip_fillheaders(struct inpcb *inp, void = *ip_ptr, void *tcp_ptr) > ip->ip_off =3D 0; > ip->ip_ttl =3D inp->inp_ip_ttl; > ip->ip_sum =3D 0; > - ip->ip_p =3D IPPROTO_TCP; > + if (port =3D=3D 0) > + ip->ip_p =3D IPPROTO_TCP; > + else > + ip->ip_p =3D IPPROTO_UDP; > ip->ip_src =3D inp->inp_laddr; > ip->ip_dst =3D inp->inp_faddr; > } > @@ -1372,7 +1631,7 @@ tcpip_maketemplate(struct inpcb *inp) > t =3D malloc(sizeof(*t), M_TEMP, M_NOWAIT); > if (t =3D=3D NULL) > return (NULL); > - tcpip_fillheaders(inp, (void *)&t->tt_ipgen, (void *)&t->tt_t); > + tcpip_fillheaders(inp, 0, (void *)&t->tt_ipgen, (void = *)&t->tt_t); > return (t); > } >=20 > @@ -1398,14 +1657,16 @@ tcp_respond(struct tcpcb *tp, void *ipgen, = struct tcphdr *th, struct mbuf *m, > struct inpcb *inp; > struct ip *ip; > struct mbuf *optm; > + struct udphdr *uh =3D NULL; > struct tcphdr *nth; > u_char *optp; > #ifdef INET6 > struct ip6_hdr *ip6; > int isipv6; > #endif /* INET6 */ > - int optlen, tlen, win; > + int optlen, tlen, win, ulen; > bool incl_opts; > + uint16_t port; >=20 > KASSERT(tp !=3D NULL || m !=3D NULL, ("tcp_respond: tp and m = both NULL")); > NET_EPOCH_ASSERT(); > @@ -1423,6 +1684,19 @@ tcp_respond(struct tcpcb *tp, void *ipgen, = struct tcphdr *th, struct mbuf *m, > } else > inp =3D NULL; >=20 > + if (m !=3D NULL) { > +#ifdef INET6 > + if (isipv6 && ip6 && (ip6->ip6_nxt =3D=3D IPPROTO_UDP)) > + port =3D m->m_pkthdr.tcp_tun_port; > + else > *** 1128 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 15:43:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEE0264FD22; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzHhB4wVkz3Mn9; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91D6D184A8; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Fh6Rq037206; Mon, 7 Jun 2021 15:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Fh6m8037205; Mon, 7 Jun 2021 15:43:06 GMT (envelope-from git) Date: Mon, 7 Jun 2021 15:43:06 GMT Message-Id: <202106071543.157Fh6m8037205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 09cb8c812b2f - stable/12 - pf tests: Make killstate:match more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09cb8c812b2fdf1d1e95cf6237a14c616169c1bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 15:43:06 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09cb8c812b2fdf1d1e95cf6237a14c616169c1bb commit 09cb8c812b2fdf1d1e95cf6237a14c616169c1bb Author: Kristof Provost AuthorDate: 2021-06-03 13:22:19 +0000 Commit: Kristof Provost CommitDate: 2021-06-07 08:35:45 +0000 pf tests: Make killstate:match more robust The killstate:match test starts nc as a background process. There was no guarantee that the nc process would have connected by the time we check for states, so this test occasionally failed without good reason. Teach the test to wait for at least some states to turn up before executing the critical checks. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674) --- tests/sys/netpfil/pf/killstate.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index b811befc08c5..2b77ea189294 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -312,6 +312,17 @@ match_head() atf_set require.user root } +wait_for_state() +{ + jail=$1 + addr=$2 + + while ! jexec $jail pfctl -s s | grep $addr >/dev/null; + do + sleep .1 + done +} + match_body() { pft_init @@ -340,6 +351,7 @@ match_body() "pass all" nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Expect two states states=$(jexec alcatraz pfctl -s s | wc -l) @@ -360,6 +372,7 @@ match_body() jexec alcatraz pfctl -F states nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Kill matching states, expect all of them to be gone jexec alcatraz pfctl -M -k 192.0.2.1 From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 15:43:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56B5264FEA6; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzHhD1v8pz3Mwk; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE0A18601; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Fh7xB037306; Mon, 7 Jun 2021 15:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Fh7W9037305; Mon, 7 Jun 2021 15:43:07 GMT (envelope-from git) Date: Mon, 7 Jun 2021 15:43:07 GMT Message-Id: <202106071543.157Fh7W9037305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dedd9ee84bb0 - stable/13 - pf tests: Make killstate:match more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 15:43:08 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 commit dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 Author: Kristof Provost AuthorDate: 2021-06-03 13:22:19 +0000 Commit: Kristof Provost CommitDate: 2021-06-07 15:42:19 +0000 pf tests: Make killstate:match more robust The killstate:match test starts nc as a background process. There was no guarantee that the nc process would have connected by the time we check for states, so this test occasionally failed without good reason. Teach the test to wait for at least some states to turn up before executing the critical checks. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674) --- tests/sys/netpfil/pf/killstate.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index b3d94a245548..f53ede8c7578 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -384,6 +384,17 @@ match_head() atf_set require.user root } +wait_for_state() +{ + jail=$1 + addr=$2 + + while ! jexec $jail pfctl -s s | grep $addr >/dev/null; + do + sleep .1 + done +} + match_body() { pft_init @@ -412,6 +423,7 @@ match_body() "pass all" nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Expect two states states=$(jexec alcatraz pfctl -s s | wc -l) @@ -432,6 +444,7 @@ match_body() jexec alcatraz pfctl -F states nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Kill matching states, expect all of them to be gone jexec alcatraz pfctl -M -k 192.0.2.1 From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 16:33:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C31650906; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnr4bdrz3hCC; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8600418E45; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX4lt004098; Mon, 7 Jun 2021 16:33:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX4pR004097; Mon, 7 Jun 2021 16:33:04 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:04 GMT Message-Id: <202106071633.157GX4pR004097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 620a48f64d08 - stable/13 - kern linker: do not allow more than one kldload and kldunload syscalls simultaneously MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 620a48f64d0848ce4ef698b3c2aae960a146cc42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=620a48f64d0848ce4ef698b3c2aae960a146cc42 commit 620a48f64d0848ce4ef698b3c2aae960a146cc42 Author: Konstantin Belousov AuthorDate: 2021-05-20 14:50:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 kern linker: do not allow more than one kldload and kldunload syscalls simultaneously (cherry picked from commit e266a0f7f001c7886eab56d8c058d92d87010400) --- sys/kern/kern_linker.c | 86 +++++++++++++++++++++++++++++++++++++++----------- sys/sys/linker.h | 9 ++++++ 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index e54546eec7b4..dbbf240a2f56 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -106,6 +106,7 @@ MALLOC_DEFINE(M_LINKER, "linker", "kernel linker"); linker_file_t linker_kernel_file; static struct sx kld_sx; /* kernel linker lock */ +static bool kld_busy; /* * Load counter used by clients to determine if a linker file has been @@ -1050,6 +1051,49 @@ linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, M_WAITOK)); } +int +linker_kldload_busy(int flags) +{ + int error; + + MPASS((flags & ~(LINKER_UB_UNLOCK | LINKER_UB_LOCKED | + LINKER_UB_PCATCH)) == 0); + if ((flags & LINKER_UB_LOCKED) != 0) + sx_assert(&kld_sx, SA_XLOCKED); + + if ((flags & LINKER_UB_LOCKED) == 0) + sx_xlock(&kld_sx); + while (kld_busy) { + error = sx_sleep(&kld_busy, &kld_sx, + (flags & LINKER_UB_PCATCH) != 0 ? PCATCH : 0, + "kldbusy", 0); + if (error != 0) { + if ((flags & LINKER_UB_UNLOCK) != 0) + sx_xunlock(&kld_sx); + return (error); + } + } + kld_busy = true; + if ((flags & LINKER_UB_UNLOCK) != 0) + sx_xunlock(&kld_sx); + return (0); +} + +void +linker_kldload_unbusy(int flags) +{ + MPASS((flags & ~LINKER_UB_LOCKED) == 0); + if ((flags & LINKER_UB_LOCKED) != 0) + sx_assert(&kld_sx, SA_XLOCKED); + + if ((flags & LINKER_UB_LOCKED) == 0) + sx_xlock(&kld_sx); + MPASS(kld_busy); + kld_busy = false; + wakeup(&kld_busy); + sx_xunlock(&kld_sx); +} + /* * Syscalls. */ @@ -1066,12 +1110,6 @@ kern_kldload(struct thread *td, const char *file, int *fileid) if ((error = priv_check(td, PRIV_KLD_LOAD)) != 0) return (error); - /* - * It is possible that kldloaded module will attach a new ifnet, - * so vnet context must be set when this ocurs. - */ - CURVNET_SET(TD_TO_VNET(td)); - /* * If file does not contain a qualified name or any dot in it * (kldname.ko, or kldname.ver.ko) treat it as an interface @@ -1085,19 +1123,27 @@ kern_kldload(struct thread *td, const char *file, int *fileid) modname = file; } - sx_xlock(&kld_sx); - error = linker_load_module(kldname, modname, NULL, NULL, &lf); - if (error) { + error = linker_kldload_busy(LINKER_UB_PCATCH); + if (error != 0) { sx_xunlock(&kld_sx); - goto done; + return (error); } - lf->userrefs++; - if (fileid != NULL) - *fileid = lf->id; - sx_xunlock(&kld_sx); -done: + /* + * It is possible that kldloaded module will attach a new ifnet, + * so vnet context must be set when this ocurs. + */ + CURVNET_SET(TD_TO_VNET(td)); + + error = linker_load_module(kldname, modname, NULL, NULL, &lf); CURVNET_RESTORE(); + + if (error == 0) { + lf->userrefs++; + if (fileid != NULL) + *fileid = lf->id; + } + linker_kldload_unbusy(LINKER_UB_LOCKED); return (error); } @@ -1132,8 +1178,13 @@ kern_kldunload(struct thread *td, int fileid, int flags) if ((error = priv_check(td, PRIV_KLD_UNLOAD)) != 0) return (error); + error = linker_kldload_busy(LINKER_UB_PCATCH); + if (error != 0) { + sx_xunlock(&kld_sx); + return (error); + } + CURVNET_SET(TD_TO_VNET(td)); - sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); @@ -1153,9 +1204,8 @@ kern_kldunload(struct thread *td, int fileid, int flags) } } else error = ENOENT; - sx_xunlock(&kld_sx); - CURVNET_RESTORE(); + linker_kldload_unbusy(LINKER_UB_LOCKED); return (error); } diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 13274ecd1a7c..6423a3989a02 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -196,6 +196,15 @@ int linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, /* HWPMC helper */ void *linker_hwpmc_list_objects(void); +/* kldload/kldunload syscalls blocking */ +#define LINKER_UB_UNLOCK 0x0001 /* busy: unlock kld_sx locked on + return */ +#define LINKER_UB_LOCKED 0x0002 /* busy/unbusy: kld_sx locked on + entry */ +#define LINKER_UB_PCATCH 0x0004 /* busy: sleep interruptible */ +int linker_kldload_busy(int flags); +void linker_kldload_unbusy(int flags); + #endif /* _KERNEL */ /* From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 16:33:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C54FA650908; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJns5Hgtz3R6B; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E9B518A68; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX519004126; Mon, 7 Jun 2021 16:33:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX5B0004125; Mon, 7 Jun 2021 16:33:05 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:05 GMT Message-Id: <202106071633.157GX5B0004125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 664aff03fae2 - stable/13 - kern_thread.c: wrap too long lines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 664aff03fae2594e7db640c06c9edac5cb57bc7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=664aff03fae2594e7db640c06c9edac5cb57bc7f commit 664aff03fae2594e7db640c06c9edac5cb57bc7f Author: Konstantin Belousov AuthorDate: 2021-05-25 18:09:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 kern_thread.c: wrap too long lines (cherry picked from commit 845d77974b3b6ab78297836ead2d2acbcdebeba7) --- sys/kern/kern_thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index c16b6dd3c791..7370fd919203 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -541,7 +541,8 @@ threadinit(void) TASK_INIT(&thread_reap_task, 0, thread_reap_task_cb, NULL); callout_init(&thread_reap_callout, 1); - callout_reset(&thread_reap_callout, 5 * hz, thread_reap_callout_cb, NULL); + callout_reset(&thread_reap_callout, 5 * hz, + thread_reap_callout_cb, NULL); } /* @@ -704,7 +705,8 @@ thread_reap_callout_cb(void *arg __unused) if (wantreap) taskqueue_enqueue(taskqueue_thread, &thread_reap_task); - callout_reset(&thread_reap_callout, 5 * hz, thread_reap_callout_cb, NULL); + callout_reset(&thread_reap_callout, 5 * hz, + thread_reap_callout_cb, NULL); } /* From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 16:33:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 048A465005B; Mon, 7 Jun 2021 16:33:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnt6NwMz3R1C; Mon, 7 Jun 2021 16:33:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C145118EB7; Mon, 7 Jun 2021 16:33:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX6aG004147; Mon, 7 Jun 2021 16:33:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX6gu004146; Mon, 7 Jun 2021 16:33:06 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:06 GMT Message-Id: <202106071633.157GX6gu004146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b25cbead39ca - stable/13 - quisce_cpus(): add special handling for PDROP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b25cbead39ca3e23de6f2a61f089da972b9f3157 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b25cbead39ca3e23de6f2a61f089da972b9f3157 commit b25cbead39ca3e23de6f2a61f089da972b9f3157 Author: Konstantin Belousov AuthorDate: 2021-05-28 17:10:47 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 quisce_cpus(): add special handling for PDROP (cherry picked from commit 3a68546d2377d6e9776060043372d66f07022543) --- sys/kern/subr_smp.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index d4f8aac9e751..935fb6ee977c 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -943,25 +943,31 @@ smp_rendezvous_cpus_done(struct smp_rendezvous_cpus_retry_arg *arg) } /* + * If (prio & PDROP) == 0: * Wait for specified idle threads to switch once. This ensures that even * preempted threads have cycled through the switch function once, * exiting their codepaths. This allows us to change global pointers * with no other synchronization. + * If (prio & PDROP) != 0: + * Force the specified CPUs to switch context at least once. */ int quiesce_cpus(cpuset_t map, const char *wmesg, int prio) { struct pcpu *pcpu; - u_int gen[MAXCPU]; + u_int *gen; int error; int cpu; error = 0; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) - continue; - pcpu = pcpu_find(cpu); - gen[cpu] = pcpu->pc_idlethread->td_generation; + if ((prio & PDROP) == 0) { + gen = malloc(sizeof(u_int) * MAXCPU, M_TEMP, M_WAITOK); + for (cpu = 0; cpu <= mp_maxid; cpu++) { + if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) + continue; + pcpu = pcpu_find(cpu); + gen[cpu] = pcpu->pc_idlethread->td_generation; + } } for (cpu = 0; cpu <= mp_maxid; cpu++) { if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) @@ -970,8 +976,10 @@ quiesce_cpus(cpuset_t map, const char *wmesg, int prio) thread_lock(curthread); sched_bind(curthread, cpu); thread_unlock(curthread); + if ((prio & PDROP) != 0) + continue; while (gen[cpu] == pcpu->pc_idlethread->td_generation) { - error = tsleep(quiesce_cpus, prio, wmesg, 1); + error = tsleep(quiesce_cpus, prio & ~PDROP, wmesg, 1); if (error != EWOULDBLOCK) goto out; error = 0; @@ -981,6 +989,8 @@ out: thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); + if ((prio & PDROP) == 0) + free(gen, M_TEMP); return (error); } From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 16:33:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CC1465005F; Mon, 7 Jun 2021 16:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnw04bMz3RHq; Mon, 7 Jun 2021 16:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCCE318DD6; Mon, 7 Jun 2021 16:33:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX7ol004170; Mon, 7 Jun 2021 16:33:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX7pL004169; Mon, 7 Jun 2021 16:33:07 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:07 GMT Message-Id: <202106071633.157GX7pL004169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8c30192804eb - stable/13 - Add thread_reap_barrier() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c30192804eb91b2b976e92d0ca52fd034520062 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8c30192804eb91b2b976e92d0ca52fd034520062 commit 8c30192804eb91b2b976e92d0ca52fd034520062 Author: Konstantin Belousov AuthorDate: 2021-05-25 18:51:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 Add thread_reap_barrier() (cherry picked from commit f62c7e54e9cc692603081328597ba0ba0d1f21cf) (cherry picked from commit d3f7975fcb346ea28dde079a9c04cff5ef20a8d7) --- sys/kern/kern_thread.c | 29 +++++++++++++++++++++++++++++ sys/sys/proc.h | 1 + 2 files changed, 30 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 7370fd919203..48aac8e057b8 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -709,6 +709,35 @@ thread_reap_callout_cb(void *arg __unused) thread_reap_callout_cb, NULL); } +/* + * Calling this function guarantees that any thread that exited before + * the call is reaped when the function returns. By 'exited' we mean + * a thread removed from the process linkage with thread_unlink(). + * Practically this means that caller must lock/unlock corresponding + * process lock before the call, to synchronize with thread_exit(). + */ +void +thread_reap_barrier(void) +{ + struct task *t; + + /* + * First do context switches to each CPU to ensure that all + * PCPU pc_deadthreads are moved to zombie list. + */ + quiesce_all_cpus("", PDROP); + + /* + * Second, fire the task in the same thread as normal + * thread_reap() is done, to serialize reaping. + */ + t = malloc(sizeof(*t), M_TEMP, M_WAITOK); + TASK_INIT(t, 0, thread_reap_task_cb, t); + taskqueue_enqueue(taskqueue_thread, t); + taskqueue_drain(taskqueue_thread, t); + free(t, M_TEMP); +} + /* * Allocate a thread. */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 7a2210778a39..b0fc13a449cb 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1177,6 +1177,7 @@ int thread_create(struct thread *td, struct rtprio *rtp, void thread_exit(void) __dead2; void thread_free(struct thread *td); void thread_link(struct thread *td, struct proc *p); +void thread_reap_barrier(void); int thread_single(struct proc *p, int how); void thread_single_end(struct proc *p, int how); void thread_stash(struct thread *td); From owner-dev-commits-src-branches@freebsd.org Mon Jun 7 23:37:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BCDD655BB7; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzVC91rxJz4m0T; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C111E469; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Nb9ID060172; Mon, 7 Jun 2021 23:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Nb9vU060171; Mon, 7 Jun 2021 23:37:09 GMT (envelope-from git) Date: Mon, 7 Jun 2021 23:37:09 GMT Message-Id: <202106072337.157Nb9vU060171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 68d6663afbae - stable/13 - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68d6663afbae7e49e04bcabc1662df5db3edd738 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 23:37:09 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=68d6663afbae7e49e04bcabc1662df5db3edd738 commit 68d6663afbae7e49e04bcabc1662df5db3edd738 Author: Randall Stewart AuthorDate: 2021-01-26 16:54:42 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 23:18:32 +0000 This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D28357 (cherry picked from commit 1a714ff204193b9eb810426048e03f5d76e9730e) --- sys/net/if_lagg.c | 11 + sys/net/if_var.h | 2 + sys/net/if_vlan.c | 30 +++ sys/netinet/in_pcb.c | 9 + sys/netinet/tcp_log_buf.h | 2 +- sys/netinet/tcp_ratelimit.c | 584 +++++++++++++++++++++++++++--------------- sys/netinet/tcp_ratelimit.h | 24 +- sys/netinet/tcp_stacks/bbr.c | 4 +- sys/netinet/tcp_stacks/rack.c | 14 +- 9 files changed, 464 insertions(+), 216 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 3144f86901b2..9a3c22789fa5 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, static int lagg_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void lagg_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); static void lagg_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); #endif @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) ifp->if_snd_tag_modify = lagg_snd_tag_modify; ifp->if_snd_tag_query = lagg_snd_tag_query; ifp->if_snd_tag_free = lagg_snd_tag_free; + ifp->if_next_snd_tag = lagg_next_snd_tag; ifp->if_ratelimit_query = lagg_ratelimit_query; #endif ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +lagg_next_snd_tag(struct m_snd_tag *mst) +{ + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + return (lst->tag); +} + static int lagg_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index bb364fd10974..291a7781d73c 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params * typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); typedef void (if_ratelimit_query_t)(struct ifnet *, struct if_ratelimit_query_results *); typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); @@ -422,6 +423,7 @@ struct ifnet { if_snd_tag_modify_t *if_snd_tag_modify; if_snd_tag_query_t *if_snd_tag_query; if_snd_tag_free_t *if_snd_tag_free; + if_next_send_tag_t *if_next_snd_tag; if_ratelimit_query_t *if_ratelimit_query; if_ratelimit_setup_t *if_ratelimit_setup; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 40b042b56248..bd3a5335a97f 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, static int vlan_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void vlan_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); +static void vlan_ratelimit_query(struct ifnet *, + struct if_ratelimit_query_results *); #endif static void vlan_qflush(struct ifnet *ifp); static int vlan_setflag(struct ifnet *ifp, int flag, int status, @@ -1099,6 +1102,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_snd_tag_modify = vlan_snd_tag_modify; ifp->if_snd_tag_query = vlan_snd_tag_query; ifp->if_snd_tag_free = vlan_snd_tag_free; + ifp->if_next_snd_tag = vlan_next_snd_tag; + ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; ether_ifattach(ifp, eaddr); @@ -2108,6 +2113,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +vlan_next_snd_tag(struct m_snd_tag *mst) +{ + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + return (vst->tag); +} + static int vlan_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) @@ -2137,4 +2151,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) m_snd_tag_rele(vst->tag); free(vst, M_VLAN); } + +static void +vlan_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) +{ + /* + * For vlan, we have an indirect + * interface. The caller needs to + * get a ratelimit tag on the actual + * interface the flow will go on. + */ + q->rate_table = NULL; + q->flags = RT_IS_INDIRECT; + q->max_flows = 0; + q->number_of_rates = 0; +} + #endif diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 857119e8213b..8b109bce9dff 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, "allocation before switching to a random one"); #ifdef RATELIMIT +counter_u64_t rate_limit_new; +counter_u64_t rate_limit_chg; counter_u64_t rate_limit_active; counter_u64_t rate_limit_alloc_fail; counter_u64_t rate_limit_set_ok; @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, alloc_fail, CTLFLAG_RD, &rate_limit_alloc_fail, "Rate limited connection failures"); SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, &rate_limit_set_ok, "Rate limited setting succeeded"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, + &rate_limit_new, "Total Rate limit new attempts"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, + &rate_limit_chg, "Total Rate limited change attempts"); + #endif /* RATELIMIT */ #endif /* INET */ @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) static void rl_init(void *st) { + rate_limit_new = counter_u64_alloc(M_WAITOK); + rate_limit_chg = counter_u64_alloc(M_WAITOK); rate_limit_active = counter_u64_alloc(M_WAITOK); rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); rate_limit_set_ok = counter_u64_alloc(M_WAITOK); diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 0d9b14a08f53..436383124dce 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -221,7 +221,7 @@ enum tcp_log_events { BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ TCP_LOG_REASS, /* Reassembly buffer logging 50 */ - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 */ BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ TCP_LOG_CONNEND, /* End of connection 54 */ diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 97f066be69e0..aeb1ed6906b5 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #endif +#include +#include #include #ifndef USECS_IN_SECOND #define USECS_IN_SECOND 1000000 @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { 180500, /* 1.44Mpbs - rate 2 common rate */ 375000, /* 3Mbps - rate 3 */ 625000, /* 5Mbps - rate 4 */ - 875000, /* 7Mbps - rate 5 */ - 1125000, /* 9Mbps - rate 6 */ - 1375000, /* 11Mbps - rate 7 */ - 1625000, /* 13Mbps - rate 8 */ - 2625000, /* 21Mbps - rate 9 */ - 3875000, /* 31Mbps - rate 10 */ - 5125000, /* 41Meg - rate 11 */ - 12500000, /* 100Mbps - rate 12 */ - 25000000, /* 200Mbps - rate 13 */ - 50000000, /* 400Mbps - rate 14 */ - 63750000, /* 51Mbps - rate 15 */ + 1250000, /* 10Mbps - rate 5 */ + 1875000, /* 15Mbps - rate 6 */ + 2500000, /* 20Mbps - rate 7 */ + 3125000, /* 25Mbps - rate 8 */ + 3750000, /* 30Mbps - rate 9 */ + 4375000, /* 35Mbps - rate 10 */ + 5000000, /* 40Meg - rate 11 */ + 6250000, /* 50Mbps - rate 12 */ + 12500000, /* 100Mbps - rate 13 */ + 25000000, /* 200Mbps - rate 14 */ + 50000000, /* 400Mbps - rate 15 */ 100000000, /* 800Mbps - rate 16 */ - 1875000, /* 15Mbps - rate 17 */ - 2125000, /* 17Mbps - rate 18 */ - 2375000, /* 19Mbps - rate 19 */ - 2875000, /* 23Mbps - rate 20 */ - 3125000, /* 25Mbps - rate 21 */ - 3375000, /* 27Mbps - rate 22 */ - 3625000, /* 29Mbps - rate 23 */ - 4125000, /* 33Mbps - rate 24 */ - 4375000, /* 35Mbps - rate 25 */ - 4625000, /* 37Mbps - rate 26 */ - 4875000, /* 39Mbps - rate 27 */ - 5375000, /* 43Mbps - rate 28 */ - 5625000, /* 45Mbps - rate 29 */ - 5875000, /* 47Mbps - rate 30 */ - 6125000, /* 49Mbps - rate 31 */ - 6625000, /* 53Mbps - rate 32 */ - 6875000, /* 55Mbps - rate 33 */ - 7125000, /* 57Mbps - rate 34 */ - 7375000, /* 59Mbps - rate 35 */ - 7625000, /* 61Mbps - rate 36 */ - 7875000, /* 63Mbps - rate 37 */ - 8125000, /* 65Mbps - rate 38 */ - 8375000, /* 67Mbps - rate 39 */ - 8625000, /* 69Mbps - rate 40 */ - 8875000, /* 71Mbps - rate 41 */ - 9125000, /* 73Mbps - rate 42 */ - 9375000, /* 75Mbps - rate 43 */ - 9625000, /* 77Mbps - rate 44 */ - 9875000, /* 79Mbps - rate 45 */ - 10125000, /* 81Mbps - rate 46 */ - 10375000, /* 83Mbps - rate 47 */ - 10625000, /* 85Mbps - rate 48 */ - 10875000, /* 87Mbps - rate 49 */ - 11125000, /* 89Mbps - rate 50 */ - 11375000, /* 91Mbps - rate 51 */ - 11625000, /* 93Mbps - rate 52 */ - 11875000, /* 95Mbps - rate 53 */ - 13125000, /* 105Mbps - rate 54 */ - 13750000, /* 110Mbps - rate 55 */ - 14375000, /* 115Mbps - rate 56 */ - 15000000, /* 120Mbps - rate 57 */ - 15625000, /* 125Mbps - rate 58 */ - 16250000, /* 130Mbps - rate 59 */ - 16875000, /* 135Mbps - rate 60 */ - 17500000, /* 140Mbps - rate 61 */ - 18125000, /* 145Mbps - rate 62 */ - 18750000, /* 150Mbps - rate 64 */ - 20000000, /* 160Mbps - rate 65 */ - 21250000, /* 170Mbps - rate 66 */ - 22500000, /* 180Mbps - rate 67 */ - 23750000, /* 190Mbps - rate 68 */ - 26250000, /* 210Mbps - rate 69 */ - 27500000, /* 220Mbps - rate 70 */ - 28750000, /* 230Mbps - rate 71 */ - 30000000, /* 240Mbps - rate 72 */ - 31250000, /* 250Mbps - rate 73 */ - 34375000, /* 275Mbps - rate 74 */ - 37500000, /* 300Mbps - rate 75 */ - 40625000, /* 325Mbps - rate 76 */ - 43750000, /* 350Mbps - rate 77 */ - 46875000, /* 375Mbps - rate 78 */ - 53125000, /* 425Mbps - rate 79 */ - 56250000, /* 450Mbps - rate 80 */ - 59375000, /* 475Mbps - rate 81 */ - 62500000, /* 500Mbps - rate 82 */ - 68750000, /* 550Mbps - rate 83 */ - 75000000, /* 600Mbps - rate 84 */ - 81250000, /* 650Mbps - rate 85 */ - 87500000, /* 700Mbps - rate 86 */ - 93750000, /* 750Mbps - rate 87 */ - 106250000, /* 850Mbps - rate 88 */ - 112500000, /* 900Mbps - rate 89 */ - 125000000, /* 1Gbps - rate 90 */ - 156250000, /* 1.25Gps - rate 91 */ - 187500000, /* 1.5Gps - rate 92 */ - 218750000, /* 1.75Gps - rate 93 */ - 250000000, /* 2Gbps - rate 94 */ - 281250000, /* 2.25Gps - rate 95 */ - 312500000, /* 2.5Gbps - rate 96 */ - 343750000, /* 2.75Gbps - rate 97 */ - 375000000, /* 3Gbps - rate 98 */ - 500000000, /* 4Gbps - rate 99 */ - 625000000, /* 5Gbps - rate 100 */ - 750000000, /* 6Gbps - rate 101 */ - 875000000, /* 7Gbps - rate 102 */ - 1000000000, /* 8Gbps - rate 103 */ - 1125000000, /* 9Gbps - rate 104 */ - 1250000000, /* 10Gbps - rate 105 */ - 1875000000, /* 15Gbps - rate 106 */ - 2500000000 /* 20Gbps - rate 107 */ + 5625000, /* 45Mbps - rate 17 */ + 6875000, /* 55Mbps - rate 19 */ + 7500000, /* 60Mbps - rate 20 */ + 8125000, /* 65Mbps - rate 21 */ + 8750000, /* 70Mbps - rate 22 */ + 9375000, /* 75Mbps - rate 23 */ + 10000000, /* 80Mbps - rate 24 */ + 10625000, /* 85Mbps - rate 25 */ + 11250000, /* 90Mbps - rate 26 */ + 11875000, /* 95Mbps - rate 27 */ + 12500000, /* 100Mbps - rate 28 */ + 13750000, /* 110Mbps - rate 29 */ + 15000000, /* 120Mbps - rate 30 */ + 16250000, /* 130Mbps - rate 31 */ + 17500000, /* 140Mbps - rate 32 */ + 18750000, /* 150Mbps - rate 33 */ + 20000000, /* 160Mbps - rate 34 */ + 21250000, /* 170Mbps - rate 35 */ + 22500000, /* 180Mbps - rate 36 */ + 23750000, /* 190Mbps - rate 37 */ + 26250000, /* 210Mbps - rate 38 */ + 27500000, /* 220Mbps - rate 39 */ + 28750000, /* 230Mbps - rate 40 */ + 30000000, /* 240Mbps - rate 41 */ + 31250000, /* 250Mbps - rate 42 */ + 34375000, /* 275Mbps - rate 43 */ + 37500000, /* 300Mbps - rate 44 */ + 40625000, /* 325Mbps - rate 45 */ + 43750000, /* 350Mbps - rate 46 */ + 46875000, /* 375Mbps - rate 47 */ + 53125000, /* 425Mbps - rate 48 */ + 56250000, /* 450Mbps - rate 49 */ + 59375000, /* 475Mbps - rate 50 */ + 62500000, /* 500Mbps - rate 51 */ + 68750000, /* 550Mbps - rate 52 */ + 75000000, /* 600Mbps - rate 53 */ + 81250000, /* 650Mbps - rate 54 */ + 87500000, /* 700Mbps - rate 55 */ + 93750000, /* 750Mbps - rate 56 */ + 106250000, /* 850Mbps - rate 57 */ + 112500000, /* 900Mbps - rate 58 */ + 125000000, /* 1Gbps - rate 59 */ + 156250000, /* 1.25Gps - rate 60 */ + 187500000, /* 1.5Gps - rate 61 */ + 218750000, /* 1.75Gps - rate 62 */ + 250000000, /* 2Gbps - rate 63 */ + 281250000, /* 2.25Gps - rate 64 */ + 312500000, /* 2.5Gbps - rate 65 */ + 343750000, /* 2.75Gbps - rate 66 */ + 375000000, /* 3Gbps - rate 67 */ + 500000000, /* 4Gbps - rate 68 */ + 625000000, /* 5Gbps - rate 69 */ + 750000000, /* 6Gbps - rate 70 */ + 875000000, /* 7Gbps - rate 71 */ + 1000000000, /* 8Gbps - rate 72 */ + 1125000000, /* 9Gbps - rate 73 */ + 1250000000, /* 10Gbps - rate 74 */ + 1875000000, /* 15Gbps - rate 75 */ + 2500000000 /* 20Gbps - rate 76 */ }; #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; static struct mtx rs_mtx; uint32_t rs_number_alive; uint32_t rs_number_dead; +static uint32_t rs_floor_mss = 0; +static uint32_t wait_time_floor = 8000; /* 8 ms */ +static uint32_t rs_hw_floor_mss = 16; +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are we willing to wait */ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Ratelimit stats"); @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, CTLFLAG_RW, SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, &rs_number_dead, 0, "Number of interfaces departing from ratelimiting"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, + &rs_floor_mss, 0, + "Number of MSS that will override the normal minimums (0 means don't enforce)"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, + &wait_time_floor, 2000, + "Has b/w increases what is the wait floor we are willing to wait at the end?"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, + &num_of_waits_allowed, 1, + "How many time blocks on the end should software pacing be willing to wait?"); + +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, + &rs_hw_floor_mss, 16, + "Number of mss that are a minum for hardware pacing?"); + static void rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) @@ -383,6 +372,17 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); + SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "using", CTLFLAG_RD, + &rs->rs_rlt[i].using, 0, + "Number of flows using"); + SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "enobufs", CTLFLAG_RD, + &rs->rs_rlt[i].rs_num_enobufs, 0, + "Number of enobufs logged on this rate"); + } } #endif @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) } #ifdef INET +extern counter_u64_t rate_limit_new; +extern counter_u64_t rate_limit_chg; extern counter_u64_t rate_limit_set_ok; extern counter_u64_t rate_limit_active; extern counter_u64_t rate_limit_alloc_fail; @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) int i; struct if_ratelimit_query_results rl; struct sysctl_oid *rl_sysctl_root; + struct epoch_tracker et; /* * We expect to enter with the * mutex locked. @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { memset(rs, 0, sizeof(struct tcp_rate_set)); @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { /* Mellanox C4 likely */ @@ -671,6 +678,8 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; + rs->rs_rlt[i].using = 0; + rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -741,18 +750,24 @@ handle_err: CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, - uint64_t bytes_per_sec, uint32_t flags) +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; - uint64_t mbits_per_sec, ind_calc; + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; int i; mbits_per_sec = (bytes_per_sec * 8); @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, * Smaller than 1Meg, only * 3 entries can match it. */ + previous_rate = 0; for(i = rs->rs_lowest_valid; i < 3; i++) { if (bytes_per_sec <= rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { arte = &rs->rs_rlt[i]; } + previous_rate = rs->rs_rlt[i].rate; } goto done; } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; else arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; goto done; } /* @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = ALL_HARDWARE_RATES-1; } if ((ind_calc >= rs->rs_lowest_valid) && - (ind_calc <= rs->rs_highest_valid)) - rte = &rs->rs_rlt[ind_calc]; + (ind_calc <= rs->rs_highest_valid)) { + rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } else if (flags & RS_PACING_EXACT_MATCH) { if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && (rs->rs_lowest_valid <= 2)){ @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, for (i=2; i>=rs->rs_lowest_valid; i--) { if (bytes_per_sec < rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else if ((flags & RS_PACING_GEQ) && (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else { arte = &rs->rs_rlt[i]; /* new alternate */ @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* The top rate is an alternative */ arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; } + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; } else { /* Its in our range 1Meg - 1Gig */ if (flags & RS_PACING_GEQ) { @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = (ALL_HARDWARE_RATES-1); } rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; } goto done; } @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* This should not happen */ ind_calc = ALL_HARDWARE_RATES-1; } - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } } done: @@ -893,11 +926,17 @@ done: /* We can use the substitute */ rte = arte; } + if (lower_rate) + *lower_rate = previous_rate; return (rte); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags) +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { /** * Hunt the rate table with the restrictions in flags and find a @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui */ int i, matched; struct tcp_hwrate_limit_table *rte = NULL; + uint64_t previous_rate = 0; if ((rs->rs_flags & RS_INT_TBL) && (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * from 1Meg - 1000Meg in 1Meg increments. * Use an alternate method to "lookup". */ - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate)); } if ((flags & RS_PACING_LT) || (flags & RS_PACING_EXACT_MATCH)) { @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } else if ((flags & RS_PACING_LT) && (bytes_per_sec <= rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } + previous_rate = rs->rs_rlt[i].rate; if (bytes_per_sec > rs->rs_rlt[i].rate) break; } @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * We found a table entry that is smaller, * stop there will be none greater or equal. */ + if (lower_rate != NULL) + *lower_rate = rs->rs_rlt[i].rate; break; } } @@ -995,10 +1042,10 @@ static struct ifnet * rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) { struct ifnet *tifp; - struct m_snd_tag *tag; + struct m_snd_tag *tag, *ntag; union if_snd_tag_alloc_params params = { .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, - .rate_limit.hdr.flowid = 1, + .rate_limit.hdr.flowid = inp->inp_flowid, .rate_limit.hdr.numa_domain = inp->inp_numa_domain, .rate_limit.max_rate = COMMON_RATE, .rate_limit.flags = M_NOWAIT, @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) *error = err; return (NULL); } - tifp = tag->ifp; + ntag = tag; + while(ntag->ifp->if_next_snd_tag != NULL) { + ntag = ntag->ifp->if_next_snd_tag(ntag); + } + tifp = ntag->ifp; m_snd_tag_rele(tag); return (tifp); } +static void +rl_increment_using(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->using, 1); +} + +static void +rl_decrement_using(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_subtract_long(&decon_rte->using, 1); +} + +void +tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->rs_num_enobufs, 1); +} + +/* + * Do NOT take the __noinline out of the + * find_rs_for_ifp() function. If you do the inline + * of it for the rt_setup_rate() will show you a + * compiler bug. For some reason the compiler thinks + * the list can never be empty. The consequence of + * this will be a crash when we dereference NULL + * if an ifp is removed just has a hw rate limit + * is attempted. If you are working on the compiler + * and want to "test" this go ahead and take the noinline + * out otherwise let sleeping dogs ly until such time + * as we get a compiler fix 10/2/20 -- RRS + */ +static __noinline struct tcp_rate_set * +find_rs_for_ifp(struct ifnet *ifp) +{ + struct tcp_rate_set *rs; + + CK_LIST_FOREACH(rs, &int_rs, next) { + if ((rs->rs_ifp == ifp) && + (rs->rs_if_dunit == ifp->if_dunit)) { + /* Ok we found it */ + return (rs); + } + } + return (NULL); +} + + static const struct tcp_hwrate_limit_table * rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, - uint32_t flags, int *error) + uint32_t flags, int *error, uint64_t *lower_rate) { /* First lets find the interface if it exists */ const struct tcp_hwrate_limit_table *rte; - struct tcp_rate_set *rs; + /* + * So why is rs volatile? This is to defeat a + * compiler bug where in the compiler is convinced + * that rs can never be NULL (which is not true). Because + * of its conviction it nicely optimizes out the if ((rs == NULL + * below which means if you get a NULL back you dereference it. + */ + volatile struct tcp_rate_set *rs; struct epoch_tracker et; + struct ifnet *oifp = ifp; int err; NET_EPOCH_ENTER(et); use_real_interface: - CK_LIST_FOREACH(rs, &int_rs, next) { - /* - * Note we don't look with the lock since we either see a - * new entry or will get one when we try to add it. - */ - if (rs->rs_flags & RS_IS_DEAD) { - /* The dead are not looked at */ - continue; - } - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* Ok we found it */ - break; - } - } + rs = find_rs_for_ifp(ifp); if ((rs == NULL) || (rs->rs_flags & RS_INTF_NO_SUP) || (rs->rs_flags & RS_IS_DEAD)) { @@ -1063,14 +1164,14 @@ use_real_interface: * might be arguable, but its impossible * to tell from the departing case. */ - if (rs->rs_disable && error) + if (error) *error = ENODEV; NET_EPOCH_EXIT(et); return (NULL); } if ((rs == NULL) || (rs->rs_disable != 0)) { - if (rs->rs_disable && error) + if (error) *error = ENOSPC; NET_EPOCH_EXIT(et); return (NULL); @@ -1086,6 +1187,10 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } + KASSERT((tifp != ifp), + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the same interface tifp:%p?\n", + ifp, inp, tifp)); + ifp = tifp; goto use_real_interface; } if (rs->rs_flow_limit && @@ -1095,9 +1200,9 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); if (rte) { - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, + err = in_pcbattach_txrtlmt(inp, oifp, inp->inp_flowtype, inp->inp_flowid, rte->rate, @@ -1107,6 +1212,11 @@ use_real_interface: if (error) *error = err; rte = NULL; + } else { + KASSERT((inp->inp_snd_tag != NULL) , + ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", + inp, rte, rte->rate, rs)); + counter_u64_add(rate_limit_new, 1); } } if (rte) { @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) { int error; struct tcp_rate_set *rs; + struct epoch_tracker et; if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || (link_state != LINK_STATE_UP)) { @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) */ return; } + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH(rs, &int_rs, next) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* We already have initialized this guy */ - mtx_unlock(&rs_mtx); - return; - } + rs = find_rs_for_ifp(ifp); + if (rs) { + /* We already have initialized this guy */ + mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); + return; } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); rt_setup_new_rs(ifp, &error); } static void tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) { - struct tcp_rate_set *rs, *nrs; + struct tcp_rate_set *rs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - CK_LIST_REMOVE(rs, next); - rs_number_alive--; - rs->rs_flags |= RS_IS_DEAD; - for (i = 0; i < rs->rs_rate_cnt; i++) { - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { - in_pcbdetach_tag(rs->rs_rlt[i].tag); - rs->rs_rlt[i].tag = NULL; - } - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; + rs = find_rs_for_ifp(ifp); + if (rs) { + CK_LIST_REMOVE(rs, next); + rs_number_alive--; + rs->rs_flags |= RS_IS_DEAD; + for (i = 0; i < rs->rs_rate_cnt; i++) { + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { + in_pcbdetach_tag(rs->rs_rlt[i].tag); + rs->rs_rlt[i].tag = NULL; } - if (rs->rs_flows_using == 0) - rs_defer_destroy(rs); - break; + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; } + if (rs->rs_flows_using == 0) + rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } static void tcp_rl_shutdown(void *arg __unused, int howto __unused) { struct tcp_rate_set *rs, *nrs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { CK_LIST_REMOVE(rs, next); @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto __unused) rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } const struct tcp_hwrate_limit_table * tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *rte; #ifdef KERN_TLS @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, } } #endif - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, lower_rate); + if (rte) + rl_increment_using(rte); #ifdef KERN_TLS if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { /* @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, *error = EINVAL; rte = NULL; } - tp->t_pacing_rate = rte->rate; - *error = 0; + if (rte != NULL) { + tp->t_pacing_rate = rte->rate; + *error = 0; + } return (rte); } const struct tcp_hwrate_limit_table * tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *nrte; const struct tcp_rate_set *rs; #ifdef KERN_TLS struct ktls_session *tls = NULL; #endif - int is_indirect = 0; int err; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if ((rs->rs_flags & RS_IS_DEAD) || (crte->flags & HDWRPACE_IFPDEPARTED)) { /* Release the rate, and try anew */ -re_rate: + tcp_rel_pacing_rate(crte, tp); *** 388 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 10:15:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 362C365D224; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzmMY0pjfz3sgx; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03EF426E2A; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AFKoP007532; Tue, 8 Jun 2021 10:15:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AFKAt007531; Tue, 8 Jun 2021 10:15:20 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:15:20 GMT Message-Id: <202106081015.158AFKAt007531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: f18b7f239dcd - stable/13 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f18b7f239dcd75a192891232bc1fc099805f7d76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:15:21 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=f18b7f239dcd75a192891232bc1fc099805f7d76 commit f18b7f239dcd75a192891232bc1fc099805f7d76 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:14:34 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index 8050edbba562..c3c2126bdef5 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -960,9 +960,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 10:24:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F7AE65D177; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzmZ33t20z3tGW; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DA3E27497; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AORtD021422; Tue, 8 Jun 2021 10:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AOR1C021421; Tue, 8 Jun 2021 10:24:27 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:24:27 GMT Message-Id: <202106081024.158AOR1C021421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 39917ef2a85f - stable/12 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 39917ef2a85fa92a641bd6be346068f6097c8e98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:24:27 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=39917ef2a85fa92a641bd6be346068f6097c8e98 commit 39917ef2a85fa92a641bd6be346068f6097c8e98 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:23:49 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index b08cecd102e9..7297756c796d 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -961,9 +961,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 10:27:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE12265D40A; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzmd15qnmz3tbR; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B04B1271A2; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AR1UE021817; Tue, 8 Jun 2021 10:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AR1iF021816; Tue, 8 Jun 2021 10:27:01 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:27:01 GMT Message-Id: <202106081027.158AR1iF021816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 90e161ec6d11 - stable/11 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:27:01 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 commit 90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:26:09 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index b08cecd102e9..7297756c796d 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -961,9 +961,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 13:37:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0173565F572; Tue, 8 Jun 2021 13:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsJ6f4lz4qVT; Tue, 8 Jun 2021 13:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC9821B2F; Tue, 8 Jun 2021 13:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dbu2J074747; Tue, 8 Jun 2021 13:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dbuii074746; Tue, 8 Jun 2021 13:37:56 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:37:56 GMT Message-Id: <202106081337.158Dbuii074746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1adf2f76c0c8 - stable/12 - pf: Avoid leaking pad bytes in struct pfr_astats when copying out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:37:57 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a commit 1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a Author: Mark Johnston AuthorDate: 2021-06-01 14:56:23 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:37:48 +0000 pf: Avoid leaking pad bytes in struct pfr_astats when copying out There is padding between pfr_astats.pfras_a and pfras_packets that was not getting initialized. Reported by: KMSAN Reviewed by: kp, imp Sponsored by: The FreeBSD Foundation (cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e) --- sys/netpfil/pf/pf_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 58b453cd550c..e9fd5f133c3f 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -1029,6 +1029,7 @@ pfr_copyout_astats(struct pfr_astats *as, const struct pfr_kentry *ke, int dir, op; const struct pfr_kcounters *kc = &ke->pfrke_counters; + bzero(as, sizeof(*as)); pfr_copyout_addr(&as->pfras_a, ke); as->pfras_tzero = kc->pfrkc_tzero; From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 13:37:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22EE865F6CD; Tue, 8 Jun 2021 13:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsL0PFNz4q9j; Tue, 8 Jun 2021 13:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E87351B30; Tue, 8 Jun 2021 13:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158DbvCa074771; Tue, 8 Jun 2021 13:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158DbvXT074770; Tue, 8 Jun 2021 13:37:57 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:37:57 GMT Message-Id: <202106081337.158DbvXT074770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0a41a2899eb2 - stable/12 - i386: Make setidt_disp a size_t instead of uintptr_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a41a2899eb226d34996b2470cf239d670ff186e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:37:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a41a2899eb226d34996b2470cf239d670ff186e commit 0a41a2899eb226d34996b2470cf239d670ff186e Author: Mark Johnston AuthorDate: 2021-06-01 14:28:57 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:37:48 +0000 i386: Make setidt_disp a size_t instead of uintptr_t setidt_disp is the offset of the ISR trampoline relative to the address of the routines in exception.s, so uintptr_t is not quite right. Also remove a bogus declaration I added in commit 18f55c67f7, it is not required after all. Reported by: jrtc27 Reviewed by: jrtc27, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420) --- sys/i386/i386/machdep.c | 2 +- sys/i386/include/md_var.h | 2 +- sys/x86/x86/local_apic.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 4ef37861b151..1aed12f422bc 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1527,7 +1527,7 @@ static struct soft_segment_descriptor ldt_segs[] = { .ssd_gran = 1 }, }; -uintptr_t setidt_disp; +size_t setidt_disp; void setidt(int idx, inthand_t *func, int typ, int dpl, int selec) diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 53e1861c8fff..0f0177012f3a 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -49,7 +49,7 @@ extern int sz_lcall_tramp; #endif extern uint32_t *vm_page_dump; extern vm_offset_t proc0kstack; -extern uintptr_t setidt_disp; +extern size_t setidt_disp; struct segment_descriptor; union savefpu; diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index a34cfbb8b1c9..759c1ae8625a 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2113,10 +2113,6 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ -#ifdef __i386__ -extern uintptr_t setidt_disp; -#endif - /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 13:38:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1F6765F6CF; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsQ5TLDz4qLY; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D491D80; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc2XJ074916; Tue, 8 Jun 2021 13:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc2Nr074915; Tue, 8 Jun 2021 13:38:02 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:02 GMT Message-Id: <202106081338.158Dc2Nr074915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5a7d63129a67 - stable/13 - pf: Avoid leaking pad bytes in struct pfr_astats when copying out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a7d63129a67ab5b343ef3054fa1ac4122218506 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:02 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a7d63129a67ab5b343ef3054fa1ac4122218506 commit 5a7d63129a67ab5b343ef3054fa1ac4122218506 Author: Mark Johnston AuthorDate: 2021-06-01 14:56:23 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:27:07 +0000 pf: Avoid leaking pad bytes in struct pfr_astats when copying out There is padding between pfr_astats.pfras_a and pfras_packets that was not getting initialized. Reported by: KMSAN Reviewed by: kp, imp Sponsored by: The FreeBSD Foundation (cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e) --- sys/netpfil/pf/pf_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index af2f614c9e8c..f643790ff620 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -1028,6 +1028,7 @@ pfr_copyout_astats(struct pfr_astats *as, const struct pfr_kentry *ke, int dir, op; const struct pfr_kcounters *kc = &ke->pfrke_counters; + bzero(as, sizeof(*as)); pfr_copyout_addr(&as->pfras_a, ke); as->pfras_tzero = kc->pfrkc_tzero; From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 13:38:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A92C65F6D0; Tue, 8 Jun 2021 13:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsR6mnxz4qJ6; Tue, 8 Jun 2021 13:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C83521D07; Tue, 8 Jun 2021 13:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc3DO074942; Tue, 8 Jun 2021 13:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc3DX074941; Tue, 8 Jun 2021 13:38:03 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:03 GMT Message-Id: <202106081338.158Dc3DX074941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 949fb4f9627b - stable/13 - i386: Make setidt_disp a size_t instead of uintptr_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 949fb4f9627b2727e4e3775d24dbc76638e885de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:04 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=949fb4f9627b2727e4e3775d24dbc76638e885de commit 949fb4f9627b2727e4e3775d24dbc76638e885de Author: Mark Johnston AuthorDate: 2021-06-01 14:28:57 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:27:32 +0000 i386: Make setidt_disp a size_t instead of uintptr_t setidt_disp is the offset of the ISR trampoline relative to the address of the routines in exception.s, so uintptr_t is not quite right. Also remove a bogus declaration I added in commit 18f55c67f7, it is not required after all. Reported by: jrtc27 Reviewed by: jrtc27, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420) --- sys/i386/i386/machdep.c | 2 +- sys/i386/include/md_var.h | 2 +- sys/x86/x86/local_apic.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 888550eab6ad..6b622c826265 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1514,7 +1514,7 @@ static struct soft_segment_descriptor ldt_segs[] = { .ssd_gran = 1 }, }; -uintptr_t setidt_disp; +size_t setidt_disp; void setidt(int idx, inthand_t *func, int typ, int dpl, int selec) diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index c41de85b9bc9..95f4907a61d0 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -48,7 +48,7 @@ extern int szosigcode; extern int sz_lcall_tramp; #endif extern vm_offset_t proc0kstack; -extern uintptr_t setidt_disp; +extern size_t setidt_disp; struct segment_descriptor; union savefpu; diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 28443c43cfc9..ee549559f5b1 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2115,10 +2115,6 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ -#ifdef __i386__ -extern uintptr_t setidt_disp; -#endif - /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 13:38:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BDA465F90D; Tue, 8 Jun 2021 13:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsT1Fpnz4qJ9; Tue, 8 Jun 2021 13:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB01A1D81; Tue, 8 Jun 2021 13:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc43J074975; Tue, 8 Jun 2021 13:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc4tL074974; Tue, 8 Jun 2021 13:38:04 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:04 GMT Message-Id: <202106081338.158Dc4tL074974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cb5fe9aa9fa0 - stable/13 - amd64: Clear the local TSS when creating a new thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb5fe9aa9fa0376078abc173b27605b6096dc681 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:05 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cb5fe9aa9fa0376078abc173b27605b6096dc681 commit cb5fe9aa9fa0376078abc173b27605b6096dc681 Author: Mark Johnston AuthorDate: 2021-06-01 23:38:22 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:33:59 +0000 amd64: Clear the local TSS when creating a new thread Otherwise it is copied from the creating thread. Then, if either thread exits, the other is left with a dangling pointer, typically resulting in a page fault upon the next context switch. Reported by: syzkaller Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 8cd05b883330049d536a40e2f4c9ff92d0e6944e) --- sys/amd64/amd64/vm_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 1acc5dc55c85..7d65269410e0 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -189,6 +189,8 @@ copy_thread(struct thread *td1, struct thread *td2) * pcb2->pcb_[fg]sbase: cloned above */ + pcb2->pcb_tssp = NULL; + /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 14:38:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF90E638986; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FztBq61H6z3CZR; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6CB92A8F; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158EcBgv097242; Tue, 8 Jun 2021 14:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158EcB96097241; Tue, 8 Jun 2021 14:38:11 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:38:11 GMT Message-Id: <202106081438.158EcB96097241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 84b8d2bc9ba8 - stable/13 - zfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:38:11 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 commit 84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 Merge: cb5fe9aa9fa0 3522f57b6ada Author: Martin Matuska AuthorDate: 2021-06-08 14:36:23 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 14:36:23 +0000 zfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13 This changes branch tracking of sys/contrib/openzfs to a new direct-import branch vendor/openzfs/zfs-2.1-release. No functional changes. OpenZFS tag: 2.1.0-rc1 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 3 --- sys/contrib/openzfs/scripts/zfs-images | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --cc sys/contrib/openzfs/scripts/zfs-images index 000000000000,3331601f6dc5..3331601f6dc5 mode 000000,160000..160000 --- a/sys/contrib/openzfs/scripts/zfs-images +++ b/sys/contrib/openzfs/scripts/zfs-images From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 15:03:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8B8C6393A6; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fztmb5BZzz3HvP; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A84D3091; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158F3xnl039341; Tue, 8 Jun 2021 15:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158F3xpo039340; Tue, 8 Jun 2021 15:03:59 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:03:59 GMT Message-Id: <202106081503.158F3xpo039340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 04c4bd7f7b52 - stable/13 - zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04c4bd7f7b525b1627304894e3413693e945bc0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:03:59 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=04c4bd7f7b525b1627304894e3413693e945bc0d commit 04c4bd7f7b525b1627304894e3413693e945bc0d Merge: 84b8d2bc9ba8 7d9f3ef0ef5c Author: Martin Matuska AuthorDate: 2021-06-08 15:01:18 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 15:01:18 +0000 zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #11710 Allow zfs to send replication streams with missing snapshots #11786 Ratelimit deadman zevents as with delay zevents #11813 Allow pool names that look like Solaris disk names #11822 Atomically check and set dropped zevent count #11822 Don't scale zfs_zevent_len_max by CPU count #11837 zfs get -p only outputs 3 columns if "clones" property is empty #11849 Use dsl_scan_setup_check() to setup a scrub #11861 Improvements to the 'compatibility' property #11862 cmd/zfs receive: allow dry-run (-n) to check property args #11864 receive: don't fail inheriting (-x) properties on wrong dataset type #11877 Combine zio caches if possible #11881 FreeBSD: use vnlru_free_vfsops if available #11883 FreeBSD: add support for lockless symlink lookup #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr #11896 Fix crash in zio_done error reporting #11905 zfs-send(8): Restore sorting of flags #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines #11966 Scale worker threads and taskqs with number of CPUs #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #11998 Simplify/fix dnode_move() for dn_zfetch #12003 FreeBSD: Initialize/destroy zp->z_lock #12010 Fix dRAID self-healing short columns #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots" #12040 Reinstate the old zpool read label logic as a fallback #12049 FreeBSD: avoid memory allocation in arc_prune_async #12061 Fix dRAID sequential resilver silent damage handling #12077 FreeBSD: Retry OCF ENOMEM errors. #12088 Propagate vdev state due to invalid label corruption #12097 FreeBSD: Update dataset_kstats for zvols in dev mode Obtained from: OpenZFS OpenZFS commit: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950 OpenZFS tag: 2.1.0-rc6 cddl/share/zfs/compatibility.d/Makefile | 4 + .../.github/workflows/zfs-tests-functional.yml | 6 + .../openzfs/.github/workflows/zfs-tests-sanity.yml | 6 + sys/contrib/openzfs/.gitmodules | 2 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 12 +- sys/contrib/openzfs/RELEASES.md | 37 + sys/contrib/openzfs/cmd/arc_summary/arc_summary2 | 97 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary3 | 44 +- sys/contrib/openzfs/cmd/fsck_zfs/.gitignore | 1 + sys/contrib/openzfs/cmd/fsck_zfs/Makefile.am | 4 + sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs | 9 - sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in | 44 + sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c | 7 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 7 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 5 +- sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c | 1 + sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 1 + sys/contrib/openzfs/cmd/zed/zed.c | 48 +- sys/contrib/openzfs/cmd/zed/zed.d/data-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/generic-notify.sh | 2 +- .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 4 +- .../openzfs/cmd/zed/zed.d/scrub_finish-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/statechange-led.sh | 90 +- .../openzfs/cmd/zed/zed.d/statechange-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/trim_finish-notify.sh | 2 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 8 +- sys/contrib/openzfs/cmd/zed/zed.h | 17 +- sys/contrib/openzfs/cmd/zed/zed_conf.c | 218 +- sys/contrib/openzfs/cmd/zed/zed_conf.h | 38 +- sys/contrib/openzfs/cmd/zed/zed_disk_event.c | 1 + sys/contrib/openzfs/cmd/zed/zed_event.c | 82 +- sys/contrib/openzfs/cmd/zed/zed_event.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_exec.c | 255 ++- sys/contrib/openzfs/cmd/zed/zed_exec.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_file.c | 120 +- sys/contrib/openzfs/cmd/zed/zed_file.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_log.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_log.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.h | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 13 +- .../openzfs/cmd/zfs_ids_to_path/zfs_ids_to_path.c | 8 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 2 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 4 + .../cmd/zpool/compatibility.d/openzfs-2.1-freebsd | 34 + .../cmd/zpool/compatibility.d/openzfs-2.1-linux | 35 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.1 | 4 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.4 | 10 + sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 184 +- sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 2 +- sys/contrib/openzfs/cmd/zstreamdump/zstreamdump | 2 +- sys/contrib/openzfs/cmd/ztest/ztest.c | 2 +- sys/contrib/openzfs/cmd/zvol_wait/zvol_wait | 42 +- sys/contrib/openzfs/config/CppCheck.am | 2 +- sys/contrib/openzfs/config/deb.am | 22 +- sys/contrib/openzfs/config/kernel-acl.m4 | 25 +- sys/contrib/openzfs/config/kernel-bdi.m4 | 4 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 8 +- .../config/kernel-block-device-operations.m4 | 32 + .../openzfs/config/kernel-generic_fillattr.m4 | 2 +- .../openzfs/config/kernel-is_owner_or_cap.m4 | 4 + sys/contrib/openzfs/config/kernel-rename.m4 | 1 + sys/contrib/openzfs/config/kernel-siginfo.m4 | 21 + sys/contrib/openzfs/config/kernel-signal-stop.m4 | 21 + sys/contrib/openzfs/config/kernel-special-state.m4 | 21 + sys/contrib/openzfs/config/kernel-tmpfile.m4 | 28 +- sys/contrib/openzfs/config/kernel.m4 | 6 + sys/contrib/openzfs/config/zfs-build.m4 | 6 + .../openzfs/contrib/bash_completion.d/.gitignore | 1 + .../openzfs/contrib/bash_completion.d/Makefile.am | 5 +- .../contrib/bash_completion.d/{zfs => zfs.in} | 11 +- sys/contrib/openzfs/contrib/bpftrace/zfs-trace.sh | 4 +- .../dracut/02zfsexpandknowledge/module-setup.sh.in | 4 +- .../contrib/dracut/90zfs/zfs-generator.sh.in | 78 +- .../openzfs/contrib/dracut/90zfs/zfs-lib.sh.in | 49 +- .../dracut/90zfs/zfs-rollback-bootfs.service.in | 2 +- .../dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +- sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 4 +- sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 48 +- .../pyzfs/libzfs_core/test/test_libzfs_core.py | 4 +- sys/contrib/openzfs/copy-builtin | 45 +- .../system-generators/zfs-mount-generator.in | 1 + sys/contrib/openzfs/etc/zfs/zfs-functions.in | 4 +- sys/contrib/openzfs/include/libzfs.h | 10 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 1 - .../openzfs/include/os/freebsd/spl/sys/console.h | 35 - .../openzfs/include/os/freebsd/spl/sys/vnode.h | 5 - .../include/os/freebsd/spl/sys/vnode_impl.h | 2 +- .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 2 +- .../include/os/linux/kernel/linux/blkdev_compat.h | 22 +- .../include/os/linux/kernel/linux/mod_compat.h | 2 +- .../openzfs/include/os/linux/spl/sys/Makefile.am | 1 - .../openzfs/include/os/linux/spl/sys/console.h | 30 - .../openzfs/include/os/linux/spl/sys/signal.h | 18 +- .../openzfs/include/os/linux/spl/sys/thread.h | 13 + sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 5 + sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/include/sys/fm/util.h | 1 - sys/contrib/openzfs/include/sys/vdev_draid.h | 2 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 5 +- sys/contrib/openzfs/include/sys/vdev_raidz_impl.h | 3 +- sys/contrib/openzfs/include/sys/vdev_rebuild.h | 2 +- sys/contrib/openzfs/include/sys/zfs_context.h | 4 +- sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c | 29 +- sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 23 +- sys/contrib/openzfs/lib/libshare/os/linux/smb.c | 2 +- .../openzfs/lib/libspl/os/linux/gethostid.c | 41 +- .../openzfs/lib/libspl/os/linux/getmntany.c | 5 +- sys/contrib/openzfs/lib/libuutil/uu_open.c | 8 +- sys/contrib/openzfs/lib/libzfs/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 2084 ++++++++++---------- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 10 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_iter.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 27 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 258 +-- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 124 +- sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 28 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 20 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 5 - .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 10 +- .../lib/libzfs/os/linux/libzfs_sendrecv_os.c | 2 +- .../openzfs/lib/libzfs/os/linux/libzfs_util_os.c | 4 +- sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 2 +- .../openzfs/lib/libzfsbootenv/lzbe_device.c | 9 +- sys/contrib/openzfs/lib/libzpool/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 8 +- sys/contrib/openzfs/lib/libzpool/util.c | 2 +- .../lib/libzutil/os/freebsd/zutil_import_os.c | 2 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 30 +- .../lib/libzutil/os/linux/zutil_import_os.c | 4 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 111 +- sys/contrib/openzfs/lib/libzutil/zutil_nicenum.c | 3 + .../openzfs/man/man5/zfs-module-parameters.5 | 95 +- sys/contrib/openzfs/man/man5/zpool-features.5 | 23 +- sys/contrib/openzfs/man/man8/fsck.zfs.8 | 26 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 182 +- sys/contrib/openzfs/man/man8/zed.8.in | 40 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 1 + sys/contrib/openzfs/man/man8/zfs-jail.8 | 4 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 1 - sys/contrib/openzfs/man/man8/zfs-program.8 | 1 + sys/contrib/openzfs/man/man8/zfs-send.8 | 12 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 3 +- sys/contrib/openzfs/man/man8/zfs.8 | 2 +- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 2 +- sys/contrib/openzfs/man/man8/zfsprops.8 | 20 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 16 +- sys/contrib/openzfs/man/man8/zstream.8 | 3 +- sys/contrib/openzfs/module/avl/avl.c | 2 +- sys/contrib/openzfs/module/icp/Makefile.in | 7 +- sys/contrib/openzfs/module/icp/algs/edonr/edonr.c | 2 +- sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 16 +- .../openzfs/module/os/freebsd/zfs/crypto_os.c | 8 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 36 +- .../openzfs/module/os/freebsd/zfs/zfs_debug.c | 5 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 36 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 15 + .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 17 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 8 +- .../openzfs/module/os/linux/spl/spl-generic.c | 4 +- sys/contrib/openzfs/module/os/linux/spl/spl-proc.c | 105 +- .../openzfs/module/os/linux/spl/spl-thread.c | 51 + sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 8 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 9 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 2 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 17 +- .../openzfs/module/os/linux/zfs/zpl_export.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 2 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 41 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 35 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 + sys/contrib/openzfs/module/unicode/u8_textprep.c | 2 +- sys/contrib/openzfs/module/zcommon/zfs_comutil.c | 2 +- .../openzfs/module/zcommon/zfs_fletcher_avx512.c | 8 +- sys/contrib/openzfs/module/zcommon/zfs_namecheck.c | 6 - sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 4 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 67 +- sys/contrib/openzfs/module/zfs/dnode.c | 8 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 6 +- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 11 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 2 +- sys/contrib/openzfs/module/zfs/fm.c | 321 +-- sys/contrib/openzfs/module/zfs/spa.c | 92 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 2 +- sys/contrib/openzfs/module/zfs/vdev.c | 14 +- sys/contrib/openzfs/module/zfs/vdev_draid.c | 49 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 7 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 9 + sys/contrib/openzfs/module/zfs/vdev_raidz.c | 11 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 6 +- sys/contrib/openzfs/module/zfs/zfs_fm.c | 8 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 2 +- sys/contrib/openzfs/module/zfs/zio.c | 32 +- sys/contrib/openzfs/module/zstd/README.md | 2 +- .../module/zstd/include/zstd_compat_wrapper.h | 2 +- sys/contrib/openzfs/module/zstd/zfs_zstd.c | 4 +- sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 2 +- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 64 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 5 +- sys/contrib/openzfs/scripts/kmodtool | 16 +- sys/contrib/openzfs/scripts/zimport.sh | 6 +- sys/contrib/openzfs/tests/runfiles/common.run | 22 +- sys/contrib/openzfs/tests/runfiles/linux.run | 8 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 2 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 25 +- .../openzfs/tests/zfs-tests/cmd/draid/draid.c | 8 +- .../tests/zfs-tests/cmd/file_write/file_write.c | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 26 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 1 + .../tests/functional/atime/root_atime_off.ksh | 2 +- .../tests/functional/atime/root_atime_on.ksh | 2 +- .../tests/functional/atime/root_relatime_on.ksh | 2 +- .../cli_root/zfs_destroy/zfs_destroy_015_pos.ksh | 2 +- .../cli_root/zfs_get/zfs_get_001_pos.ksh | 12 +- .../cli_root/zfs_get/zfs_get_common.kshlib | 10 +- .../cli_root/zfs_mount/zfs_mount_test_race.ksh | 9 +- .../zfs_receive/receive-o-x_props_override.ksh | 15 +- .../tests/functional/cli_root/zfs_send/Makefile.am | 3 +- .../cli_root/zfs_send/zfs_send_skip_missing.ksh | 77 + .../cli_root/zpool_add/zpool_add_dryrun_output.ksh | 4 +- .../cli_user/misc/arc_summary_001_pos.ksh | 3 + .../cli_user/zfs_list/zfs_list_002_pos.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_homedir.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_searchpath.ksh | 2 +- .../zpool_status/zpool_status_-c_homedir.ksh | 2 +- .../zpool_status/zpool_status_-c_searchpath.ksh | 2 +- .../zfs-tests/tests/functional/deadman/Makefile.am | 1 + .../tests/functional/deadman/deadman_ratelimit.ksh | 78 + .../tests/functional/deadman/deadman_sync.ksh | 6 +- .../zfs-tests/tests/functional/events/.gitignore | 1 + .../zfs-tests/tests/functional/events/Makefile.am | 9 +- .../zfs-tests/tests/functional/events/cleanup.ksh | 2 +- .../tests/functional/events/events_002_pos.ksh | 4 +- .../tests/functional/events/zed_fd_spill-zedlet.c | 36 + .../tests/functional/events/zed_fd_spill.ksh | 77 + .../tests/functional/events/zed_rc_filter.ksh | 1 + .../functional/fault/auto_offline_001_pos.ksh | 4 +- .../pool_checkpoint/checkpoint_big_rewind.ksh | 3 +- .../pool_checkpoint/checkpoint_capacity.ksh | 7 +- .../pool_checkpoint/checkpoint_discard_busy.ksh | 3 +- .../pool_checkpoint/pool_checkpoint.kshlib | 9 +- .../functional/pool_names/pool_names_002_neg.ksh | 2 +- .../tests/functional/redundancy/Makefile.am | 2 + .../tests/functional/redundancy/redundancy.kshlib | 24 +- .../functional/redundancy/redundancy_draid.ksh | 248 +++ .../functional/redundancy/redundancy_draid3.ksh | 2 +- .../redundancy/redundancy_draid_damaged.ksh | 153 ++ .../redundancy/redundancy_draid_spare1.ksh | 31 +- .../redundancy/redundancy_draid_spare3.ksh | 46 +- .../functional/redundancy/redundancy_raidz.ksh | 52 +- .../functional/redundancy/redundancy_stripe.ksh | 4 +- .../functional/removal/removal_condense_export.ksh | 2 + .../functional/removal/removal_with_export.ksh | 2 +- .../functional/replacement/attach_multiple.ksh | 6 +- .../functional/replacement/replace_import.ksh | 2 +- .../replacement/resilver_restart_001.ksh | 2 +- .../functional/reservation/reservation_006_pos.ksh | 2 +- .../functional/rsend/send_encrypted_files.ksh | 2 +- .../tests/functional/userquota/Makefile.am | 3 +- .../userquota/userspace_send_encrypted.ksh | 108 - .../tests/functional/xattr/xattr_002_neg.ksh | 4 +- sys/modules/zfs/zfs_config.h | 6 +- 282 files changed, 4580 insertions(+), 3367 deletions(-) diff --cc cddl/share/zfs/compatibility.d/Makefile index 8bc18bcd6391,000000000000..255f4a3542b3 mode 100644,000000..100644 --- a/cddl/share/zfs/compatibility.d/Makefile +++ b/cddl/share/zfs/compatibility.d/Makefile @@@ -1,49 -1,0 +1,53 @@@ +# $FreeBSD$ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +.PATH: ${ZFSTOP}/cmd/zpool/compatibility.d + +FILES= \ + compat-2018 \ + compat-2019 \ + compat-2020 \ + compat-2021 \ + freebsd-11.0 \ + freebsd-11.2 \ + freebsd-11.3 \ + freenas-9.10.2 \ + grub2 \ + openzfsonosx-1.7.0 \ + openzfsonosx-1.8.1 \ + openzfsonosx-1.9.3 \ + openzfs-2.0-freebsd \ + openzfs-2.0-linux \ ++ openzfs-2.1-freebsd \ ++ openzfs-2.1-linux \ ++ zol-0.6.1 \ ++ zol-0.6.4 \ + zol-0.6.5 \ + zol-0.7 \ + zol-0.8 + +FILESDIR= ${SHAREDIR}/zfs/compatibility.d + +LINKS= \ + ${FILESDIR}/compat-2018 ${FILESDIR}/2018 \ + ${FILESDIR}/compat-2019 ${FILESDIR}/2019 \ + ${FILESDIR}/compat-2020 ${FILESDIR}/2020 \ + ${FILESDIR}/compat-2021 ${FILESDIR}/2021 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freebsd-11.1 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freenas-11.0 \ + ${FILESDIR}/freebsd-11.2 ${FILESDIR}/freenas-11.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-11.4 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.0 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.1 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freenas-11.3 \ + ${FILESDIR}/freenas-11.0 ${FILESDIR}/freenas-11.1 \ + ${FILESDIR}/openzfsonosx-1.9.3 ${FILESDIR}/openzfsonosx-1.9.4 \ + ${FILESDIR}/openzfs-2.0-freebsd ${FILESDIR}/truenas-12.0 \ + ${FILESDIR}/zol-0.7 ${FILESDIR}/ubuntu-18.04 \ + ${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 + +LINKMODE= ${NOBINMODE} + +.include diff --cc sys/contrib/openzfs/RELEASES.md index 000000000000,55bfdb80ef6e..55bfdb80ef6e mode 000000,100644..100644 --- a/sys/contrib/openzfs/RELEASES.md +++ b/sys/contrib/openzfs/RELEASES.md diff --cc sys/contrib/openzfs/cmd/fsck_zfs/.gitignore index 000000000000,0edf0309e94a..0edf0309e94a mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore +++ b/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore diff --cc sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in index 000000000000,32c8043e68fb..32c8043e68fb mode 000000,100755..100755 --- a/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in +++ b/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd index 000000000000,9fde997e8c60..9fde997e8c60 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux index 000000000000,c3ff176bf8f2..c3ff176bf8f2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 index 000000000000,9bc963ddccab..9bc963ddccab mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 index 000000000000,82a2698c8c5c..82a2698c8c5c mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 diff --cc sys/contrib/openzfs/config/kernel-siginfo.m4 index 000000000000,6ddb0dcc37d2..6ddb0dcc37d2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-siginfo.m4 +++ b/sys/contrib/openzfs/config/kernel-siginfo.m4 diff --cc sys/contrib/openzfs/config/kernel-signal-stop.m4 index 000000000000,6cb86e7c4cde..6cb86e7c4cde mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-signal-stop.m4 +++ b/sys/contrib/openzfs/config/kernel-signal-stop.m4 diff --cc sys/contrib/openzfs/config/kernel-special-state.m4 index 000000000000,aa60aabebc43..aa60aabebc43 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-special-state.m4 +++ b/sys/contrib/openzfs/config/kernel-special-state.m4 diff --cc sys/contrib/openzfs/contrib/bash_completion.d/.gitignore index 000000000000,0fd9cc63af2a..0fd9cc63af2a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore +++ b/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index 0491b2ff3e28,fd1da03712f1..dace3ec345fa --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@@ -1247,12 -1253,16 +1253,21 @@@ zfs_znode_free(znode_t *zp list_remove(&zfsvfs->z_all_znodes, zp); zfsvfs->z_nr_znodes--; mutex_exit(&zfsvfs->z_znodes_lock); + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #if __FreeBSD_version >= 1300139 + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, + (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #endif + if (zp->z_acl_cached) { zfs_acl_free(zp->z_acl_cached); zp->z_acl_cached = NULL; diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh index 000000000000,b367cef9c4a4..b367cef9c4a4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh index 000000000000,469117a56cc0..469117a56cc0 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore index 000000000000,ed5af03a1095..ed5af03a1095 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c index 000000000000,c072f906d23e..c072f906d23e mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh index 000000000000,8736a7fdf7e6..8736a7fdf7e6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh index 000000000000,8015e682c892..8015e682c892 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh index 000000000000,6796cc78a1bd..6796cc78a1bd mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh diff --cc sys/modules/zfs/zfs_config.h index ebc9bbe9059b,000000000000..7e910ef6ec43 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,774 -1,0 +1,774 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* kernel has large stacks */ +/* #undef HAVE_LARGE_STACKS */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->create()/mkdir()/mknod() take umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + *** 305 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 23:39:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FB6A6402D2; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06C946bSz3kXG; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7183E1204B; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158NdHXi017387; Tue, 8 Jun 2021 23:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158NdH0R017386; Tue, 8 Jun 2021 23:39:17 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:39:17 GMT Message-Id: <202106082339.158NdH0R017386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 39b87f051506 - stable/13 - Fix LINT kernel builds after 1a714ff20419 . MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39b87f051506f5d77ab5fa5ece948a73d4e91809 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:39:17 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=39b87f051506f5d77ab5fa5ece948a73d4e91809 commit 39b87f051506f5d77ab5fa5ece948a73d4e91809 Author: Hans Petter Selasky AuthorDate: 2021-02-01 12:23:21 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:32:14 +0000 Fix LINT kernel builds after 1a714ff20419 . Discussed with: rrs@ Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit db46c0d0cb3da2813727e56df1f2db292065867a) --- sys/netinet/tcp_ratelimit.c | 36 ++++++++---------------------------- sys/netinet/tcp_ratelimit.h | 2 -- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b5..8f2cf3d8d061 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ use_real_interface: rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee1..b69f0e634b60 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 23:57:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0D7C640576; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06bw4rvdz3lMv; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA791261E; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158NvGob043886; Tue, 8 Jun 2021 23:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158NvG09043885; Tue, 8 Jun 2021 23:57:16 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:57:16 GMT Message-Id: <202106082357.158NvG09043885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a7619988ebc2 - stable/13 - This brings into sync FreeBSD with the netflix versions of rack and bbr. This fixes several breakages (panics) since the tcp_lro code was committed that have been reported. Quite a few new features are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the largest). There is also support for ack-war prevention. Documents comming soon on rack.. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7619988ebc23fc4db80cddec7c13627f4bb80fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:57:16 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a7619988ebc23fc4db80cddec7c13627f4bb80fe commit a7619988ebc23fc4db80cddec7c13627f4bb80fe Author: Randall Stewart AuthorDate: 2021-05-06 15:22:26 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:56:18 +0000 This brings into sync FreeBSD with the netflix versions of rack and bbr. This fixes several breakages (panics) since the tcp_lro code was committed that have been reported. Quite a few new features are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the largest). There is also support for ack-war prevention. Documents comming soon on rack.. Sponsored by: Netflix Reviewed by: rscheff, mtuexen Differential Revision: https://reviews.freebsd.org/D30036 (cherry picked from commit 5d8fd932e418f03e98b3469c4088a36f0ef34ffe) --- sys/netinet/cc/cc.h | 7 +- sys/netinet/cc/cc_newreno.c | 34 +- sys/netinet/cc/cc_newreno.h | 13 +- sys/netinet/tcp.h | 24 +- sys/netinet/tcp_accounting.h | 39 + sys/netinet/tcp_input.c | 10 +- sys/netinet/tcp_log_buf.h | 8 +- sys/netinet/tcp_ratelimit.c | 29 +- sys/netinet/tcp_ratelimit.h | 4 +- sys/netinet/tcp_sack.c | 11 + sys/netinet/tcp_stacks/bbr.c | 92 +- sys/netinet/tcp_stacks/rack.c | 9876 ++++++++++++++++++++++-------- sys/netinet/tcp_stacks/rack_bbr_common.c | 473 +- sys/netinet/tcp_stacks/rack_bbr_common.h | 21 +- sys/netinet/tcp_stacks/tcp_bbr.h | 6 +- sys/netinet/tcp_stacks/tcp_rack.h | 201 +- sys/netinet/tcp_subr.c | 105 + sys/netinet/tcp_var.h | 12 + 18 files changed, 8181 insertions(+), 2784 deletions(-) diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index a52cfca9579b..be84a6841d15 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -91,15 +91,20 @@ struct cc_var { struct sctp_nets *sctp; } ccvc; uint16_t nsegs; /* # segments coalesced into current chain. */ + uint8_t labc; /* Dont use system abc use passed in */ }; /* cc_var flags. */ #define CCF_ABC_SENTAWND 0x0001 /* ABC counted cwnd worth of bytes? */ #define CCF_CWND_LIMITED 0x0002 /* Are we currently cwnd limited? */ -#define CCF_UNUSED1 0x0004 /* unused */ +#define CCF_USE_LOCAL_ABC 0x0004 /* Dont use the system l_abc val */ #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ +#define CCF_MAX_CWND 0x0040 /* Have we reached maximum cwnd? */ +#define CCF_CHG_MAX_CWND 0x0080 /* Cubic max_cwnd changed, for K */ +#define CCF_USR_IWND 0x0100 /* User specified initial window */ +#define CCF_USR_IWND_INIT_NSEG 0x0200 /* Convert segs to bytes on conn init */ /* ACK types passed to the ack_received() hook. */ #define CC_ACK 0x0001 /* Regular in sequence ACK. */ diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index a924acb0b8d6..55cab36e149a 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -86,8 +86,8 @@ static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); static void newreno_post_recovery(struct cc_var *ccv); static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf); -VNET_DEFINE_STATIC(uint32_t, newreno_beta) = 50; -VNET_DEFINE_STATIC(uint32_t, newreno_beta_ecn) = 80; +VNET_DEFINE(uint32_t, newreno_beta) = 50; +VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; #define V_newreno_beta VNET(newreno_beta) #define V_newreno_beta_ecn VNET(newreno_beta_ecn) @@ -101,11 +101,6 @@ struct cc_algo newreno_cc_algo = { .ctl_output = newreno_ctl_output, }; -struct newreno { - uint32_t beta; - uint32_t beta_ecn; -}; - static inline struct newreno * newreno_malloc(struct cc_var *ccv) { @@ -182,9 +177,15 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type) * XXXLAS: Find a way to signal SS after RTO that * doesn't rely on tcpcb vars. */ + uint16_t abc_val; + + if (ccv->flags & CCF_USE_LOCAL_ABC) + abc_val = ccv->labc; + else + abc_val = V_tcp_abc_l_var; if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) incr = min(ccv->bytes_this_ack, - ccv->nsegs * V_tcp_abc_l_var * + ccv->nsegs * abc_val * CCV(ccv, t_maxseg)); else incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); @@ -237,7 +238,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) u_int mss; cwin = CCV(ccv, snd_cwnd); - mss = tcp_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->ccvc.tcp); /* * Other TCP congestion controls use newreno_cong_signal(), but * with their own private cc_data. Make sure the cc_data is used @@ -246,7 +247,15 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) nreno = (CC_ALGO(ccv->ccvc.tcp) == &newreno_cc_algo) ? ccv->cc_data : NULL; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; - if (V_cc_do_abe && type == CC_ECN) + + /* + * Note that we only change the backoff for ECN if the + * global sysctl V_cc_do_abe is set the stack itself + * has set a flag in our newreno_flags (due to pacing) telling + * us to use the lower valued back-off. + */ + if (V_cc_do_abe || + (nreno && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN) && (type == CC_ECN))) factor = beta_ecn; else factor = beta; @@ -265,8 +274,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) V_cc_do_abe && V_cc_abe_frlossreduce)) { CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_ssthresh) * - (uint64_t)beta) / - (100ULL * (uint64_t)beta_ecn); + (uint64_t)beta) / (uint64_t)beta_ecn; } if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) CCV(ccv, snd_ssthresh) = cwin; @@ -352,7 +360,7 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) nreno->beta = opt->val; break; case CC_NEWRENO_BETA_ECN: - if (!V_cc_do_abe) + if ((!V_cc_do_abe) && ((nreno->newreno_flags & CC_NEWRENO_BETA_ECN) == 0)) return (EACCES); nreno->beta_ecn = opt->val; break; diff --git a/sys/netinet/cc/cc_newreno.h b/sys/netinet/cc/cc_newreno.h index 9e2a3cff5fe9..16cf1757e830 100644 --- a/sys/netinet/cc/cc_newreno.h +++ b/sys/netinet/cc/cc_newreno.h @@ -31,12 +31,17 @@ #define CCALGONAME_NEWRENO "newreno" +struct newreno { + uint32_t beta; + uint32_t beta_ecn; + uint32_t newreno_flags; +}; + struct cc_newreno_opts { - int name; + int name; uint32_t val; }; -#define CC_NEWRENO_BETA 1 -#define CC_NEWRENO_BETA_ECN 2 - +#define CC_NEWRENO_BETA 1 /* Beta for normal DUP-ACK/Sack recovery */ +#define CC_NEWRENO_BETA_ECN 2 /* ECN Beta for Abe */ #endif /* _CC_NEWRENO_H */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index d2bf1f8431fd..50f0811a6517 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -181,13 +181,24 @@ struct tcphdr { #define TCP_TXTLS_MODE 40 /* Transmit TLS mode */ #define TCP_RXTLS_ENABLE 41 /* TLS framing and encryption for receive */ #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ +#define TCP_IWND_NB 43 /* Override initial window (units: bytes) */ +#define TCP_IWND_NSEG 44 /* Override initial window (units: MSS segs) */ +#define TCP_LOGID_CNT 46 /* get number of connections with the same ID */ +#define TCP_LOG_TAG 47 /* configure tag for grouping logs */ +#define TCP_USER_LOG 48 /* userspace log event */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ +#define TCP_MAXUNACKTIME 68 /* maximum time without making progress (sec) */ +#define TCP_MAXPEAKRATE 69 /* maximum peak rate allowed (kbps) */ +#define TCP_IDLE_REDUCE 70 /* Reduce cwnd on idle input */ #define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ #define TCP_DELACK 72 /* socket option for delayed ack */ #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a RST */ #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log */ #define TCP_SHARED_CWND_ALLOWED 75 /* Use of a shared cwnd is allowed */ +#define TCP_PROC_ACCOUNTING 76 /* Do accounting on tcp cpu usage and counts */ +#define TCP_USE_CMP_ACKS 77 /* The transport can handle the Compressed mbuf acks */ +#define TCP_PERF_INFO 78 /* retrieve accounting counters */ #define TCP_KEEPINIT 128 /* N, time to establish connection */ #define TCP_KEEPIDLE 256 /* L,N,X start keeplives after this period */ #define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ @@ -201,7 +212,7 @@ struct tcphdr { #define TCP_RACK_MBUF_QUEUE 1050 /* Do we allow mbuf queuing if supported */ #define TCP_RACK_PROP 1051 /* RACK proportional rate reduction (bool) */ #define TCP_RACK_TLP_REDUCE 1052 /* RACK TLP cwnd reduction (bool) */ -#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacing reduction factor (divisor) */ +#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacingv reduction factor (divisor) */ #define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send */ #define TCP_RACK_PACE_ALWAYS 1055 /* Use the always pace method */ #define TCP_RACK_PROP_RATE 1056 /* The proportional reduction rate */ @@ -284,6 +295,16 @@ struct tcphdr { #define TCP_RACK_PACE_TO_FILL 1127 /* If we are not in recovery, always pace to fill the cwnd in 1 RTT */ #define TCP_SHARED_CWND_TIME_LIMIT 1128 /* we should limit to low time values the scwnd life */ #define TCP_RACK_PROFILE 1129 /* Select a profile that sets multiple options */ +#define TCP_HDWR_RATE_CAP 1130 /* Allow hardware rates to cap pacing rate */ +#define TCP_PACING_RATE_CAP 1131 /* Highest rate allowed in pacing in bytes per second (uint64_t) */ +#define TCP_HDWR_UP_ONLY 1132 /* Allow the pacing rate to climb but not descend (with the exception of fill-cw */ +#define TCP_RACK_ABC_VAL 1133 /* Set a local ABC value different then the system default */ +#define TCP_REC_ABC_VAL 1134 /* Do we use the ABC value for recovery or the override one from sysctl */ +#define TCP_RACK_MEASURE_CNT 1135 /* How many measurements are required in GP pacing */ +#define TCP_DEFER_OPTIONS 1136 /* Defer options until the proper number of measurements occur, does not defer TCP_RACK_MEASURE_CNT */ +#define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't twiddle the TLP bits properly in fast_rsm_output? */ +#define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ +#define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR @@ -295,6 +316,7 @@ struct tcphdr { #define TCPI_OPT_WSCALE 0x04 #define TCPI_OPT_ECN 0x08 #define TCPI_OPT_TOE 0x10 +#define TCPI_OPT_TFO 0x20 /* Maximum length of log ID. */ #define TCP_LOG_ID_LEN 64 diff --git a/sys/netinet/tcp_accounting.h b/sys/netinet/tcp_accounting.h new file mode 100644 index 000000000000..a2e2d4edd46d --- /dev/null +++ b/sys/netinet/tcp_accounting.h @@ -0,0 +1,39 @@ +#ifndef __tcp_accounting_h__ +#define __tcp_accounting_h__ +/* + * Return values from tcp_do_ack_accounting + * and indexs to the into the tcp_proc_time[] + * array. + */ +#define ACK_BEHIND 0 +#define ACK_SACK 1 +#define ACK_CUMACK 2 +#define ACK_CUMACK_SACK 3 +#define ACK_DUPACK 4 +#define ACK_RWND 5 +/* Added values for tracking output too */ +#define SND_BLOCKED 6 +#define SND_LIMITED 7 +#define SND_OUT_DATA 8 +#define SND_OUT_ACK 9 +#define SND_OUT_FAIL 10 +/* We also count in the counts array two added (MSS sent and ACKS In) */ +#define CNT_OF_MSS_OUT 11 +#define CNT_OF_ACKS_IN 12 + +/* for the tcpcb we add two more cycle counters */ +#define CYC_HANDLE_MAP 11 +#define CYC_HANDLE_ACK 12 + +/* Should the tp->xxx array's be alloc'ed? */ +/* #define TCP_NUM_PROC_COUNTERS 11 defined in tcp_var.h */ +/* #define TCP_NUM_CNT_COUNTERS 13 defined in tcp_var.h */ + +#ifdef _KERNEL +#ifdef TCP_ACCOUNTING +extern counter_u64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; +extern counter_u64_t tcp_proc_time[TCP_NUM_PROC_COUNTERS]; +#endif +#endif + +#endif diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d36f9566ffba..916a7186770c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -531,7 +531,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) void inline -cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) +cc_ecnpkt_handler_flags(struct tcpcb *tp, uint16_t flags, uint8_t iptos) { INP_WLOCK_ASSERT(tp->t_inpcb); @@ -549,7 +549,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) break; } - if (th->th_flags & TH_CWR) + if (flags & TH_CWR) tp->ccv->flags |= CCF_TCPHDR_CWR; else tp->ccv->flags &= ~CCF_TCPHDR_CWR; @@ -563,6 +563,12 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) } } +void inline +cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) +{ + cc_ecnpkt_handler_flags(tp, th->th_flags, iptos); +} + /* * TCP input handling is split into multiple parts: * tcp6_input is a thin wrapper around tcp_input for the extended diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 436383124dce..4e8b79babfe8 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -174,7 +174,7 @@ enum tcp_log_events { TCP_LOG_IN = 1, /* Incoming packet 1 */ TCP_LOG_OUT, /* Transmit (without other event) 2 */ TCP_LOG_RTO, /* Retransmit timeout 3 */ - TCP_LOG_TF_ACK, /* Transmit due to TF_ACK 4 */ + TCP_LOG_SB_WAKE, /* Awaken socket buffer 4 */ TCP_LOG_BAD_RETRAN, /* Detected bad retransmission 5 */ TCP_LOG_PRR, /* Doing PRR 6 */ TCP_LOG_REORDER, /* Detected reorder 7 */ @@ -200,7 +200,7 @@ enum tcp_log_events { BBR_LOG_DOSEG_DONE, /* hpts do_segment completes 27 */ BBR_LOG_EXIT_GAIN, /* hpts do_segment completes 28 */ BBR_LOG_THRESH_CALC, /* Doing threshold calculation 29 */ - BBR_LOG_EXTRACWNDGAIN, /* Removed 30 */ + TCP_LOG_MAPCHG, /* Map Changes to the sendmap 30 */ TCP_LOG_USERSEND, /* User level sends data 31 */ BBR_RSM_CLEARED, /* RSM cleared of ACK flags 32 */ BBR_LOG_STATE_TARGET, /* Log of target at state 33 */ @@ -232,7 +232,9 @@ enum tcp_log_events { TCP_LOG_USER_EVENT, /* User space event data 59 */ TCP_LOG_SENDFILE, /* sendfile() logging for TCP connections 60 */ TCP_LOG_HTTP_T, /* logging of http request tracking 61 */ - TCP_LOG_END /* End (keep at end) 62 */ + TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ + TCP_LOG_FSB, /* FSB information 63 */ + TCP_LOG_END /* End (keep at end) 64 */ }; enum tcp_log_states { diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 8f2cf3d8d061..c33b2872e91f 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -367,11 +367,22 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "pacetime", CTLFLAG_RD, &rs->rs_rlt[i].time_between, 0, "Time hardware inserts between 1500 byte sends"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_ADD_LONG(&rs->sysctl_ctx, SYSCTL_CHILDREN(rl_rate_num), OID_AUTO, "rate", CTLFLAG_RD, - &rs->rs_rlt[i].rate, 0, + &rs->rs_rlt[i].rate, "Rate in bytes per second"); + SYSCTL_ADD_LONG(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "using", CTLFLAG_RD, + &rs->rs_rlt[i].using, + "Number of flows using"); + SYSCTL_ADD_LONG(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "enobufs", CTLFLAG_RD, + &rs->rs_rlt[i].rs_num_enobufs, + "Number of enobufs logged on this rate"); + } } #endif @@ -667,6 +678,8 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; + rs->rs_rlt[i].using = 0; + rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1063,16 +1076,28 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index b69f0e634b60..8747708e8b5e 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -43,7 +43,9 @@ struct m_snd_tag; struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ - uint64_t rate; /* Rate we get in Bytes per second (Bps) */ + long rate; /* Rate we get in Bytes per second (Bps) */ + long using; /* How many flows are using this hdwr rate. */ + long rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 9187a9fc66d8..7d1e4077c79c 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -150,6 +150,17 @@ SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); +int +tcp_dsack_block_exists(struct tcpcb *tp) +{ + /* Return true if a DSACK block exists */ + if (tp->rcv_numsacks == 0) + return (0); + if (SEQ_LEQ(tp->sackblks[0].end, tp->rcv_nxt)) + return(1); + return (0); +} + /* * This function will find overlaps with the currently stored sackblocks * and add any overlap as a dsack block upfront diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index fbd5ac231496..f19872245e55 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -3930,6 +3930,9 @@ bbr_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type, struct bbr_s struct tcp_bbr *bbr; INP_WLOCK_ASSERT(tp->t_inpcb); +#ifdef STATS + stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_CSIG, type); +#endif bbr = (struct tcp_bbr *)tp->t_fb_ptr; switch (type) { case CC_NDUPACK: @@ -4403,6 +4406,7 @@ bbr_clone_rsm(struct tcp_bbr *bbr, struct bbr_sendmap *nrsm, struct bbr_sendmap nrsm->r_start = start; nrsm->r_end = rsm->r_end; nrsm->r_rtr_cnt = rsm->r_rtr_cnt; + nrsm-> r_rtt_not_allowed = rsm->r_rtt_not_allowed; nrsm->r_flags = rsm->r_flags; /* We don't transfer forward the SYN flag */ nrsm->r_flags &= ~BBR_HAS_SYN; @@ -6429,65 +6433,6 @@ tcp_bbr_xmit_timer_commit(struct tcp_bbr *bbr, struct tcpcb *tp, uint32_t cts) bbr->r_ctl.bbr_smallest_srtt_this_state = rtt; } -static void -bbr_earlier_retran(struct tcpcb *tp, struct tcp_bbr *bbr, struct bbr_sendmap *rsm, - uint32_t t, uint32_t cts, int ack_type) -{ - /* - * For this RSM, we acknowledged the data from a previous - * transmission, not the last one we made. This means we did a false - * retransmit. - */ - if (rsm->r_flags & BBR_HAS_FIN) { - /* - * The sending of the FIN often is multiple sent when we - * have everything outstanding ack'd. We ignore this case - * since its over now. - */ - return; - } - if (rsm->r_flags & BBR_TLP) { - /* - * We expect TLP's to have this occur often - */ - bbr->rc_tlp_rtx_out = 0; - return; - } - if (ack_type != BBR_CUM_ACKED) { - /* - * If it was not a cum-ack we - * don't really know for sure since - * the timestamp could be from some - * other transmission. - */ - return; - } - - if (rsm->r_flags & BBR_WAS_SACKPASS) { - /* - * We retransmitted based on a sack and the earlier - * retransmission ack'd it - re-ordering is occuring. - */ - BBR_STAT_INC(bbr_reorder_seen); - bbr->r_ctl.rc_reorder_ts = cts; - } - /* Back down the loss count */ - if (rsm->r_flags & BBR_MARKED_LOST) { - bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; - bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; - rsm->r_flags &= ~BBR_MARKED_LOST; - if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) - /* LT sampling also needs adjustment */ - bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; - } - /***** RRS HERE ************************/ - /* Do we need to do this??? */ - /* bbr_reset_lt_bw_sampling(bbr, cts); */ - /***** RRS HERE ************************/ - BBR_STAT_INC(bbr_badfr); - BBR_STAT_ADD(bbr_badfr_bytes, (rsm->r_end - rsm->r_start)); -} - static void bbr_set_reduced_rtt(struct tcp_bbr *bbr, uint32_t cts, uint32_t line) { @@ -6869,6 +6814,10 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, /* Already done */ return (0); } + if (rsm->r_rtt_not_allowed) { + /* Not allowed */ + return (0); + } if (rsm->r_rtr_cnt == 1) { /* * Only one transmit. Hopefully the normal case. @@ -6926,7 +6875,7 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, rsm->r_tim_lastsent[i], ack_type, to); if ((i + 1) < rsm->r_rtr_cnt) { /* Likely */ - bbr_earlier_retran(tp, bbr, rsm, t, cts, ack_type); + return (0); } else if (rsm->r_flags & BBR_TLP) { bbr->rc_tlp_rtx_out = 0; } @@ -6974,7 +6923,7 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, t = 1; bbr_update_bbr_info(bbr, rsm, t, cts, to->to_tsecr, uts, BBR_RTT_BY_EARLIER_RET, rsm->r_tim_lastsent[i], ack_type, to); - bbr_earlier_retran(tp, bbr, rsm, t, cts, ack_type); + return (0); } else { /* * Too many prior transmissions, just @@ -10207,7 +10156,7 @@ bbr_init(struct tcpcb *tp) tp->t_fb_ptr = NULL; return (ENOMEM); } - rsm->r_flags = BBR_OVERMAX; + rsm->r_rtt_not_allowed = 1; rsm->r_tim_lastsent[0] = cts; rsm->r_rtr_cnt = 1; rsm->r_rtr_bytes = 0; @@ -10320,6 +10269,10 @@ bbr_fini(struct tcpcb *tp, int32_t tcb_is_purged) counter_u64_add(bbr_flows_whdwr_pacing, -1); else counter_u64_add(bbr_flows_nohdwr_pacing, -1); + if (bbr->r_ctl.crte != NULL) { + tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); + bbr->r_ctl.crte = NULL; + } rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); while (rsm) { TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next); @@ -13463,15 +13416,6 @@ send: th->th_seq = htonl(tp->snd_max); bbr_seq = tp->snd_max; } - } else if (flags & TH_RST) { - /* - * For a Reset send the last cum ack in sequence - * (this like any other choice may still generate a - * challenge ack, if a ack-update packet is in - * flight). - */ - th->th_seq = htonl(tp->snd_una); - bbr_seq = tp->snd_una; } else { /* * len == 0 and not persist we use snd_max, sending @@ -14536,9 +14480,9 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sopt, } else { bbr->bbr_hdw_pace_ena = 0; #ifdef RATELIMIT - if (bbr->bbr_hdrw_pacing) { - bbr->bbr_hdrw_pacing = 0; - in_pcbdetach_txrtlmt(bbr->rc_inp); + if (bbr->r_ctl.crte != NULL) { + tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); + bbr->r_ctl.crte = NULL; } #endif } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a6b439e38ad7..dd60091bbbc0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -63,7 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include #include - +#ifdef TCP_ACCOUNTING +#include +#include +#endif #include #include @@ -91,8 +94,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #ifdef NETFLIX_SHARED_CWND @@ -133,6 +138,15 @@ uma_zone_t rack_pcb_zone; #define TICKS2SBT(__t) (tick_sbt * ((sbintime_t)(__t))) #endif +VNET_DECLARE(uint32_t, newreno_beta); +VNET_DECLARE(uint32_t, newreno_beta_ecn); +#define V_newreno_beta VNET(newreno_beta) +#define V_newreno_beta_ecn VNET(newreno_beta_ecn) + + +MALLOC_DEFINE(M_TCPFSB, "tcp_fsb", "TCP fast send block"); +MALLOC_DEFINE(M_TCPDO, "tcp_do", "TCP deferred options"); + struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; @@ -175,30 +189,51 @@ static int32_t rack_tlp_thresh = 1; static int32_t rack_tlp_limit = 2; /* No more than 2 TLPs w-out new data */ static int32_t rack_tlp_use_greater = 1; static int32_t rack_reorder_thresh = 2; -static int32_t rack_reorder_fade = 60000; /* 0 - never fade, def 60,000 +static int32_t rack_reorder_fade = 60000000; /* 0 - never fade, def 60,000,000 * - 60 seconds */ +static uint8_t rack_req_measurements = 1; /* Attack threshold detections */ static uint32_t rack_highest_sack_thresh_seen = 0; static uint32_t rack_highest_move_thresh_seen = 0; - -static int32_t rack_pkt_delay = 1; -static int32_t rack_early_recovery = 1; +static int32_t rack_enable_hw_pacing = 0; /* Due to CCSP keep it off by default */ +static int32_t rack_hw_pace_extra_slots = 2; /* 2 extra MSS time betweens */ +static int32_t rack_hw_rate_caps = 1; /* 1; */ +static int32_t rack_hw_rate_min = 0; /* 1500000;*/ +static int32_t rack_hw_rate_to_low = 0; /* 1200000; */ +static int32_t rack_hw_up_only = 1; +static int32_t rack_stats_gets_ms_rtt = 1; +static int32_t rack_prr_addbackmax = 2; + +static int32_t rack_pkt_delay = 1000; static int32_t rack_send_a_lot_in_prr = 1; -static int32_t rack_min_to = 1; /* Number of ms minimum timeout */ +static int32_t rack_min_to = 1000; /* Number of microsecond min timeout */ static int32_t rack_verbose_logging = 0; static int32_t rack_ignore_data_after_close = 1; -static int32_t rack_enable_shared_cwnd = 0; +static int32_t rack_enable_shared_cwnd = 1; +static int32_t rack_use_cmp_acks = 1; +static int32_t rack_use_fsb = 1; +static int32_t rack_use_rfo = 1; +static int32_t rack_use_rsm_rfo = 1; +static int32_t rack_max_abc_post_recovery = 2; +static int32_t rack_client_low_buf = 0; +#ifdef TCP_ACCOUNTING +static int32_t rack_tcp_accounting = 0; +#endif static int32_t rack_limits_scwnd = 1; static int32_t rack_enable_mqueue_for_nonpaced = 0; static int32_t rack_disable_prr = 0; static int32_t use_rack_rr = 1; static int32_t rack_non_rxt_use_cr = 0; /* does a non-rxt in recovery use the configured rate (ss/ca)? */ -static int32_t rack_persist_min = 250; /* 250ms */ -static int32_t rack_persist_max = 2000; /* 2 Second */ -static int32_t rack_sack_not_required = 0; /* set to one to allow non-sack to use rack */ -static int32_t rack_default_init_window = 0; /* Use system default */ +static int32_t rack_persist_min = 250000; /* 250usec */ +static int32_t rack_persist_max = 2000000; /* 2 Second in usec's */ +static int32_t rack_sack_not_required = 1; /* set to one to allow non-sack to use rack */ +static int32_t rack_default_init_window = 0; /* Use system default */ static int32_t rack_limit_time_with_srtt = 0; -static int32_t rack_hw_pace_adjust = 0; +static int32_t rack_autosndbuf_inc = 20; /* In percentage form */ +static int32_t rack_enobuf_hw_boost_mult = 2; /* How many times the hw rate we boost slot using time_between */ +static int32_t rack_enobuf_hw_max = 12000; /* 12 ms in usecs */ +static int32_t rack_enobuf_hw_min = 10000; /* 10 ms in usecs */ +static int32_t rack_hw_rwnd_factor = 2; /* How many max_segs the rwnd must be before we hold off sending */ /* * Currently regular tcp has a rto_min of 30ms * the backoff goes 12 times so that ends up @@ -209,23 +244,21 @@ static uint32_t rack_def_data_window = 20; static uint32_t rack_goal_bdp = 2; static uint32_t rack_min_srtts = 1; static uint32_t rack_min_measure_usec = 0; -static int32_t rack_tlp_min = 10; -static int32_t rack_rto_min = 30; /* 30ms same as main freebsd */ -static int32_t rack_rto_max = 4000; /* 4 seconds */ +static int32_t rack_tlp_min = 10000; /* 10ms */ +static int32_t rack_rto_min = 30000; /* 30,000 usec same as main freebsd */ +static int32_t rack_rto_max = 4000000; /* 4 seconds in usec's */ static const int32_t rack_free_cache = 2; static int32_t rack_hptsi_segments = 40; static int32_t rack_rate_sample_method = USE_RTT_LOW; static int32_t rack_pace_every_seg = 0; -static int32_t rack_delayed_ack_time = 200; /* 200ms */ +static int32_t rack_delayed_ack_time = 40000; /* 40ms in usecs */ static int32_t rack_slot_reduction = 4; static int32_t rack_wma_divisor = 8; /* For WMA calculation */ static int32_t rack_cwnd_block_ends_measure = 0; static int32_t rack_rwnd_block_ends_measure = 0; +static int32_t rack_def_profile = 0; static int32_t rack_lower_cwnd_at_tlp = 0; -static int32_t rack_use_proportional_reduce = 0; -static int32_t rack_proportional_rate = 10; -static int32_t rack_tlp_max_resend = 2; static int32_t rack_limited_retran = 0; static int32_t rack_always_send_oldest = 0; static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; @@ -247,13 +280,13 @@ static uint32_t rack_probertt_use_min_rtt_entry = 1; /* Use the min to calculate static uint32_t rack_probertt_use_min_rtt_exit = 0; static uint32_t rack_probe_rtt_sets_cwnd = 0; static uint32_t rack_probe_rtt_safety_val = 2000000; /* No more than 2 sec in probe-rtt */ -static uint32_t rack_time_between_probertt = 9600000; /* 9.6 sec in us */ +static uint32_t rack_time_between_probertt = 9600000; /* 9.6 sec in usecs */ static uint32_t rack_probertt_gpsrtt_cnt_mul = 0; /* How many srtt periods does probe-rtt last top fraction */ -static uint32_t rack_probertt_gpsrtt_cnt_div = 0; /* How many srtt periods does probe-rtt last bottom fraction */ -static uint32_t rack_min_probertt_hold = 200000; /* Equal to delayed ack time */ +static uint32_t rack_probertt_gpsrtt_cnt_div = 0; /* How many srtt periods does probe-rtt last bottom fraction */ +static uint32_t rack_min_probertt_hold = 40000; /* Equal to delayed ack time */ static uint32_t rack_probertt_filter_life = 10000000; static uint32_t rack_probertt_lower_within = 10; -static uint32_t rack_min_rtt_movement = 250; /* Must move at least 250 useconds to count as a lowering */ +static uint32_t rack_min_rtt_movement = 250000; /* Must move at least 250ms (in microseconds) to count as a lowering */ static int32_t rack_pace_one_seg = 0; /* Shall we pace for less than 1.4Meg 1MSS at a time */ static int32_t rack_probertt_clear_is = 1; static int32_t rack_max_drain_hbp = 1; /* Extra drain times gpsrtt for highly buffered paths */ @@ -264,7 +297,7 @@ static int32_t rack_max_per_above = 30; /* When we go to increment stop if abov /* Timely information */ /* Combine these two gives the range of 'no change' to bw */ -/* ie the up/down provide the upper and lower bound */ +/* ie the up/down provide the upper and lower bound */ static int32_t rack_gp_per_bw_mul_up = 2; /* 2% */ static int32_t rack_gp_per_bw_mul_down = 4; /* 4% */ static int32_t rack_gp_rtt_maxmul = 3; /* 3 x maxmin */ @@ -286,6 +319,7 @@ static int32_t rack_timely_int_timely_only = 0; /* do interim timely's only use static int32_t rack_timely_no_stopping = 0; static int32_t rack_down_raise_thresh = 100; static int32_t rack_req_segs = 1; +static uint64_t rack_bw_rate_cap = 0; /* Weird delayed ack mode */ static int32_t rack_use_imac_dack = 0; @@ -301,9 +335,14 @@ counter_u64_t rack_unpaced_segments; counter_u64_t rack_calc_zero; counter_u64_t rack_calc_nonzero; counter_u64_t rack_saw_enobuf; +counter_u64_t rack_saw_enobuf_hw; counter_u64_t rack_saw_enetunreach; counter_u64_t rack_per_timer_hole; - +counter_u64_t rack_large_ackcmp; +counter_u64_t rack_small_ackcmp; +#ifdef INVARIANTS +counter_u64_t rack_adjust_map_bw; +#endif /* Tail loss probe counters */ counter_u64_t rack_tlp_tot; counter_u64_t rack_tlp_newdata; @@ -313,6 +352,7 @@ counter_u64_t rack_tlp_retran_fail; counter_u64_t rack_to_tot; counter_u64_t rack_to_arm_rack; counter_u64_t rack_to_arm_tlp; +counter_u64_t rack_hot_alloc; counter_u64_t rack_to_alloc; counter_u64_t rack_to_alloc_hard; counter_u64_t rack_to_alloc_emerg; @@ -320,6 +360,17 @@ counter_u64_t rack_to_alloc_limited; counter_u64_t rack_alloc_limited_conns; counter_u64_t rack_split_limited; +#define MAX_NUM_OF_CNTS 13 +counter_u64_t rack_proc_comp_ack[MAX_NUM_OF_CNTS]; +counter_u64_t rack_multi_single_eq; +counter_u64_t rack_proc_non_comp_ack; + +counter_u64_t rack_fto_send; +counter_u64_t rack_fto_rsm_send; +counter_u64_t rack_nfto_resend; +counter_u64_t rack_non_fto_send; +counter_u64_t rack_extended_rfo; + counter_u64_t rack_sack_proc_all; counter_u64_t rack_sack_proc_short; counter_u64_t rack_sack_proc_restart; @@ -342,6 +393,10 @@ counter_u64_t rack_input_idle_reduces; counter_u64_t rack_collapsed_win; counter_u64_t rack_tlp_does_nada; counter_u64_t rack_try_scwnd; +counter_u64_t rack_hw_pace_init_fail; +counter_u64_t rack_hw_pace_lost; +counter_u64_t rack_sbsndptr_right; +counter_u64_t rack_sbsndptr_wrong; /* Temp CPU counters */ counter_u64_t rack_find_high; @@ -350,6 +405,17 @@ counter_u64_t rack_progress_drops; counter_u64_t rack_out_size[TCP_MSS_ACCT_SIZE]; counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; + +#define RACK_REXMTVAL(tp) max(rack_rto_min, ((tp)->t_srtt + ((tp)->t_rttvar << 2))) + +#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ + (tv) = (value) + TICKS_2_USEC(tcp_rexmit_slop); \ + if ((u_long)(tv) < (u_long)(tvmin)) \ + (tv) = (tvmin); \ + if ((u_long)(tv) > (u_long)(tvmax)) \ + (tv) = (tvmax); \ +} while (0) + static void rack_log_progress_event(struct tcp_rack *rack, struct tcpcb *tp, uint32_t tick, int event, int line); @@ -363,7 +429,7 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); static void rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, - struct tcphdr *th, uint16_t nsegs, uint16_t type, int32_t recovery); + uint32_t th_ack, uint16_t nsegs, uint16_t type, int32_t recovery); static struct rack_sendmap *rack_alloc(struct tcp_rack *rack); static struct rack_sendmap *rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type); @@ -371,24 +437,21 @@ static struct rack_sendmap * rack_check_recovery_mode(struct tcpcb *tp, uint32_t tsused); static void -rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, - uint32_t type); +rack_cong_signal(struct tcpcb *tp, + uint32_t type, uint32_t ack); static void rack_counter_destroy(void); static int rack_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp); static int32_t rack_ctor(void *mem, int32_t size, void *arg, int32_t how); static void -rack_set_pace_segments(struct tcpcb *tp, struct tcp_rack *rack, uint32_t line); +rack_set_pace_segments(struct tcpcb *tp, struct tcp_rack *rack, uint32_t line, uint64_t *fill_override); static void rack_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, uint8_t iptos); static void rack_dtor(void *mem, int32_t size, void *arg); static void -rack_earlier_retran(struct tcpcb *tp, struct rack_sendmap *rsm, - uint32_t t, uint32_t cts); -static void rack_log_alt_to_to_cancel(struct tcp_rack *rack, uint32_t flex1, uint32_t flex2, uint32_t flex3, uint32_t flex4, @@ -416,11 +479,12 @@ static int32_t rack_init(struct tcpcb *tp); static void rack_init_sysctls(void); static void rack_log_ack(struct tcpcb *tp, struct tcpopt *to, - struct tcphdr *th); + struct tcphdr *th, int entered_rec, int dup_ack_struck); static void rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, - uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t ts, - uint8_t pass, struct rack_sendmap *hintrsm, uint32_t us_cts); + uint32_t seq_out, uint8_t th_flags, int32_t err, uint64_t ts, + struct rack_sendmap *hintrsm, uint16_t add_flags, struct mbuf *s_mb, uint32_t s_moff); + static void rack_log_sack_passed(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm); @@ -431,7 +495,7 @@ static uint32_t rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, uint32_t cts, int *moved_two); -static void rack_post_recovery(struct tcpcb *tp, struct tcphdr *th); +static void rack_post_recovery(struct tcpcb *tp, uint32_t th_seq); static void rack_remxt_tmr(struct tcpcb *tp); static int rack_set_sockopt(struct socket *so, struct sockopt *sopt, @@ -446,10 +510,10 @@ static void rack_timer_cancel(struct tcpcb *tp, struct tcp_rack *rack, uint32_t static void rack_timer_stop(struct tcpcb *tp, uint32_t timer_type); static uint32_t rack_update_entry(struct tcpcb *tp, struct tcp_rack *rack, - struct rack_sendmap *rsm, uint32_t ts, int32_t * lenp); + struct rack_sendmap *rsm, uint64_t ts, int32_t * lenp, uint16_t add_flag); static void rack_update_rsm(struct tcpcb *tp, struct tcp_rack *rack, - struct rack_sendmap *rsm, uint32_t ts); + struct rack_sendmap *rsm, uint64_t ts, uint16_t add_flag); static int rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type, tcp_seq th_ack); @@ -496,15 +560,182 @@ tcp_rack_output(struct tcpcb *tp, struct tcp_rack *rack, static void tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt, uint32_t len, uint32_t us_tim, int confidence, struct rack_sendmap *rsm, uint16_t rtrcnt); static void - tcp_rack_partialack(struct tcpcb *tp, struct tcphdr *th); + tcp_rack_partialack(struct tcpcb *tp); +static int +rack_set_profile(struct tcp_rack *rack, int prof); +static void +rack_apply_deferred_options(struct tcp_rack *rack); int32_t rack_clear_counter=0; +static void +rack_set_cc_pacing(struct tcp_rack *rack) +{ + struct sockopt sopt; + struct cc_newreno_opts opt; + struct newreno old, *ptr; + struct tcpcb *tp; + int error; + + if (rack->rc_pacing_cc_set) + return; + + tp = rack->rc_tp; + if (tp->cc_algo == NULL) { + /* Tcb is leaving */ + printf("No cc algorithm?\n"); + return; + } + rack->rc_pacing_cc_set = 1; + if (strcmp(tp->cc_algo->name, CCALGONAME_NEWRENO) != 0) { + /* Not new-reno we can't play games with beta! */ + printf("cc_algo:%s is not NEWRENO:%s\n", + tp->cc_algo->name, CCALGONAME_NEWRENO); + goto out; + } + ptr = ((struct newreno *)tp->ccv->cc_data); + if (CC_ALGO(tp)->ctl_output == NULL) { + /* Huh, why does new_reno no longer have a set function? */ *** 14150 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 8 23:59:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF8B640E14; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06dw43pzz3l7q; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 742B712354; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Nx0iW044102; Tue, 8 Jun 2021 23:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Nx0JI044101; Tue, 8 Jun 2021 23:59:00 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:59:00 GMT Message-Id: <202106082359.158Nx0JI044101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f5d0badc7007 - stable/13 - Fix a UDP tunneling issue with rack. Basically there are two issues. A) Not enough hdrlen was being calculated when a UDP tunnel is in place. and B) Not enough memory is allocated in racks fsb. We need to overbook the fsb to include a udphdr just in case. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:59:00 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 commit f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 Author: Randall Stewart AuthorDate: 2021-05-07 18:06:43 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:58:06 +0000 Fix a UDP tunneling issue with rack. Basically there are two issues. A) Not enough hdrlen was being calculated when a UDP tunnel is in place. and B) Not enough memory is allocated in racks fsb. We need to overbook the fsb to include a udphdr just in case. Submitted by: Peter Lei Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30157 (cherry picked from commit a16cee0218652230d94a73690201e76baab0bba1) --- sys/netinet/tcp_stacks/rack.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index dd60091bbbc0..110304d29cc0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -11875,6 +11875,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; if (tp->t_port) { + rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr); udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; @@ -11894,6 +11895,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; if (tp->t_port) { + rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr); udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; @@ -11914,10 +11916,14 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) static int rack_init_fsb(struct tcpcb *tp, struct tcp_rack *rack) { - /* Allocate the larger of spaces V6 if available else just V4 */ - rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); + /* + * Allocate the larger of spaces V6 if available else just + * V4 and include udphdr (overbook) + */ #ifdef INET6 - rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr) + sizeof(struct udphdr); +#else + rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr) + sizeof(struct udphdr); #endif rack->r_ctl.fsb.tcp_ip_hdr = malloc(rack->r_ctl.fsb.tcp_ip_hdr_len, M_TCPFSB, M_NOWAIT|M_ZERO); @@ -15078,6 +15084,8 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma optlen = tcp_addoptions(&to, opt); hdrlen += optlen; udp = rack->r_ctl.fsb.udp; + if (udp) + hdrlen += sizeof(struct udphdr); if (rack->r_ctl.rc_pace_max_segs) max_val = rack->r_ctl.rc_pace_max_segs; else if (rack->rc_user_set_max_segs) @@ -15530,6 +15538,8 @@ rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, optlen = tcp_addoptions(&to, opt); hdrlen += optlen; udp = rack->r_ctl.fsb.udp; + if (udp) + hdrlen += sizeof(struct udphdr); if (rack->r_ctl.rc_pace_max_segs) max_val = rack->r_ctl.rc_pace_max_segs; else if (rack->rc_user_set_max_segs) From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:00:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B878C640C9A; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06gD4Vvtz3l84; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 827F812355; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159008pr048101; Wed, 9 Jun 2021 00:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159008lG048098; Wed, 9 Jun 2021 00:00:08 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:00:08 GMT Message-Id: <202106090000.159008lG048098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4651125ac6df - stable/13 - This takes Warners suggested approach to making it so that platforms that for whatever reason cannot include the RATELIMIT option can still work with rack. It adds two dummy functions that rack will call and find out that the highest hw supported b/w is 0 (which kinda makes sense and rack is already prepared to handle). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4651125ac6df34e24251463a37e4c1c652c2ff80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:00:08 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4651125ac6df34e24251463a37e4c1c652c2ff80 commit 4651125ac6df34e24251463a37e4c1c652c2ff80 Author: Randall Stewart AuthorDate: 2021-05-07 21:32:32 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:59:21 +0000 This takes Warners suggested approach to making it so that platforms that for whatever reason cannot include the RATELIMIT option can still work with rack. It adds two dummy functions that rack will call and find out that the highest hw supported b/w is 0 (which kinda makes sense and rack is already prepared to handle). Reviewed by: Michael Tuexen, Warner Losh Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30163 (cherry picked from commit 5a4333a5378f7afe4f8cab293a987865ae0c32c4) --- sys/netinet/tcp_ratelimit.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index 8747708e8b5e..b689c9127493 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -147,6 +147,20 @@ tcp_rel_pacing_rate(const struct tcp_hwrate_limit_table *crte, { return; } + +static uint64_t inline +tcp_hw_highest_rate(const struct tcp_hwrate_limit_table *rle) +{ + return (0); +} + +static uint64_t inline +tcp_hw_highest_rate_ifp(struct ifnet *ifp, struct inpcb *inp) +{ + return (0); +} + + #endif /* * Given a b/w and a segsiz, and optional hardware From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:01:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B6F9640CB4; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06hY35wNz3lWs; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 510C112361; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15901Hgh053521; Wed, 9 Jun 2021 00:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15901HgD053520; Wed, 9 Jun 2021 00:01:17 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:01:17 GMT Message-Id: <202106090001.15901HgD053520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 87cf5dcc3335 - stable/13 - tcp:Host cache and rack ending up with incorrect values. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 87cf5dcc3335de32661ae75471f29bc387de194e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:01:17 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=87cf5dcc3335de32661ae75471f29bc387de194e commit 87cf5dcc3335de32661ae75471f29bc387de194e Author: Randall Stewart AuthorDate: 2021-05-10 15:25:51 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:00:27 +0000 tcp:Host cache and rack ending up with incorrect values. The hostcache up to now as been updated in the discard callback but without checking if we are all done (the race where there are more than one calls and the counter has not yet reached zero). This means that when the race occurs, we end up calling the hc_upate more than once. Also alternate stacks can keep there srtt/rttvar in different formats (example rack keeps its values in microseconds). Since we call the hc_update *before* the stack fini() then the values will be in the wrong format. Rack on the other hand, needs to convert items pulled from the hostcache into its internal format else it may end up with very much incorrect values from the hostcache. In the process lets commonize the update mechanism for srtt/rttvar since we now have more than one place that needs to call it. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30172 (cherry picked from commit 9867224bab3f247ac875d89c2472aa4bc855fe3b) --- sys/netinet/tcp_stacks/rack.c | 102 ++++++++++++++++++++---------------- sys/netinet/tcp_subr.c | 118 ++++++++++++++++++++++-------------------- 2 files changed, 119 insertions(+), 101 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 110304d29cc0..7bb77d8158af 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6563,13 +6563,65 @@ rack_remxt_tmr(struct tcpcb *tp) rack->r_ctl.rc_snd_max_at_rto = tp->snd_max; } +static void +rack_convert_rtts(struct tcpcb *tp) +{ + if (tp->t_srtt > 1) { + uint32_t val, frac; + + val = tp->t_srtt >> TCP_RTT_SHIFT; + frac = tp->t_srtt & 0x1f; + tp->t_srtt = TICKS_2_USEC(val); + /* + * frac is the fractional part of the srtt (if any) + * but its in ticks and every bit represents + * 1/32nd of a hz. + */ + if (frac) { + if (hz == 1000) { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); + } else { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); + } + tp->t_srtt += frac; + } + } + if (tp->t_rttvar) { + uint32_t val, frac; + + val = tp->t_rttvar >> TCP_RTTVAR_SHIFT; + frac = tp->t_rttvar & 0x1f; + tp->t_rttvar = TICKS_2_USEC(val); + /* + * frac is the fractional part of the srtt (if any) + * but its in ticks and every bit represents + * 1/32nd of a hz. + */ + if (frac) { + if (hz == 1000) { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); + } else { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); + } + tp->t_rttvar += frac; + } + } + RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), + rack_rto_min, rack_rto_max); +} + static void rack_cc_conn_init(struct tcpcb *tp) { struct tcp_rack *rack; rack = (struct tcp_rack *)tp->t_fb_ptr; + cc_conn_init(tp); + /* + * Now convert to rack's internal format. + */ + rack_convert_rtts(tp); /* * We want a chance to stay in slowstart as * we create a connection. TCP spec says that @@ -11916,9 +11968,9 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) static int rack_init_fsb(struct tcpcb *tp, struct tcp_rack *rack) { - /* - * Allocate the larger of spaces V6 if available else just - * V4 and include udphdr (overbook) + /* + * Allocate the larger of spaces V6 if available else just + * V4 and include udphdr (overbook) */ #ifdef INET6 rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr) + sizeof(struct udphdr); @@ -12147,47 +12199,7 @@ rack_init(struct tcpcb *tp) * bit decimal so we have to carefully convert * these to get the full precision. */ - if (tp->t_srtt > 1) { - uint32_t val, frac; - - val = tp->t_srtt >> TCP_RTT_SHIFT; - frac = tp->t_srtt & 0x1f; - tp->t_srtt = TICKS_2_USEC(val); - /* - * frac is the fractional part of the srtt (if any) - * but its in ticks and every bit represents - * 1/32nd of a hz. - */ - if (frac) { - if (hz == 1000) { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); - } else { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); - } - tp->t_srtt += frac; - } - } - if (tp->t_rttvar) { - uint32_t val, frac; - - val = tp->t_rttvar >> TCP_RTTVAR_SHIFT; - frac = tp->t_rttvar & 0x1f; - tp->t_rttvar = TICKS_2_USEC(val); - /* - * frac is the fractional part of the srtt (if any) - * but its in ticks and every bit represents - * 1/32nd of a hz. - */ - if (frac) { - if (hz == 1000) { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); - } else { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); - } - tp->t_rttvar += frac; - } - } - tp->t_rxtcur = TICKS_2_USEC(tp->t_rxtcur); + rack_convert_rtts(tp); tp->t_rttlow = TICKS_2_USEC(tp->t_rttlow); if (rack_def_profile) rack_set_profile(rack, rack_def_profile); @@ -12230,7 +12242,7 @@ rack_init(struct tcpcb *tp) rack_stop_all_timers(tp); /* Lets setup the fsb block */ rack_start_hpts_timer(rack, tp, tcp_get_usecs(NULL), 0, 0, 0); - rack_log_rtt_shrinks(rack, us_cts, 0, + rack_log_rtt_shrinks(rack, us_cts, tp->t_rxtcur, __LINE__, RACK_RTTS_INIT); return (0); } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 93445c636d41..b9da908d2a15 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2305,62 +2305,6 @@ tcp_discardcb(struct tcpcb *tp) tp->t_fb->tfb_tcp_timer_stop_all(tp); } - /* - * If we got enough samples through the srtt filter, - * save the rtt and rttvar in the routing entry. - * 'Enough' is arbitrarily defined as 4 rtt samples. - * 4 samples is enough for the srtt filter to converge - * to within enough % of the correct value; fewer samples - * and we could save a bogus rtt. The danger is not high - * as tcp quickly recovers from everything. - * XXX: Works very well but needs some more statistics! - */ - if (tp->t_rttupdated >= 4) { - struct hc_metrics_lite metrics; - uint32_t ssthresh; - - bzero(&metrics, sizeof(metrics)); - /* - * Update the ssthresh always when the conditions below - * are satisfied. This gives us better new start value - * for the congestion avoidance for new connections. - * ssthresh is only set if packet loss occurred on a session. - * - * XXXRW: 'so' may be NULL here, and/or socket buffer may be - * being torn down. Ideally this code would not use 'so'. - */ - ssthresh = tp->snd_ssthresh; - if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) { - /* - * convert the limit from user data bytes to - * packets then to packet data bytes. - */ - ssthresh = (ssthresh + tp->t_maxseg / 2) / tp->t_maxseg; - if (ssthresh < 2) - ssthresh = 2; - ssthresh *= (tp->t_maxseg + -#ifdef INET6 - (isipv6 ? sizeof (struct ip6_hdr) + - sizeof (struct tcphdr) : -#endif - sizeof (struct tcpiphdr) -#ifdef INET6 - ) -#endif - ); - } else - ssthresh = 0; - metrics.rmx_ssthresh = ssthresh; - - metrics.rmx_rtt = tp->t_srtt; - metrics.rmx_rttvar = tp->t_rttvar; - metrics.rmx_cwnd = tp->snd_cwnd; - metrics.rmx_sendpipe = 0; - metrics.rmx_recvpipe = 0; - - tcp_hc_update(&inp->inp_inc, &metrics); - } - /* free the reassembly queue, if any */ tcp_reass_flush(tp); @@ -2400,6 +2344,68 @@ tcp_discardcb(struct tcpcb *tp) TCPSTATES_DEC(tp->t_state); if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); + + /* + * If we got enough samples through the srtt filter, + * save the rtt and rttvar in the routing entry. + * 'Enough' is arbitrarily defined as 4 rtt samples. + * 4 samples is enough for the srtt filter to converge + * to within enough % of the correct value; fewer samples + * and we could save a bogus rtt. The danger is not high + * as tcp quickly recovers from everything. + * XXX: Works very well but needs some more statistics! + * + * XXXRRS: Updating must be after the stack fini() since + * that may be converting some internal representation of + * say srtt etc into the general one used by other stacks. + * Lets also at least protect against the so being NULL + * as RW stated below. + */ + if ((tp->t_rttupdated >= 4) && (so != NULL)) { + struct hc_metrics_lite metrics; + uint32_t ssthresh; + + bzero(&metrics, sizeof(metrics)); + /* + * Update the ssthresh always when the conditions below + * are satisfied. This gives us better new start value + * for the congestion avoidance for new connections. + * ssthresh is only set if packet loss occurred on a session. + * + * XXXRW: 'so' may be NULL here, and/or socket buffer may be + * being torn down. Ideally this code would not use 'so'. + */ + ssthresh = tp->snd_ssthresh; + if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) { + /* + * convert the limit from user data bytes to + * packets then to packet data bytes. + */ + ssthresh = (ssthresh + tp->t_maxseg / 2) / tp->t_maxseg; + if (ssthresh < 2) + ssthresh = 2; + ssthresh *= (tp->t_maxseg + +#ifdef INET6 + (isipv6 ? sizeof (struct ip6_hdr) + + sizeof (struct tcphdr) : +#endif + sizeof (struct tcpiphdr) +#ifdef INET6 + ) +#endif + ); + } else + ssthresh = 0; + metrics.rmx_ssthresh = ssthresh; + + metrics.rmx_rtt = tp->t_srtt; + metrics.rmx_rttvar = tp->t_rttvar; + metrics.rmx_cwnd = tp->snd_cwnd; + metrics.rmx_sendpipe = 0; + metrics.rmx_recvpipe = 0; + + tcp_hc_update(&inp->inp_inc, &metrics); + } refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:02:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD703641056; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06jk5vYcz3ljp; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1B5C128A5; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15902IQQ056775; Wed, 9 Jun 2021 00:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15902Ii4056774; Wed, 9 Jun 2021 00:02:18 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:02:18 GMT Message-Id: <202106090002.15902Ii4056774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ecfc25f05bf4 - stable/13 - tcp: In rack, we must only convert restored rtt when the hostcache does restore them. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ecfc25f05bf4bea6ce35a34b746d50fe57d84130 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:02:18 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfc25f05bf4bea6ce35a34b746d50fe57d84130 commit ecfc25f05bf4bea6ce35a34b746d50fe57d84130 Author: Randall Stewart AuthorDate: 2021-05-11 12:15:05 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:01:32 +0000 tcp: In rack, we must only convert restored rtt when the hostcache does restore them. Rack now after the previous commit is very careful to translate any value in the hostcache for srtt/rttvar into its proper format. However there is a snafu here in that if tp->srtt is 0 is the only time that the HC will actually restore the srtt. We need to then only convert the srtt restored when it is actually restored. We do this by making sure it was zero before the call to cc_conn_init and it is non-zero afterwards. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30213 (cherry picked from commit 4b86a24a76a4d58c1d870fcb2252b321f61cb3cc) --- sys/netinet/tcp_stacks/rack.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 7bb77d8158af..e9d3c6b95d91 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6614,14 +6614,17 @@ static void rack_cc_conn_init(struct tcpcb *tp) { struct tcp_rack *rack; + uint32_t srtt; rack = (struct tcp_rack *)tp->t_fb_ptr; - + srtt = tp->t_srtt; cc_conn_init(tp); /* - * Now convert to rack's internal format. + * Now convert to rack's internal format, + * if required. */ - rack_convert_rtts(tp); + if ((srtt == 0) && (tp->t_srtt != 0)) + rack_convert_rtts(tp); /* * We want a chance to stay in slowstart as * we create a connection. TCP spec says that From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:03:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 806EA640F49; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06l03Dm4z3m2y; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57C60126B2; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15903O8v057815; Wed, 9 Jun 2021 00:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15903ODa057814; Wed, 9 Jun 2021 00:03:24 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:03:24 GMT Message-Id: <202106090003.15903ODa057814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6170c93c03fa - stable/13 - tcp rack: improve initialisation of retransmit timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6170c93c03fa394eae81ce20f969b6a53bc68415 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:03:24 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6170c93c03fa394eae81ce20f969b6a53bc68415 commit 6170c93c03fa394eae81ce20f969b6a53bc68415 Author: Michael Tuexen AuthorDate: 2021-05-12 15:58:56 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:02:39 +0000 tcp rack: improve initialisation of retransmit timeout When the TCP is in the front states, don't take the slop variable into account. This improves consistency with the base stack. Reviewed by: rrs@ Differential Revision: https://reviews.freebsd.org/D30230 Sponsored by: Netflix, Inc. (cherry picked from commit 251842c63927fc4af63bdc61989bbfbf3823c679) --- sys/netinet/tcp_stacks/rack.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index e9d3c6b95d91..48b278806410 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6606,8 +6606,13 @@ rack_convert_rtts(struct tcpcb *tp) tp->t_rttvar += frac; } } - RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + tp->t_rxtcur = RACK_REXMTVAL(tp); + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + tp->t_rxtcur += TICKS_2_USEC(tcp_rexmit_slop); + } + if (tp->t_rxtcur > rack_rto_max) { + tp->t_rxtcur = rack_rto_max; + } } static void From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:04:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0D6A640CE6; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06mC61HZz3lmm; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6B05127D6; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15904RTE057995; Wed, 9 Jun 2021 00:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15904RS5057994; Wed, 9 Jun 2021 00:04:27 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:04:27 GMT Message-Id: <202106090004.15904RS5057994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 821543e7834b - stable/13 - mod_cc: cross reference CC modules consistently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 821543e7834b0c050bfc33d9f7c70f3cc288b736 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:04:27 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=821543e7834b0c050bfc33d9f7c70f3cc288b736 commit 821543e7834b0c050bfc33d9f7c70f3cc288b736 Author: Michael Tuexen AuthorDate: 2021-05-13 08:47:45 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:04:12 +0000 mod_cc: cross reference CC modules consistently Reviewed by: bcr, gbe Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30240 (cherry picked from commit 8ea5eeb913b94aa45aa7773d14b31222d509ec34) --- share/man/man4/cc_cdg.4 | 3 ++- share/man/man4/cc_chd.4 | 4 +++- share/man/man4/cc_cubic.4 | 4 +++- share/man/man4/cc_dctcp.4 | 3 ++- share/man/man4/cc_hd.4 | 4 +++- share/man/man4/cc_htcp.4 | 4 +++- share/man/man4/cc_newreno.4 | 4 +++- share/man/man4/cc_vegas.4 | 4 +++- share/man/man9/mod_cc.9 | 3 ++- 9 files changed, 24 insertions(+), 9 deletions(-) diff --git a/share/man/man4/cc_cdg.4 b/share/man/man4/cc_cdg.4 index 38f8ed397def..1b14e094ff84 100644 --- a/share/man/man4/cc_cdg.4 +++ b/share/man/man4/cc_cdg.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2013 +.Dd May 13, 2021 .Dt CC_CDG 4 .Os .Sh NAME @@ -99,6 +99,7 @@ Default is 0. .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_chd.4 b/share/man/man4/cc_chd.4 index 963d89247fde..32b0444f89d7 100644 --- a/share/man/man4/cc_chd.4 +++ b/share/man/man4/cc_chd.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CHD 4 .Os .Sh NAME @@ -86,7 +86,9 @@ is used. Default is 1. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_cubic.4 b/share/man/man4/cc_cubic.4 index 75df183fa16f..92ac8971e867 100644 --- a/share/man/man4/cc_cubic.4 +++ b/share/man/man4/cc_cubic.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CUBIC 4 .Os .Sh NAME @@ -62,7 +62,9 @@ section below. .Sh MIB Variables There are currently no tunable MIB variables. .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_dctcp.4 b/share/man/man4/cc_dctcp.4 index 5c5be4fed96e..8c23f2eaa134 100644 --- a/share/man/man4/cc_dctcp.4 +++ b/share/man/man4/cc_dctcp.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2019 +.Dd May 13, 2021 .Dt CC_DCTCP 4 .Os .Sh NAME @@ -93,6 +93,7 @@ A flag if the congestion window should be reduced by one half after slow start. Valid settings 0 and 1, default 0. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , diff --git a/share/man/man4/cc_hd.4 b/share/man/man4/cc_hd.4 index 497e61616a0a..d56d9b77b4d9 100644 --- a/share/man/man4/cc_hd.4 +++ b/share/man/man4/cc_hd.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HD 4 .Os .Sh NAME @@ -69,8 +69,10 @@ Minimum queuing delay threshold (qmin) in ticks. Default is 5. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_htcp.4 b/share/man/man4/cc_htcp.4 index 0e141bb79a7d..46d94a12114a 100644 --- a/share/man/man4/cc_htcp.4 +++ b/share/man/man4/cc_htcp.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HTCP 4 .Os .Sh NAME @@ -69,8 +69,10 @@ window increase during congestion avoidance mode invariant with respect to RTT. Default is 0 (disabled). .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_newreno.4 b/share/man/man4/cc_newreno.4 index 8169c04c3eaa..0ac59beeec48 100644 --- a/share/man/man4/cc_newreno.4 +++ b/share/man/man4/cc_newreno.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2019 +.Dd May 13, 2021 .Dt CC_NEWRENO 4 .Os .Sh NAME @@ -96,8 +96,10 @@ per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_vegas.4 b/share/man/man4/cc_vegas.4 index 45b4b6244017..ad043b218a4d 100644 --- a/share/man/man4/cc_vegas.4 +++ b/share/man/man4/cc_vegas.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_VEGAS 4 .Os .Sh NAME @@ -92,8 +92,10 @@ When setting beta, the value must satisfy: 0 < alpha < beta. Default is 3. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man9/mod_cc.9 b/share/man/man9/mod_cc.9 index 7e9ab2488437..8be6fb2381bd 100644 --- a/share/man/man9/mod_cc.9 +++ b/share/man/man9/mod_cc.9 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2016 +.Dd May 13, 2021 .Dt MOD_CC 9 .Os .Sh NAME @@ -309,6 +309,7 @@ a large difference between the congestion window and send window. .Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:05:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D74B464132F; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06nz5ktfz3lxc; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC83D128AA; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15905xMD058211; Wed, 9 Jun 2021 00:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15905xj2058210; Wed, 9 Jun 2021 00:05:59 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:05:59 GMT Message-Id: <202106090005.15905xj2058210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3a3bba7df566 - stable/13 - tcp: Incorrect KASSERT causes a panic in rack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a3bba7df566e421c385444912ce603ee845c171 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:05:59 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3a3bba7df566e421c385444912ce603ee845c171 commit 3a3bba7df566e421c385444912ce603ee845c171 Author: Randall Stewart AuthorDate: 2021-05-13 11:36:04 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:05:15 +0000 tcp: Incorrect KASSERT causes a panic in rack Skyzall found an interesting panic in rack. When a SYN and FIN are both sent together a KASSERT gets tripped where it is validating that a mbuf pointer is in the sendmap. But a SYN and FIN often will not have a mbuf pointer. So the fix is two fold a) make sure that the SYN and FIN split the right way when cloning an RSM SYN on left edge and FIN on right. And also make sure the KASSERT properly accounts for the case that we have a SYN or FIN so we don't panic. Reviewed by: mtuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D30241 (cherry picked from commit 02cffbc2507e83944b0c29d69d6ddf26c9386d54) --- sys/netinet/tcp_stacks/rack.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 48b278806410..6b0eadd89004 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6054,6 +6054,12 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, for (idx = 0; idx < nrsm->r_rtr_cnt; idx++) { nrsm->r_tim_lastsent[idx] = rsm->r_tim_lastsent[idx]; } + /* Now if we have SYN flag we keep it on the left edge */ + if (nrsm->r_flags & RACK_HAS_SYN) + nrsm->r_flags &= ~RACK_HAS_SYN; + /* Now if we have a FIN flag we keep it on the right edge */ + if (nrsm->r_flags & RACK_HAS_FIN) + nrsm->r_flags &= ~RACK_HAS_FIN; /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + @@ -6061,9 +6067,11 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, * chain to find the righ postion, it may be the same mbuf * or maybe not. */ - KASSERT((rsm->m != NULL), + KASSERT(((rsm->m != NULL) || + (rsm->r_flags & (RACK_HAS_SYN|RACK_HAS_FIN))), ("rsm:%p nrsm:%p rack:%p -- rsm->m is NULL?", rsm, nrsm, rack)); - rack_setup_offset_for_rsm(rsm, nrsm); + if (rsm->m) + rack_setup_offset_for_rsm(rsm, nrsm); } static struct rack_sendmap * From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:08:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46F9A6414B9; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06sD1Y0Jz3mBp; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1C312376; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15908mPL058616; Wed, 9 Jun 2021 00:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15908lod058615; Wed, 9 Jun 2021 00:08:47 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:08:47 GMT Message-Id: <202106090008.15908lod058615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 56aeedd2fda4 - stable/13 - tcp: Fix sending of TCP segments with IP level options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56aeedd2fda4e1a714812a1fbdc9e8a784283d94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:08:48 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=56aeedd2fda4e1a714812a1fbdc9e8a784283d94 commit 56aeedd2fda4e1a714812a1fbdc9e8a784283d94 Author: Michael Tuexen AuthorDate: 2021-05-21 07:45:00 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:06:26 +0000 tcp: Fix sending of TCP segments with IP level options When bringing in TCP over UDP support in https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605, the length of IP level options was considered when locating the transport header. This was incorrect and is fixed by this patch. X-MFC with: https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605 Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30358 (cherry picked from commit 500eb6dd80404ea512e31a8f795c73cb802c9c64) --- sys/netinet/tcp_output.c | 4 ++-- sys/netinet/tcp_stacks/bbr.c | 4 ++-- sys/netinet/tcp_stacks/rack.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 5bda2be14df0..2a91570acdad 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1154,7 +1154,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -1172,7 +1172,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index f19872245e55..abc0536d47c7 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -13354,7 +13354,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -13372,7 +13372,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 6b0eadd89004..d7a01bab6bd0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -17658,7 +17658,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -17675,7 +17675,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:10:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B5CA641467; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06v81gKQz3m6x; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2185D125DA; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590ASO4067016; Wed, 9 Jun 2021 00:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590AS1M067015; Wed, 9 Jun 2021 00:10:28 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:10:28 GMT Message-Id: <202106090010.1590AS1M067015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6264ff9bd9f0 - stable/13 - tcp: Handle stack switch while processing socket options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6264ff9bd9f0f01f052b9b100af12e53613a825c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:10:28 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6264ff9bd9f0f01f052b9b100af12e53613a825c commit 6264ff9bd9f0f01f052b9b100af12e53613a825c Author: Michael Tuexen AuthorDate: 2021-05-22 12:35:09 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:09:37 +0000 tcp: Handle stack switch while processing socket options Handle the case where during socket option processing, the user switches a stack such that processing the stack specific socket option does not make sense anymore. Return an error in this case. Reviewed by: markj Reported by: syzbot+a6e1d91f240ad5d72cd1@syzkaller.appspotmail.com Sponsored by: Netflix, Inc. Differential revision: https://reviews.freebsd.org/D30395 (cherry picked from commit 8923ce630492d21ec57c2637757bcc44da9970f8) --- sys/netinet/tcp_stacks/bbr.c | 62 ++++++++++++++++++++++++------------------- sys/netinet/tcp_stacks/rack.c | 60 ++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 55 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index abc0536d47c7..2a98f5cb43ef 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -518,6 +518,10 @@ static void bbr_log_pacing_delay_calc(struct tcp_bbr *bbr, uint16_t gain, uint32_t len, uint32_t cts, uint32_t usecs, uint64_t bw, uint32_t override, int mod); +static int +bbr_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, + struct tcpcb *tp); + static inline uint8_t bbr_state_val(struct tcp_bbr *bbr) { @@ -14197,6 +14201,33 @@ bbr_mtu_chg(struct tcpcb *tp) } } +static int +bbr_pru_options(struct tcpcb *tp, int flags) +{ + if (flags & PRUS_OOB) + return (EOPNOTSUPP); + return (0); +} + +struct tcp_function_block __tcp_bbr = { + .tfb_tcp_block_name = __XSTRING(STACKNAME), + .tfb_tcp_output = bbr_output, + .tfb_do_queued_segments = ctf_do_queued_segments, + .tfb_do_segment_nounlock = bbr_do_segment_nounlock, + .tfb_tcp_do_segment = bbr_do_segment, + .tfb_tcp_ctloutput = bbr_ctloutput, + .tfb_tcp_fb_init = bbr_init, + .tfb_tcp_fb_fini = bbr_fini, + .tfb_tcp_timer_stop_all = bbr_stopall, + .tfb_tcp_timer_activate = bbr_timer_activate, + .tfb_tcp_timer_active = bbr_timer_active, + .tfb_tcp_timer_stop = bbr_timer_stop, + .tfb_tcp_rexmit_tmr = bbr_remxt_tmr, + .tfb_tcp_handoff_ok = bbr_handoff_ok, + .tfb_tcp_mtu_chg = bbr_mtu_chg, + .tfb_pru_options = bbr_pru_options, +}; + /* * bbr_ctloutput() must drop the inpcb lock before performing copyin on * socket option arguments. When it re-acquires the lock after the copy, it @@ -14269,6 +14300,10 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sopt, return (ECONNRESET); } tp = intotcpcb(inp); + if (tp->t_fb != &__tcp_bbr) { + INP_WUNLOCK(inp); + return (ENOPROTOOPT); + } bbr = (struct tcp_bbr *)tp->t_fb_ptr; switch (sopt->sopt_name) { case TCP_BBR_PACE_PER_SEC: @@ -14772,33 +14807,6 @@ out: return (error); } -static int -bbr_pru_options(struct tcpcb *tp, int flags) -{ - if (flags & PRUS_OOB) - return (EOPNOTSUPP); - return (0); -} - -struct tcp_function_block __tcp_bbr = { - .tfb_tcp_block_name = __XSTRING(STACKNAME), - .tfb_tcp_output = bbr_output, - .tfb_do_queued_segments = ctf_do_queued_segments, - .tfb_do_segment_nounlock = bbr_do_segment_nounlock, - .tfb_tcp_do_segment = bbr_do_segment, - .tfb_tcp_ctloutput = bbr_ctloutput, - .tfb_tcp_fb_init = bbr_init, - .tfb_tcp_fb_fini = bbr_fini, - .tfb_tcp_timer_stop_all = bbr_stopall, - .tfb_tcp_timer_activate = bbr_timer_activate, - .tfb_tcp_timer_active = bbr_timer_active, - .tfb_tcp_timer_stop = bbr_timer_stop, - .tfb_tcp_rexmit_tmr = bbr_remxt_tmr, - .tfb_tcp_handoff_ok = bbr_handoff_ok, - .tfb_tcp_mtu_chg = bbr_mtu_chg, - .tfb_pru_options = bbr_pru_options, -}; - static const char *bbr_stack_names[] = { __XSTRING(STACKNAME), #ifdef STACKALIAS diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index d7a01bab6bd0..c870b286a847 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -19409,6 +19409,34 @@ rack_apply_deferred_options(struct tcp_rack *rack) } } +static int +rack_pru_options(struct tcpcb *tp, int flags) +{ + if (flags & PRUS_OOB) + return (EOPNOTSUPP); + return (0); +} + +static struct tcp_function_block __tcp_rack = { + .tfb_tcp_block_name = __XSTRING(STACKNAME), + .tfb_tcp_output = rack_output, + .tfb_do_queued_segments = ctf_do_queued_segments, + .tfb_do_segment_nounlock = rack_do_segment_nounlock, + .tfb_tcp_do_segment = rack_do_segment, + .tfb_tcp_ctloutput = rack_ctloutput, + .tfb_tcp_fb_init = rack_init, + .tfb_tcp_fb_fini = rack_fini, + .tfb_tcp_timer_stop_all = rack_stopall, + .tfb_tcp_timer_activate = rack_timer_activate, + .tfb_tcp_timer_active = rack_timer_active, + .tfb_tcp_timer_stop = rack_timer_stop, + .tfb_tcp_rexmit_tmr = rack_remxt_tmr, + .tfb_tcp_handoff_ok = rack_handoff_ok, + .tfb_tcp_mtu_chg = rack_mtu_change, + .tfb_pru_options = rack_pru_options, + +}; + /* * rack_ctloutput() must drop the inpcb lock before performing copyin on * socket option arguments. When it re-acquires the lock after the copy, it @@ -19498,6 +19526,10 @@ rack_set_sockopt(struct socket *so, struct sockopt *sopt, INP_WUNLOCK(inp); return (ECONNRESET); } + if (tp->t_fb != &__tcp_rack) { + INP_WUNLOCK(inp); + return (ENOPROTOOPT); + } if (rack->defer_options && (rack->gp_ready == 0) && (sopt->sopt_name != TCP_DEFER_OPTIONS) && (sopt->sopt_name != TCP_RACK_PACING_BETA) && @@ -19834,34 +19866,6 @@ out: return (error); } -static int -rack_pru_options(struct tcpcb *tp, int flags) -{ - if (flags & PRUS_OOB) - return (EOPNOTSUPP); - return (0); -} - -static struct tcp_function_block __tcp_rack = { - .tfb_tcp_block_name = __XSTRING(STACKNAME), - .tfb_tcp_output = rack_output, - .tfb_do_queued_segments = ctf_do_queued_segments, - .tfb_do_segment_nounlock = rack_do_segment_nounlock, - .tfb_tcp_do_segment = rack_do_segment, - .tfb_tcp_ctloutput = rack_ctloutput, - .tfb_tcp_fb_init = rack_init, - .tfb_tcp_fb_fini = rack_fini, - .tfb_tcp_timer_stop_all = rack_stopall, - .tfb_tcp_timer_activate = rack_timer_activate, - .tfb_tcp_timer_active = rack_timer_active, - .tfb_tcp_timer_stop = rack_timer_stop, - .tfb_tcp_rexmit_tmr = rack_remxt_tmr, - .tfb_tcp_handoff_ok = rack_handoff_ok, - .tfb_tcp_mtu_chg = rack_mtu_change, - .tfb_pru_options = rack_pru_options, - -}; - static const char *rack_stack_names[] = { __XSTRING(STACKNAME), #ifdef STACKALIAS From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:13:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A15B7641699; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06yH46x0z3mZf; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7566112BCA; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590DB2n071255; Wed, 9 Jun 2021 00:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590DBhr071254; Wed, 9 Jun 2021 00:13:11 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:13:11 GMT Message-Id: <202106090013.1590DBhr071254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e99fa57b981e - stable/13 - tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e99fa57b981eaeac287a1d0d8c0b351740f7a30b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:13:11 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e99fa57b981eaeac287a1d0d8c0b351740f7a30b commit e99fa57b981eaeac287a1d0d8c0b351740f7a30b Author: Randall Stewart AuthorDate: 2021-05-24 18:42:15 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:12:21 +0000 tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's The push bit itself was also not actually being properly moved to the right edge. The FIN bit was incorrectly on the left edge. We fix these two issues as well as plumb in the mtu_change for alternate stacks. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30413 (cherry picked from commit 631449d5d03506295eaa6947c1b0e8a168a2f6b7) --- sys/netinet/tcp_stacks/rack.c | 8 ++++++-- sys/netinet/tcp_subr.c | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index c870b286a847..0bdcc20d2b7c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6058,8 +6058,12 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, if (nrsm->r_flags & RACK_HAS_SYN) nrsm->r_flags &= ~RACK_HAS_SYN; /* Now if we have a FIN flag we keep it on the right edge */ - if (nrsm->r_flags & RACK_HAS_FIN) - nrsm->r_flags &= ~RACK_HAS_FIN; + if (rsm->r_flags & RACK_HAS_FIN) + rsm->r_flags &= ~RACK_HAS_FIN; + /* Push bit must go to the right edge as well */ + if (rsm->r_flags & RACK_HAD_PUSH) + rsm->r_flags &= ~RACK_HAD_PUSH; + /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b9da908d2a15..bb2c35c76fde 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3373,6 +3373,15 @@ tcp_mtudisc(struct inpcb *inp, int mtuoffer) tp->snd_recover = tp->snd_max; if (tp->t_flags & TF_SACK_PERMIT) EXIT_FASTRECOVERY(tp->t_flags); + if (tp->t_fb->tfb_tcp_mtu_chg != NULL) { + /* + * Conceptually the snd_nxt setting + * and freeing sack holes should + * be done by the default stacks + * own tfb_tcp_mtu_chg(). + */ + tp->t_fb->tfb_tcp_mtu_chg(tp); + } tp->t_fb->tfb_tcp_output(tp); } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:14:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0111A64188C; Wed, 9 Jun 2021 00:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06zl6Zrqz3mdK; Wed, 9 Jun 2021 00:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA2FB12C07; Wed, 9 Jun 2021 00:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590ERMM071463; Wed, 9 Jun 2021 00:14:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590ERSB071462; Wed, 9 Jun 2021 00:14:27 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:14:27 GMT Message-Id: <202106090014.1590ERSB071462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 12e181b67273 - stable/13 - tcp: Fix bugs related to the PUSH bit and rack and an ack war MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12e181b6727326f79173182d04eb799eab3bdec7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:14:28 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=12e181b6727326f79173182d04eb799eab3bdec7 commit 12e181b6727326f79173182d04eb799eab3bdec7 Author: Randall Stewart AuthorDate: 2021-05-25 17:23:31 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:13:32 +0000 tcp: Fix bugs related to the PUSH bit and rack and an ack war Michaels testing with UDP tunneling found an issue with the push bit, which was only partly fixed in the last commit. The problem is the left edge gets transmitted before the adjustments are done to the send_map, this means that right edge bits must be considered to be added only if the entire RSM is being retransmitted. Now syzkaller also continued to find a crash, which Michael sent me the reproducer for. Turns out that the reproducer on default (freebsd) stack made the stack get into an ack-war with itself. After fixing the reference issues in rack the same ack-war was found in rack (and bbr). Basically what happens is we go into the reassembly code and lose the FIN bit. The trick here is we should not be going into the reassembly code if tlen == 0 i.e. the peer never sent you anything. That then gets the proper action on the FIN bit but then you end up in LAST_ACK with no timers running. This is because the usrclosed function gets called and the FIN's and such have already been exchanged. So when we should be entering FIN_WAIT2 (or even FIN_WAIT1) we get stuck in LAST_ACK. Fixing this means tweaking the usrclosed function so that we properly recognize the condition and drop into FIN_WAIT2 where a timer will allow at least TP_MAXIDLE before closing (to allow time for the peer to retransmit its FIN if the ack is lost). Setting the fast_finwait2 timer can speed this up in testing. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30451 (cherry picked from commit 13c0e198ca275447f9a60a03f730c38c98f19009) --- sys/netinet/tcp_input.c | 6 +++-- sys/netinet/tcp_stacks/bbr.c | 6 +++-- sys/netinet/tcp_stacks/rack.c | 58 +++++++++++++++++++++++++++++-------------- sys/netinet/tcp_usrreq.c | 16 ++++++++++++ 4 files changed, 64 insertions(+), 22 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 916a7186770c..4ea0f7c5231c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,8 +3184,10 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 2a98f5cb43ef..78957bdfb27d 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,8 +8321,10 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0bdcc20d2b7c..a500c2a18004 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6017,7 +6017,7 @@ rack_setup_offset_for_rsm(struct rack_sendmap *src_rsm, struct rack_sendmap *rsm struct mbuf *m; uint32_t soff; - if (src_rsm->orig_m_len != src_rsm->m->m_len) { + if (src_rsm->m && (src_rsm->orig_m_len != src_rsm->m->m_len)) { /* Fix up the orig_m_len and possibly the mbuf offset */ rack_adjust_orig_mlen(src_rsm); } @@ -8818,21 +8818,23 @@ more: rack->r_ctl.rc_gp_cumack_ts = rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; rack_log_map_chg(tp, rack, NULL, rsm, NULL, MAP_TRIM_HEAD, th_ack, __LINE__); /* Now we need to move our offset forward too */ - if (rsm->orig_m_len != rsm->m->m_len) { + if (rsm->m && (rsm->orig_m_len != rsm->m->m_len)) { /* Fix up the orig_m_len and possibly the mbuf offset */ rack_adjust_orig_mlen(rsm); } rsm->soff += (th_ack - rsm->r_start); rsm->r_start = th_ack; /* Now do we need to move the mbuf fwd too? */ - while (rsm->soff >= rsm->m->m_len) { - rsm->soff -= rsm->m->m_len; - rsm->m = rsm->m->m_next; - KASSERT((rsm->m != NULL), - (" nrsm:%p hit at soff:%u null m", - rsm, rsm->soff)); - } - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) { + while (rsm->soff >= rsm->m->m_len) { + rsm->soff -= rsm->m->m_len; + rsm->m = rsm->m->m_next; + KASSERT((rsm->m != NULL), + (" nrsm:%p hit at soff:%u null m", + rsm, rsm->soff)); + } + rsm->orig_m_len = rsm->m->m_len; + } if (rack->app_limited_needs_set) rack_need_set_test(tp, rack, rsm, tp->snd_una, __LINE__, RACK_USE_BEG); } @@ -9655,7 +9657,7 @@ rack_adjust_sendmap(struct tcp_rack *rack, struct sockbuf *sb, tcp_seq snd_una) /* Nothing outstanding */ return; } - while (rsm->m == m) { + while (rsm->m && (rsm->m == m)) { /* one to adjust */ #ifdef INVARIANTS struct mbuf *tm; @@ -9676,10 +9678,16 @@ rack_adjust_sendmap(struct tcp_rack *rack, struct sockbuf *sb, tcp_seq snd_una) } rsm->m = tm; rsm->soff = soff; - rsm->orig_m_len = rsm->m->m_len; + if (tm) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; #else rsm->m = sbsndmbuf(sb, (rsm->r_start - snd_una), &rsm->soff); - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; #endif rsm = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); @@ -10058,6 +10066,7 @@ rack_validate_fo_sendwin_up(struct tcpcb *tp, struct tcp_rack *rack) } } + /* * Return value of 1, the TCB is unlocked and most * likely gone, return value of 0, the TCP is still @@ -10227,9 +10236,10 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && @@ -12190,7 +12200,10 @@ rack_init(struct tcpcb *tp) rsm->r_dupack = 0; if (rack->rc_inp->inp_socket->so_snd.sb_mb != NULL) { rsm->m = sbsndmbuf(&rack->rc_inp->inp_socket->so_snd, 0, &rsm->soff); - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; } else { /* * This can happen if we have a stand-alone FIN or @@ -15075,6 +15088,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma uint32_t us_cts; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; + #ifdef INET6 struct ip6_hdr *ip6 = NULL; @@ -15184,7 +15198,15 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma } th->th_seq = htonl(rsm->r_start); th->th_ack = htonl(tp->rcv_nxt); - if(rsm->r_flags & RACK_HAD_PUSH) + /* + * The PUSH bit should only be applied + * if the full retransmission is made. If + * we are sending less than this is the + * left hand edge and should not have + * the PUSH bit. + */ + if ((rsm->r_flags & RACK_HAD_PUSH) && + (len == (rsm->r_end - rsm->r_start))) flags |= TH_PUSH; th->th_flags = flags; th->th_win = htons((u_short)(rack->r_ctl.fsb.recwin >> tp->rcv_scale)); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index bd847426681e..55aa609fd084 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2635,6 +2635,22 @@ tcp_usrclosed(struct tcpcb *tp) tcp_state_change(tp, TCPS_LAST_ACK); break; } + if ((tp->t_state == TCPS_LAST_ACK) && + (tp->t_flags & TF_SENTFIN)) { + /* + * If we have reached LAST_ACK, and + * we sent a FIN (e.g. via MSG_EOR), then + * we really should move to either FIN_WAIT_1 + * or FIN_WAIT_2 depending on snd_max/snd_una. + */ + if (tp->snd_una == tp->snd_max) { + /* The FIN is acked */ + tcp_state_change(tp, TCPS_FIN_WAIT_2); + } else { + /* The FIN is still outstanding */ + tcp_state_change(tp, TCPS_FIN_WAIT_1); + } + } if (tp->t_state >= TCPS_FIN_WAIT_2) { soisdisconnected(tp->t_inpcb->inp_socket); /* Prevent the connection hanging in FIN_WAIT_2 forever. */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:18:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C27FB6418AA; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G074D52z2z3mXf; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954B012BCE; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590IKJT071823; Wed, 9 Jun 2021 00:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590IKo4071822; Wed, 9 Jun 2021 00:18:20 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:18:20 GMT Message-Id: <202106090018.1590IKo4071822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 362f95f52897 - stable/13 - tcp: Add a socket option to rack so we can test various changes to the slop value in timers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 362f95f5289706dfcdf46dac3619a6aa8ee25186 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:18:20 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=362f95f5289706dfcdf46dac3619a6aa8ee25186 commit 362f95f5289706dfcdf46dac3619a6aa8ee25186 Author: Randall Stewart AuthorDate: 2021-05-26 10:43:30 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:16:00 +0000 tcp: Add a socket option to rack so we can test various changes to the slop value in timers. Timer_slop, in TCP, has been 200ms for a long time. This value dates back a long time when delayed ack timers were longer and links were slower. A 200ms timer slop allows 1 MSS to be sent over a 60kbps link. Its possible that lowering this value to something more in line with todays delayed ack values (40ms) might improve TCP. This bit of code makes it so rack can, via a socket option, adjust the timer slop. Reviewed by: mtuexen Sponsered by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30249 (cherry picked from commit 4f3addd94be5e02e6e425f6119f5409972ab5d14) --- sys/netinet/tcp.h | 1 + sys/netinet/tcp_stacks/rack.c | 44 +++++++++++++++++++++++++++------------ sys/netinet/tcp_stacks/tcp_rack.h | 2 ++ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 50f0811a6517..7273cb5104ea 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -305,6 +305,7 @@ struct tcphdr { #define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't twiddle the TLP bits properly in fast_rsm_output? */ #define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ #define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ +#define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a500c2a18004..5556e562c0eb 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -408,8 +408,8 @@ counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; #define RACK_REXMTVAL(tp) max(rack_rto_min, ((tp)->t_srtt + ((tp)->t_rttvar << 2))) -#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ - (tv) = (value) + TICKS_2_USEC(tcp_rexmit_slop); \ +#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax, slop) do { \ + (tv) = (value) + slop; \ if ((u_long)(tv) < (u_long)(tvmin)) \ (tv) = (tvmin); \ if ((u_long)(tv) > (u_long)(tvmax)) \ @@ -2448,7 +2448,7 @@ rack_log_rtt_sample(struct tcp_rack *rack, uint32_t rtt) /* Lets capture all the things that make up t_rtxcur */ log.u_bbr.applimited = rack_rto_min; log.u_bbr.epoch = rack_rto_max; - log.u_bbr.lt_epoch = rtt; + log.u_bbr.lt_epoch = rack->r_ctl.timer_slop; log.u_bbr.lost = rack_rto_min; log.u_bbr.pkt_epoch = TICKS_2_USEC(tcp_rexmit_slop); log.u_bbr.rttProp = RACK_REXMTVAL(rack->rc_tp); @@ -5260,7 +5260,7 @@ rack_get_persists_timer_val(struct tcpcb *tp, struct tcp_rack *rack) t = (tp->t_srtt + (tp->t_rttvar << 2)); RACK_TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], - rack_persist_min, rack_persist_max); + rack_persist_min, rack_persist_max, rack->r_ctl.timer_slop); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; rack->r_ctl.rc_hpts_flags |= PACE_TMR_PERSIT; @@ -5526,7 +5526,7 @@ rack_enter_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) rack_timer_cancel(tp, rack, cts, __LINE__); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_in_persist = 1; } } @@ -5581,7 +5581,7 @@ rack_exit_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) rack->r_ctl.rc_went_idle_time = 0; tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->r_ctl.rc_agg_delayed = 0; rack->r_early = 0; rack->r_late = 0; @@ -6777,7 +6777,7 @@ drop_it: rexmt = max(rack_rto_min, (tp->t_srtt + (tp->t_rttvar << 2))) * tcp_backoff[tp->t_rxtshift]; RACK_TCPT_RANGESET(tp->t_rxtcur, rexmt, - max(rack_rto_min, rexmt), rack_rto_max); + max(rack_rto_min, rexmt), rack_rto_max, rack->r_ctl.timer_slop); /* * We enter the path for PLMTUD if connection is established or, if * connection is FIN_WAIT_1 status, reason for the last is that if @@ -7702,7 +7702,7 @@ tcp_rack_xmit_timer_commit(struct tcp_rack *rack, struct tcpcb *tp) */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - max(rack_rto_min, rtt + 2), rack_rto_max); + max(rack_rto_min, rtt + 2), rack_rto_max, rack->r_ctl.timer_slop); rack_log_rtt_sample(rack, rtt); tp->t_softerror = 0; } @@ -7877,7 +7877,7 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); tp->t_softerror = 0; if (to && (to->to_flags & TOF_TS) && (ack_type == CUM_ACKED) && @@ -9735,7 +9735,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (rack->rc_in_persist) { tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); } if ((th->th_ack == tp->snd_una) && (tiwin == tp->snd_wnd)) { rack_strike_dupack(rack); @@ -9798,7 +9798,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, /* assure we are not backed off */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* @@ -10650,7 +10650,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* @@ -12089,6 +12089,7 @@ rack_init(struct tcpcb *tp) rack->r_ctl.rc_lowest_us_rtt = 0xffffffff; rack->r_ctl.rc_highest_us_rtt = 0; rack->r_ctl.bw_rate_cap = rack_bw_rate_cap; + rack->r_ctl.timer_slop = TICKS_2_USEC(tcp_rexmit_slop); if (rack_use_cmp_acks) rack->r_use_cmp_ack = 1; if (rack_disable_prr) @@ -13183,7 +13184,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb /* Clear out shifts and such */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* Send recover and snd_nxt must be dragged along */ @@ -18880,6 +18881,19 @@ rack_process_option(struct tcpcb *tp, struct tcp_rack *rack, int sopt_name, rack->r_ctl.rc_saved_beta.beta = optval; } break; + case TCP_RACK_TIMER_SLOP: + RACK_OPTS_INC(tcp_rack_timer_slop); + rack->r_ctl.timer_slop = optval; + if (rack->rc_tp->t_srtt) { + /* + * If we have an SRTT lets update t_rxtcur + * to have the new slop. + */ + RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), + rack_rto_min, rack_rto_max, + rack->r_ctl.timer_slop); + } + break; case TCP_RACK_PACING_BETA_ECN: RACK_OPTS_INC(tcp_rack_beta_ecn); if (strcmp(tp->cc_algo->name, CCALGONAME_NEWRENO) != 0) { @@ -19526,6 +19540,7 @@ rack_set_sockopt(struct socket *so, struct sockopt *sopt, case TCP_DEFER_OPTIONS: /* URL:defer */ case TCP_RACK_PACING_BETA: /* URL:pacing_beta */ case TCP_RACK_PACING_BETA_ECN: /* URL:pacing_beta_ecn */ + case TCP_RACK_TIMER_SLOP: /* URL:timer_slop */ break; default: /* Filter off all unknown options to the base stack */ @@ -19857,6 +19872,9 @@ rack_get_sockopt(struct socket *so, struct sockopt *sopt, case TCP_SHARED_CWND_TIME_LIMIT: optval = rack->r_limit_scw; break; + case TCP_RACK_TIMER_SLOP: + optval = rack->r_ctl.timer_slop; + break; default: return (tcp_default_ctloutput(so, sopt, inp, tp)); break; diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 7f2b2ce4786a..349f6daec2f4 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -245,6 +245,7 @@ struct rack_opts_stats { uint64_t tcp_rack_fastrsm_hack; uint64_t tcp_rack_beta; uint64_t tcp_rack_beta_ecn; + uint64_t tcp_rack_timer_slop; }; /* RTT shrink reasons */ @@ -341,6 +342,7 @@ struct rack_control { struct rack_sendmap *rc_resend; /* something we have been asked to * resend */ struct rack_fast_send_blk fsb; /* The fast-send block */ + uint32_t timer_slop; uint32_t input_pkt; uint32_t saved_input_pkt; uint32_t rc_hpts_flags; From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:19:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64A7C641353; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G075V2PBnz3mh6; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AA31127F3; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590JQEr072005; Wed, 9 Jun 2021 00:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590JQ81072004; Wed, 9 Jun 2021 00:19:26 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:19:26 GMT Message-Id: <202106090019.1590JQ81072004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: eb91abb4ba3d - stable/13 - tcp: When we have an out-of-order FIN we do want to strip off the FIN bit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb91abb4ba3dbdafedfea125129b2f0115e81137 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:19:26 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eb91abb4ba3dbdafedfea125129b2f0115e81137 commit eb91abb4ba3dbdafedfea125129b2f0115e81137 Author: Randall Stewart AuthorDate: 2021-05-27 14:50:32 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:18:36 +0000 tcp: When we have an out-of-order FIN we do want to strip off the FIN bit. The last set of commits fixed both a panic (in rack) and an ACK-war (in freebsd and bbr). However there was a missing case, i.e. where we get an out-of-order FIN by itself. In such a case we don't want to leave the FIN bit set, otherwise we will do the wrong thing and ack the FIN incorrectly. Instead we need to go through the tcp_reasm() code and that way the FIN will be stripped and all will be well. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30497 (cherry picked from commit 8c69d988a8d32e53310c7b73ec8721b04b7249e6) --- sys/netinet/tcp_input.c | 7 ++++++- sys/netinet/tcp_stacks/bbr.c | 7 ++++++- sys/netinet/tcp_stacks/rack.c | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 4ea0f7c5231c..b6a198b49eef 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,7 +3184,12 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 78957bdfb27d..a10235f94c89 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,7 +8321,12 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 5556e562c0eb..63574691112c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10236,7 +10236,12 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 00:20:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB80E6418C7; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G07733XwPz3mfF; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620C51294B; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590KloW082585; Wed, 9 Jun 2021 00:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590KlIb082545; Wed, 9 Jun 2021 00:20:47 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:20:47 GMT Message-Id: <202106090020.1590KlIb082545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fc53b7269fed - stable/13 - tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc53b7269fedf53b5fb13e4587d017d6bd833cf3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:20:47 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fc53b7269fedf53b5fb13e4587d017d6bd833cf3 commit fc53b7269fedf53b5fb13e4587d017d6bd833cf3 Author: Randall Stewart AuthorDate: 2021-06-04 09:26:43 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:19:47 +0000 tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. So it turns out that my fix before was not correct. It ended with us failing some of the "improved" SYN tests, since we are not in the correct states. With more digging I have figured out the root of the problem is that when we receive a SYN|FIN the reassembly code made it so we create a segq entry to hold the FIN. In the established state where we were not in order this would be correct i.e. a 0 len with a FIN would need to be accepted. But if you are in a front state we need to strip the FIN so we correctly handle the ACK but ignore the FIN. This gets us into the proper states and avoids the previous ack war. I back out some of the previous changes but then add a new change here in tcp_reass() that fixes the root cause of the issue. We still leave the rack panic fixes in place however. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30627 (cherry picked from commit 4747500deaaa7765ba1c0413197c23ddba4faf49) --- sys/netinet/tcp_input.c | 12 +++--------- sys/netinet/tcp_reass.c | 14 ++++++++++++++ sys/netinet/tcp_stacks/bbr.c | 12 +++--------- sys/netinet/tcp_stacks/rack.c | 13 ++++--------- sys/netinet/tcp_usrreq.c | 16 ---------------- 5 files changed, 24 insertions(+), 43 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index b6a198b49eef..5e25b38c45e2 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,15 +3184,9 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 310d7d540507..e708b6db14c0 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -571,6 +571,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq *seq_start, * the rcv_nxt <-> rcv_wnd but thats * already done for us by the caller. */ +strip_fin: #ifdef TCP_REASS_COUNTERS counter_u64_add(tcp_zero_input, 1); #endif @@ -579,6 +580,19 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq *seq_start, tcp_reass_log_dump(tp); #endif return (0); + } else if ((*tlenp == 0) && + (th->th_flags & TH_FIN) && + !TCPS_HAVEESTABLISHED(tp->t_state)) { + /* + * We have not established, and we + * have a FIN and no data. Lets treat + * this as the same as if the FIN were + * not present. We don't want to save + * the FIN bit in a reassembly buffer + * we want to get established first before + * we do that (the peer will retransmit). + */ + goto strip_fin; } /* * Will it fit? diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index a10235f94c89..a3f7961af345 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,15 +8321,9 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 63574691112c..4a547e900c4f 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10236,15 +10236,10 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 55aa609fd084..bd847426681e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2635,22 +2635,6 @@ tcp_usrclosed(struct tcpcb *tp) tcp_state_change(tp, TCPS_LAST_ACK); break; } - if ((tp->t_state == TCPS_LAST_ACK) && - (tp->t_flags & TF_SENTFIN)) { - /* - * If we have reached LAST_ACK, and - * we sent a FIN (e.g. via MSG_EOR), then - * we really should move to either FIN_WAIT_1 - * or FIN_WAIT_2 depending on snd_max/snd_una. - */ - if (tp->snd_una == tp->snd_max) { - /* The FIN is acked */ - tcp_state_change(tp, TCPS_FIN_WAIT_2); - } else { - /* The FIN is still outstanding */ - tcp_state_change(tp, TCPS_FIN_WAIT_1); - } - } if (tp->t_state >= TCPS_FIN_WAIT_2) { soisdisconnected(tp->t_inpcb->inp_socket); /* Prevent the connection hanging in FIN_WAIT_2 forever. */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 01:42:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13356642860; Wed, 9 Jun 2021 01:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G08xW04LYz4TLy; Wed, 9 Jun 2021 01:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEEB813DBD; Wed, 9 Jun 2021 01:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1591gcjA090738; Wed, 9 Jun 2021 01:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1591gcmo090737; Wed, 9 Jun 2021 01:42:38 GMT (envelope-from git) Date: Wed, 9 Jun 2021 01:42:38 GMT Message-Id: <202106090142.1591gcmo090737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 20c918af7a3d - stable/12 - Cirrus-CI: Add descriptive task name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 01:42:39 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 commit 20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 Author: Ed Maste AuthorDate: 2021-06-02 15:31:48 +0000 Commit: Ed Maste CommitDate: 2021-06-09 01:41:45 +0000 Cirrus-CI: Add descriptive task name Previously it appeared only as "main" in places like GitHub's list of checks run as part of a pull request. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 903526542ac2309c08c769e517ea173a9f67cdb2) "boot smoke test" dropped from task name for the MFC, because Cirrus runs a build test only on stable/12 (see 05b9673637fe for details). --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index ed89c0061973..356125f7d7b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,6 +9,7 @@ env: CIRRUS_CLONE_DEPTH: 1 task: + name: World and kernel amd64 build test timeout_in: 90m install_script: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 05:22:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FFFB64672C; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Fpk1q0jz4mNs; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2706A164E9; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1595M6JC078879; Wed, 9 Jun 2021 05:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1595M64K078878; Wed, 9 Jun 2021 05:22:06 GMT (envelope-from git) Date: Wed, 9 Jun 2021 05:22:06 GMT Message-Id: <202106090522.1595M64K078878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Takanori Watanabe Subject: git: 26c3e7a1ecb3 - stable/13 - Fix a use-after-free in an error case. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: takawata X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 26c3e7a1ecb375de071786a07bdd68f867acdb3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 05:22:06 -0000 The branch stable/13 has been updated by takawata: URL: https://cgit.FreeBSD.org/src/commit/?id=26c3e7a1ecb375de071786a07bdd68f867acdb3c commit 26c3e7a1ecb375de071786a07bdd68f867acdb3c Author: Takanori Watanabe AuthorDate: 2021-05-26 09:23:33 +0000 Commit: Takanori Watanabe CommitDate: 2021-06-09 05:20:57 +0000 Fix a use-after-free in an error case. PR: 255872 Submitted by: lylgood Differential Revision: https://reviews.freebsd.org/D30454 (cherry picked from commit 14803ec8d193d8d46f4137a7dba61b277c6a2fed) --- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index 9e299d12fd1e..64ab4f0b36b9 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -528,6 +528,7 @@ static int le_connection_complete(ng_hci_unit_p unit, struct mbuf *event) if (error != 0) { ng_hci_con_untimeout(con); ng_hci_free_con(con); + goto out; } } else if ((error = ng_hci_con_untimeout(con)) != 0) From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:36:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84F416476D8; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS3354tz4sxg; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51E3517878; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a35l074046; Wed, 9 Jun 2021 06:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a3ot074045; Wed, 9 Jun 2021 06:36:03 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:03 GMT Message-Id: <202106090636.1596a3ot074045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: a7a46c77f1b4 - stable/12 - rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:03 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 commit a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 Author: Dmitry Chagin AuthorDate: 2021-05-26 07:13:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:32:54 +0000 rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. (cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8) --- share/man/man4/rtwn_usb.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 3019827fd5e4..60ec680d6ddd 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -92,6 +92,7 @@ based USB wireless network adapters, including: .It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 .It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 .It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Mercusys MW150US" Ta RTL8188EU Ta USB 2.0 .It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:36:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A867647B2C; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS4412Pz4sct; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 737B0179D3; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a4LF074074; Wed, 9 Jun 2021 06:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a4cp074073; Wed, 9 Jun 2021 06:36:04 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:04 GMT Message-Id: <202106090636.1596a4cp074073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 6cc8a2f4bbc1 - stable/12 - rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:04 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 commit 6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 Author: Dmitry Chagin AuthorDate: 2021-05-26 05:01:04 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:33:46 +0000 rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list (cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6) --- share/man/man4/rtwn_usb.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 60ec680d6ddd..1cbc280dfdcb 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd June 27, 2020 +.Dd May 26, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -70,6 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:36:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F368D647C17; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS566BFz4syw; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B078917879; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a5Zg074101; Wed, 9 Jun 2021 06:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a58x074100; Wed, 9 Jun 2021 06:36:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:05 GMT Message-Id: <202106090636.1596a58x074100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f29323c94f58 - stable/12 - rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f29323c94f5874f10d440dc43380ff17fb39d44f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:06 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f29323c94f5874f10d440dc43380ff17fb39d44f commit f29323c94f5874f10d440dc43380ff17fb39d44f Author: Dmitry Chagin AuthorDate: 2021-05-26 06:47:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:34:39 +0000 rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). (cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b) --- share/man/man4/rtwn_usb.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 1cbc280dfdcb..b146cfe4fe09 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -70,7 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 -.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-121 rev C1A (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:38:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81250647C53; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVM3HQ4z4t39; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59BD41787B; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c3Rf074353; Wed, 9 Jun 2021 06:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c3gn074352; Wed, 9 Jun 2021 06:38:03 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:03 GMT Message-Id: <202106090638.1596c3gn074352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 13bdb7d59456 - stable/13 - rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13bdb7d59456e435b6b95f115aa1e75aa65e978c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:03 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=13bdb7d59456e435b6b95f115aa1e75aa65e978c commit 13bdb7d59456e435b6b95f115aa1e75aa65e978c Author: Dmitry Chagin AuthorDate: 2021-05-26 07:13:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:19 +0000 rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. (cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8) --- share/man/man4/rtwn_usb.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 3019827fd5e4..60ec680d6ddd 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -92,6 +92,7 @@ based USB wireless network adapters, including: .It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 .It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 .It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Mercusys MW150US" Ta RTL8188EU Ta USB 2.0 .It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:38:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12FA647AFC; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVN4Yc1z4ssC; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 846E2178B9; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c4NG074377; Wed, 9 Jun 2021 06:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c4NZ074376; Wed, 9 Jun 2021 06:38:04 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:04 GMT Message-Id: <202106090638.1596c4NZ074376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f38af5d76c87 - stable/13 - rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f38af5d76c87bf0b6438afb98cda831a8ac13f86 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:04 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f38af5d76c87bf0b6438afb98cda831a8ac13f86 commit f38af5d76c87bf0b6438afb98cda831a8ac13f86 Author: Dmitry Chagin AuthorDate: 2021-05-26 05:01:04 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:36 +0000 rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list (cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6) --- share/man/man4/rtwn_usb.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 60ec680d6ddd..1cbc280dfdcb 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd June 27, 2020 +.Dd May 26, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -70,6 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 06:38:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75891647C62; Wed, 9 Jun 2021 06:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVP6yGTz4t3J; Wed, 9 Jun 2021 06:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB5F91787C; Wed, 9 Jun 2021 06:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c5WD074401; Wed, 9 Jun 2021 06:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c50R074400; Wed, 9 Jun 2021 06:38:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:05 GMT Message-Id: <202106090638.1596c50R074400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 7cddc353b63c - stable/13 - rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7cddc353b63cc1496fd714593133b706512c4788 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:06 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7cddc353b63cc1496fd714593133b706512c4788 commit 7cddc353b63cc1496fd714593133b706512c4788 Author: Dmitry Chagin AuthorDate: 2021-05-26 06:47:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:50 +0000 rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). (cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b) --- share/man/man4/rtwn_usb.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 1cbc280dfdcb..b146cfe4fe09 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -70,7 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 -.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-121 rev C1A (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 11:14:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3EE664BD44; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdC5WWkz3v2Y; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3C141B434; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BENhi047440; Wed, 9 Jun 2021 11:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BENSj047439; Wed, 9 Jun 2021 11:14:23 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:23 GMT Message-Id: <202106091114.159BENSj047439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 0230e6cf56eb - stable/13 - rack: honor prior socket buffer lock when doing the upcall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0230e6cf56eb6be41b075537a4752b898d27cc1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:23 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0230e6cf56eb6be41b075537a4752b898d27cc1d commit 0230e6cf56eb6be41b075537a4752b898d27cc1d Author: Richard Scheffenegger AuthorDate: 2021-05-21 22:08:56 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:36 +0000 rack: honor prior socket buffer lock when doing the upcall While partially reverting D24237 with D29690, due to introducing some unintended effects for in-kernel TCP consumers, the preexisting lock on the socket send buffer was not considered properly. Found by: markj MFC after: 2 weeks Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D30390 (cherry picked from commit 39756885633fd9d9649b4cb0f0abf594bfeb8dbb) --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 9203eb8e252d..bd17749bbd0e 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10643,7 +10643,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - sowwakeup(so); + sowwakeup_locked(so); m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), @@ -13172,7 +13172,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - sowwakeup(so); + sowwakeup_locked(so); m_freem(mfree); } /* update progress */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 11:14:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA32E64BE4B; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdB4qCQz3ttb; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAA11B489; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BEMkl047416; Wed, 9 Jun 2021 11:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BEMl8047415; Wed, 9 Jun 2021 11:14:22 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:22 GMT Message-Id: <202106091114.159BEMl8047415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 55cc0a478506 - stable/13 - [tcp] Keep socket buffer locked until upcall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 55cc0a478506ee1c2db7b2f9aadb9855e5490af3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:22 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=55cc0a478506ee1c2db7b2f9aadb9855e5490af3 commit 55cc0a478506ee1c2db7b2f9aadb9855e5490af3 Author: Richard Scheffenegger AuthorDate: 2021-05-21 09:00:53 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:19 +0000 [tcp] Keep socket buffer locked until upcall r367492 would unlock the socket buffer before eventually calling the upcall. This leads to problematic interaction with NFS kernel server/client components (MP threads) accessing the socket buffer with potentially not correctly updated state. Reported by: rmacklem Reviewed By: tuexen, #transport Tested by: rmacklem, otis MFC after: 2 weeks Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29690 (cherry picked from commit 032bf749fd44ac5ff20aab2c3d8e3c05491778ea) --- sys/netinet/tcp_input.c | 38 ++++++++++++++------------------ sys/netinet/tcp_reass.c | 2 -- sys/netinet/tcp_stacks/bbr.c | 20 ++++++++--------- sys/netinet/tcp_stacks/rack.c | 20 ++++++++--------- sys/netinet/tcp_stacks/rack_bbr_common.c | 1 - sys/netinet/tcp_var.h | 2 +- 6 files changed, 37 insertions(+), 46 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 5e25b38c45e2..19232218170b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1505,18 +1505,17 @@ tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) * the TIME_WAIT state before coming here, we need * to check if the socket is still connected. */ - if ((so->so_state & SS_ISCONNECTED) == 0) + if (tp == NULL) { return; + } + if (so == NULL) { + return; + } INP_LOCK_ASSERT(tp->t_inpcb); if (tp->t_flags & TF_WAKESOR) { tp->t_flags &= ~TF_WAKESOR; - SOCKBUF_UNLOCK_ASSERT(&so->so_rcv); - sorwakeup(so); - } - if (tp->t_flags & TF_WAKESOW) { - tp->t_flags &= ~TF_WAKESOW; - SOCKBUF_UNLOCK_ASSERT(&so->so_snd); - sowwakeup(so); + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + sorwakeup_locked(so); } } @@ -1894,7 +1893,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, else if (!tcp_timer_active(tp, TT_PERSIST)) tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); if (sbavail(&so->so_snd)) (void) tp->t_fb->tfb_tcp_output(tp); goto check_delack; @@ -1959,8 +1958,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, m_adj(m, drop_hdrlen); /* delayed header drop */ sbappendstream_locked(&so->so_rcv, m, 0); } - SOCKBUF_UNLOCK(&so->so_rcv); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); if (DELAY_ACK(tp, tlen)) { tp->t_flags |= TF_DELACK; } else { @@ -2498,9 +2497,11 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() * later; if not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; /* FALLTHROUGH */ @@ -2952,8 +2953,8 @@ process_ACK: tp->snd_wnd = 0; ourfinisacked = 0; } - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); /* Detect una wraparound. */ if (!IN_RECOVERY(tp->t_flags) && @@ -3174,7 +3175,6 @@ dodata: /* XXX */ m_freem(m); else sbappendstream_locked(&so->so_rcv, m, 0); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; } else { /* @@ -3221,6 +3221,7 @@ dodata: /* XXX */ save_start + tlen); } } + tcp_handle_wakeup(tp, so); #if 0 /* * Note the amount of data that peer has sent into @@ -3244,9 +3245,8 @@ dodata: /* XXX */ */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized * (ie NEEDSYN flag on) then delay ACK, @@ -3310,7 +3310,6 @@ check_delack: tp->t_flags &= ~TF_DELACK; tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); } - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); return; @@ -3344,7 +3343,6 @@ dropafterack: TCP_PROBE3(debug__input, tp, th, m); tp->t_flags |= TF_ACKNOW; (void) tp->t_fb->tfb_tcp_output(tp); - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); m_freem(m); return; @@ -3352,7 +3350,6 @@ dropafterack: dropwithreset: if (tp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } else tcp_dropwithreset(m, th, NULL, tlen, rstreason); @@ -3369,7 +3366,6 @@ drop: #endif TCP_PROBE3(debug__input, tp, th, m); if (tp != NULL) { - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } m_freem(m); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index e708b6db14c0..5b9255da3acf 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -973,7 +973,6 @@ new_entry: } else { sbappendstream_locked(&so->so_rcv, m, 0); } - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; return (flags); } @@ -1122,7 +1121,6 @@ present: #ifdef TCP_REASS_LOGGING tcp_reass_log_dump(tp); #endif - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; return (flags); } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index a3f7961af345..7d709e33f0d7 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -7829,8 +7829,8 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, acked_amount = min(acked, (int)sbavail(&so->so_snd)); tp->snd_wnd -= acked_amount; mfree = sbcut_locked(&so->so_snd, acked_amount); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); if (SEQ_GT(th->th_ack, tp->snd_una)) { bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp)); @@ -8306,7 +8306,6 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, appended = #endif sbappendstream_locked(&so->so_rcv, m, 0); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) @@ -8358,6 +8357,7 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } + tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -8369,9 +8369,8 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -8562,8 +8561,8 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, sbappendstream_locked(&so->so_rcv, m, 0); ctf_calc_rwin(so, tp); } - SOCKBUF_UNLOCK(&so->so_rcv); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); @@ -8754,7 +8753,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, &tcp_savetcp, 0); #endif /* Wake up the socket if we have room to write more */ - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); if (tp->snd_una == tp->snd_max) { /* Nothing left outstanding */ bbr_log_progress_event(bbr, tp, ticks, PROGRESS_CLEAR, __LINE__); @@ -9162,9 +9161,11 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() later; if * not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void)tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; if (bbr_process_ack(m, th, so, tp, to, tiwin, tlen, &ourfinisacked, thflags, &ret_val)) { return (ret_val); @@ -11716,7 +11717,6 @@ bbr_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, retval = bbr_do_segment_nounlock(m, th, so, tp, drop_hdrlen, tlen, iptos, 0, &tv); if (retval == 0) { - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 4a547e900c4f..9203eb8e252d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -9869,8 +9869,8 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (acked_amount && sbavail(&so->so_snd)) rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); if (SEQ_GT(tp->snd_una, tp->snd_recover)) tp->snd_recover = tp->snd_una; @@ -10221,7 +10221,6 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, sbappendstream_locked(&so->so_rcv, m, 0); rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) @@ -10279,6 +10278,7 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } + tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -10290,9 +10290,8 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -10485,7 +10484,6 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, ctf_calc_rwin(so, tp); } rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) @@ -10645,8 +10643,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), @@ -11084,9 +11081,11 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() later; if * not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; /* For syn-recv we need to possibly update the rtt */ if ((to->to_flags & TOF_TS) != 0 && to->to_tsecr) { @@ -13173,8 +13172,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); m_freem(mfree); } /* update progress */ diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 6475a1a01c26..501d29ac48da 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -533,7 +533,6 @@ ctf_do_queued_segments(struct socket *so, struct tcpcb *tp, int have_pkt) /* We lost the tcpcb (maybe a RST came in)? */ return(1); } - tcp_handle_wakeup(tp, so); } return (0); } diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 917e993d79e0..7b51afbb42b6 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -408,7 +408,7 @@ TAILQ_HEAD(tcp_funchead, tcp_function); #define TF_FORCEDATA 0x00800000 /* force out a byte */ #define TF_TSO 0x01000000 /* TSO enabled on this connection */ #define TF_TOE 0x02000000 /* this connection is offloaded */ -#define TF_WAKESOW 0x04000000 /* wake up send socket */ +#define TF_UNUSED0 0x04000000 /* unused */ #define TF_UNUSED1 0x08000000 /* unused */ #define TF_UNUSED2 0x10000000 /* unused */ #define TF_CONGRECOVERY 0x20000000 /* congestion recovery mode */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 11:14:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3462E64BD4A; Wed, 9 Jun 2021 11:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdF0p1Bz3tth; Wed, 9 Jun 2021 11:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0971B502; Wed, 9 Jun 2021 11:14:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BEObb047471; Wed, 9 Jun 2021 11:14:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BEOTA047470; Wed, 9 Jun 2021 11:14:24 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:24 GMT Message-Id: <202106091114.159BEOTA047470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 71b88ee39fc6 - stable/13 - tcp: fix a RACK socket buffer lock issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71b88ee39fc6427b6353e9210710a947a27f383f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:25 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=71b88ee39fc6427b6353e9210710a947a27f383f commit 71b88ee39fc6427b6353e9210710a947a27f383f Author: Michael Tuexen AuthorDate: 2021-05-24 18:31:23 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:50 +0000 tcp: fix a RACK socket buffer lock issue Fix a missing socket buffer unlocking of the socket receive buffer. Reviewed by: gallatin, rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30402 (cherry picked from commit 9bbd1a8fcb13928cd4b6cfddf0a8359d5dc97451) --- sys/netinet/tcp_stacks/rack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index bd17749bbd0e..f010c958951c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6063,7 +6063,7 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, /* Push bit must go to the right edge as well */ if (rsm->r_flags & RACK_HAD_PUSH) rsm->r_flags &= ~RACK_HAD_PUSH; - + /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + @@ -10492,6 +10492,7 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_handle_delayed_ack(tp, rack, tlen, 0); if (tp->snd_una == tp->snd_max) sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una); + tcp_handle_wakeup(tp, so); return (1); } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 16:14:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9424E65008C; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XHv3dR8z4s3k; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 651721F522; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GEphE044200; Wed, 9 Jun 2021 16:14:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GEpcX044199; Wed, 9 Jun 2021 16:14:51 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:14:51 GMT Message-Id: <202106091614.159GEpcX044199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 3045f4aa1a2b - stable/13 - libsa: Fix infinite loop in bzipfs & gzipfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:14:51 -0000 The branch stable/13 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab commit 3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab Author: David Bright AuthorDate: 2021-05-24 17:12:15 +0000 Commit: David Bright CommitDate: 2021-06-09 16:11:01 +0000 libsa: Fix infinite loop in bzipfs & gzipfs A bug in the loader's bzipfs & gzipfs filesystems caused compressed kernel and modules not to work on EFI systems with a veriexec-enabled loader. Since the size of files in these filesystems are not known _a priori_ `stat` would initialize the size to -1 and the loader would then hang in an infinite loop while trying to seek (read) to the end of file since the loop termination condition compares the current offset to that negative target position. Sponsored by: Dell EMC Isilon (cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2) --- stand/libsa/bzipfs.c | 3 +++ stand/libsa/gzipfs.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c index 47380ae72e5e..bb67bda2aa19 100644 --- a/stand/libsa/bzipfs.c +++ b/stand/libsa/bzipfs.c @@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where) target - bzf->bzf_bzstream.total_out_lo32), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (bzf->bzf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(bzf->bzf_bzstream.total_out_lo32); diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c index 39e2f98eb1e0..8154b0f95a9a 100644 --- a/stand/libsa/gzipfs.c +++ b/stand/libsa/gzipfs.c @@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where) target - zf->zf_zstream.total_out), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (zf->zf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(zf->zf_zstream.total_out); From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 16:16:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C457650307; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XL51DDHz4ryV; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11ECD1F429; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GGiGO044447; Wed, 9 Jun 2021 16:16:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GGiCe044446; Wed, 9 Jun 2021 16:16:44 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:16:44 GMT Message-Id: <202106091616.159GGiCe044446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 80a5d786a3cd - stable/12 - libsa: Fix infinite loop in bzipfs & gzipfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:16:45 -0000 The branch stable/12 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be commit 80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be Author: David Bright AuthorDate: 2021-05-24 17:12:15 +0000 Commit: David Bright CommitDate: 2021-06-09 16:15:33 +0000 libsa: Fix infinite loop in bzipfs & gzipfs A bug in the loader's bzipfs & gzipfs filesystems caused compressed kernel and modules not to work on EFI systems with a veriexec-enabled loader. Since the size of files in these filesystems are not known _a priori_ `stat` would initialize the size to -1 and the loader would then hang in an infinite loop while trying to seek (read) to the end of file since the loop termination condition compares the current offset to that negative target position. Sponsored by: Dell EMC Isilon (cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2) --- stand/libsa/bzipfs.c | 3 +++ stand/libsa/gzipfs.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c index 47380ae72e5e..bb67bda2aa19 100644 --- a/stand/libsa/bzipfs.c +++ b/stand/libsa/bzipfs.c @@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where) target - bzf->bzf_bzstream.total_out_lo32), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (bzf->bzf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(bzf->bzf_bzstream.total_out_lo32); diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c index 39e2f98eb1e0..8154b0f95a9a 100644 --- a/stand/libsa/gzipfs.c +++ b/stand/libsa/gzipfs.c @@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where) target - zf->zf_zstream.total_out), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (zf->zf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(zf->zf_zstream.total_out); From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 16:18:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 589C76500B4; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XN1283xz4sHk; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 334C81F336; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GIP6d044675; Wed, 9 Jun 2021 16:18:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GIPnu044674; Wed, 9 Jun 2021 16:18:25 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:18:25 GMT Message-Id: <202106091618.159GIPnu044674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 7f06d6f3fdde - stable/13 - pciconf: Fix up pciconf -lc output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:18:25 -0000 The branch stable/13 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a commit 7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a Author: David Bright AuthorDate: 2021-05-24 19:02:43 +0000 Commit: David Bright CommitDate: 2021-06-09 16:17:58 +0000 pciconf: Fix up pciconf -lc output The pciconf command fails to emit newlines when particular ecap field values are seen. Fix them up. This has been seen on several systems at $JOB. The documentation for PCI capabilities says that capability type 0 should not be used once the spec for PCI capabilities was published, but that seems more wishful-thinking than reality. pciconf also chooses not to print fields related to field values that are zero, but it seems several of these fields are zero on actual hardware. Sponsored by: Dell EMC Isilon Submitted by: Robert Herndon (Robert.Herndon@dell.com) (cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514) --- usr.sbin/pciconf/cap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index bd7315beb047..eae53acbd250 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -861,8 +861,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t sta, mask; printf("AER %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); printf(" %d fatal", bitcount32(sta & mask)); @@ -877,8 +879,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t cap1; printf("VC %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) @@ -893,8 +897,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t high, low; printf("Serial %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); printf(" %08x%08x\n", high, low); @@ -940,8 +946,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t val; printf("PCIe Sec %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } val = read_config(fd, &p->pc_sel, ptr + 8, 4); printf(" lane errors %#x\n", val); } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 16:19:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C7D06500C4; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XPq3scCz4s5D; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4801EFD2; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GJxGj044905; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GJxhd044904; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:19:59 GMT Message-Id: <202106091619.159GJxhd044904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: fe58db828934 - stable/12 - pciconf: Fix up pciconf -lc output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fe58db828934c40b5d84a6485573e04f6981f8b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:19:59 -0000 The branch stable/12 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=fe58db828934c40b5d84a6485573e04f6981f8b6 commit fe58db828934c40b5d84a6485573e04f6981f8b6 Author: David Bright AuthorDate: 2021-05-24 19:02:43 +0000 Commit: David Bright CommitDate: 2021-06-09 16:19:10 +0000 pciconf: Fix up pciconf -lc output The pciconf command fails to emit newlines when particular ecap field values are seen. Fix them up. This has been seen on several systems at $JOB. The documentation for PCI capabilities says that capability type 0 should not be used once the spec for PCI capabilities was published, but that seems more wishful-thinking than reality. pciconf also chooses not to print fields related to field values that are zero, but it seems several of these fields are zero on actual hardware. Sponsored by: Dell EMC Isilon Submitted by: Robert Herndon (Robert.Herndon@dell.com) (cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514) --- usr.sbin/pciconf/cap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index f990fdca7313..07f4b63bbcd2 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -854,8 +854,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t sta, mask; printf("AER %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); printf(" %d fatal", bitcount32(sta & mask)); @@ -870,8 +872,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t cap1; printf("VC %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) @@ -886,8 +890,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t high, low; printf("Serial %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); printf(" %08x%08x\n", high, low); @@ -911,8 +917,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t val; printf("PCIe Sec %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } val = read_config(fd, &p->pc_sel, ptr + 8, 4); printf(" lane errors %#x\n", val); } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:20:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFBE16531F5; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5056Nkz3nMD; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 991B7233DD; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKqJk051375; Wed, 9 Jun 2021 21:20:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKqhO051374; Wed, 9 Jun 2021 21:20:52 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:52 GMT Message-Id: <202106092120.159LKqhO051374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5452cb6bf9f0 - stable/13 - etcupdate: Always extract to a temporary tree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5452cb6bf9f07cdc479c24e880a3628fcb3dda49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:52 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5452cb6bf9f07cdc479c24e880a3628fcb3dda49 commit 5452cb6bf9f07cdc479c24e880a3628fcb3dda49 Author: John Baldwin AuthorDate: 2021-04-20 20:21:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Always extract to a temporary tree. etcupdate has had a somewhat nasty race condition since its creation in that its state machine can get very confused if it is interrupted while building the tree to compare against. This is exacerbated by the fact that etcupdate doesn't emit any output while building the tree which can take several seconds (especially in recent years with the addition of the tree-wide buildconfig/installconfig passes). To mitigate this, always install a new tree into a temporary directory created via mktemp as was previously done only for dry-runs via -n. The existing trees are only rotated and the new tree installed as /var/db/etcupdate/current after the update command has completed. Reported by: dim, np (and many others) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29843 (cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472) (cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71) --- usr.sbin/etcupdate/etcupdate.sh | 148 +++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 87d269f2ca69..41f13412f340 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -226,9 +226,11 @@ build_tree() return 0 } -# Generate a new NEWTREE tree. If tarball is set, then the tree is +# Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. +# +# $1 - directory to store new tree in extract_tree() { local files @@ -239,16 +241,16 @@ extract_tree() if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi - if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ + if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \ >&3 2>&1; then echo "Failed to extract new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi else - if ! build_tree $NEWTREE; then + if ! build_tree $1; then echo "Failed to build new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi fi @@ -1353,14 +1355,28 @@ extract_cmd() log "extract command: tarball=$tarball" + # Create a temporary directory to hold the tree + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi + + extract_tree $dir + if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." + remove_tree $dir exit 1 fi fi - extract_tree + if ! mv $dir $NEWTREE >&3 2>&1; then + echo "Unable to rename temp tree to current tree." + remove_tree $dir + exit 1 + fi } # Resolve conflicts left from an earlier merge. @@ -1420,7 +1436,7 @@ status_cmd() # source tree. update_cmd() { - local dir + local dir new old if [ $# -ne 0 ]; then usage @@ -1449,60 +1465,44 @@ update_cmd() exit 1 fi + # Save tree names to use for rotation later. + old=$OLDTREE + new=$NEWTREE if [ -z "$rerun" ]; then - # For a dryrun that is not a rerun, do not rotate the existing - # stock tree. Instead, extract a tree to a temporary directory - # and use that for the comparison. - if [ -n "$dryrun" ]; then - dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` - if [ $? -ne 0 ]; then - echo "Unable to create temporary directory." - exit 1 - fi - - # A pre-world dryrun has already set OLDTREE to - # point to the current stock tree. - if [ -z "$preworld" ]; then - OLDTREE=$NEWTREE - fi - NEWTREE=$dir - - # For a pre-world update, blow away any pre-existing - # NEWTREE. - elif [ -n "$preworld" ]; then - if ! remove_tree $NEWTREE; then - echo "Unable to remove pre-world tree." - exit 1 - fi + # Extract the new tree to a temporary directory. The + # trees are only rotated after a successful update to + # avoid races if an update command is interrupted + # before it completes. + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi - # Rotate the existing stock tree to the old tree. - elif [ -d $NEWTREE ]; then - # First, delete the previous old tree if it exists. - if ! remove_tree $OLDTREE; then - echo "Unable to remove old tree." - exit 1 - fi + # Populate the new tree. + extract_tree $dir - # Move the current stock tree. - if ! mv $NEWTREE $OLDTREE >&3 2>&1; then - echo "Unable to rename current stock tree." - exit 1 - fi + # Compare the new tree against the previous tree. For + # the preworld case OLDTREE already points to the + # current stock tree. + if [ -z "$preworld" ]; then + OLDTREE=$NEWTREE fi + NEWTREE=$dir + fi - if ! [ -d $OLDTREE ]; then - cat <&3 2>&1; then + echo "Unable to rename old tree." + exit 1 + fi + fi + + # Rotate the new tree. Remove a previous pre-world + # tree if it exists. + if [ -d $new ]; then + if [ -z "$preworld" ]; then + panic "New tree should be rotated to old" + fi + if ! remove_tree $new; then + echo "Unable to remove previous pre-world tree." + exit 1 + fi + fi + + if ! mv $NEWTREE $new >&3 2>&1; then + echo "Unable to rename current tree." + exit 1 + fi fi } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:20:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE2E16534BD; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g515kXhz3nWX; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD513233DF; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKrfw051407; Wed, 9 Jun 2021 21:20:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKrOd051406; Wed, 9 Jun 2021 21:20:53 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:53 GMT Message-Id: <202106092120.159LKrOd051406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6d55189fe7c3 - stable/13 - etcupdate: Gracefully handle SIGINT when building trees. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d55189fe7c38df13aac1ad980318387f3cbe7b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:54 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6d55189fe7c38df13aac1ad980318387f3cbe7b3 commit 6d55189fe7c38df13aac1ad980318387f3cbe7b3 Author: John Baldwin AuthorDate: 2021-04-20 20:22:11 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Gracefully handle SIGINT when building trees. Run the 'build_tree' function inside of a subshell and trap SIGINT to return an error to the caller. This allows callers to gracefully cleanup a partially created tree. While here, redirect stdout/stderr of the subshell to the log file instead of applying redirections individually to each command executed while building the tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29844 (cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e) --- usr.sbin/etcupdate/etcupdate.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 41f13412f340..3fd2e87bf52a 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -179,17 +179,21 @@ always_install() return 1 } -# Build a new tree +# Build a new tree. This runs inside a subshell to trap SIGINT. # # $1 - directory to store new tree in build_tree() -{ +( local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" - mkdir -p $1/usr/obj >&3 2>&1 + + exec >&3 2>&1 + trap 'return 1' INT + + mkdir -p $1/usr/obj destdir=`realpath $1` if [ -n "$preworld" ]; then @@ -197,34 +201,33 @@ build_tree() # crucial to installworld. for file in $PREWORLD_FILES; do name=$(basename $file) - mkdir -p $1/etc >&3 2>&1 || return 1 + mkdir -p $1/etc || return 1 cp -p $SRCDIR/$file $1/etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ - >&3 2>&1 || return 1 + MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ + return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 + $make DESTDIR=$destdir distribution) || return 1 fi - chflags -R noschg $1 >&3 2>&1 || return 1 - rm -rf $1/usr/obj >&3 2>&1 || return 1 + chflags -R noschg $1 || return 1 + rm -rf $1/usr/obj || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. - rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ - return 1 + rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1 # Remove empty files. These just clutter the output of 'diff'. - find $1 -type f -size 0 -delete >&3 2>&1 || return 1 + find $1 -type f -size 0 -delete || return 1 # Trim empty directories. - find -d $1 -type d -empty -delete >&3 2>&1 || return 1 + find -d $1 -type d -empty -delete || return 1 return 0 -} +) # Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:20:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9BA6538F3; Wed, 9 Jun 2021 21:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5305d3z3nT6; Wed, 9 Jun 2021 21:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D38BA233E0; Wed, 9 Jun 2021 21:20:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKsLB051432; Wed, 9 Jun 2021 21:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKs6U051431; Wed, 9 Jun 2021 21:20:54 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:54 GMT Message-Id: <202106092120.159LKs6U051431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 76a0f6f3bfd8 - stable/13 - etcupdate: Trim trailing whitespace. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76a0f6f3bfd8a77146d328c89b424565d4036761 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:55 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=76a0f6f3bfd8a77146d328c89b424565d4036761 commit 76a0f6f3bfd8a77146d328c89b424565d4036761 Author: John Baldwin AuthorDate: 2021-04-20 20:22:24 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Trim trailing whitespace. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29845 (cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b) --- usr.sbin/etcupdate/etcupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 3fd2e87bf52a..dc26bc0c8aab 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -442,7 +442,7 @@ empty_destdir() # # $1 - first tree # $2 - second tree -# $3 - node name +# $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() @@ -867,7 +867,7 @@ merge_file() # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { - + egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } @@ -1526,7 +1526,7 @@ EOF if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi - + # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:20:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B015B653A12; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g551hgRz3n9L; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A92235A0; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKvS1051480; Wed, 9 Jun 2021 21:20:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKvo2051479; Wed, 9 Jun 2021 21:20:57 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:57 GMT Message-Id: <202106092120.159LKvo2051479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c417b618b933 - stable/13 - etcupdate: Add -D destdir to usage for 'extract'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c417b618b93395c2b084382646e94ee9ac6a1451 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:57 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c417b618b93395c2b084382646e94ee9ac6a1451 commit c417b618b93395c2b084382646e94ee9ac6a1451 Author: John Baldwin AuthorDate: 2021-04-26 16:49:34 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:39 +0000 etcupdate: Add -D destdir to usage for 'extract'. Reported by: Mark Millard (cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2) --- usr.sbin/etcupdate/etcupdate.8 | 1 + usr.sbin/etcupdate/etcupdate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 5f13ed1d6733..3d48e218494c 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -60,6 +60,7 @@ .Op Fl B .Op Fl d Ar workdir .Op Fl s Ar source | Fl t Ar tarball +.Op Fl D Ar destdir .Op Fl L Ar logfile .Op Fl M Ar options .Nm diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 254a72abae08..acfc601b93af 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options] etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] - etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] - [-M options] + etcupdate extract [-B] [-d workdir] [-s source | -t tarball] + [-D destdir] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:20:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A4DC653A09; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g541P0bz3nP1; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07D7323579; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKtS5051456; Wed, 9 Jun 2021 21:20:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKtiV051455; Wed, 9 Jun 2021 21:20:55 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:55 GMT Message-Id: <202106092120.159LKtiV051455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 960c954c55f2 - stable/13 - etcupdate: Add a revert mode to restore one or more stock files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 960c954c55f24d08b7cbd184b035f0e93e4be5ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:56 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=960c954c55f24d08b7cbd184b035f0e93e4be5ee commit 960c954c55f24d08b7cbd184b035f0e93e4be5ee Author: John Baldwin AuthorDate: 2021-04-20 20:22:35 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:39 +0000 etcupdate: Add a revert mode to restore one or more stock files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29846 (cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d) --- usr.sbin/etcupdate/etcupdate.8 | 24 ++++++++++++-------- usr.sbin/etcupdate/etcupdate.sh | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 24afbca12951..5f13ed1d6733 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 27, 2018 +.Dd April 20, 2021 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -69,6 +69,12 @@ .Op Fl D Ar destdir .Op Fl L Ar logfile .Nm +.Cm revert +.Op Fl d Ar workdir +.Op Fl D Ar destdir +.Op Fl L Ar logfile +.Ar +.Nm .Cm status .Op Fl d Ar workdir .Op Fl D Ar destdir @@ -342,6 +348,14 @@ tree and discard any local changes made to the file. .It (h) help Display the list of commands. .El +.Ss Revert Mode +The +.Cm revert +mode is used to restore the stock versions of files. +In this mode, +.Nm +installs the stock version of requested files. +This mode cannot be used to restore directories, only individual files. .Ss Status Mode The .Cm status @@ -880,14 +894,6 @@ For example, one can imagine a syntax along the lines of .Pp to resolve a specific conflict in an automated fashion. .Pp -It might be nice to have something like a -.Sq revert -command to replace a locally modified version of a file with the stock -version of the file. -For example: -.Pp -.Dl "etcupdate revert /etc/mail/freebsd.cf" -.Pp Bootstrapping .Nm often results in gratuitous diffs in diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index dc26bc0c8aab..254a72abae08 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -58,7 +58,6 @@ # TODO: # - automatable conflict resolution -# - a 'revert' command to make a file "stock" usage() { @@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] + etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] EOF exit 1 @@ -1415,6 +1415,47 @@ resolve_cmd() fi } +# Restore files to the stock version. Only files with a local change +# are restored from the stock version. +revert_cmd() +{ + local cmp file + + if [ $# -eq 0 ]; then + usage + fi + + for file; do + log "revert $file" + + if ! [ -e $NEWTREE/$file ]; then + echo "File $file does not exist in the current tree." + exit 1 + fi + if [ -d $NEWTREE/$file ]; then + echo "File $file is a directory." + exit 1 + fi + + compare $DESTDIR/$file $NEWTREE/$file + cmp=$? + if [ $cmp -eq $COMPARE_EQUAL ]; then + continue + fi + + if update_unmodified $file; then + # If this file had a conflict, clean up the + # conflict. + if [ -e $CONFLICTS/$file ]; then + if ! rm $CONFLICTS/$file >&3 2>&1; then + echo "Failed to remove conflict " \ + "for $file". + fi + fi + fi + done +} + # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. @@ -1622,7 +1663,7 @@ EOF command="update" if [ $# -gt 0 ]; then case "$1" in - build|diff|extract|status|resolve) + build|diff|extract|status|resolve|revert) command="$1" shift ;; @@ -1801,7 +1842,7 @@ case $command in usage fi ;; - build|diff|status) + build|diff|status|revert) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage @@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then fi case $command in - diff|resolve|status) + diff|resolve|revert|status) exec 3>>$LOGFILE ;; *) From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:21:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AB16653C83; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5F3zMjz3nRj; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705EA233E6; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL592051658; Wed, 9 Jun 2021 21:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL5Wg051657; Wed, 9 Jun 2021 21:21:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:05 GMT Message-Id: <202106092121.159LL5Wg051657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6914b924d579 - stable/12 - etcupdate: Always extract to a temporary tree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6914b924d57989b1da56588c247b9e248a9190ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:05 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6914b924d57989b1da56588c247b9e248a9190ff commit 6914b924d57989b1da56588c247b9e248a9190ff Author: John Baldwin AuthorDate: 2021-04-20 20:21:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Always extract to a temporary tree. etcupdate has had a somewhat nasty race condition since its creation in that its state machine can get very confused if it is interrupted while building the tree to compare against. This is exacerbated by the fact that etcupdate doesn't emit any output while building the tree which can take several seconds (especially in recent years with the addition of the tree-wide buildconfig/installconfig passes). To mitigate this, always install a new tree into a temporary directory created via mktemp as was previously done only for dry-runs via -n. The existing trees are only rotated and the new tree installed as /var/db/etcupdate/current after the update command has completed. Reported by: dim, np (and many others) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29843 (cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472) (cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71) --- usr.sbin/etcupdate/etcupdate.sh | 148 +++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 9144498544da..a84323890828 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -226,9 +226,11 @@ build_tree() return 0 } -# Generate a new NEWTREE tree. If tarball is set, then the tree is +# Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. +# +# $1 - directory to store new tree in extract_tree() { local files @@ -239,16 +241,16 @@ extract_tree() if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi - if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ + if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \ >&3 2>&1; then echo "Failed to extract new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi else - if ! build_tree $NEWTREE; then + if ! build_tree $1; then echo "Failed to build new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi fi @@ -1353,14 +1355,28 @@ extract_cmd() log "extract command: tarball=$tarball" + # Create a temporary directory to hold the tree + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi + + extract_tree $dir + if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." + remove_tree $dir exit 1 fi fi - extract_tree + if ! mv $dir $NEWTREE >&3 2>&1; then + echo "Unable to rename temp tree to current tree." + remove_tree $dir + exit 1 + fi } # Resolve conflicts left from an earlier merge. @@ -1420,7 +1436,7 @@ status_cmd() # source tree. update_cmd() { - local dir + local dir new old if [ $# -ne 0 ]; then usage @@ -1449,60 +1465,44 @@ update_cmd() exit 1 fi + # Save tree names to use for rotation later. + old=$OLDTREE + new=$NEWTREE if [ -z "$rerun" ]; then - # For a dryrun that is not a rerun, do not rotate the existing - # stock tree. Instead, extract a tree to a temporary directory - # and use that for the comparison. - if [ -n "$dryrun" ]; then - dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` - if [ $? -ne 0 ]; then - echo "Unable to create temporary directory." - exit 1 - fi - - # A pre-world dryrun has already set OLDTREE to - # point to the current stock tree. - if [ -z "$preworld" ]; then - OLDTREE=$NEWTREE - fi - NEWTREE=$dir - - # For a pre-world update, blow away any pre-existing - # NEWTREE. - elif [ -n "$preworld" ]; then - if ! remove_tree $NEWTREE; then - echo "Unable to remove pre-world tree." - exit 1 - fi + # Extract the new tree to a temporary directory. The + # trees are only rotated after a successful update to + # avoid races if an update command is interrupted + # before it completes. + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi - # Rotate the existing stock tree to the old tree. - elif [ -d $NEWTREE ]; then - # First, delete the previous old tree if it exists. - if ! remove_tree $OLDTREE; then - echo "Unable to remove old tree." - exit 1 - fi + # Populate the new tree. + extract_tree $dir - # Move the current stock tree. - if ! mv $NEWTREE $OLDTREE >&3 2>&1; then - echo "Unable to rename current stock tree." - exit 1 - fi + # Compare the new tree against the previous tree. For + # the preworld case OLDTREE already points to the + # current stock tree. + if [ -z "$preworld" ]; then + OLDTREE=$NEWTREE fi + NEWTREE=$dir + fi - if ! [ -d $OLDTREE ]; then - cat <&3 2>&1; then + echo "Unable to rename old tree." + exit 1 + fi + fi + + # Rotate the new tree. Remove a previous pre-world + # tree if it exists. + if [ -d $new ]; then + if [ -z "$preworld" ]; then + panic "New tree should be rotated to old" + fi + if ! remove_tree $new; then + echo "Unable to remove previous pre-world tree." + exit 1 + fi + fi + + if ! mv $NEWTREE $new >&3 2>&1; then + echo "Unable to rename current tree." + exit 1 + fi fi } From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:21:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75290653D00; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5G5y4jz3nRm; Wed, 9 Jun 2021 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A524A235A8; Wed, 9 Jun 2021 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL6tW051682; Wed, 9 Jun 2021 21:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL6Qb051681; Wed, 9 Jun 2021 21:21:06 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:06 GMT Message-Id: <202106092121.159LL6Qb051681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 29ed8efb3b1e - stable/12 - etcupdate: Gracefully handle SIGINT when building trees. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:07 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 commit 29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 Author: John Baldwin AuthorDate: 2021-04-20 20:22:11 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Gracefully handle SIGINT when building trees. Run the 'build_tree' function inside of a subshell and trap SIGINT to return an error to the caller. This allows callers to gracefully cleanup a partially created tree. While here, redirect stdout/stderr of the subshell to the log file instead of applying redirections individually to each command executed while building the tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29844 (cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e) --- usr.sbin/etcupdate/etcupdate.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index a84323890828..f64e58e4ecd1 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -179,17 +179,21 @@ always_install() return 1 } -# Build a new tree +# Build a new tree. This runs inside a subshell to trap SIGINT. # # $1 - directory to store new tree in build_tree() -{ +( local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" - mkdir -p $1/usr/obj >&3 2>&1 + + exec >&3 2>&1 + trap 'return 1' INT + + mkdir -p $1/usr/obj destdir=`realpath $1` if [ -n "$preworld" ]; then @@ -197,34 +201,33 @@ build_tree() # crucial to installworld. for file in $PREWORLD_FILES; do dir=`dirname /$file` - mkdir -p $1/$dir >&3 2>&1 || return 1 + mkdir -p $1/$dir || return 1 cp -p $SRCDIR/$file $1/$file || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ - >&3 2>&1 || return 1 + MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ + return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 + $make DESTDIR=$destdir distribution) || return 1 fi - chflags -R noschg $1 >&3 2>&1 || return 1 - rm -rf $1/usr/obj >&3 2>&1 || return 1 + chflags -R noschg $1 || return 1 + rm -rf $1/usr/obj || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. - rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ - return 1 + rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1 # Remove empty files. These just clutter the output of 'diff'. - find $1 -type f -size 0 -delete >&3 2>&1 || return 1 + find $1 -type f -size 0 -delete || return 1 # Trim empty directories. - find -d $1 -type d -empty -delete >&3 2>&1 || return 1 + find -d $1 -type d -empty -delete || return 1 return 0 -} +) # Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:21:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C924653C05; Wed, 9 Jun 2021 21:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5H6Xj6z3ncK; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF9223689; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL7hB051708; Wed, 9 Jun 2021 21:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL7Mq051707; Wed, 9 Jun 2021 21:21:07 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:07 GMT Message-Id: <202106092121.159LL7Mq051707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ea6546fa1dd4 - stable/12 - etcupdate: Trim trailing whitespace. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ea6546fa1dd4fad52421585ebbfce56a07d8284d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:08 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6546fa1dd4fad52421585ebbfce56a07d8284d commit ea6546fa1dd4fad52421585ebbfce56a07d8284d Author: John Baldwin AuthorDate: 2021-04-20 20:22:24 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Trim trailing whitespace. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29845 (cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b) --- usr.sbin/etcupdate/etcupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index f64e58e4ecd1..28f6cbb42aff 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -442,7 +442,7 @@ empty_destdir() # # $1 - first tree # $2 - second tree -# $3 - node name +# $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() @@ -867,7 +867,7 @@ merge_file() # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { - + egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } @@ -1526,7 +1526,7 @@ EOF if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi - + # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:21:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A319653979; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5K0Nmzz3nfw; Wed, 9 Jun 2021 21:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7FA5235AA; Wed, 9 Jun 2021 21:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL8RS051734; Wed, 9 Jun 2021 21:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL8o2051733; Wed, 9 Jun 2021 21:21:08 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:08 GMT Message-Id: <202106092121.159LL8o2051733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5cb183fe4369 - stable/12 - etcupdate: Add a revert mode to restore one or more stock files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5cb183fe4369ca7170038d5333f297e9a60168d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:10 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5cb183fe4369ca7170038d5333f297e9a60168d6 commit 5cb183fe4369ca7170038d5333f297e9a60168d6 Author: John Baldwin AuthorDate: 2021-04-20 20:22:35 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Add a revert mode to restore one or more stock files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29846 (cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d) --- usr.sbin/etcupdate/etcupdate.8 | 24 ++++++++++++-------- usr.sbin/etcupdate/etcupdate.sh | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 4cc5d69eb195..c3d95b3261ef 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2015 +.Dd April 20, 2021 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -69,6 +69,12 @@ .Op Fl D Ar destdir .Op Fl L Ar logfile .Nm +.Cm revert +.Op Fl d Ar workdir +.Op Fl D Ar destdir +.Op Fl L Ar logfile +.Ar +.Nm .Cm status .Op Fl d Ar workdir .Op Fl D Ar destdir @@ -342,6 +348,14 @@ tree and discard any local changes made to the file. .It (h) help Display the list of commands. .El +.Ss Revert Mode +The +.Cm revert +mode is used to restore the stock versions of files. +In this mode, +.Nm +installs the stock version of requested files. +This mode cannot be used to restore directories, only individual files. .Ss Status Mode The .Cm status @@ -879,14 +893,6 @@ For example, one can imagine a syntax along the lines of .Pp to resolve a specific conflict in an automated fashion. .Pp -It might be nice to have something like a -.Sq revert -command to replace a locally modified version of a file with the stock -version of the file. -For example: -.Pp -.Dl "etcupdate revert /etc/mail/freebsd.cf" -.Pp Bootstrapping .Nm often results in gratuitous diffs in diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 28f6cbb42aff..aa7d12e80be6 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -58,7 +58,6 @@ # TODO: # - automatable conflict resolution -# - a 'revert' command to make a file "stock" usage() { @@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] + etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] EOF exit 1 @@ -1415,6 +1415,47 @@ resolve_cmd() fi } +# Restore files to the stock version. Only files with a local change +# are restored from the stock version. +revert_cmd() +{ + local cmp file + + if [ $# -eq 0 ]; then + usage + fi + + for file; do + log "revert $file" + + if ! [ -e $NEWTREE/$file ]; then + echo "File $file does not exist in the current tree." + exit 1 + fi + if [ -d $NEWTREE/$file ]; then + echo "File $file is a directory." + exit 1 + fi + + compare $DESTDIR/$file $NEWTREE/$file + cmp=$? + if [ $cmp -eq $COMPARE_EQUAL ]; then + continue + fi + + if update_unmodified $file; then + # If this file had a conflict, clean up the + # conflict. + if [ -e $CONFLICTS/$file ]; then + if ! rm $CONFLICTS/$file >&3 2>&1; then + echo "Failed to remove conflict " \ + "for $file". + fi + fi + fi + done +} + # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. @@ -1622,7 +1663,7 @@ EOF command="update" if [ $# -gt 0 ]; then case "$1" in - build|diff|extract|status|resolve) + build|diff|extract|status|resolve|revert) command="$1" shift ;; @@ -1801,7 +1842,7 @@ case $command in usage fi ;; - build|diff|status) + build|diff|status|revert) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage @@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then fi case $command in - diff|resolve|status) + diff|resolve|revert|status) exec 3>>$LOGFILE ;; *) From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 21:21:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBB6B6534E3; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5L2HVBz3nQ3; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0752523701; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL9Fw051758; Wed, 9 Jun 2021 21:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL9u2051757; Wed, 9 Jun 2021 21:21:09 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:09 GMT Message-Id: <202106092121.159LL9u2051757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 73a9788cf474 - stable/12 - etcupdate: Add -D destdir to usage for 'extract'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 73a9788cf474ba3c168286a1a0ffa9bd04aef30d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:12 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=73a9788cf474ba3c168286a1a0ffa9bd04aef30d commit 73a9788cf474ba3c168286a1a0ffa9bd04aef30d Author: John Baldwin AuthorDate: 2021-04-26 16:49:34 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Add -D destdir to usage for 'extract'. Reported by: Mark Millard (cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2) --- usr.sbin/etcupdate/etcupdate.8 | 1 + usr.sbin/etcupdate/etcupdate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index c3d95b3261ef..22e1eb3c4483 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -60,6 +60,7 @@ .Op Fl B .Op Fl d Ar workdir .Op Fl s Ar source | Fl t Ar tarball +.Op Fl D Ar destdir .Op Fl L Ar logfile .Op Fl M Ar options .Nm diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index aa7d12e80be6..1070c6905e46 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options] etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] - etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] - [-M options] + etcupdate extract [-B] [-d workdir] [-s source | -t tarball] + [-D destdir] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 22:19:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CD90654B8B; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0hNx10r9z3sT2; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A43F24035; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159MJi0d023745; Wed, 9 Jun 2021 22:19:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159MJiiS023744; Wed, 9 Jun 2021 22:19:44 GMT (envelope-from git) Date: Wed, 9 Jun 2021 22:19:44 GMT Message-Id: <202106092219.159MJiiS023744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f8edb3f9c725 - stable/13 - libcrypto: Add symbol versions for symbols added since 1.1.1d. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8edb3f9c725e5b4a60981ee19a56395b0497e13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 22:19:45 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f8edb3f9c725e5b4a60981ee19a56395b0497e13 commit f8edb3f9c725e5b4a60981ee19a56395b0497e13 Author: John Baldwin AuthorDate: 2021-05-28 22:18:15 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:53:42 +0000 libcrypto: Add symbol versions for symbols added since 1.1.1d. While here, trim a spurious local: I missed when added SSL_sendfile. PR: 255277 Reported by: yuri Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D30483 (cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf) --- secure/lib/libcrypto/Version.map | 17 ++++++++++++++++- secure/lib/libssl/Version.map | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map index 33432019a023..bed7623b9c47 100644 --- a/secure/lib/libcrypto/Version.map +++ b/secure/lib/libcrypto/Version.map @@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d { global: X509_get0_authority_issuer; X509_get0_authority_serial; - local: *; } OPENSSL_1_1_1c; +OPENSSL_1_1_1e { + global: + EVP_PKEY_meth_get_digestsign; + EVP_PKEY_meth_get_digestverify; + EVP_PKEY_meth_set_digestsign; + EVP_PKEY_meth_set_digestverify; + RSA_get0_pss_params; +} OPENSSL_1_1_1d; +OPENSSL_1_1_1h { + global: + EC_KEY_decoded_from_explicit_params; + X509_ALGOR_copy; + X509_REQ_set0_signature; + X509_REQ_set1_signature_algo; + local: *; +} OPENSSL_1_1_1e; diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map index 8c5eba6795ec..3e4e00950def 100644 --- a/secure/lib/libssl/Version.map +++ b/secure/lib/libssl/Version.map @@ -512,7 +512,6 @@ OPENSSL_1_1_1 { OPENSSL_1_1_1a { global: SSL_get_signature_type_nid; - local: *; } OPENSSL_1_1_1; OPENSSL_1_1_1e { From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 22:19:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92623654B78; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0hP23lq5z3sbc; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6966B23DFE; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159MJoPN023873; Wed, 9 Jun 2021 22:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159MJo4E023872; Wed, 9 Jun 2021 22:19:50 GMT (envelope-from git) Date: Wed, 9 Jun 2021 22:19:50 GMT Message-Id: <202106092219.159MJo4E023872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f29f5cc6f2d3 - stable/12 - libcrypto: Add symbol versions for symbols added since 1.1.1d. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f29f5cc6f2d390b1ae4a6c526271e37233aafc70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 22:19:50 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f29f5cc6f2d390b1ae4a6c526271e37233aafc70 commit f29f5cc6f2d390b1ae4a6c526271e37233aafc70 Author: John Baldwin AuthorDate: 2021-05-28 22:18:15 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:54:13 +0000 libcrypto: Add symbol versions for symbols added since 1.1.1d. While here, trim a spurious local: I missed when added SSL_sendfile. PR: 255277 Reported by: yuri Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D30483 (cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf) --- secure/lib/libcrypto/Version.map | 17 ++++++++++++++++- secure/lib/libssl/Version.map | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map index 33432019a023..bed7623b9c47 100644 --- a/secure/lib/libcrypto/Version.map +++ b/secure/lib/libcrypto/Version.map @@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d { global: X509_get0_authority_issuer; X509_get0_authority_serial; - local: *; } OPENSSL_1_1_1c; +OPENSSL_1_1_1e { + global: + EVP_PKEY_meth_get_digestsign; + EVP_PKEY_meth_get_digestverify; + EVP_PKEY_meth_set_digestsign; + EVP_PKEY_meth_set_digestverify; + RSA_get0_pss_params; +} OPENSSL_1_1_1d; +OPENSSL_1_1_1h { + global: + EC_KEY_decoded_from_explicit_params; + X509_ALGOR_copy; + X509_REQ_set0_signature; + X509_REQ_set1_signature_algo; + local: *; +} OPENSSL_1_1_1e; diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map index 9011ff99d88d..118ac93966e3 100644 --- a/secure/lib/libssl/Version.map +++ b/secure/lib/libssl/Version.map @@ -512,5 +512,4 @@ OPENSSL_1_1_1 { OPENSSL_1_1_1a { global: SSL_get_signature_type_nid; - local: *; } OPENSSL_1_1_1; From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:14:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E66D656472; Thu, 10 Jun 2021 00:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxq0fypz4TXX; Thu, 10 Jun 2021 00:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF0FA25C8E; Thu, 10 Jun 2021 00:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0Es7f082568; Thu, 10 Jun 2021 00:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0Es5j082567; Thu, 10 Jun 2021 00:14:54 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:54 GMT Message-Id: <202106100014.15A0Es5j082567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a4f99b3c2384 - stable/13 - Disable building svnlite(1) by default. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4f99b3c2384e04118182d917c689d446a63be71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:55 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a4f99b3c2384e04118182d917c689d446a63be71 commit a4f99b3c2384e04118182d917c689d446a63be71 Author: John Baldwin AuthorDate: 2021-05-05 21:05:10 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:21:59 +0000 Disable building svnlite(1) by default. Now that all repositories have switched to git, initiate the de-orbit burn for svnlite(1). Reviewed by: emaste Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30105 (cherry picked from commit a2bc17474b962ba9e29c4526356203fe48a549eb) --- share/mk/src.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d01472c7fae6..70462adb6a37 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -176,7 +176,6 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_HOST \ SOURCELESS_UCODE \ STATS \ - SVNLITE \ SYSCONS \ SYSTEM_COMPILER \ SYSTEM_LINKER \ @@ -216,6 +215,7 @@ __DEFAULT_NO_OPTIONS = \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ SVN \ + SVNLITE \ ZONEINFO_LEAPSECONDS_SUPPORT \ # LEFT/RIGHT. Left options which default to "yes" unless their corresponding From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:14:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 873A3656473; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxr2kTpz4TRd; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3462592B; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0EtVT082599; Thu, 10 Jun 2021 00:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0Ett1082598; Thu, 10 Jun 2021 00:14:55 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:55 GMT Message-Id: <202106100014.15A0Ett1082598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 214bbc2ddca8 - stable/13 - Add a description for WITH_SVNLITE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 214bbc2ddca8708004df7577fe70d38c91c69e5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:56 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=214bbc2ddca8708004df7577fe70d38c91c69e5e commit 214bbc2ddca8708004df7577fe70d38c91c69e5e Author: John Baldwin AuthorDate: 2021-05-05 21:05:38 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:22:43 +0000 Add a description for WITH_SVNLITE. Reviewed by: emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30106 (cherry picked from commit 0ac711e07ece9ac260023a62250d50fb2f37e975) --- tools/build/options/WITH_SVNLITE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build/options/WITH_SVNLITE b/tools/build/options/WITH_SVNLITE new file mode 100644 index 000000000000..25aeec40fab1 --- /dev/null +++ b/tools/build/options/WITH_SVNLITE @@ -0,0 +1,3 @@ +Build +.Xr svnlite 1 +and related programs. From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:14:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6628C65604A; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxs1ztGz4TM0; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241C325C52; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0Ev9o082623; Thu, 10 Jun 2021 00:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0EvuP082622; Thu, 10 Jun 2021 00:14:57 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:57 GMT Message-Id: <202106100014.15A0EvuP082622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cbf2dc5ffc8b - stable/13 - src.conf.5: Regen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:57 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c commit cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c Author: John Baldwin AuthorDate: 2021-06-09 22:24:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:24:42 +0000 src.conf.5: Regen. --- share/man/man5/src.conf.5 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 90905413175e..dad8d465e3fd 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 4, 2021 +.Dd June 9, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1250,10 +1250,19 @@ Set to build nvme related tools and kernel modules. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. -.It Va WITH_OFED -Set to build the +.It Va WITHOUT_OFED +Set to disable the build of the .Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. +Infiniband software stack, including kernel modules and userspace libraries. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_OFED_EXTRA +.El .It Va WITH_OFED_EXTRA Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" @@ -1497,8 +1506,8 @@ Set to install .Xr svnlite 1 as .Xr svn 1 . -.It Va WITHOUT_SVNLITE -Set to not build +.It Va WITH_SVNLITE +Build .Xr svnlite 1 and related programs. .It Va WITHOUT_SYSCONS From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:48:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20878656FC6; Thu, 10 Jun 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhF0P5Sz4Wl8; Thu, 10 Jun 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D1325E3C; Thu, 10 Jun 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mCks022994; Thu, 10 Jun 2021 00:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mCsT022993; Thu, 10 Jun 2021 00:48:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:12 GMT Message-Id: <202106100048.15A0mCsT022993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b48d1066d54b - stable/13 - madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b48d1066d54b1a134cbf64f86c0bc2035fd08251 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b48d1066d54b1a134cbf64f86c0bc2035fd08251 commit b48d1066d54b1a134cbf64f86c0bc2035fd08251 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:01:28 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC (cherry picked from commit a603d41aca48ff21df59967c55ddef181e16ec14) --- sys/x86/acpica/madt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 5683f7eb321d..11c7b9de52d7 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -158,7 +158,9 @@ madt_setup_local(void) reason = "by DMAR table"; acpi_unmap_table(dmartbl); } - if (vm_guest == VM_GUEST_VMWARE) { + if (reason != NULL) { + /* Already disabled */ + } else if (vm_guest == VM_GUEST_VMWARE) { vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:48:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34CF7657142; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhG1124z4WlB; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C39D25E3D; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mDnt023018; Thu, 10 Jun 2021 00:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mDXd023017; Thu, 10 Jun 2021 00:48:13 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:13 GMT Message-Id: <202106100048.15A0mDXd023017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ca473f38c156 - stable/13 - madt_setup_local: convert series of strcmp to iteration over the array MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca473f38c1568c89113e64e1495df3f17271b433 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:14 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ca473f38c1568c89113e64e1495df3f17271b433 commit ca473f38c1568c89113e64e1495df3f17271b433 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:19:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: convert series of strcmp to iteration over the array (cherry picked from commit 92adf00d0512b674ce18eb1a542ae42e85dd5bca) --- sys/x86/acpica/madt.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 11c7b9de52d7..035a618f68a3 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -128,6 +128,11 @@ madt_probe_cpus(void) return (0); } +static const char *x2apic_sandy_dis[] = { + "LENOVO", + "ASUSTeK Computer Inc.", +}; + /* * Initialize the local APIC on the BSP. */ @@ -139,7 +144,7 @@ madt_setup_local(void) const char *reason; char *hw_vendor; u_int p[4]; - int user_x2apic; + int i, user_x2apic; bool bios_x2apic; if ((cpu_feature2 & CPUID2_X2APIC) != 0) { @@ -173,21 +178,22 @@ madt_setup_local(void) CPUID_TO_MODEL(cpu_id) == 0x2a) { hw_vendor = kern_getenv("smbios.planar.maker"); /* - * It seems that some Lenovo and ASUS - * SandyBridge-based notebook BIOSes have a - * bug which prevents booting AP in x2APIC - * mode. Since the only way to detect mobile - * CPU is to check northbridge pci id, which - * cannot be done that early, disable x2APIC - * for all Lenovo and ASUS SandyBridge + * It seems that some SandyBridge-based + * notebook BIOSes have a bug which prevents + * booting AP in x2APIC mode. Since the only + * way to detect mobile CPU is to check + * northbridge pci id, which cannot be done + * that early, disable x2APIC for all such * machines. */ if (hw_vendor != NULL) { - if (!strcmp(hw_vendor, "LENOVO") || - !strcmp(hw_vendor, - "ASUSTeK Computer Inc.")) { - reason = + for (i = 0; i < nitems(x2apic_sandy_dis); i++) { + if (strcmp(hw_vendor, + x2apic_sandy_dis[i]) == 0) { + reason = "for a suspected SandyBridge BIOS bug"; + break; + } } freeenv(hw_vendor); } From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:48:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B4E4656F68; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhH1z51z4Wc0; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C4882597B; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mFcG023042; Thu, 10 Jun 2021 00:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mFpH023041; Thu, 10 Jun 2021 00:48:15 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:15 GMT Message-Id: <202106100048.15A0mFpH023041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9e500de92587 - stable/13 - madt_setup_local: extract special case checks into a helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e500de925873bb16e45def54512d3abda958ae3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:15 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9e500de925873bb16e45def54512d3abda958ae3 commit 9e500de925873bb16e45def54512d3abda958ae3 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:27:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: extract special case checks into a helper (cherry picked from commit e9e00cc0c98738f0ce7bface221c920c36a1356e) --- sys/x86/acpica/madt.c | 114 ++++++++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 035a618f68a3..e041296d4ca5 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -134,70 +134,84 @@ static const char *x2apic_sandy_dis[] = { }; /* - * Initialize the local APIC on the BSP. + * Automatically detect several configurations where x2APIC mode is + * known to cause troubles. User can override the setting with + * hw.x2apic_enable tunable. */ -static int -madt_setup_local(void) +static const char * +madt_x2apic_disable_reason(void) { ACPI_TABLE_DMAR *dmartbl; vm_paddr_t dmartbl_physaddr; const char *reason; char *hw_vendor; u_int p[4]; - int i, user_x2apic; - bool bios_x2apic; + int i; - if ((cpu_feature2 & CPUID2_X2APIC) != 0) { - reason = NULL; + reason = NULL; + dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); + if (dmartbl_physaddr != 0) { + dmartbl = acpi_map_table(dmartbl_physaddr, ACPI_SIG_DMAR); + if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) + reason = "by DMAR table"; + acpi_unmap_table(dmartbl); + if (reason != NULL) + return (reason); + } + + if (vm_guest == VM_GUEST_VMWARE) { + vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); + if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || + (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) + return ("inside VMWare without intr redirection"); + } + + if (vm_guest == VM_GUEST_XEN) + return ("due to running under XEN"); + + if (vm_guest == VM_GUEST_NO && + CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) == 0x2a) { + hw_vendor = kern_getenv("smbios.planar.maker"); /* - * Automatically detect several configurations where - * x2APIC mode is known to cause troubles. User can - * override the setting with hw.x2apic_enable tunable. + * It seems that some SandyBridge-based notebook + * BIOSes have a bug which prevents booting AP in + * x2APIC mode. Since the only way to detect mobile + * CPU is to check northbridge pci id, which cannot be + * done that early, disable x2APIC for all such + * machines. */ - dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); - if (dmartbl_physaddr != 0) { - dmartbl = acpi_map_table(dmartbl_physaddr, - ACPI_SIG_DMAR); - if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) - reason = "by DMAR table"; - acpi_unmap_table(dmartbl); - } - if (reason != NULL) { - /* Already disabled */ - } else if (vm_guest == VM_GUEST_VMWARE) { - vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); - if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || - (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) - reason = - "inside VMWare without intr redirection"; - } else if (vm_guest == VM_GUEST_XEN) { - reason = "due to running under XEN"; - } else if (vm_guest == VM_GUEST_NO && - CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) == 0x2a) { - hw_vendor = kern_getenv("smbios.planar.maker"); - /* - * It seems that some SandyBridge-based - * notebook BIOSes have a bug which prevents - * booting AP in x2APIC mode. Since the only - * way to detect mobile CPU is to check - * northbridge pci id, which cannot be done - * that early, disable x2APIC for all such - * machines. - */ - if (hw_vendor != NULL) { - for (i = 0; i < nitems(x2apic_sandy_dis); i++) { - if (strcmp(hw_vendor, - x2apic_sandy_dis[i]) == 0) { - reason = - "for a suspected SandyBridge BIOS bug"; - break; - } + if (hw_vendor != NULL) { + for (i = 0; i < nitems(x2apic_sandy_dis); i++) { + if (strcmp(hw_vendor, x2apic_sandy_dis[i]) == + 0) { + reason = + "for a suspected SandyBridge BIOS bug"; + break; } - freeenv(hw_vendor); } + freeenv(hw_vendor); } + if (reason != NULL) + return (reason); + } + + return (NULL); +} + +/* + * Initialize the local APIC on the BSP. + */ +static int +madt_setup_local(void) +{ + const char *reason; + int user_x2apic; + bool bios_x2apic; + + if ((cpu_feature2 & CPUID2_X2APIC) != 0) { + reason = madt_x2apic_disable_reason(); bios_x2apic = lapic_is_x2apic(); if (reason != NULL && bios_x2apic) { if (bootverbose) From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 00:48:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B37F3656AF5; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhJ3Vgwz4Wc8; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD3026124; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mGhY023072; Thu, 10 Jun 2021 00:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mG0W023071; Thu, 10 Jun 2021 00:48:16 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:16 GMT Message-Id: <202106100048.15A0mG0W023071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c04954bb39d8 - stable/13 - Disable x2APIC for SandyBridge laptops with Samsung BIOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c04954bb39d807860d27ffe867d86c1f12465f6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:16 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c04954bb39d807860d27ffe867d86c1f12465f6e commit c04954bb39d807860d27ffe867d86c1f12465f6e Author: Konstantin Belousov AuthorDate: 2021-06-02 22:29:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 Disable x2APIC for SandyBridge laptops with Samsung BIOS PR: 256389 (cherry picked from commit 37f780d3e0a2e8e4c64c526b6e7dc77ff6b91057) --- sys/x86/acpica/madt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index e041296d4ca5..8e343a6619f3 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -131,6 +131,7 @@ madt_probe_cpus(void) static const char *x2apic_sandy_dis[] = { "LENOVO", "ASUSTeK Computer Inc.", + "SAMSUNG ELECTRONICS CO., LTD.", }; /* From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 06:13:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 817F16435C1; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0tvh3Jb5z3FFp; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FD9E26B3; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A6Dasb063845; Thu, 10 Jun 2021 06:13:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A6Daiu063844; Thu, 10 Jun 2021 06:13:36 GMT (envelope-from git) Date: Thu, 10 Jun 2021 06:13:36 GMT Message-Id: <202106100613.15A6Daiu063844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e34c3d0721bc - stable/12 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e34c3d0721bc52b4130489170e509266ce4e4b96 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 06:13:36 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e34c3d0721bc52b4130489170e509266ce4e4b96 commit e34c3d0721bc52b4130489170e509266ce4e4b96 Author: Dmitry Chagin AuthorDate: 2021-05-27 18:52:10 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 06:13:04 +0000 rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. PR: 256203 Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu (cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09) --- share/man/man4/rtwn_usb.4 | 3 ++- sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 + sys/dev/usb/usbdevs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index b146cfe4fe09..86c4c02aafa9 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 26, 2021 +.Dd May 27, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -99,6 +99,7 @@ based USB wireless network adapters, including: .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0 +.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h b/sys/dev/rtwn/usb/rtwn_usb_attach.h index 40076dbb941c..c7a0f1ce1576 100644 --- a/sys/dev/rtwn/usb/rtwn_usb_attach.h +++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h @@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2), RTWN_RTL8821AU_DEV(TPLINK, T2UNANO), RTWN_RTL8821AU_DEV(TPLINK, T2UPLUS), + RTWN_RTL8821AU_DEV(TPLINK, T2UV3), #undef RTWN_RTL8821AU_DEV }; diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 9add31c6d781..15cd996745e6 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4694,6 +4694,7 @@ product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK T2UNANO 0x011e Archer T2U Nano +product TPLINK T2UV3 0x011f Archer T2U ver 3 product TPLINK T2UPLUS 0x0120 Archer T2U Plus product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 06:14:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D4E36438C9; Thu, 10 Jun 2021 06:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0twz5c33z3FfJ; Thu, 10 Jun 2021 06:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 527241F71; Thu, 10 Jun 2021 06:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A6Eh7K064079; Thu, 10 Jun 2021 06:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A6EhF1064078; Thu, 10 Jun 2021 06:14:43 GMT (envelope-from git) Date: Thu, 10 Jun 2021 06:14:43 GMT Message-Id: <202106100614.15A6EhF1064078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 923cd7e05af8 - stable/13 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 923cd7e05af843421b6eb46086f9a786f643361c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 06:14:44 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=923cd7e05af843421b6eb46086f9a786f643361c commit 923cd7e05af843421b6eb46086f9a786f643361c Author: Dmitry Chagin AuthorDate: 2021-05-27 18:52:10 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 06:14:22 +0000 rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. PR: 256203 Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu (cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09) --- share/man/man4/rtwn_usb.4 | 3 ++- sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 + sys/dev/usb/usbdevs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index b146cfe4fe09..86c4c02aafa9 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 26, 2021 +.Dd May 27, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -99,6 +99,7 @@ based USB wireless network adapters, including: .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0 +.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h b/sys/dev/rtwn/usb/rtwn_usb_attach.h index 40076dbb941c..c7a0f1ce1576 100644 --- a/sys/dev/rtwn/usb/rtwn_usb_attach.h +++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h @@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2), RTWN_RTL8821AU_DEV(TPLINK, T2UNANO), RTWN_RTL8821AU_DEV(TPLINK, T2UPLUS), + RTWN_RTL8821AU_DEV(TPLINK, T2UV3), #undef RTWN_RTL8821AU_DEV }; diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 1239449b4697..b3cf80be01a4 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4699,6 +4699,7 @@ product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK T2UNANO 0x011e Archer T2U Nano +product TPLINK T2UV3 0x011f Archer T2U ver 3 product TPLINK T2UPLUS 0x0120 Archer T2U Plus product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:30:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40174646378; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHH1P2Wz3lQQ; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D254E7B; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9Up8P029460; Thu, 10 Jun 2021 09:30:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9UpO2029459; Thu, 10 Jun 2021 09:30:51 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:30:51 GMT Message-Id: <202106100930.15A9UpO2029459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 37370a6773cd - stable/13 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 37370a6773cde7fcae063aed0a4cc024f95534bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:30:51 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=37370a6773cde7fcae063aed0a4cc024f95534bd commit 37370a6773cde7fcae063aed0a4cc024f95534bd Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:29:34 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 63bc251f52f9..ae179cf13a45 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -855,6 +855,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:30:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBF356467C5; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHR5Pp1z3lct; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A161E4EDD; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9UxpZ030121; Thu, 10 Jun 2021 09:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9Ux5W030120; Thu, 10 Jun 2021 09:30:59 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:30:59 GMT Message-Id: <202106100930.15A9Ux5W030120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 540206069cb6 - stable/12 - Direct commit: MFC r367395 (e9b13c6612fea4e74f0c9c543e21d29d91a24dff) by cem: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 540206069cb6c0449a00745c57b74d19f4b216b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:30:59 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=540206069cb6c0449a00745c57b74d19f4b216b8 commit 540206069cb6c0449a00745c57b74d19f4b216b8 Author: Dmitry Chagin AuthorDate: 2021-06-10 09:22:43 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:22:43 +0000 Direct commit: MFC r367395 (e9b13c6612fea4e74f0c9c543e21d29d91a24dff) by cem: linux(4): Deduplicate unimpl/dummy syscall handlers No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 --- sys/amd64/linux/linux_dummy.c | 192 --------------------- sys/amd64/linux/linux_dummy_machdep.c | 74 ++++++++ sys/amd64/linux32/linux32_dummy.c | 119 ------------- sys/arm64/linux/linux_dummy_machdep.c | 63 +++++++ sys/{arm64 => compat}/linux/linux_dummy.c | 24 +-- sys/conf/files.amd64 | 2 + sys/conf/files.i386 | 4 +- .../linux/{linux_dummy.c => linux_dummy_machdep.c} | 131 +------------- sys/modules/linux/Makefile | 6 + sys/modules/linux64/Makefile | 8 +- sys/modules/linux_common/Makefile | 2 +- sys/x86/linux/linux_dummy_x86.c | 69 ++++++++ 12 files changed, 242 insertions(+), 452 deletions(-) diff --git a/sys/amd64/linux/linux_dummy.c b/sys/amd64/linux/linux_dummy.c deleted file mode 100644 index ee21b4da212b..000000000000 --- a/sys/amd64/linux/linux_dummy.c +++ /dev/null @@ -1,192 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2013 Dmitry Chagin - * 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, 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -UNIMPLEMENTED(afs_syscall); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(epoll_ctl_old); -UNIMPLEMENTED(epoll_wait_old); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(get_thread_area); -UNIMPLEMENTED(getpmsg); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ -UNIMPLEMENTED(tuxcall); -UNIMPLEMENTED(security); -UNIMPLEMENTED(set_thread_area); -UNIMPLEMENTED(uselib); -UNIMPLEMENTED(vserver); - -DUMMY(sendfile); -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(sysfs); -DUMMY(vhangup); -DUMMY(modify_ldt); -DUMMY(pivot_root); -DUMMY(adjtimex); -DUMMY(swapoff); -DUMMY(init_module); -DUMMY(ioperm); -DUMMY(delete_module); -DUMMY(quotactl); -DUMMY(readahead); -DUMMY(io_setup); -DUMMY(io_destroy); -DUMMY(io_getevents); -DUMMY(io_submit); -DUMMY(io_cancel); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(restart_syscall); -DUMMY(semtimedop); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); -DUMMY(mq_open); -DUMMY(mq_unlink); -DUMMY(mq_timedsend); -DUMMY(mq_timedreceive); -DUMMY(mq_notify); -DUMMY(mq_getsetattr); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.15: */ -DUMMY(kexec_file_load); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); -/* Linux 4.11: */ -DUMMY(statx); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); -/* Linux 5.0: */ -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/amd64/linux/linux_dummy_machdep.c b/sys/amd64/linux/linux_dummy_machdep.c new file mode 100644 index 000000000000..aba79b69d55d --- /dev/null +++ b/sys/amd64/linux/linux_dummy_machdep.c @@ -0,0 +1,74 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c (or + * sys/x86/linux/linux_dummy_x86.c). + */ + +UNIMPLEMENTED(get_thread_area); +UNIMPLEMENTED(set_thread_area); +UNIMPLEMENTED(uselib); + +DUMMY(modify_ldt); + +DUMMY(ioperm); +DUMMY(io_setup); +DUMMY(io_destroy); +DUMMY(io_getevents); +DUMMY(io_submit); +DUMMY(io_cancel); +DUMMY(mq_open); +DUMMY(mq_unlink); +DUMMY(mq_timedsend); +DUMMY(mq_timedreceive); +DUMMY(mq_notify); +DUMMY(mq_getsetattr); +DUMMY(readahead); +DUMMY(restart_syscall); +DUMMY(semtimedop); +/* Linux 3.15: */ +DUMMY(kexec_file_load); diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index 97a8aa0d3ddd..5eb54fefd276 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -43,123 +43,29 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); -UNIMPLEMENTED(afs_syscall); UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); -UNIMPLEMENTED(vserver); DUMMY(stime); DUMMY(olduname); DUMMY(uname); -DUMMY(vhangup); -DUMMY(swapoff); -DUMMY(adjtimex); -DUMMY(init_module); -DUMMY(delete_module); -DUMMY(quotactl); DUMMY(bdflush); -DUMMY(sysfs); -DUMMY(sendfile); -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(pivot_root); DUMMY(ptrace); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); DUMMY(mq_open); DUMMY(mq_unlink); DUMMY(mq_timedsend); DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); /* Linux 4.11: */ -DUMMY(statx); DUMMY(arch_prctl); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); /* Linux 5.0: */ DUMMY(clock_gettime64); DUMMY(clock_settime64); @@ -181,28 +87,3 @@ DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/arm64/linux/linux_dummy_machdep.c b/sys/arm64/linux/linux_dummy_machdep.c new file mode 100644 index 000000000000..b006809740d7 --- /dev/null +++ b/sys/arm64/linux/linux_dummy_machdep.c @@ -0,0 +1,63 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c. + */ + +UNIMPLEMENTED(get_thread_area); +UNIMPLEMENTED(set_thread_area); +UNIMPLEMENTED(uselib); + +DUMMY(mq_open); +DUMMY(mq_unlink); +DUMMY(mq_timedsend); +DUMMY(mq_timedreceive); +DUMMY(mq_notify); +DUMMY(mq_getsetattr); +DUMMY(semtimedop); diff --git a/sys/arm64/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c similarity index 90% rename from sys/arm64/linux/linux_dummy.c rename to sys/compat/linux/linux_dummy.c index 92a0feb94f73..1003b7d4c6e4 100644 --- a/sys/arm64/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -37,14 +37,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + #include #include -// LINUXTODO: deduplicate arm64 dummy against other archs? -// LINUXTODO: review/update/add unimplemented syscalls - /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -53,15 +56,11 @@ UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(epoll_ctl_old); UNIMPLEMENTED(epoll_wait_old); UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(get_thread_area); UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(putpmsg); UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(security); -UNIMPLEMENTED(set_thread_area); -UNIMPLEMENTED(tuxcall); -UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); DUMMY(sendfile); @@ -75,16 +74,9 @@ DUMMY(init_module); DUMMY(delete_module); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(semtimedop); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); -DUMMY(mq_open); -DUMMY(mq_unlink); -DUMMY(mq_timedsend); -DUMMY(mq_timedreceive); -DUMMY(mq_notify); -DUMMY(mq_getsetattr); DUMMY(kexec_load); /* Linux 2.6.11: */ DUMMY(add_key); diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index b78d99336b03..5effa0f5f9c6 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -714,6 +714,7 @@ amd64/linux32/linux32_support.s optional compat_linux32 \ dependency "linux32_assym.h" amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 +compat/linux/linux_dummy.c optional compat_linux32 compat/linux/linux_emul.c optional compat_linux32 compat/linux/linux_errno.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 @@ -737,6 +738,7 @@ compat/linux/linux_vdso.c optional compat_linux32 compat/linux/linux_common.c optional compat_linux32 compat/linux/linux_event.c optional compat_linux32 compat/linux/linux.c optional compat_linux32 +x86/linux/linux_dummy_x86.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr dev/mfi/mfi_linux.c optional compat_linux32 mfi # diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 8077a7bafa0f..ffbb8c314e3e 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,6 +86,7 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_errno.c optional compat_linux @@ -542,7 +543,7 @@ i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_copyout.c optional compat_linux -i386/linux/linux_dummy.c optional compat_linux +i386/linux/linux_dummy_machdep.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux @@ -608,6 +609,7 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa +x86/linux/linux_dummy_x86.c optional compat_linux x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/autoconf.c standard diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy_machdep.c similarity index 50% rename from sys/i386/linux/linux_dummy.c rename to sys/i386/linux/linux_dummy_machdep.c index 05c873529c15..dfcc691a3582 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -43,119 +43,31 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); -UNIMPLEMENTED(afs_syscall); +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c (or + * sys/x86/linux/linux_dummy_x86.c). + */ + UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); -UNIMPLEMENTED(vserver); -DUMMY(stime); +DUMMY(bdflush); DUMMY(fstat); DUMMY(olduname); +DUMMY(stime); DUMMY(uname); -DUMMY(vhangup); -DUMMY(vm86old); -DUMMY(swapoff); -DUMMY(adjtimex); -DUMMY(init_module); -DUMMY(delete_module); -DUMMY(quotactl); -DUMMY(bdflush); -DUMMY(sysfs); DUMMY(vm86); -DUMMY(sendfile); /* different semantics */ -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(pivot_root); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); +DUMMY(vm86old); /* Linux 4.11: */ -DUMMY(statx); DUMMY(arch_prctl); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); /* Linux 5.0: */ DUMMY(clock_gettime64); DUMMY(clock_settime64); @@ -177,28 +89,3 @@ DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 7065c1f0f6cd..3092c5d81d80 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -6,6 +6,9 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 .endif .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX} +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${SRCTOP}/sys/x86/linux +.endif VDSO= linux${SFX}_vdso @@ -18,6 +21,9 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux_dummy_x86.c +.endif .if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux${SFX}_support.s .else diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 046eeeda30f2..ec1aee563aa3 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -1,11 +1,14 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${SRCTOP}/sys/x86/linux +.endif VDSO= linux_vdso KMOD= linux64 -SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ +SRCS= linux_fork.c linux_dummy_machdep.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ @@ -13,6 +16,9 @@ SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h \ linux_support.s +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux_dummy_x86.c +.endif DPSRCS= assym.inc linux_genassym.c # XXX: for assym.inc diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile index 5b49a7409997..b4b71a709b70 100644 --- a/sys/modules/linux_common/Makefile +++ b/sys/modules/linux_common/Makefile @@ -4,7 +4,7 @@ KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ - linux_errno.c \ + linux_dummy.c linux_errno.c \ linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h EXPORT_SYMS= diff --git a/sys/x86/linux/linux_dummy_x86.c b/sys/x86/linux/linux_dummy_x86.c new file mode 100644 index 000000000000..1defe4e9674e --- /dev/null +++ b/sys/x86/linux/linux_dummy_x86.c @@ -0,0 +1,69 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +DUMMY(sysfs); +DUMMY(quotactl); +/* Linux 2.6.13: */ +DUMMY(inotify_init); +/* Linux 2.6.22: */ +DUMMY(signalfd); +/* Linux 4.11: */ +DUMMY(statx); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6B0646070; Thu, 10 Jun 2021 09:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHT09n5z3llV; Thu, 10 Jun 2021 09:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD36B504B; Thu, 10 Jun 2021 09:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V0e3030461; Thu, 10 Jun 2021 09:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V00V030460; Thu, 10 Jun 2021 09:31:00 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:00 GMT Message-Id: <202106100931.15A9V00V030460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: a2760a540fbf - stable/12 - linux(4): Fix loadable modules after r367395 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a2760a540fbf38584798a057d43adb659e0bb50e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:01 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a2760a540fbf38584798a057d43adb659e0bb50e commit a2760a540fbf38584798a057d43adb659e0bb50e Author: Conrad Meyer AuthorDate: 2020-11-06 22:04:57 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:23:48 +0000 linux(4): Fix loadable modules after r367395 Move dtrace SDT definitions into linux_common module code. Also, build linux_dummy.c into the linux_common kld -- we don't need separate versions of these stubs for 32- and 64-bit emulation. Reported by: several PR: 250897 Discussed with: emaste, trasz Tested by: John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin X-MFC-With: r367395 Differential Revision: https://reviews.freebsd.org/D27124 (cherry picked from commit 76b2bfeda42bbb686c74d3608dbc9b84b8e22e29) --- sys/compat/linux/linux_common.c | 15 +++++++++++++++ sys/compat/linux/linux_dummy.c | 12 +++++------- sys/compat/linux/linux_misc.c | 13 ------------- sys/conf/files.i386 | 1 + 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index a6c780bd5e10..6eebfb91d002 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -49,6 +50,20 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); MODULE_VERSION(linux_common, 1); +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(linuxulator); +LIN_SDT_PROVIDER_DEFINE(linuxulator32); + SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 1003b7d4c6e4..39e0d0a914b9 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -29,21 +29,19 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include #include #include -#ifdef COMPAT_LINUX32 -#include -#include -#else +/* + * Including linux vs linux32 here is arbitrary -- the syscall args structures + * (proto.h) are not dereferenced by the DUMMY stub implementations, and + * suitable for use by both native and compat32 entrypoints. + */ #include #include -#endif #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index af3e774f3505..d436aadf0035 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -99,19 +99,6 @@ __FBSDID("$FreeBSD$"); #include #include -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); - int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index ffbb8c314e3e..aa26d29c02f9 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,6 +86,7 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_common.c optional compat_linux compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56E6A646A04; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHW1dh4z3lj4; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157CB548E; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V2Lh030516; Thu, 10 Jun 2021 09:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V2xG030515; Thu, 10 Jun 2021 09:31:02 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:02 GMT Message-Id: <202106100931.15A9V2xG030515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 1f717a8166a1 - stable/12 - Move V4L feature declarations and DTrace provider definitions from linux_common.c to linux_util.c so they become available on i386. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1f717a8166a13e74f0190a4b18d79587ed39d204 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:03 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1f717a8166a13e74f0190a4b18d79587ed39d204 commit 1f717a8166a13e74f0190a4b18d79587ed39d204 Author: Tijl Coosemans AuthorDate: 2020-12-06 10:58:55 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:25:16 +0000 Move V4L feature declarations and DTrace provider definitions from linux_common.c to linux_util.c so they become available on i386. linux_common.c defines the linux_common kernel module but this module does not exist on i386 and linux_common.c is not included in the linux module. linux_util.c is included in the linux_common module on amd64 and the linux module on i386. Remove linux_common.c from files.i386 again. It was added recently in r367433 when the DTrace provider definitions were moved. The V4L feature declarations were moved to linux_common in r283423. (cherry picked from commit 77fb6b6644446beb0ea45085b953f464c729c049) --- sys/compat/linux/linux_common.c | 19 ------------------- sys/compat/linux/linux_util.c | 18 ++++++++++++++++++ sys/conf/files.i386 | 1 - 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 6eebfb91d002..4a6d8718b8af 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -36,34 +36,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include #include -FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); -FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); - MODULE_VERSION(linux_common, 1); -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(linuxulator); -LIN_SDT_PROVIDER_DEFINE(linuxulator32); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 59fc844e1cbe..9b801b522a45 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -60,6 +61,23 @@ MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structures"); MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); +FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); +FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); + +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(linuxulator); +LIN_SDT_PROVIDER_DEFINE(linuxulator32); + char linux_emul_path[MAXPATHLEN] = "/compat/linux"; SYSCTL_STRING(_compat_linux, OID_AUTO, emul_path, CTLFLAG_RWTUN, diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index aa26d29c02f9..ffbb8c314e3e 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,7 +86,6 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs -compat/linux/linux_common.c optional compat_linux compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B2F3646910; Thu, 10 Jun 2021 09:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHV1cV4z3lZP; Thu, 10 Jun 2021 09:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE3A7504C; Thu, 10 Jun 2021 09:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V1pM030485; Thu, 10 Jun 2021 09:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V1l6030484; Thu, 10 Jun 2021 09:31:01 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:01 GMT Message-Id: <202106100931.15A9V1l6030484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: bb687ce01268 - stable/12 - Fix i386 linux module after r367395. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bb687ce0126833710ac5fc9a9d80240e94735df6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:02 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bb687ce0126833710ac5fc9a9d80240e94735df6 commit bb687ce0126833710ac5fc9a9d80240e94735df6 Author: Tijl Coosemans AuthorDate: 2020-12-05 14:53:24 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:24:32 +0000 Fix i386 linux module after r367395. In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. (cherry picked from commit df4ca45cf943fb62c7771e479f5f999570ec6928) --- sys/amd64/linux32/{linux32_dummy.c => linux32_dummy_machdep.c} | 0 sys/conf/files.amd64 | 2 +- sys/modules/linux/Makefile | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy_machdep.c similarity index 100% rename from sys/amd64/linux32/linux32_dummy.c rename to sys/amd64/linux32/linux32_dummy_machdep.c diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 5effa0f5f9c6..c49728bff1aa 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -708,7 +708,7 @@ compat/linsysfs/linsysfs.c optional linsysfs # # Linux/i386 binary support # -amd64/linux32/linux32_dummy.c optional compat_linux32 +amd64/linux32/linux32_dummy_machdep.c optional compat_linux32 amd64/linux32/linux32_machdep.c optional compat_linux32 amd64/linux32/linux32_support.s optional compat_linux32 \ dependency "linux32_assym.h" diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 3092c5d81d80..0cf780106be7 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -13,7 +13,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 VDSO= linux${SFX}_vdso KMOD= linux -SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ +SRCS= linux_fork.c linux${SFX}_dummy_machdep.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux${SFX}_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ @@ -41,7 +41,7 @@ OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c linux_mmap.c \ - linux_emul.c linux_errno.c opt_cpu.h linux.c + linux_dummy.c linux_emul.c linux_errno.c opt_cpu.h linux.c .endif .if ${MACHINE_CPUARCH} == "i386" From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 932EE64691C; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHX2Vv8z3lZb; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33B944C79; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V4X2030540; Thu, 10 Jun 2021 09:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V4mn030539; Thu, 10 Jun 2021 09:31:04 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:04 GMT Message-Id: <202106100931.15A9V4mn030539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 2d7565bbbc53 - stable/12 - linux_common: retire extra module version. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2d7565bbbc537b1e338bd98468bd7fc25ccccdca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:04 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2d7565bbbc537b1e338bd98468bd7fc25ccccdca commit 2d7565bbbc537b1e338bd98468bd7fc25ccccdca Author: Dmitry Chagin AuthorDate: 2021-05-26 05:34:32 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:26:07 +0000 linux_common: retire extra module version. The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52 but Linuxulator's modules dependend on 'linux_common'. To avoid such mistakes in the future rename moduledata name and module name to 'linux_common' and retire 'linuxcommon' line. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30409 MFC after: 2 weeks (cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9) --- sys/compat/linux/linux_common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 4a6d8718b8af..15ae502a22d1 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -MODULE_VERSION(linux_common, 1); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = @@ -94,10 +92,10 @@ linux_common_modevent(module_t mod, int type, void *data) } static moduledata_t linux_common_mod = { - "linuxcommon", + "linux_common", linux_common_modevent, 0 }; -DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_VERSION(linuxcommon, 1); +DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(linux_common, 1); From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCB29646030; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHY4F9Sz3lWn; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55BCD4EDF; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V5pv030564; Thu, 10 Jun 2021 09:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V5Re030563; Thu, 10 Jun 2021 09:31:05 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:05 GMT Message-Id: <202106100931.15A9V5Re030563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4d0dc71a7bf0 - stable/12 - linux_renameat2: improve flag checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:05 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 commit 4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 Author: Ed Maste AuthorDate: 2019-11-07 15:51:44 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:27:45 +0000 linux_renameat2: improve flag checks In the cases where Linux returns an error (e.g. passing in an undefined flag) there's no need for us to emit a message. (The target of this message is a developer working on the linuxulatorm, not the author of presumably broken Linux software). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21606 (cherry picked from commit 01b9ee4c509e2882147af35eea4772d06ecd4150) --- sys/compat/linux/linux_file.c | 7 +++++++ sys/compat/linux/linux_file.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index dfa428e714d7..0b7efb6fa964 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -708,6 +708,13 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args) int error, olddfd, newdfd; if (args->flags != 0) { + if (args->flags & ~(LINUX_RENAME_EXCHANGE | + LINUX_RENAME_NOREPLACE | LINUX_RENAME_WHITEOUT)) + return (EINVAL); + if (args->flags & LINUX_RENAME_EXCHANGE && + args->flags & (LINUX_RENAME_NOREPLACE | + LINUX_RENAME_WHITEOUT)) + return (EINVAL); linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); return (EINVAL); diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h index 756a3b2be3e2..c3b1eeb8d7f4 100644 --- a/sys/compat/linux/linux_file.h +++ b/sys/compat/linux/linux_file.h @@ -127,6 +127,13 @@ #define LINUX_F_UNLCK 2 #endif +/* + * renameat2 flags + */ +#define LINUX_RENAME_NOREPLACE 0x00000001 +#define LINUX_RENAME_EXCHANGE 0x00000002 +#define LINUX_RENAME_WHITEOUT 0x00000004 + /* * sync_file_range flags */ From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D145C646AA5; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHZ4jMhz3lWx; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74BAD5490; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V6bX030588; Thu, 10 Jun 2021 09:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V6VE030587; Thu, 10 Jun 2021 09:31:06 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:06 GMT Message-Id: <202106100931.15A9V6VE030587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e1e6daa8cf8e - stable/12 - linux: silence renameat2 flags warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1e6daa8cf8e385a0c94c5275296252488646615 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:07 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e1e6daa8cf8e385a0c94c5275296252488646615 commit e1e6daa8cf8e385a0c94c5275296252488646615 Author: Mateusz Guzik AuthorDate: 2020-10-26 18:03:50 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:28:35 +0000 linux: silence renameat2 flags warning Hogs the console while building the Linux kernel in a Ubuntu Focal jail. (cherry picked from commit fe76bef462048f9beb3bffd448ae1adb01969594) --- sys/compat/linux/linux_file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 0b7efb6fa964..ae7dbe76c96d 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -715,8 +715,16 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args) args->flags & (LINUX_RENAME_NOREPLACE | LINUX_RENAME_WHITEOUT)) return (EINVAL); +#if 0 + /* + * This spams the console on Ubuntu Focal. + * + * What's needed here is a general mechanism to let users know + * about missing features without hogging the system. + */ linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); +#endif return (EINVAL); } From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:31:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 515FB646B1F; Thu, 10 Jun 2021 09:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHc05Npz3ljB; Thu, 10 Jun 2021 09:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 997805505; Thu, 10 Jun 2021 09:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V7nI030612; Thu, 10 Jun 2021 09:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V7oX030611; Thu, 10 Jun 2021 09:31:07 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:07 GMT Message-Id: <202106100931.15A9V7oX030611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 6fab8f9b8ae7 - stable/12 - Get rid of i386 ref here as linux64 is a 64-bit module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6fab8f9b8ae7a2f5489191714393494c88bd937b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:08 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6fab8f9b8ae7a2f5489191714393494c88bd937b commit 6fab8f9b8ae7a2f5489191714393494c88bd937b Author: Dmitry Chagin AuthorDate: 2021-03-24 15:56:46 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:29:21 +0000 Get rid of i386 ref here as linux64 is a 64-bit module. Reviewed By: emaste, imp Differential Revision: https://reviews.freebsd.org/D29412 (cherry picked from commit 88588c4b7611a39cdf965c3c07d8fcc13ed553b4) --- sys/modules/linux64/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index ec1aee563aa3..3730c019c559 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .PATH: ${SRCTOP}/sys/x86/linux .endif @@ -16,16 +16,13 @@ SRCS= linux_fork.c linux_dummy_machdep.c linux_file.c linux_event.c \ opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h \ linux_support.s -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux_dummy_x86.c .endif DPSRCS= assym.inc linux_genassym.c # XXX: for assym.inc SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h -.if ${MACHINE_CPUARCH} == "i386" -SRCS+= opt_apic.h -.endif CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ genassym.o From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:33:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C901D646E50; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zLg5JtLz3mry; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F62A54BC; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9Xl2E033354; Thu, 10 Jun 2021 09:33:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9XltM033353; Thu, 10 Jun 2021 09:33:47 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:33:47 GMT Message-Id: <202106100933.15A9XltM033353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: a0694da5d035 - stable/12 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a0694da5d035ea0e686ad1bae95709e52df0913a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:33:47 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=a0694da5d035ea0e686ad1bae95709e52df0913a commit a0694da5d035ea0e686ad1bae95709e52df0913a Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:33:19 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 4c6a2f606119..f7c2cdb9afb0 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -854,6 +854,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:36:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B07D64710E; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zPG2yb9z3nXx; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6C95519; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9a2wt033620; Thu, 10 Jun 2021 09:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9a2Oo033619; Thu, 10 Jun 2021 09:36:02 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:36:02 GMT Message-Id: <202106100936.15A9a2Oo033619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: b57a593cb2d6 - stable/11 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:36:02 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 commit b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:35:21 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 065a539a7eec..b39c1b831b31 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -854,6 +854,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 09:42:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBE45647134; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zXy5lx4z3r0K; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE5635630; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9ggs2046501; Thu, 10 Jun 2021 09:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9ggis046500; Thu, 10 Jun 2021 09:42:42 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:42:42 GMT Message-Id: <202106100942.15A9ggis046500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e06cbb2b7ac1 - stable/13 - linux_common: retire extra module version. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:42:43 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b commit e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b Author: Dmitry Chagin AuthorDate: 2021-05-26 05:34:32 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:39:38 +0000 linux_common: retire extra module version. The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52 but Linuxulator's modules dependend on 'linux_common'. To avoid such mistakes in the future rename moduledata name and module name to 'linux_common' and retire 'linuxcommon' line. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30409 (cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9) --- sys/compat/linux/linux_common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 5a0ac015ed0e..4d81470649de 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -MODULE_VERSION(linux_common, 1); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = @@ -83,10 +81,10 @@ linux_common_modevent(module_t mod, int type, void *data) } static moduledata_t linux_common_mod = { - "linuxcommon", + "linux_common", linux_common_modevent, 0 }; -DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_VERSION(linuxcommon, 1); +DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(linux_common, 1); From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 12:56:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A77064B0DB; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G13rD32rYz4hkf; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DAFE7CBF; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACuCFB099537; Thu, 10 Jun 2021 12:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACuCGc099536; Thu, 10 Jun 2021 12:56:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:56:12 GMT Message-Id: <202106101256.15ACuCGc099536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6eea2623b5c6 - stable/13 - Cirrus-CI: retry pkg installation on failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6eea2623b5c6d6aad9976b591c23c20c8a227c74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:56:12 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6eea2623b5c6d6aad9976b591c23c20c8a227c74 commit 6eea2623b5c6d6aad9976b591c23c20c8a227c74 Author: Ed Maste AuthorDate: 2021-06-02 14:42:57 +0000 Commit: Ed Maste CommitDate: 2021-06-10 12:54:52 +0000 Cirrus-CI: retry pkg installation on failure Pkg installation failed somewhat frequently, always at: [62/104] Fetching jpeg-turbo-2.0.6.txz: .......... done pkg: http://pkgmir.geo.freebsd.org/FreeBSD:13:amd64/quarterly/All/jbigkit-2.1_1.txz: No route to host Move pkg installation to a script and retry once upon failure as a (hopefully temporary) workaround. Reviewed by: imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30613 (cherry picked from commit dd41de95a84d979615a2ef11df6850622bf6184e) --- .cirrus-ci/pkg-install.sh | 15 +++++++++++++++ .cirrus.yml | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.cirrus-ci/pkg-install.sh b/.cirrus-ci/pkg-install.sh new file mode 100644 index 000000000000..ef83e5284078 --- /dev/null +++ b/.cirrus-ci/pkg-install.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +pkg install -y "$@" && exit 0 + +cat < Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 116CD64EF89; Thu, 10 Jun 2021 15:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G176r6xShz3JYf; Thu, 10 Jun 2021 15:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5647122A0; Thu, 10 Jun 2021 15:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFO4k4004259; Thu, 10 Jun 2021 15:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFO44e004258; Thu, 10 Jun 2021 15:24:04 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:04 GMT Message-Id: <202106101524.15AFO44e004258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 21d163f8a101 - stable/13 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21d163f8a1013278ecdded77abf6c0dfda554a46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:05 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=21d163f8a1013278ecdded77abf6c0dfda554a46 commit 21d163f8a1013278ecdded77abf6c0dfda554a46 Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:24 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 15:24:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA3D64EAEB; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G176y60dGz3Jc2; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B715411FF6; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFOAhV004376; Thu, 10 Jun 2021 15:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFOAJE004375; Thu, 10 Jun 2021 15:24:10 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:10 GMT Message-Id: <202106101524.15AFOAJE004375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: e76098b5c372 - stable/12 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e76098b5c372f78a70b763021e9ea22d860ecc6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:11 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=e76098b5c372f78a70b763021e9ea22d860ecc6a commit e76098b5c372f78a70b763021e9ea22d860ecc6a Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:42 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 15:24:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D1E064EA5E; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17732gRpz3Jt1; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45514122A1; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFOFex004493; Thu, 10 Jun 2021 15:24:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFOFfK004492; Thu, 10 Jun 2021 15:24:15 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:15 GMT Message-Id: <202106101524.15AFOFfK004492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: bd1139898643 - stable/11 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: bd1139898643dd54529c464e6ff66011d6388b3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:15 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=bd1139898643dd54529c464e6ff66011d6388b3e commit bd1139898643dd54529c464e6ff66011d6388b3e Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:50 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 15:29:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE5764F26F; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17F11M83z3KpR; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D62B123D0; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFTOCP004944; Thu, 10 Jun 2021 15:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFTOfJ004943; Thu, 10 Jun 2021 15:29:24 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:29:24 GMT Message-Id: <202106101529.15AFTOfJ004943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 90372d8ec305 - stable/13 - Add freeze/thaw description to devctl(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90372d8ec305d75143378666a578d9ddc73f9ac1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:29:25 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=90372d8ec305d75143378666a578d9ddc73f9ac1 commit 90372d8ec305d75143378666a578d9ddc73f9ac1 Author: Li-Wen Hsu AuthorDate: 2021-06-01 04:33:12 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:28:29 +0000 Add freeze/thaw description to devctl(8) This is a follow-up to 5fa29797910346fc0c54829bd979856e83b9b7ea . PR: 256311 Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29867 (cherry picked from commit 315674fb6acc4fa54cf82de3863c349c5a71f498) --- usr.sbin/devctl/devctl.8 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/usr.sbin/devctl/devctl.8 b/usr.sbin/devctl/devctl.8 index 17f480bd66ee..965c310d0868 100644 --- a/usr.sbin/devctl/devctl.8 +++ b/usr.sbin/devctl/devctl.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2019 +.Dd June 1, 2021 .Dt DEVCTL 8 .Os .Sh NAME @@ -67,6 +67,10 @@ .Op Fl f .Ar device .Nm +.Cm freeze +.Nm +.Cm thaw +.Nm .Cm reset .Op Fl d .Ar device @@ -170,6 +174,23 @@ the device will be deleted even if it is physically present. This command should be used with care as a device that is deleted but present can no longer be used unless the parent bus device rediscovers the device via a rescan request. +.It Cm freeze +Freeze probe and attach processing initiated in response to drivers being +loaded. +Drivers are placed on a +.Do +frozen list +.Dc +and processed when a later +.Do +thaw +.Dc +occurs. +.It Cm thaw +Resume (thaw the freeze) probe and attach initiated in response to drivers +being loaded. +In addition to resuming, all pending actions that were frozen during the freeze +are performed. .It Xo Cm reset .Op Fl d .Ar device From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 15:29:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 721CF64F392; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17F31bwwz3Ksq; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20315122A3; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFTR54005054; Thu, 10 Jun 2021 15:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFTRB2005053; Thu, 10 Jun 2021 15:29:27 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:29:27 GMT Message-Id: <202106101529.15AFTRB2005053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 1e83183d38d5 - stable/12 - Add freeze/thaw description to devctl(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1e83183d38d5ab0bb9971b95d088662402153988 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:29:27 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=1e83183d38d5ab0bb9971b95d088662402153988 commit 1e83183d38d5ab0bb9971b95d088662402153988 Author: Li-Wen Hsu AuthorDate: 2021-06-01 04:33:12 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:28:38 +0000 Add freeze/thaw description to devctl(8) This is a follow-up to 5fa29797910346fc0c54829bd979856e83b9b7ea . PR: 256311 Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29867 (cherry picked from commit 315674fb6acc4fa54cf82de3863c349c5a71f498) --- usr.sbin/devctl/devctl.8 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/usr.sbin/devctl/devctl.8 b/usr.sbin/devctl/devctl.8 index 17f480bd66ee..965c310d0868 100644 --- a/usr.sbin/devctl/devctl.8 +++ b/usr.sbin/devctl/devctl.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2019 +.Dd June 1, 2021 .Dt DEVCTL 8 .Os .Sh NAME @@ -67,6 +67,10 @@ .Op Fl f .Ar device .Nm +.Cm freeze +.Nm +.Cm thaw +.Nm .Cm reset .Op Fl d .Ar device @@ -170,6 +174,23 @@ the device will be deleted even if it is physically present. This command should be used with care as a device that is deleted but present can no longer be used unless the parent bus device rediscovers the device via a rescan request. +.It Cm freeze +Freeze probe and attach processing initiated in response to drivers being +loaded. +Drivers are placed on a +.Do +frozen list +.Dc +and processed when a later +.Do +thaw +.Dc +occurs. +.It Cm thaw +Resume (thaw the freeze) probe and attach initiated in response to drivers +being loaded. +In addition to resuming, all pending actions that were frozen during the freeze +are performed. .It Xo Cm reset .Op Fl d .Ar device From owner-dev-commits-src-branches@freebsd.org Thu Jun 10 15:42:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9DC364F542; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17Xg4p69z3MBB; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BAF5122F5; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFgxJc031059; Thu, 10 Jun 2021 15:42:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFgxCe031058; Thu, 10 Jun 2021 15:42:59 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:42:59 GMT Message-Id: <202106101542.15AFgxCe031058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: cb96c6ba30cb - stable/13 - Clarify that the new STABLE branch is branched off CURRENT, not renamed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb96c6ba30cb917bc1223247caa93d135818199a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:42:59 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cb96c6ba30cb917bc1223247caa93d135818199a commit cb96c6ba30cb917bc1223247caa93d135818199a Author: Li-Wen Hsu AuthorDate: 2021-03-18 09:16:16 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:42:39 +0000 Clarify that the new STABLE branch is branched off CURRENT, not renamed Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D29317 (cherry picked from commit 53844d3ea4aa504c37c8bd679cfea9966ade1400) --- share/man/man7/development.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index f64f01f24d17..a0459ccfad72 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -77,8 +77,8 @@ Git branch represents CURRENT; all changes are first committed to CURRENT and then usually cherry-picked back to STABLE, which refers to Git branches such as .Ql stable/13 . -Every few years the CURRENT branch is renamed to STABLE, and a new -CURRENT is branched, with an incremented major version number. +Every few years a new STABLE is branched from CURRENT, +with an incremented major version number. Releases are then branched off STABLE and numbered with consecutive minor numbers. .Pp From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 00:48:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 652DC656699; Fri, 11 Jun 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1MdZ0ygnz3Ftt; Fri, 11 Jun 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF6EC196F7; Fri, 11 Jun 2021 00:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15B0m1rn047990; Fri, 11 Jun 2021 00:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15B0m1w9047989; Fri, 11 Jun 2021 00:48:01 GMT (envelope-from git) Date: Fri, 11 Jun 2021 00:48:01 GMT Message-Id: <202106110048.15B0m1w9047989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 043f20498526 - stable/13 - fdescfs: add an option to return underlying file vnode on lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 043f204985261d6daae69538c4609b3e143ee444 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 00:48:02 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=043f204985261d6daae69538c4609b3e143ee444 commit 043f204985261d6daae69538c4609b3e143ee444 Author: Konstantin Belousov AuthorDate: 2021-05-05 22:53:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-11 00:33:48 +0000 fdescfs: add an option to return underlying file vnode on lookup (cherry picked from commit f9b1e711f0d8c27f2d29e7a8e6276947d37a6a22) --- share/man/man5/fdescfs.5 | 94 +++++++++++++++++++++++++++++++++++++------ sys/fs/fdescfs/fdesc.h | 1 + sys/fs/fdescfs/fdesc_vfsops.c | 2 + sys/fs/fdescfs/fdesc_vnops.c | 12 +++++- 4 files changed, 95 insertions(+), 14 deletions(-) diff --git a/share/man/man5/fdescfs.5 b/share/man/man5/fdescfs.5 index 3f16104c0ac8..f2abda2bb4c2 100644 --- a/share/man/man5/fdescfs.5 +++ b/share/man/man5/fdescfs.5 @@ -1,3 +1,5 @@ +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. +.\" .\" Copyright (c) 1996 .\" Mike Pritchard . All rights reserved. .\" @@ -8,6 +10,10 @@ .\" This code is derived from software donated to Berkeley by .\" Jan-Simon Pendry. .\" +.\" Parts of this documentation was written by +.\" Konstantin Belousov 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: @@ -34,7 +40,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2017 +.Dd May 17, 2021 .Dt FDESCFS 5 .Os .Sh NAME @@ -62,7 +68,40 @@ through .Pa /dev/fd/# refer to file descriptors which can be accessed through the file system. -If the file descriptor is open and the mode the file is being opened +.Pp +The following mount options can be used when mounting +.Nm +filesystem: +.Bl -tag -width linrdlnk +.It Cm nodup +For file descriptors referencing vnodes, instead of the +.Xr dup 2 +semantic described above, implement re-opening of the referenced vnode. +See below for more details. +.It Cm linrdlnk +Report the type of the +.Nm +vnode as +.Dv VLNK +instead of +.Fx +traditional +.Dv VCHR . +For +.Xr linux 4 +ABI compatibility mount +.Nm +volume with the +.Cm linrdlnk +option. +.El +.Pp +For +.Nm +mounted without the +.Cm nodup +mount option, +if the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call: .Bd -literal -offset indent fd = open("/dev/fd/0", mode); @@ -74,7 +113,6 @@ fd = fcntl(0, F_DUPFD, 0); .Ed .Pp are equivalent. -.Pp Flags to the .Xr open 2 call other than @@ -84,6 +122,38 @@ and .Dv O_RDWR are ignored. .Pp +For +.Nm +mounted with the +.Cm nodup +option, and file descriptor referencing a vnode, the call: +.Bd -literal -offset indent +fd = open("/dev/fd/0", mode); +.Ed +.Pp +reopens the referenced vnode with the specified +.Fa mode . +In other words, the +.Fn open +call above is equivalent to +.Bd -literal -offset indent +fd = openat(0, "", O_EMPTY_PATH, mode); +.Ed +.Pp +In particular, if the file descriptor was opened with the +.Dv O_PATH +flag, then either +.Dv O_EMPTY_PATH +or +.Fn open +over +.Nm +mount with +.Cm nodup +option allows one to convert it to a regularly opened file, +assuming that the current permissions allow the requested +.Fa mode . +.Pp .Em "Note:" .Pa /dev/fd/0 , .Pa /dev/fd/1 @@ -92,14 +162,6 @@ and files are created by default when devfs alone is mounted. .Nm creates entries for all file descriptors opened by the process. -.Pp -For -.Xr linux 4 -ABI compatibility mount -.Nm -volume with -.Cm linrdlnk -option. .Sh FILES .Bl -tag -width /dev/stderr -compact .It Pa /dev/fd/# @@ -110,13 +172,19 @@ To mount a volume located on .Pa /dev/fd : .Pp -.Dl "mount -t fdescfs null /dev/fd" +.Dl "mount -t fdescfs none /dev/fd" .Pp For .Xr linux 4 ABI compatibility: .Pp -.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd" +.Dl "mount -t fdescfs -o linrdlnk none /compat/linux/dev/fd" +.Pp +For substitute of +.Dv O_EMPTY_PATH +flag use: +.Pp +.Dl "mount -t fdescfs -o nodup none /dev/fdpath" .Sh SEE ALSO .Xr devfs 5 , .Xr mount 8 diff --git a/sys/fs/fdescfs/fdesc.h b/sys/fs/fdescfs/fdesc.h index b578b7309130..94682f42cdb3 100644 --- a/sys/fs/fdescfs/fdesc.h +++ b/sys/fs/fdescfs/fdesc.h @@ -42,6 +42,7 @@ /* Private mount flags for fdescfs. */ #define FMNT_UNMOUNTF 0x01 #define FMNT_LINRDLNKF 0x02 +#define FMNT_NODUP 0x04 struct fdescmount { struct vnode *f_root; /* Root node */ diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 64f8d28bdcfd..9d8fdda47cbf 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -101,6 +101,8 @@ fdesc_mount(struct mount *mp) fmp->flags = 0; if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0) fmp->flags |= FMNT_LINRDLNKF; + if (vfs_getopt(mp->mnt_optnew, "nodup", NULL, NULL) == 0) + fmp->flags |= FMNT_NODUP; error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); if (error) { free(fmp, M_FDESCMNT); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 1271b50e6e94..c5a7b86f1de5 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -264,10 +264,20 @@ fdesc_get_ino_alloc(struct mount *mp, void *arg, int lkflags, struct vnode **rvp) { struct fdesc_get_ino_args *a; + struct fdescmount *fdm; + struct vnode *vp; int error; a = arg; - error = fdesc_allocvp(a->ftype, a->fd_fd, a->ix, mp, rvp); + fdm = VFSTOFDESC(mp); + if ((fdm->flags & FMNT_NODUP) != 0 && a->fp->f_type == DTYPE_VNODE) { + vp = a->fp->f_vnode; + vget(vp, lkflags | LK_RETRY); + *rvp = vp; + error = 0; + } else { + error = fdesc_allocvp(a->ftype, a->fd_fd, a->ix, mp, rvp); + } fdrop(a->fp, a->td); return (error); } From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 14:18:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BD1765FA95; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1jc92qqwz3LkC; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4591F242C6; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BEI1DN023096; Fri, 11 Jun 2021 14:18:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BEI1LZ023095; Fri, 11 Jun 2021 14:18:01 GMT (envelope-from git) Date: Fri, 11 Jun 2021 14:18:01 GMT Message-Id: <202106111418.15BEI1LZ023095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ca81bcbbf118 - stable/13 - Add missing chunks after cherry-picking 9ca874cf740ee68c5742df8b5f9e20910085c011 from main to stable/13: Add TCP LRO support for VLAN and VxLAN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca81bcbbf1182b725d2f7c1eada932731a9d6432 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 14:18:01 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ca81bcbbf1182b725d2f7c1eada932731a9d6432 commit ca81bcbbf1182b725d2f7c1eada932731a9d6432 Author: Hans Petter Selasky AuthorDate: 2021-06-11 13:48:28 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-11 13:51:05 +0000 Add missing chunks after cherry-picking 9ca874cf740ee68c5742df8b5f9e20910085c011 from main to stable/13: Add TCP LRO support for VLAN and VxLAN. Make sure all counters are allocated. This is a direct commit. Reported by: Herbert J. Skuhra Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_subr.c | 4 ++++ sys/netinet/tcp_var.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index bb2c35c76fde..ec162d889902 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1509,6 +1509,10 @@ tcp_init(void) tcp_inp_lro_wokeup_queue = counter_u64_alloc(M_WAITOK); tcp_inp_lro_compressed = counter_u64_alloc(M_WAITOK); tcp_inp_lro_locks_taken = counter_u64_alloc(M_WAITOK); + tcp_extra_mbuf = counter_u64_alloc(M_WAITOK); + tcp_would_have_but = counter_u64_alloc(M_WAITOK); + tcp_comp_total = counter_u64_alloc(M_WAITOK); + tcp_uncomp_total = counter_u64_alloc(M_WAITOK); #ifdef TCPPCAP tcp_pcap_init(); #endif diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 7b51afbb42b6..1858d0146ce5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1010,6 +1010,10 @@ extern counter_u64_t tcp_inp_lro_direct_queue; extern counter_u64_t tcp_inp_lro_wokeup_queue; extern counter_u64_t tcp_inp_lro_compressed; extern counter_u64_t tcp_inp_lro_locks_taken; +extern counter_u64_t tcp_extra_mbuf; +extern counter_u64_t tcp_would_have_but; +extern counter_u64_t tcp_comp_total; +extern counter_u64_t tcp_uncomp_total; #ifdef NETFLIX_EXP_DETECTION /* Various SACK attack thresholds */ From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 16:53:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F4074661259; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1n466Zfjz3sJN; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAD232675D; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGrwX0035419; Fri, 11 Jun 2021 16:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGrwwG035418; Fri, 11 Jun 2021 16:53:58 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:53:58 GMT Message-Id: <202106111653.15BGrwwG035418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 157a960058c2 - stable/13 - fsck_ffs(8): fix divide by zero when debug messages are enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 157a960058c221bda068c902ba9ccf216fa2fbaa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:53:59 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=157a960058c221bda068c902ba9ccf216fa2fbaa commit 157a960058c221bda068c902ba9ccf216fa2fbaa Author: Robert Wing AuthorDate: 2021-05-20 20:53:52 +0000 Commit: Robert Wing CommitDate: 2021-06-11 16:44:29 +0000 fsck_ffs(8): fix divide by zero when debug messages are enabled Only print buffer cache debug message when a cache lookup has been done. When running `fsck_ffs -d` on a gjournal'ed filesystem, it's possible that totalreads is greater than zero when no cache lookup has been done - causing a divide by zero. This commit fixes the following error: Floating point exception (core dumped) Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D30370 (cherry picked from commit 20123b25ee51e9b122676a30d45c21a506bf1461) --- sbin/fsck_ffs/fsutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index b13ba4c54bde..db22ee5b20cf 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -576,7 +576,7 @@ ckfini(int markclean) rerun = 1; } } - if (debug && totalreads > 0) + if (debug && cachelookups > 0) printf("cache with %d buffers missed %d of %d (%d%%)\n", numbufs, cachereads, cachelookups, (int)(cachereads * 100 / cachelookups)); From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 16:59:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 120FC6617EF; Fri, 11 Jun 2021 16:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1nBW017Mz3tJK; Fri, 11 Jun 2021 16:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFEC2663F; Fri, 11 Jun 2021 16:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGxUHX036078; Fri, 11 Jun 2021 16:59:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGxUwn036077; Fri, 11 Jun 2021 16:59:30 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:59:30 GMT Message-Id: <202106111659.15BGxUwn036077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 47ec64b3e801 - stable/13 - fsck_ufs: fix segfault with gjournal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47ec64b3e801cbb793ccff49d21bc8eeb219ad9f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:59:31 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=47ec64b3e801cbb793ccff49d21bc8eeb219ad9f commit 47ec64b3e801cbb793ccff49d21bc8eeb219ad9f Author: Robert Wing AuthorDate: 2021-06-03 01:41:31 +0000 Commit: Robert Wing CommitDate: 2021-06-11 16:56:00 +0000 fsck_ufs: fix segfault with gjournal The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while attempting to traverse the buffer cache. The tail queue used for the buffer cache was not initialized before dropping into gjournal_check(). Initialize the buffer cache before calling gjournal_check(). PR: 245907 Reviewed by: jhb, mckusick Differential Revision: https://reviews.freebsd.org/D30537 (cherry picked from commit 441e69e419effac0225a45f4cdb948280b8ce5ab) --- sbin/fsck_ffs/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 401ee10f9be3..67aff2dde73c 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -309,6 +309,7 @@ checkfilesys(char *filesys) exit(0); } if ((sblock.fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) { + bufinit(); gjournal_check(filesys); if (chkdoreload(mntp) == 0) exit(0); From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 17:58:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1D976626E8; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1pVc4jV9z4Rjs; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A2DF26FE7; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BHwWc5015735; Fri, 11 Jun 2021 17:58:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BHwWbM015734; Fri, 11 Jun 2021 17:58:32 GMT (envelope-from git) Date: Fri, 11 Jun 2021 17:58:32 GMT Message-Id: <202106111758.15BHwWbM015734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 01cf73198d1e - stable/13 - bectl(8): don't allow creation of boot environments with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 01cf73198d1e0b3d00f9bb75027e75327c2c5b9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 17:58:32 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=01cf73198d1e0b3d00f9bb75027e75327c2c5b9b commit 01cf73198d1e0b3d00f9bb75027e75327c2c5b9b Author: Robert Wing AuthorDate: 2021-06-03 16:36:11 +0000 Commit: Robert Wing CommitDate: 2021-06-11 17:28:41 +0000 bectl(8): don't allow creation of boot environments with spaces Boot environment datasets that contain spaces are not bootable. When a user attempts to create a boot environment with a space, abort the creation and print an error message. PR: 254441 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D30194 (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a) --- sbin/bectl/bectl.c | 9 ++++++++- sbin/bectl/tests/bectl_test.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 50229b4b96b7..d3de58ea2982 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -233,7 +233,10 @@ bectl_cmd_create(int argc, char *argv[]) bootenv = *argv; err = BE_ERR_SUCCESS; - if ((atpos = strchr(bootenv, '@')) != NULL) { + if (strchr(bootenv, ' ') != NULL) + /* BE datasets with spaces are not bootable */ + err = BE_ERR_INVALIDNAME; + else if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot * environment is to be created here. @@ -261,6 +264,10 @@ bectl_cmd_create(int argc, char *argv[]) switch (err) { case BE_ERR_SUCCESS: break; + case BE_ERR_INVALIDNAME: + fprintf(stderr, + "bectl create: boot environment name must not contain spaces\n"); + break; default: if (atpos != NULL) fprintf(stderr, diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 221fe21e29ed..b101591c3ee9 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -122,6 +122,10 @@ bectl_create_body() atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ ${zpool}/ROOT/default/usr + # BE datasets with spaces are not bootable, PR 254441. + atf_check -e not-empty -s not-exit:0 \ + bectl -r ${zpool}/ROOT create "foo bar" + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 18:03:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CAFB662786; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1pbv30Pjz4S8s; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EF522734B; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BI37ps029198; Fri, 11 Jun 2021 18:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BI37TY029197; Fri, 11 Jun 2021 18:03:07 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:03:07 GMT Message-Id: <202106111803.15BI37TY029197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: e1dfdff10967 - stable/12 - bectl(8): don't allow creation of boot environments with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1dfdff10967d294f8c9acb22812380901be3f80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:03:07 -0000 The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=e1dfdff10967d294f8c9acb22812380901be3f80 commit e1dfdff10967d294f8c9acb22812380901be3f80 Author: Robert Wing AuthorDate: 2021-06-03 16:36:11 +0000 Commit: Robert Wing CommitDate: 2021-06-11 17:41:51 +0000 bectl(8): don't allow creation of boot environments with spaces Boot environment datasets that contain spaces are not bootable. When a user attempts to create a boot environment with a space, abort the creation and print an error message. PR: 254441 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D30194 (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a) --- sbin/bectl/bectl.c | 9 ++++++++- sbin/bectl/tests/bectl_test.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 768d1cd89ac2..0c8b9c313488 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -217,7 +217,10 @@ bectl_cmd_create(int argc, char *argv[]) bootenv = *argv; err = BE_ERR_SUCCESS; - if ((atpos = strchr(bootenv, '@')) != NULL) { + if (strchr(bootenv, ' ') != NULL) + /* BE datasets with spaces are not bootable */ + err = BE_ERR_INVALIDNAME; + else if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot * environment is to be created here. @@ -245,6 +248,10 @@ bectl_cmd_create(int argc, char *argv[]) switch (err) { case BE_ERR_SUCCESS: break; + case BE_ERR_INVALIDNAME: + fprintf(stderr, + "bectl create: boot environment name must not contain spaces\n"); + break; default: if (atpos != NULL) fprintf(stderr, diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 4a3fc78db0bc..c23cde13adb5 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -105,6 +105,10 @@ bectl_create_body() atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ ${zpool}/ROOT/default/usr + # BE datasets with spaces are not bootable, PR 254441. + atf_check -e not-empty -s not-exit:0 \ + bectl -r ${zpool}/ROOT create "foo bar" + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 18:26:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7FEC662DC3; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1q6c4Qp3z4THY; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C5027BDA; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BIQGM8056781; Fri, 11 Jun 2021 18:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BIQGRY056780; Fri, 11 Jun 2021 18:26:16 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:26:16 GMT Message-Id: <202106111826.15BIQGRY056780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: fcfd3c7909ba - stable/13 - Enable IPIs on CPU 0 on arm and arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fcfd3c7909bad40506c7f27d6a76c0c90ec11569 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:26:16 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fcfd3c7909bad40506c7f27d6a76c0c90ec11569 commit fcfd3c7909bad40506c7f27d6a76c0c90ec11569 Author: Andrew Turner AuthorDate: 2021-05-02 07:43:34 +0000 Commit: Andrew Turner CommitDate: 2021-06-11 18:23:50 +0000 Enable IPIs on CPU 0 on arm and arm64 Not all interrupt controllers enable IPIs by default as the Arm GIC specs make it an implementation defined option. As at least two hypervisors have also previously masked the IPIs on boot. As we already enable these IPIs on the non-boot CPUs it is expected this is a safe operation. Differential Revision: https://reviews.freebsd.org/D26975 (cherry picked from commit 2420f6aed9e355ff65377152ba977b3a5ac441d1) --- sys/arm64/arm64/mp_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 8d5d82879571..3b1a8cc89cab 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -364,6 +364,8 @@ intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, ii->ii_send_arg = isrc; strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); ii->ii_count = intr_ipi_setup_counters(name); + + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); } static void From owner-dev-commits-src-branches@freebsd.org Fri Jun 11 18:26:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD54C662850; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1q6d5Qhzz4TKs; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A283A275EC; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BIQH3o056810; Fri, 11 Jun 2021 18:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BIQHIN056809; Fri, 11 Jun 2021 18:26:17 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:26:17 GMT Message-Id: <202106111826.15BIQHIN056809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 4b707591838d - stable/13 - Also enable IPIs on 32-bit arm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b707591838de29c8b10a13c56f7da5489542d7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:26:17 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4b707591838de29c8b10a13c56f7da5489542d7c commit 4b707591838de29c8b10a13c56f7da5489542d7c Author: Andrew Turner AuthorDate: 2021-05-02 10:05:03 +0000 Commit: Andrew Turner CommitDate: 2021-06-11 18:23:50 +0000 Also enable IPIs on 32-bit arm This was missed in 2420f6a Reported by: tuexen, imp (cherry picked from commit 0ec205197b56b9257cf0fdc1a5b268fef3e3f2dc) --- sys/arm/arm/machdep_intr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/arm/machdep_intr.c b/sys/arm/arm/machdep_intr.c index e2fb34ce93c8..cc2e67a6211e 100644 --- a/sys/arm/arm/machdep_intr.c +++ b/sys/arm/arm/machdep_intr.c @@ -223,6 +223,7 @@ intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, isrc->isrc_handlers++; intr_ipi_setup(ipi, name, hand, arg, pic_ipi_send, isrc); + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); return (0); } #endif From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 00:41:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66EFC667BA1; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR52NSyz3DJg; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A6742C9C8; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f5IK057689; Sat, 12 Jun 2021 00:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f5WJ057688; Sat, 12 Jun 2021 00:41:05 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:05 GMT Message-Id: <202106120041.15C0f5WJ057688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 04456f711853 - stable/13 - linuxkpi: Add rom and romlen to struct pci_dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04456f7118533676c50f29464b58e541f03757fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:05 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=04456f7118533676c50f29464b58e541f03757fe commit 04456f7118533676c50f29464b58e541f03757fe Author: Neel Chauhan AuthorDate: 2021-06-07 22:50:46 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:36:05 +0000 linuxkpi: Add rom and romlen to struct pci_dev Approved by: bz (src), hselasky (src) Differential Reivison: https://reviews.freebsd.org/D30686 (cherry picked from commit 096104e790fb182d230f25f169792cc610b8f41c) --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 4c07edebc796..0cc467f4cc8f 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -243,6 +243,8 @@ struct pci_dev { uint32_t class; uint8_t revision; bool msi_enabled; + phys_addr_t rom; + size_t romlen; TAILQ_HEAD(, pci_mmio_region) mmio; }; From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 00:41:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EE4B667AF0; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR63Vpfz3DMR; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2E72CC0D; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f6q6057713; Sat, 12 Jun 2021 00:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f6Vn057712; Sat, 12 Jun 2021 00:41:06 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:06 GMT Message-Id: <202106120041.15C0f6Vn057712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: df370b47a66f - stable/13 - linuxkpi: Add _RET_IP_ macro in kernel.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df370b47a66f27e195a26d0e983a64a3756823bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:06 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df370b47a66f27e195a26d0e983a64a3756823bb commit df370b47a66f27e195a26d0e983a64a3756823bb Author: Neel Chauhan AuthorDate: 2021-06-09 21:34:58 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:41:08 +0000 linuxkpi: Add _RET_IP_ macro in kernel.h This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30707 (cherry picked from commit fee0d486ef34c6bd113ed743e33357ff626f2495) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index daef6216a151..6ee292940016 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -283,6 +283,8 @@ extern int linuxkpi_debug; #define u64_to_user_ptr(val) ((void *)(uintptr_t)(val)) +#define _RET_IP_ __builtin_return_address(0) + static inline unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base) { From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 00:41:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AE6E667EC9; Sat, 12 Jun 2021 00:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR74jv9z3D7G; Sat, 12 Jun 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809052CC84; Sat, 12 Jun 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f7rE057737; Sat, 12 Jun 2021 00:41:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f7Ep057736; Sat, 12 Jun 2021 00:41:07 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:07 GMT Message-Id: <202106120041.15C0f7Ep057736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 658f5eed38c3 - stable/13 - linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 658f5eed38c35f3f7d6695110b7dae8dc94d12c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:08 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=658f5eed38c35f3f7d6695110b7dae8dc94d12c7 commit 658f5eed38c35f3f7d6695110b7dae8dc94d12c7 Author: Neel Chauhan AuthorDate: 2021-06-09 21:38:52 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:41:11 +0000 linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() In Linux, these are macros to locks in the kernel for scheduling purposes. But as with other macros in this header, we aren't doing anything with them so we are doing `do {} while (0)` for now. This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30710 (cherry picked from commit 8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535) --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 5 +++++ sys/sys/param.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index a86157ba5924..e270224b0bde 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -77,6 +77,7 @@ lockdep_is_held(void *__m) #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) +#define might_lock_nested(m, n) do { } while (0) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) @@ -85,4 +86,8 @@ lockdep_is_held(void *__m) #define mutex_acquire(...) do { } while (0) #define mutex_release(...) do { } while (0) +#define lockdep_pin_lock(l) do { } while (0) +#define lockdep_repin_lock(l,c) do { } while (0) +#define lockdep_unpin_lock(l,c) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index f9b67ef94bc0..22b93e1d17fa 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 01:22:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 442C8640FB7; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G20Lr1762z3KYD; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F7542D784; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C1MRFm014952; Sat, 12 Jun 2021 01:22:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C1MRnE014951; Sat, 12 Jun 2021 01:22:27 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:22:27 GMT Message-Id: <202106120122.15C1MRnE014951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 624a723a955b - stable/13 - nfscl: Use hash lists to improve expected search performance for opens MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 624a723a955b66c2da379ae132ff5f44311a397a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:22:28 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=624a723a955b66c2da379ae132ff5f44311a397a commit 624a723a955b66c2da379ae132ff5f44311a397a Author: Rick Macklem AuthorDate: 2021-05-25 21:19:29 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:19:13 +0000 nfscl: Use hash lists to improve expected search performance for opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. Commit 3f7e14ad9345 added a hash table of lists hashed on file handle for the opens. This patch uses the hash lists for searching for a matching open based of file handle instead of an exhaustive linear search of all opens. This change appears to be performance neutral for a small number of opens, but should improve expected performance for a large number of opens. This patch also moves any found match to the front of the hash list, to try and maintain the hash lists in recently used ordering (least recently used at the end of the list). This commit should not affect the high level semantics of open handling. (cherry picked from commit 724072ab1d588677a83a5a5011b5ad9ff5d56538) --- sys/fs/nfsclient/nfs_clstate.c | 89 ++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 33 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index a8eace2ffd0b..63c70ebcfdf5 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -100,8 +100,9 @@ int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; -static int nfscl_getopen(struct nfsclownerhead *, u_int8_t *, int, u_int8_t *, - u_int8_t *, u_int32_t, struct nfscllockowner **, struct nfsclopen **); +static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, + u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, + struct nfscllockowner **, struct nfsclopen **); static bool nfscl_checkown(struct nfsclowner *, struct nfsclopen *, uint8_t *, uint8_t *, struct nfscllockowner **, struct nfsclopen **, struct nfsclopen **); @@ -509,8 +510,8 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, void **lckpp) { struct nfsclclient *clp; - struct nfsclowner *owp; struct nfsclopen *op = NULL, *top; + struct nfsclopenhash *oph; struct nfscllockowner *lp; struct nfscldeleg *dp; struct nfsnode *np; @@ -587,8 +588,8 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, else nfscl_filllockowner(p->td_proc, own, F_POSIX); lp = NULL; - error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, own, own, - mode, &lp, &op); + error = nfscl_getopen(NULL, clp->nfsc_openhash, nfhp, fhlen, + own, own, mode, &lp, &op); if (error == 0 && lp != NULL && fords == 0) { /* Don't return a lock stateid for a DS. */ stateidp->seqid = @@ -607,22 +608,22 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, /* If not found, just look for any OpenOwner that will work. */ top = NULL; done = false; - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == fhlen && - !NFSBCMP(op->nfso_fh, nfhp, fhlen)) { - if (top == NULL && (op->nfso_mode & - NFSV4OPEN_ACCESSWRITE) != 0 && - (mode & NFSV4OPEN_ACCESSREAD) != 0) - top = op; - if ((mode & op->nfso_mode) == mode) { - done = true; - break; - } + oph = NFSCLOPENHASH(clp, nfhp, fhlen); + LIST_FOREACH(op, oph, nfso_hash) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, nfhp, fhlen)) { + if (top == NULL && (op->nfso_mode & + NFSV4OPEN_ACCESSWRITE) != 0 && + (mode & NFSV4OPEN_ACCESSREAD) != 0) + top = op; + if ((mode & op->nfso_mode) == mode) { + /* LRU order the hash list. */ + LIST_REMOVE(op, nfso_hash); + LIST_INSERT_HEAD(oph, op, nfso_hash); + done = true; + break; } } - if (done) - break; } if (!done) { NFSCL_DEBUG(2, "openmode top=%p\n", top); @@ -655,14 +656,17 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, * Search for a matching file, mode and, optionally, lockowner. */ static int -nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nfhp, int fhlen, - u_int8_t *openown, u_int8_t *lockown, u_int32_t mode, - struct nfscllockowner **lpp, struct nfsclopen **opp) +nfscl_getopen(struct nfsclownerhead *ohp, struct nfsclopenhash *ohashp, + u_int8_t *nfhp, int fhlen, u_int8_t *openown, u_int8_t *lockown, + u_int32_t mode, struct nfscllockowner **lpp, struct nfsclopen **opp) { struct nfsclowner *owp; struct nfsclopen *op, *rop, *rop2; + struct nfsclopenhash *oph; bool keep_looping; + KASSERT(ohp == NULL || ohashp == NULL, ("nfscl_getopen: " + "only one of ohp and ohashp can be set")); if (lpp != NULL) *lpp = NULL; /* @@ -679,19 +683,38 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nfhp, int fhlen, rop2 = NULL; keep_looping = true; /* Search the client list */ - LIST_FOREACH(owp, ohp, nfsow_list) { - /* and look for the correct open */ - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + if (ohashp == NULL) { + /* Search the local opens on the delegation. */ + LIST_FOREACH(owp, ohp, nfsow_list) { + /* and look for the correct open */ + LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, nfhp, fhlen) + && (op->nfso_mode & mode) == mode) + keep_looping = nfscl_checkown(owp, op, openown, + lockown, lpp, &rop, &rop2); + if (!keep_looping) + break; + } + if (!keep_looping) + break; + } + } else { + /* Search for matching opens on the hash list. */ + oph = &ohashp[NFSCLOPENHASHFUNC(nfhp, fhlen)]; + LIST_FOREACH(op, oph, nfso_hash) { if (op->nfso_fhlen == fhlen && !NFSBCMP(op->nfso_fh, nfhp, fhlen) && (op->nfso_mode & mode) == mode) - keep_looping = nfscl_checkown(owp, op, openown, - lockown, lpp, &rop, &rop2); - if (!keep_looping) + keep_looping = nfscl_checkown(op->nfso_own, op, + openown, lockown, lpp, &rop, &rop2); + if (!keep_looping) { + /* LRU order the hash list. */ + LIST_REMOVE(op, nfso_hash); + LIST_INSERT_HEAD(oph, op, nfso_hash); break; + } } - if (!keep_looping) - break; } if (rop == NULL) rop = rop2; @@ -1090,10 +1113,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, } if (dp != NULL) { /* Now, find an open and maybe a lockowner. */ - ret = nfscl_getopen(&dp->nfsdl_owner, np->n_fhp->nfh_fh, + ret = nfscl_getopen(&dp->nfsdl_owner, NULL, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, NULL, &op); if (ret) - ret = nfscl_getopen(&clp->nfsc_owner, + ret = nfscl_getopen(NULL, clp->nfsc_openhash, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, NULL, &op); if (!ret) { @@ -1110,7 +1133,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, /* * Get the related Open and maybe lockowner. */ - error = nfscl_getopen(&clp->nfsc_owner, + error = nfscl_getopen(NULL, clp->nfsc_openhash, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, &lp, &op); if (!error) From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 01:30:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FFE4640C96; Sat, 12 Jun 2021 01:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G20XM0X27z3LHs; Sat, 12 Jun 2021 01:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE39A2D461; Sat, 12 Jun 2021 01:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C1Ugex025577; Sat, 12 Jun 2021 01:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C1Ugpi025576; Sat, 12 Jun 2021 01:30:42 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:30:42 GMT Message-Id: <202106120130.15C1Ugpi025576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 972883b9e06e - stable/13 - nfscl: Use hash lists to improve expected search performance for opens MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 972883b9e06e32df319fea46e365ff7be498bc15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:30:43 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=972883b9e06e32df319fea46e365ff7be498bc15 commit 972883b9e06e32df319fea46e365ff7be498bc15 Author: Rick Macklem AuthorDate: 2021-05-28 02:08:36 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:21:03 +0000 nfscl: Use hash lists to improve expected search performance for opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. Commit 3f7e14ad9345 added a hash table of lists hashed on file handle for the opens. This patch uses the hash lists for searching for a matching open based of file handle instead of an exhaustive linear search of all opens. This change appears to be performance neutral for a small number of opens, but should improve expected performance for a large number of opens. This commit should not affect the high level semantics of open handling. (cherry picked from commit 96b40b896772bbce5f93d62eaa640e1eb51b4a30) --- sys/fs/nfsclient/nfs_clstate.c | 165 +++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 90 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 63c70ebcfdf5..5e4ac2ae9d4d 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1229,7 +1229,6 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, struct nfscllockowner **lpp, int *dorpcp) { struct nfscllockowner *lp; - struct nfsclowner *owp; struct nfsclopen *op; struct nfscllock *nlop, *other_lop = NULL; struct nfscldeleg *dp; @@ -1291,24 +1290,21 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, */ lp = NULL; fnd = 0; - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (lp->nfsl_inprog == NULL && - !NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) { - fnd = 1; - break; + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (lp->nfsl_inprog == NULL && + !NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) { + fnd = 1; + break; + } } - } - if (fnd) - break; } - } - if (fnd) - break; + if (fnd) + break; } if (lp != NULL) { @@ -1338,7 +1334,6 @@ void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { - struct nfsclowner *owp; struct nfsclopen *op; struct nfscllockowner *lp; struct nfsnode *np; @@ -1347,20 +1342,19 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, np = VTONFS(vp); nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (lp->nfsl_inprog == p && - !NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) { - lp->nfsl_inprog = NULL; - nfscl_lockunlock(&lp->nfsl_rwlock); + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (lp->nfsl_inprog == p && + !NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) { + lp->nfsl_inprog = NULL; + nfscl_lockunlock(&lp->nfsl_rwlock); + } } - } } - } } nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); @@ -1376,7 +1370,6 @@ int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { - struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsclopen *op; struct nfsclclient *clp; @@ -1445,30 +1438,29 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, /* * Now, check state against the server. */ - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (!NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) - break; - } - if (lp != NULL) { - LIST_FOREACH(lop, &lp->nfsl_lock, nfslo_list) { - if (lop->nfslo_first >= end) - break; - if (lop->nfslo_end <= off) - continue; - if (lop->nfslo_type == F_WRLCK) { - nfscl_clrelease(clp); - NFSUNLOCKCLSTATE(); - return (1); - } + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (!NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) + break; + } + if (lp != NULL) { + LIST_FOREACH(lop, &lp->nfsl_lock, nfslo_list) { + if (lop->nfslo_first >= end) + break; + if (lop->nfslo_end <= off) + continue; + if (lop->nfslo_type == F_WRLCK) { + nfscl_clrelease(clp); + NFSUNLOCKCLSTATE(); + return (1); + } + } } - } } - } } nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); @@ -3243,23 +3235,22 @@ nfscl_getclose(vnode_t vp, struct nfsclclient **clpp) } /* Now process the opens against the server. */ - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == nfhp->nfh_len && - !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, - nfhp->nfh_len)) { - /* Found an open, decrement cnt if possible */ - if (notdecr && op->nfso_opencnt > 0) { - notdecr = 0; - op->nfso_opencnt--; - } - /* - * There are more opens, so just return. - */ - if (op->nfso_opencnt > 0) { - NFSUNLOCKCLSTATE(); - return (0); - } + LIST_FOREACH(op, NFSCLOPENHASH(clp, nfhp->nfh_fh, nfhp->nfh_len), + nfso_hash) { + if (op->nfso_fhlen == nfhp->nfh_len && + !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, + nfhp->nfh_len)) { + /* Found an open, decrement cnt if possible */ + if (notdecr && op->nfso_opencnt > 0) { + notdecr = 0; + op->nfso_opencnt--; + } + /* + * There are more opens, so just return. + */ + if (op->nfso_opencnt > 0) { + NFSUNLOCKCLSTATE(); + return (0); } } } @@ -3310,24 +3301,21 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) /* Now process the opens against the server. */ lookformore: - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - op = LIST_FIRST(&owp->nfsow_open); - while (op != NULL) { - if (op->nfso_fhlen == nfhp->nfh_len && - !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, - nfhp->nfh_len)) { - /* Found an open, close it. */ + LIST_FOREACH(op, NFSCLOPENHASH(clp, nfhp->nfh_fh, nfhp->nfh_len), + nfso_hash) { + if (op->nfso_fhlen == nfhp->nfh_len && + !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, + nfhp->nfh_len)) { + /* Found an open, close it. */ #ifdef DIAGNOSTIC - KASSERT((op->nfso_opencnt == 0), - ("nfscl: bad open cnt on server (%d)", - op->nfso_opencnt)); + KASSERT((op->nfso_opencnt == 0), + ("nfscl: bad open cnt on server (%d)", + op->nfso_opencnt)); #endif - NFSUNLOCKCLSTATE(); - nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); - NFSLOCKCLSTATE(); - goto lookformore; - } - op = LIST_NEXT(op, nfso_list); + NFSUNLOCKCLSTATE(); + nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); + NFSLOCKCLSTATE(); + goto lookformore; } } NFSUNLOCKCLSTATE(); @@ -3956,7 +3944,6 @@ nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen, struct nfscllock *nlop, u_int8_t *own, struct nfscldeleg *dp, struct nfscllock **lopp) { - struct nfsclowner *owp; struct nfsclopen *op; int ret; @@ -3965,15 +3952,13 @@ nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen, if (ret) return (ret); } - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == fhlen && - !NFSBCMP(op->nfso_fh, fhp, fhlen)) { - ret = nfscl_checkconflict(&op->nfso_lock, nlop, - own, lopp); - if (ret) - return (ret); - } + LIST_FOREACH(op, NFSCLOPENHASH(clp, fhp, fhlen), nfso_hash) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, fhp, fhlen)) { + ret = nfscl_checkconflict(&op->nfso_lock, nlop, + own, lopp); + if (ret) + return (ret); } } return (0); From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8706C64C032; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KB83C69z4q7s; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5664F72F2; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE146H022185; Sat, 12 Jun 2021 14:01:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE14mp022184; Sat, 12 Jun 2021 14:01:04 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:04 GMT Message-Id: <202106121401.15CE14mp022184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2c89a8c9aae2 - stable/13 - Clean up the style in the arm64 bus.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c89a8c9aae25a20882bf33c0f291fab692f307a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:04 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2c89a8c9aae25a20882bf33c0f291fab692f307a commit 2c89a8c9aae25a20882bf33c0f291fab692f307a Author: Andrew Turner AuthorDate: 2021-04-08 09:41:23 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:11 +0000 Clean up the style in the arm64 bus.h MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 5998328e55f8850718a6b48842823eb0a6524ae6) --- sys/arm64/include/bus.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index 417b918f595f..5995aa0b4a79 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -79,12 +79,12 @@ #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFFUL #define BUS_SPACE_MAXSIZE_40BIT 0xFFFFFFFFFFUL -#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL -#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL +#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL #define BUS_SPACE_MAP_CACHEABLE 0x01 #define BUS_SPACE_MAP_LINEAR 0x02 -#define BUS_SPACE_MAP_PREFETCHABLE 0x04 +#define BUS_SPACE_MAP_PREFETCHABLE 0x04 #define BUS_SPACE_UNRESTRICTED (~0) @@ -133,7 +133,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rm_8) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* read region */ void (*bs_rr_1) (void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); @@ -143,7 +143,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rr_8) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* write single */ void (*bs_w_1) (void *, bus_space_handle_t, bus_size_t, u_int8_t); @@ -163,7 +163,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wm_8) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); - + /* write region */ void (*bs_wr_1) (void *, bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t); @@ -219,7 +219,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rm_8_s) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* read region stream */ void (*bs_rr_1_s) (void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); @@ -229,7 +229,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rr_8_s) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* write single stream */ void (*bs_w_1_s) (void *, bus_space_handle_t, bus_size_t, u_int8_t); @@ -249,7 +249,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wm_8_s) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); - + /* write region stream */ void (*bs_wr_1_s) (void *, bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t); @@ -259,6 +259,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wr_8_s) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); + /* peek */ int (*bs_peek_1)(void *, bus_space_handle_t, bus_size_t , uint8_t *); @@ -268,6 +269,7 @@ struct bus_space { bus_size_t , uint32_t *); int (*bs_peek_8)(void *, bus_space_handle_t, bus_size_t , uint64_t *); + /* poke */ int (*bs_poke_1)(void *, bus_space_handle_t, bus_size_t, uint8_t); @@ -341,9 +343,9 @@ struct bus_space { #define bus_space_read_4(t, h, o) __bs_rs(4,(t),(h),(o)) #define bus_space_read_8(t, h, o) __bs_rs(8,(t),(h),(o)) -#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) -#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) -#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) +#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) +#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) +#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) #define bus_space_read_stream_8(t, h, o) __bs_rs_s(8,(t), (h), (o)) /* From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAD6964C034; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KB94T5hz4pmF; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8204971D3; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE15it022209; Sat, 12 Jun 2021 14:01:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE15Ts022208; Sat, 12 Jun 2021 14:01:05 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:05 GMT Message-Id: <202106121401.15CE15Ts022208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a0dd2317e8f5 - stable/13 - Use if ... else when printing memory attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:05 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc commit a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc Author: Andrew Turner AuthorDate: 2021-04-11 09:00:00 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:12 +0000 Use if ... else when printing memory attributes In vmstat there is a switch statement that converts these attributes to a string. As some values can be duplicate we have to hide these from userspace. Replace this switch statement with an if ... else macro that lets us repeat values without a compiler error. Reviewed by: kib MFC after: 2 weeks Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D29703 (cherry picked from commit 15221c552b3cabcbf26613246e855010b176805a) --- usr.bin/vmstat/vmstat.c | 54 +++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index aae3af8aeef8..403dc6e2a054 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1538,66 +1538,48 @@ display_object(struct kinfo_vmobject *kvo) xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive); xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count); xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count); - switch (kvo->kvo_memattr) { + +#define MEMATTR_STR(type, val) \ + if (kvo->kvo_memattr == (type)) { \ + str = (val); \ + } else #ifdef VM_MEMATTR_UNCACHEABLE - case VM_MEMATTR_UNCACHEABLE: - str = "UC"; - break; + MEMATTR_STR(VM_MEMATTR_UNCACHEABLE, "UC") #endif #ifdef VM_MEMATTR_WRITE_COMBINING - case VM_MEMATTR_WRITE_COMBINING: - str = "WC"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_COMBINING, "WC") #endif #ifdef VM_MEMATTR_WRITE_THROUGH - case VM_MEMATTR_WRITE_THROUGH: - str = "WT"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_THROUGH, "WT") #endif #ifdef VM_MEMATTR_WRITE_PROTECTED - case VM_MEMATTR_WRITE_PROTECTED: - str = "WP"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_PROTECTED, "WP") #endif #ifdef VM_MEMATTR_WRITE_BACK - case VM_MEMATTR_WRITE_BACK: - str = "WB"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_BACK, "WB") #endif #ifdef VM_MEMATTR_WEAK_UNCACHEABLE - case VM_MEMATTR_WEAK_UNCACHEABLE: - str = "UC-"; - break; + MEMATTR_STR(VM_MEMATTR_WEAK_UNCACHEABLE, "UC-") #endif #ifdef VM_MEMATTR_WB_WA - case VM_MEMATTR_WB_WA: - str = "WB"; - break; + MEMATTR_STR(VM_MEMATTR_WB_WA, "WB") #endif #ifdef VM_MEMATTR_NOCACHE - case VM_MEMATTR_NOCACHE: - str = "NC"; - break; + MEMATTR_STR(VM_MEMATTR_NOCACHE, "NC") #endif #ifdef VM_MEMATTR_DEVICE - case VM_MEMATTR_DEVICE: - str = "DEV"; - break; + MEMATTR_STR(VM_MEMATTR_DEVICE, "DEV") #endif #ifdef VM_MEMATTR_CACHEABLE - case VM_MEMATTR_CACHEABLE: - str = "C"; - break; + MEMATTR_STR(VM_MEMATTR_CACHEABLE, "C") #endif #ifdef VM_MEMATTR_PREFETCHABLE - case VM_MEMATTR_PREFETCHABLE: - str = "PRE"; - break; + MEMATTR_STR(VM_MEMATTR_PREFETCHABLE, "PRE") #endif - default: + { str = "??"; - break; } +#undef MEMATTR_STR xo_emit("{:attribute/%-3s} ", str); switch (kvo->kvo_type) { case KVME_TYPE_NONE: From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8F7964C10F; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBB5fcFz4q81; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A74427884; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE16aE022233; Sat, 12 Jun 2021 14:01:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE16Nv022232; Sat, 12 Jun 2021 14:01:06 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:06 GMT Message-Id: <202106121401.15CE16Nv022232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 48e4430ea5a1 - stable/13 - Implement bus_map_resource on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48e4430ea5a1e82121a8fe486eb09986b9b62f0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:07 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=48e4430ea5a1e82121a8fe486eb09986b9b62f0f commit 48e4430ea5a1e82121a8fe486eb09986b9b62f0f Author: Andrew Turner AuthorDate: 2021-04-10 10:25:39 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:54 +0000 Implement bus_map_resource on arm64 This will allow us to allocate an unmapped memory resource, then later map it with a specific memory attribute. This is also needed for virtio with the modern PCI attachment. Reviewed by: kib (via D29723) Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D29694 (cherry picked from commit fe3822497726ab84a1e3753be41e43e4d51aab0b) --- sys/arm64/arm64/nexus.c | 77 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 924496ec7f52..cc28d87f002b 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -106,6 +106,8 @@ static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol); static struct resource_list *nexus_get_reslist(device_t, device_t); @@ -135,6 +137,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), @@ -344,10 +347,8 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_map map; int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; if ((err = rman_activate_resource(r)) != 0) return (err); @@ -355,18 +356,21 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, /* * If this is a memory resource, map it into the kernel. */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + err = nexus_map_resource(bus, child, type, r, NULL, + &map); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } + + rman_set_mapping(r, &map); } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - } else if (type == SYS_RES_IRQ) { + break; + case SYS_RES_IRQ: err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); @@ -420,6 +424,51 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, return (rman_deactivate_resource(r)); } +static int +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t end, length, start; + + /* Resources must be active to be mapped. */ + if ((rman_get_flags(r) & RF_ACTIVE) == 0) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + if (argsp != NULL) + bcopy(argsp, &args, imin(argsp->size, args.size)); + start = rman_get_start(r) + args.offset; + if (args.length == 0) + length = rman_get_size(r); + else + length = args.length; + end = start + length - 1; + if (start > rman_get_end(r) || start < rman_get_start(r)) + return (EINVAL); + if (end > rman_get_end(r) || end < start) + return (EINVAL); + + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + map->r_bustag = &memmap_bus; + map->r_size = length; + + /* + * The handle is the virtual address. + */ + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + #ifdef FDT static device_method_t nexus_fdt_methods[] = { /* Device interface */ From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33C7264BB5B; Sat, 12 Jun 2021 14:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBF0dnFz4q8C; Sat, 12 Jun 2021 14:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF45372F6; Sat, 12 Jun 2021 14:01:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE18OM022281; Sat, 12 Jun 2021 14:01:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE18Eq022280; Sat, 12 Jun 2021 14:01:08 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:08 GMT Message-Id: <202106121401.15CE18Eq022280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: abb9d448b32d - stable/13 - Update the EFI timer to be called once a second MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abb9d448b32dce5f80de68992315f0c71b6c8b81 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:09 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=abb9d448b32dce5f80de68992315f0c71b6c8b81 commit abb9d448b32dce5f80de68992315f0c71b6c8b81 Author: Andrew Turner AuthorDate: 2021-05-12 08:59:04 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:55 +0000 Update the EFI timer to be called once a second There is no need to call it evert 10ms when we need 1s granularity. Update to update the time every second. Reviewed by: imp, manu, tsoome Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D30227 (cherry picked from commit 93f7be080f3ad0bd71190d87aa2043d714270206) --- stand/efi/libefi/time_event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/efi/libefi/time_event.c b/stand/efi/libefi/time_event.c index f96f1d845f6a..f171bf997078 100644 --- a/stand/efi/libefi/time_event.c +++ b/stand/efi/libefi/time_event.c @@ -40,7 +40,7 @@ static void time_update(EFI_EVENT event, void *context) { - curtime += 10; + curtime++; } void @@ -50,8 +50,8 @@ efi_time_init(void) /* Create a timer event */ BS->CreateEvent(EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, time_update, 0, &time_event); - /* Use a 10ms timer */ - BS->SetTimer(time_event, TimerPeriodic, 100000); + /* Use a 1s timer */ + BS->SetTimer(time_event, TimerPeriodic, 10000000); } void @@ -68,7 +68,7 @@ time(time_t *tloc) { time_t t; - t = curtime / 1000; + t = curtime; if (tloc != NULL) *tloc = t; From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 115AB64BB58; Sat, 12 Jun 2021 14:01:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBC6WPWz4ppJ; Sat, 12 Jun 2021 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C84D376A1; Sat, 12 Jun 2021 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE17Gk022257; Sat, 12 Jun 2021 14:01:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE179T022256; Sat, 12 Jun 2021 14:01:07 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:07 GMT Message-Id: <202106121401.15CE179T022256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3699da67bf4d - stable/13 - Use '.arch_extension crc' in the arm64 crc32 code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3699da67bf4de9a1efe69d498ff4ec896b650dc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:08 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3699da67bf4de9a1efe69d498ff4ec896b650dc7 commit 3699da67bf4de9a1efe69d498ff4ec896b650dc7 Author: Andrew Turner AuthorDate: 2021-05-06 07:37:47 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:54 +0000 Use '.arch_extension crc' in the arm64 crc32 code We don't care about the base architecture here, just that the crc extension is enabled. Sponsored by: Innovate UK (cherry picked from commit 0ec3e991112d85a790ca3bbb4175652f37f4bd15) --- sys/libkern/arm64/crc32c_armv8.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/libkern/arm64/crc32c_armv8.S b/sys/libkern/arm64/crc32c_armv8.S index e5d0ff80d97b..6a1991262a33 100644 --- a/sys/libkern/arm64/crc32c_armv8.S +++ b/sys/libkern/arm64/crc32c_armv8.S @@ -27,7 +27,8 @@ #include __FBSDID("$FreeBSD$"); -.arch armv8-a+crc + +.arch_extension crc /* * uint32_t From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 14:01:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6616C64BCC6; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBG1h6Yz4ppS; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E938753B; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE19TC022311; Sat, 12 Jun 2021 14:01:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE19KX022308; Sat, 12 Jun 2021 14:01:09 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:09 GMT Message-Id: <202106121401.15CE19KX022308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b96893a48979 - stable/13 - Clean up early arm64 pmap code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b96893a489796750b1515cc46c725928e023dfd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:10 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b96893a489796750b1515cc46c725928e023dfd2 commit b96893a489796750b1515cc46c725928e023dfd2 Author: Andrew Turner AuthorDate: 2021-05-20 06:52:15 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:55 +0000 Clean up early arm64 pmap code Early in the arm64 pmap code we need to translate between a virtual address and a physical address. Rather than manually walking the page table we can ask the hardware to do it for us. Reviewed by: kib, markj Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D30357 (cherry picked from commit e779604f1d4e5fd0cdf3a9d1bb756b168f97b39c) --- sys/arm64/arm64/locore.S | 6 ------ sys/arm64/arm64/pmap.c | 28 +++------------------------- sys/arm64/include/vmparam.h | 1 - 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index c62a2a5bd626..48dd794116cd 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -756,10 +756,6 @@ ENTRY(abort) b abort END(abort) - .align 3 -init_pt_va: - .quad pagetable /* XXX: Keep page tables VA */ - .section .init_pagetable, "aw", %nobits .align PAGE_SHIFT /* @@ -792,8 +788,6 @@ pagetable_end: el2_pagetable: .space PAGE_SIZE - .globl init_pt_va - .align 4 initstack: .space (PAGE_SIZE * KSTACK_PAGES) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index d4047fc84096..efe6bdd3d034 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -742,35 +742,13 @@ pmap_resident_count_dec(pmap_t pmap, int count) pmap->pm_stats.resident_count -= count; } -static pt_entry_t * -pmap_early_page_idx(vm_offset_t l1pt, vm_offset_t va, u_int *l1_slot, - u_int *l2_slot) -{ - pt_entry_t *l2; - pd_entry_t *l1; - - l1 = (pd_entry_t *)l1pt; - *l1_slot = (va >> L1_SHIFT) & Ln_ADDR_MASK; - - /* Check locore has used a table L1 map */ - KASSERT((l1[*l1_slot] & ATTR_DESCR_MASK) == L1_TABLE, - ("Invalid bootstrap L1 table")); - /* Find the address of the L2 table */ - l2 = (pt_entry_t *)init_pt_va; - *l2_slot = pmap_l2_index(va); - - return (l2); -} - static vm_paddr_t pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va) { - u_int l1_slot, l2_slot; - pt_entry_t *l2; - - l2 = pmap_early_page_idx(l1pt, va, &l1_slot, &l2_slot); + vm_paddr_t pa_page; - return ((l2[l2_slot] & ~ATTR_MASK) + (va & L2_OFFSET)); + pa_page = arm64_address_translate_s1e1r(va) & PAR_PA_MASK; + return (pa_page | (va & PAR_LOW_MASK)); } static vm_offset_t diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h index 4a90c7711e01..a42c68d52887 100644 --- a/sys/arm64/include/vmparam.h +++ b/sys/arm64/include/vmparam.h @@ -228,7 +228,6 @@ extern vm_paddr_t dmap_phys_base; extern vm_paddr_t dmap_phys_max; extern vm_offset_t dmap_max_addr; extern vm_offset_t vm_max_kernel_address; -extern vm_offset_t init_pt_va; #endif From owner-dev-commits-src-branches@freebsd.org Sat Jun 12 17:35:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6784E64EA99; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2PxX29mtz3JBj; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DD3012824; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CHZScJ003577; Sat, 12 Jun 2021 17:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CHZS6O003576; Sat, 12 Jun 2021 17:35:28 GMT (envelope-from git) Date: Sat, 12 Jun 2021 17:35:28 GMT Message-Id: <202106121735.15CHZS6O003576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a3a907abbf60 - stable/13 - hyperv: register intr handler as usermode-mapped if loaded as module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3a907abbf60203278167db59d2c1efd97f239a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 17:35:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a907abbf60203278167db59d2c1efd97f239a1 commit a3a907abbf60203278167db59d2c1efd97f239a1 Author: Konstantin Belousov AuthorDate: 2021-01-12 16:35:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-12 16:58:02 +0000 hyperv: register intr handler as usermode-mapped if loaded as module (cherry picked from commit fe7d7ac40881c9d01a54bf57fff71a3af199f237) --- sys/dev/hyperv/vmbus/vmbus.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index d3568494405e..929eff33e7c9 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include @@ -139,6 +143,7 @@ SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); extern inthand_t IDTVEC(vmbus_isr), IDTVEC(vmbus_isr_pti); +#define VMBUS_ISR_ADDR trunc_page((uintptr_t)IDTVEC(vmbus_isr_pti)) uint32_t vmbus_current_version; @@ -980,6 +985,10 @@ vmbus_intr_setup(struct vmbus_softc *sc) vmbus_msg_task, sc); } +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_add_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE, true); +#endif + /* * All Hyper-V ISR required resources are setup, now let's find a * free IDT vector for Hyper-V ISR and set it up. @@ -987,6 +996,9 @@ vmbus_intr_setup(struct vmbus_softc *sc) sc->vmbus_idtvec = lapic_ipi_alloc(pti ? IDTVEC(vmbus_isr_pti) : IDTVEC(vmbus_isr)); if (sc->vmbus_idtvec < 0) { +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE); +#endif device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); return ENXIO; } @@ -1007,6 +1019,10 @@ vmbus_intr_teardown(struct vmbus_softc *sc) sc->vmbus_idtvec = -1; } +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE); +#endif + CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, event_tq, cpu) != NULL) { taskqueue_free(VMBUS_PCPU_GET(sc, event_tq, cpu)); From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:38:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5F7B654004; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfR4ry2z4j36; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A01F187C5; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c7XI038237; Sun, 13 Jun 2021 01:38:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c7kP038236; Sun, 13 Jun 2021 01:38:07 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:07 GMT Message-Id: <202106130138.15D1c7kP038236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0379dc900e53 - stable/13 - kern_exec.c: Add execve_nosetid() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0379dc900e5304d3915ca82110445f2bcc415fcb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0379dc900e5304d3915ca82110445f2bcc415fcb commit 0379dc900e5304d3915ca82110445f2bcc415fcb Author: Konstantin Belousov AuthorDate: 2021-01-14 13:36:15 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:32 +0000 kern_exec.c: Add execve_nosetid() helper (cherry picked from commit 19e6043a443ea51207786b85c8d62d070ec36005) --- sys/kern/kern_exec.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3de6ac565db5..1df422dec08e 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -353,6 +353,16 @@ kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, return (do_execve(td, args, mac_p, oldvmspace)); } +static void +execve_nosetid(struct image_params *imgp) +{ + imgp->credential_setid = false; + if (imgp->newcred != NULL) { + crfree(imgp->newcred); + imgp->newcred = NULL; + } +} + /* * In-kernel implementation of execve(). All arguments are assumed to be * userspace pointers from the passed thread. @@ -639,11 +649,7 @@ interpret: vput(newtextvp); vm_object_deallocate(imgp->object); imgp->object = NULL; - imgp->credential_setid = false; - if (imgp->newcred != NULL) { - crfree(imgp->newcred); - imgp->newcred = NULL; - } + execve_nosetid(imgp); imgp->execpath = NULL; free(imgp->freepath, M_TEMP); imgp->freepath = NULL; From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:38:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5C1A6534DF; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfS5BDrz4j7J; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BCF3188FB; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c8Go038267; Sun, 13 Jun 2021 01:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c8iA038266; Sun, 13 Jun 2021 01:38:08 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:08 GMT Message-Id: <202106130138.15D1c8iA038266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ff59c9de3274 - stable/13 - sysent: allow ABI to disable setid on exec. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f commit ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f Author: Konstantin Belousov AuthorDate: 2021-01-14 13:38:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:32 +0000 sysent: allow ABI to disable setid on exec. (cherry picked from commit 2d423f7671fe452486932c8e41e7d3547afe82aa) --- sys/kern/kern_exec.c | 4 ++++ sys/sys/sysent.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1df422dec08e..3413a5d024d4 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -774,6 +774,10 @@ interpret: signotify(td); } + if (imgp->sysent->sv_setid_allowed != NULL && + !(*imgp->sysent->sv_setid_allowed)(td, imgp)) + execve_nosetid(imgp); + /* * Implement image setuid/setgid installation. */ diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index e6db2ec3dfb1..4a707b41e020 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -148,6 +148,8 @@ struct sysentvec { void (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); + bool (*sv_setid_allowed)(struct thread *td, + struct image_params *imgp); }; #define SV_ILP32 0x000100 /* 32-bit executable. */ From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:38:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 162216538F8; Sun, 13 Jun 2021 01:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfT73vgz4j7M; Sun, 13 Jun 2021 01:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D878018766; Sun, 13 Jun 2021 01:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c9Wr038292; Sun, 13 Jun 2021 01:38:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c9aZ038291; Sun, 13 Jun 2021 01:38:09 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:09 GMT Message-Id: <202106130138.15D1c9aZ038291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dc107fe1f939 - stable/13 - linuxolator: Add compat.linux.setid_allowed knob MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc107fe1f939c7d4c5575868202b4cd3edf3e846 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc107fe1f939c7d4c5575868202b4cd3edf3e846 commit dc107fe1f939c7d4c5575868202b4cd3edf3e846 Author: Konstantin Belousov AuthorDate: 2021-01-14 13:51:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 linuxolator: Add compat.linux.setid_allowed knob PR: 21463 (cherry picked from commit 598f6fb49c9ca688029b79de0a44227ab79c608c) --- share/man/man4/linux.4 | 14 +++++++++++++- sys/amd64/linux/linux_sysvec.c | 1 + sys/amd64/linux32/linux32_sysvec.c | 1 + sys/arm64/linux/linux_sysvec.c | 1 + sys/compat/linux/linux_mib.c | 12 ++++++++++++ sys/compat/linux/linux_mib.h | 3 +++ sys/i386/linux/linux_sysvec.c | 2 ++ 7 files changed, 33 insertions(+), 1 deletion(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 23bc0c26f7f9..b2d36158c622 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2020 +.Dd May 6, 2021 .Dt LINUX 4 .Os .Sh NAME @@ -130,6 +130,18 @@ From a user perspective, this makes .Va SIGINFO work for Linux executables. Defaults to 0. +.It Va compat.linux.setid_allowed +Disable handling of set-user-ID and set-group-ID mode bits for the new +process image file when image is to be executed under Linux ABI. +When set, new Linux images always use credentials of the program +that issued +.Xr execve 2 +call, regardless of the image file mode. +.Pp +This might be reasonable or even required, because +.Fx +does not emulate Linux environment completely, and missed features +could become holes. .El .Sh FILES .Bl -tag -width /compat/linux/dev/shm -compact diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 252579a4809e..3766cea5e699 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -763,6 +763,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 3790d0fcb69c..2fd246086810 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -930,6 +930,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index e20e0fd32b91..7c88b0d9f2ea 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -441,6 +441,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index cc4207f74a39..3a6627df9abd 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -99,6 +99,18 @@ int linux_use_emul_path = 1; SYSCTL_INT(_compat_linux, OID_AUTO, use_emul_path, CTLFLAG_RWTUN, &linux_use_emul_path, 0, "Use linux.compat.emul_path"); +static bool linux_setid_allowed = true; +SYSCTL_BOOL(_compat_linux, OID_AUTO, setid_allowed, CTLFLAG_RWTUN, + &linux_setid_allowed, 0, + "Allow setuid/setgid on execve of Linux binary"); + +bool +linux_setid_allowed_query(struct thread *td __unused, + struct image_params *imgp __unused) +{ + return (linux_setid_allowed); +} + static int linux_set_osname(struct thread *td, char *osname); static int linux_set_osrelease(struct thread *td, char *osrelease); static int linux_set_oss_version(struct thread *td, int oss_version); diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 0a1baec39826..49da02da44df 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -70,4 +70,7 @@ extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; +struct image_params; +bool linux_setid_allowed_query(struct thread *td, struct image_params *imgp); + #endif /* _LINUX_MIB_H_ */ diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index ef845675aaa4..1c92dafa7dcc 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -871,6 +871,7 @@ struct sysentvec linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); @@ -908,6 +909,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:38:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AD02654080; Sun, 13 Jun 2021 01:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfW0cGYz4j59; Sun, 13 Jun 2021 01:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D82EE18AA2; Sun, 13 Jun 2021 01:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1cAOM038316; Sun, 13 Jun 2021 01:38:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1cAAl038315; Sun, 13 Jun 2021 01:38:10 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:10 GMT Message-Id: <202106130138.15D1cAAl038315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: af3dce614155 - stable/13 - Change the return type of sv__setid_allowed from bool to int MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af3dce614155dd3264c7248e0fd082d2c214890a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:11 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=af3dce614155dd3264c7248e0fd082d2c214890a commit af3dce614155dd3264c7248e0fd082d2c214890a Author: Konstantin Belousov AuthorDate: 2021-06-06 20:38:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 Change the return type of sv__setid_allowed from bool to int (cherry picked from commit 62b8258a7e43f3c774f13eab758b2cfdf353073e) --- sys/compat/linux/linux_mib.c | 2 +- sys/compat/linux/linux_mib.h | 2 +- sys/sys/sysent.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index 3a6627df9abd..13beba323787 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -104,7 +104,7 @@ SYSCTL_BOOL(_compat_linux, OID_AUTO, setid_allowed, CTLFLAG_RWTUN, &linux_setid_allowed, 0, "Allow setuid/setgid on execve of Linux binary"); -bool +int linux_setid_allowed_query(struct thread *td __unused, struct image_params *imgp __unused) { diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 49da02da44df..8f2b87e5f3a6 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -71,6 +71,6 @@ extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; struct image_params; -bool linux_setid_allowed_query(struct thread *td, struct image_params *imgp); +int linux_setid_allowed_query(struct thread *td, struct image_params *imgp); #endif /* _LINUX_MIB_H_ */ diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 4a707b41e020..c2cbd77a92b9 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -148,7 +148,7 @@ struct sysentvec { void (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); - bool (*sv_setid_allowed)(struct thread *td, + int (*sv_setid_allowed)(struct thread *td, struct image_params *imgp); }; From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78DAF6541D2; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpN2rF8z4jbQ; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 495C118CAA; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j0gH051802; Sun, 13 Jun 2021 01:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j0lc051801; Sun, 13 Jun 2021 01:45:00 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:00 GMT Message-Id: <202106130145.15D1j0lc051801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 11cfede1e62a - stable/13 - accounting: explicitly mark the exiting thread as doing accounting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11cfede1e62afa1ff00cf97107bc48ebe1561ecb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:00 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=11cfede1e62afa1ff00cf97107bc48ebe1561ecb commit 11cfede1e62afa1ff00cf97107bc48ebe1561ecb Author: Konstantin Belousov AuthorDate: 2021-05-13 23:48:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 accounting: explicitly mark the exiting thread as doing accounting (cherry picked from commit 9bb84c23e762e7d1b6154ef4afdcc80662692e76) --- sys/kern/kern_acct.c | 26 +++++--------------------- sys/kern/vfs_vnops.c | 3 ++- sys/sys/proc.h | 1 + 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 675113c6b2ba..4c1efada10da 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -141,7 +141,6 @@ static int acct_configured; static int acct_suspended; static struct vnode *acct_vp; static struct ucred *acct_cred; -static struct plimit *acct_limit; static int acct_flags; static struct sx acct_sx; @@ -206,7 +205,7 @@ int sys_acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, i, replacing; + int error, flags, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -276,15 +275,6 @@ sys_acct(struct thread *td, struct acct_args *uap) return (error); } - /* - * Create our own plimit object without limits. It will be assigned - * to exiting processes. - */ - acct_limit = lim_alloc(); - for (i = 0; i < RLIM_NLIMITS; i++) - acct_limit->pl_rlimit[i].rlim_cur = - acct_limit->pl_rlimit[i].rlim_max = RLIM_INFINITY; - /* * Save the new accounting file vnode, and schedule the new * free space watcher. @@ -328,7 +318,6 @@ acct_disable(struct thread *td, int logging) sx_assert(&acct_sx, SX_XLOCKED); error = vn_close(acct_vp, acct_flags, acct_cred, td); crfree(acct_cred); - lim_free(acct_limit); acct_configured = 0; acct_vp = NULL; acct_cred = NULL; @@ -349,7 +338,6 @@ acct_process(struct thread *td) { struct acctv3 acct; struct timeval ut, st, tmp; - struct plimit *oldlim; struct proc *p; struct rusage ru; int t, ret; @@ -374,6 +362,7 @@ acct_process(struct thread *td) } p = td->td_proc; + td->td_pflags2 |= TDP2_ACCT; /* * Get process accounting information. @@ -426,20 +415,14 @@ acct_process(struct thread *td) /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flagx = p->p_acflag; + PROC_UNLOCK(p); + /* Setup ancillary structure fields. */ acct.ac_flagx |= ANVER; acct.ac_zero = 0; acct.ac_version = 3; acct.ac_len = acct.ac_len2 = sizeof(acct); - /* - * Eliminate rlimits (file size limit in particular). - */ - oldlim = p->p_limit; - p->p_limit = lim_hold(acct_limit); - PROC_UNLOCK(p); - lim_free(oldlim); - /* * Write the accounting information to the file. */ @@ -447,6 +430,7 @@ acct_process(struct thread *td) (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, NULL, td); sx_sunlock(&acct_sx); + td->td_pflags2 &= ~TDP2_ACCT; return (ret); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 4ce4678f292f..8be30df40dc5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2361,7 +2361,8 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { - if (vp->v_type != VREG || td == NULL) + if (vp->v_type != VREG || td == NULL || + (td->td_pflags2 & TDP2_ACCT) != 0) return (0); if ((uoff_t)uio->uio_offset + uio->uio_resid > lim_cur(td, RLIMIT_FSIZE)) { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b0fc13a449cb..b47af58c34be 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -527,6 +527,7 @@ do { \ #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ +#define TDP2_ACCT 0x00000004 /* Doing accounting */ /* * Reasons that the current thread can not be run yet. From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCEBB6540DA; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpP3xgyz4jbS; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDC118ACB; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j1W8051833; Sun, 13 Jun 2021 01:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j1GS051832; Sun, 13 Jun 2021 01:45:01 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:01 GMT Message-Id: <202106130145.15D1j1GS051832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 31df316c108b - stable/13 - ktrace: do not stop tracing other processes if our cannot write to this vnode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31df316c108b073478f3b04eef422abd8011018b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:01 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31df316c108b073478f3b04eef422abd8011018b commit 31df316c108b073478f3b04eef422abd8011018b Author: Konstantin Belousov AuthorDate: 2021-05-15 00:10:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: do not stop tracing other processes if our cannot write to this vnode (cherry picked from commit a6144f713cee8f522150b1398b225eedbf4cfef1) --- sys/kern/kern_ktrace.c | 53 ++++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index d0f7e0067064..26fba786e1e9 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1192,7 +1192,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) struct uio auio; struct iovec aiov[3]; struct mount *mp; - int datalen, buflen, vrele_count; + int datalen, buflen; int error; /* @@ -1266,44 +1266,29 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) } /* - * If error encountered, give up tracing on this vnode. We defer - * all the vrele()'s on the vnode until after we are finished walking - * the various lists to avoid needlessly holding locks. - * NB: at this point we still hold the vnode reference that must - * not go away as we need the valid vnode to compare with. Thus let - * vrele_count start at 1 and the reference will be freed - * by the loop at the end after our last use of vp. - */ - log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n", - error); - vrele_count = 1; - /* - * First, clear this vnode from being used by any processes in the - * system. - * XXX - If one process gets an EPERM writing to the vnode, should - * we really do this? Other processes might have suitable - * credentials for the operation. + * If error encountered, give up tracing on this vnode on this + * process. Other processes might still be suitable for + * writes to this vnode. */ + p = td->td_proc; + log(LOG_NOTICE, + "ktrace write failed, errno %d, tracing stopped for pid %d\n", + error, p->p_pid); cred = NULL; sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_tracevp == vp) { - mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, NULL); - mtx_unlock(&ktrace_mtx); - vrele_count++; - } - PROC_UNLOCK(p); - if (cred != NULL) { - crfree(cred); - cred = NULL; - } + PROC_LOCK(p); + mtx_lock(&ktrace_mtx); + if (p->p_tracevp == vp) + ktr_freeproc(p, &cred, NULL); + mtx_unlock(&ktrace_mtx); + PROC_UNLOCK(p); + if (cred != NULL) { + crfree(cred); + cred = NULL; } sx_sunlock(&allproc_lock); - - while (vrele_count-- > 0) - vrele(vp); + vrele(vp); + vrele(vp); } /* From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECB056540DC; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpQ59ffz4jMG; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8882E18ACC; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j2Ef051857; Sun, 13 Jun 2021 01:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j2nw051856; Sun, 13 Jun 2021 01:45:02 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:02 GMT Message-Id: <202106130145.15D1j2nw051856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ce0cef608e45 - stable/13 - ktrace: pack all ktrace parameters into allocated structure ktr_io_params MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 commit ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 Author: Konstantin Belousov AuthorDate: 2021-05-14 23:22:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: pack all ktrace parameters into allocated structure ktr_io_params (cherry picked from commit 1762f674ccb571e6b03c009906dd1af3c6343f9b) --- sys/kern/kern_descrip.c | 6 +- sys/kern/kern_exec.c | 16 ++-- sys/kern/kern_ktrace.c | 234 ++++++++++++++++++++++++++++++------------------ sys/kern/kern_proc.c | 5 +- sys/sys/ktrace.h | 6 +- sys/sys/proc.h | 4 +- 6 files changed, 165 insertions(+), 106 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 585f2124eab1..36092c9acd42 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -79,9 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE #include -#endif #include @@ -4384,9 +4382,7 @@ kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, PROC_LOCK_ASSERT(p, MA_OWNED); /* ktrace vnode */ - tracevp = p->p_tracevp; - if (tracevp != NULL) - vrefact(tracevp); + tracevp = ktr_get_tracevp(p, true); /* text vnode */ textvp = p->p_textvp; if (textvp != NULL) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3413a5d024d4..2936e246f706 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -382,8 +382,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, struct pargs *oldargs = NULL, *newargs = NULL; struct sigacts *oldsigacts = NULL, *newsigacts = NULL; #ifdef KTRACE - struct vnode *tracevp = NULL; - struct ucred *tracecred = NULL; + struct ktr_io_params *kiop; #endif struct vnode *oldtextvp = NULL, *newtextvp; int credential_changing; @@ -399,6 +398,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, static const char fexecv_proc_title[] = "(fexecv)"; imgp = &image_params; + kiop = NULL; /* * Lock the process and set the P_INEXEC flag to indicate that @@ -788,11 +788,10 @@ interpret: * we do not regain any tracing during a possible block. */ setsugid(p); + kiop = NULL; #ifdef KTRACE - if (p->p_tracecred != NULL && - priv_check_cred(p->p_tracecred, PRIV_DEBUG_DIFFCRED)) - ktrprocexec(p, &tracecred, &tracevp); + kiop = ktrprocexec(p); #endif /* * Close any file descriptors 0..2 that reference procfs, @@ -947,12 +946,7 @@ exec_fail: */ if (oldtextvp != NULL) vrele(oldtextvp); -#ifdef KTRACE - if (tracevp != NULL) - vrele(tracevp); - if (tracecred != NULL) - crfree(tracecred); -#endif + ktr_io_params_free(kiop); pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 26fba786e1e9..c923149ed129 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -145,20 +145,27 @@ static int print_message = 1; static struct mtx ktrace_mtx; static struct sx ktrace_sx; +struct ktr_io_params { + struct vnode *vp; + struct ucred *cr; + u_int refs; +}; + static void ktrace_init(void *dummy); static int sysctl_kern_ktrace_request_pool(SYSCTL_HANDLER_ARGS); static u_int ktrace_resize_pool(u_int oldsize, u_int newsize); static struct ktr_request *ktr_getrequest_entered(struct thread *td, int type); static struct ktr_request *ktr_getrequest(int type); static void ktr_submitrequest(struct thread *td, struct ktr_request *req); -static void ktr_freeproc(struct proc *p, struct ucred **uc, - struct vnode **vp); +static struct ktr_io_params *ktr_freeproc(struct proc *p); static void ktr_freerequest(struct ktr_request *req); static void ktr_freerequest_locked(struct ktr_request *req); static void ktr_writerequest(struct thread *td, struct ktr_request *req); static int ktrcanset(struct thread *,struct proc *); -static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *); -static int ktrops(struct thread *,struct proc *,int,int,struct vnode *); +static int ktrsetchildren(struct thread *, struct proc *, int, int, + struct ktr_io_params *); +static int ktrops(struct thread *, struct proc *, int, int, + struct ktr_io_params *); static void ktrprocctor_entered(struct thread *, struct proc *); /* @@ -421,28 +428,85 @@ ktr_freerequest_locked(struct ktr_request *req) STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); } +static void +ktr_io_params_ref(struct ktr_io_params *kiop) +{ + mtx_assert(&ktrace_mtx, MA_OWNED); + kiop->refs++; +} + +static struct ktr_io_params * +ktr_io_params_rele(struct ktr_io_params *kiop) +{ + mtx_assert(&ktrace_mtx, MA_OWNED); + if (kiop == NULL) + return (NULL); + KASSERT(kiop->refs > 0, ("kiop ref == 0 %p", kiop)); + return (--(kiop->refs) == 0 ? kiop : NULL); +} + +void +ktr_io_params_free(struct ktr_io_params *kiop) +{ + if (kiop == NULL) + return; + + MPASS(kiop->refs == 0); + vn_close(kiop->vp, FWRITE, kiop->cr, curthread); + crfree(kiop->cr); + free(kiop, M_KTRACE); +} + +static struct ktr_io_params * +ktr_io_params_alloc(struct thread *td, struct vnode *vp) +{ + struct ktr_io_params *res; + + res = malloc(sizeof(struct ktr_io_params), M_KTRACE, M_WAITOK); + res->vp = vp; + res->cr = crhold(td->td_ucred); + res->refs = 1; + return (res); +} + /* * Disable tracing for a process and release all associated resources. * The caller is responsible for releasing a reference on the returned * vnode and credentials. */ -static void -ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp) +static struct ktr_io_params * +ktr_freeproc(struct proc *p) { + struct ktr_io_params *kiop; struct ktr_request *req; PROC_LOCK_ASSERT(p, MA_OWNED); mtx_assert(&ktrace_mtx, MA_OWNED); - *uc = p->p_tracecred; - p->p_tracecred = NULL; - if (vp != NULL) - *vp = p->p_tracevp; - p->p_tracevp = NULL; + kiop = ktr_io_params_rele(p->p_ktrioparms); + p->p_ktrioparms = NULL; p->p_traceflag = 0; while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) { STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list); ktr_freerequest_locked(req); } + return (kiop); +} + +struct vnode * +ktr_get_tracevp(struct proc *p, bool ref) +{ + struct vnode *vp; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + if (p->p_ktrioparms != NULL) { + vp = p->p_ktrioparms->vp; + if (ref) + vrefact(vp); + } else { + vp = NULL; + } + return (vp); } void @@ -501,14 +565,21 @@ ktrsysret(int code, int error, register_t retval) * * XXX: We toss any pending asynchronous records. */ -void -ktrprocexec(struct proc *p, struct ucred **uc, struct vnode **vp) +struct ktr_io_params * +ktrprocexec(struct proc *p) { + struct ktr_io_params *kiop; PROC_LOCK_ASSERT(p, MA_OWNED); + + kiop = p->p_ktrioparms; + if (kiop == NULL || priv_check_cred(kiop->cr, PRIV_DEBUG_DIFFCRED)) + return (NULL); + mtx_lock(&ktrace_mtx); - ktr_freeproc(p, uc, vp); + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); + return (kiop); } /* @@ -520,8 +591,7 @@ ktrprocexit(struct thread *td) { struct ktr_request *req; struct proc *p; - struct ucred *cred; - struct vnode *vp; + struct ktr_io_params *kiop; p = td->td_proc; if (p->p_traceflag == 0) @@ -536,13 +606,10 @@ ktrprocexit(struct thread *td) sx_xunlock(&ktrace_sx); PROC_LOCK(p); mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, &vp); + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (vp != NULL) - vrele(vp); - if (cred != NULL) - crfree(cred); + ktr_io_params_free(kiop); ktrace_exit(td); } @@ -583,7 +650,7 @@ void ktrprocfork(struct proc *p1, struct proc *p2) { - MPASS(p2->p_tracevp == NULL); + MPASS(p2->p_ktrioparms == NULL); MPASS(p2->p_traceflag == 0); if (p1->p_traceflag == 0) @@ -593,12 +660,8 @@ ktrprocfork(struct proc *p1, struct proc *p2) mtx_lock(&ktrace_mtx); if (p1->p_traceflag & KTRFAC_INHERIT) { p2->p_traceflag = p1->p_traceflag; - if ((p2->p_tracevp = p1->p_tracevp) != NULL) { - VREF(p2->p_tracevp); - KASSERT(p1->p_tracecred != NULL, - ("ktrace vnode with no cred")); - p2->p_tracecred = crhold(p1->p_tracecred); - } + if ((p2->p_ktrioparms = p1->p_ktrioparms) != NULL) + p1->p_ktrioparms->refs++; } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p1); @@ -934,7 +997,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) int nfound, ret = 0; int flags, error = 0; struct nameidata nd; - struct ucred *cred; + struct ktr_io_params *kiop, *old_kiop; /* * Need something to (un)trace. @@ -942,6 +1005,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) if (ops != KTROP_CLEARFILE && facs == 0) return (EINVAL); + kiop = NULL; ktrace_enter(td); if (ops != KTROP_CLEAR) { /* @@ -962,34 +1026,34 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) ktrace_exit(td); return (EACCES); } + kiop = ktr_io_params_alloc(td, vp); } /* * Clear all uses of the tracefile. */ if (ops == KTROP_CLEARFILE) { - int vrele_count; - - vrele_count = 0; +restart: sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { + old_kiop = NULL; PROC_LOCK(p); - if (p->p_tracevp == vp) { + if (p->p_ktrioparms != NULL && + p->p_ktrioparms->vp == vp) { if (ktrcanset(td, p)) { mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, NULL); + old_kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); - vrele_count++; - crfree(cred); } else error = EPERM; } PROC_UNLOCK(p); + if (old_kiop != NULL) { + sx_sunlock(&allproc_lock); + ktr_io_params_free(old_kiop); + goto restart; + } } sx_sunlock(&allproc_lock); - if (vrele_count > 0) { - while (vrele_count-- > 0) - vrele(vp); - } goto done; } /* @@ -1021,9 +1085,9 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) } nfound++; if (descend) - ret |= ktrsetchildren(td, p, ops, facs, vp); + ret |= ktrsetchildren(td, p, ops, facs, kiop); else - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, kiop); } if (nfound == 0) { sx_sunlock(&proctree_lock); @@ -1046,16 +1110,20 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) goto done; } if (descend) - ret |= ktrsetchildren(td, p, ops, facs, vp); + ret |= ktrsetchildren(td, p, ops, facs, kiop); else - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, kiop); } sx_sunlock(&proctree_lock); if (!ret) error = EPERM; done: - if (vp != NULL) - (void) vn_close(vp, FWRITE, td->td_ucred, td); + if (kiop != NULL) { + mtx_lock(&ktrace_mtx); + kiop = ktr_io_params_rele(kiop); + mtx_unlock(&ktrace_mtx); + ktr_io_params_free(kiop); + } ktrace_exit(td); return (error); #else /* !KTRACE */ @@ -1099,10 +1167,10 @@ sys_utrace(struct thread *td, struct utrace_args *uap) #ifdef KTRACE static int -ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) +ktrops(struct thread *td, struct proc *p, int ops, int facs, + struct ktr_io_params *new_kiop) { - struct vnode *tracevp = NULL; - struct ucred *tracecred = NULL; + struct ktr_io_params *old_kiop; PROC_LOCK_ASSERT(p, MA_OWNED); if (!ktrcanset(td, p)) { @@ -1114,19 +1182,18 @@ ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) PROC_UNLOCK(p); return (1); } + old_kiop = NULL; mtx_lock(&ktrace_mtx); if (ops == KTROP_SET) { - if (p->p_tracevp != vp) { - /* - * if trace file already in use, relinquish below - */ - tracevp = p->p_tracevp; - VREF(vp); - p->p_tracevp = vp; + if (p->p_ktrioparms != NULL && + p->p_ktrioparms->vp != new_kiop->vp) { + /* if trace file already in use, relinquish below */ + old_kiop = ktr_io_params_rele(p->p_ktrioparms); + p->p_ktrioparms = NULL; } - if (p->p_tracecred != td->td_ucred) { - tracecred = p->p_tracecred; - p->p_tracecred = crhold(td->td_ucred); + if (p->p_ktrioparms == NULL) { + p->p_ktrioparms = new_kiop; + ktr_io_params_ref(new_kiop); } p->p_traceflag |= facs; if (priv_check(td, PRIV_KTRACE) == 0) @@ -1135,23 +1202,20 @@ ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) /* KTROP_CLEAR */ if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) /* no more tracing */ - ktr_freeproc(p, &tracecred, &tracevp); + old_kiop = ktr_freeproc(p); } mtx_unlock(&ktrace_mtx); if ((p->p_traceflag & KTRFAC_MASK) != 0) ktrprocctor_entered(td, p); PROC_UNLOCK(p); - if (tracevp != NULL) - vrele(tracevp); - if (tracecred != NULL) - crfree(tracecred); + ktr_io_params_free(old_kiop); return (1); } static int ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, - struct vnode *vp) + struct ktr_io_params *new_kiop) { struct proc *p; int ret = 0; @@ -1160,7 +1224,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, PROC_LOCK_ASSERT(p, MA_OWNED); sx_assert(&proctree_lock, SX_LOCKED); for (;;) { - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, new_kiop); /* * If this process has children, descend to them next, * otherwise do any siblings, and if done with this level, @@ -1185,6 +1249,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, static void ktr_writerequest(struct thread *td, struct ktr_request *req) { + struct ktr_io_params *kiop; struct ktr_header *kth; struct vnode *vp; struct proc *p; @@ -1195,6 +1260,8 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) int datalen, buflen; int error; + p = td->td_proc; + /* * We hold the vnode and credential for use in I/O in case ktrace is * disabled on the process as we write out the request. @@ -1203,20 +1270,22 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) * the vnode has been closed. */ mtx_lock(&ktrace_mtx); - vp = td->td_proc->p_tracevp; - cred = td->td_proc->p_tracecred; + + kiop = p->p_ktrioparms; /* - * If vp is NULL, the vp has been cleared out from under this - * request, so just drop it. Make sure the credential and vnode are - * in sync: we should have both or neither. + * If kiop is NULL, it has been cleared out from under this + * request, so just drop it. */ - if (vp == NULL) { - KASSERT(cred == NULL, ("ktr_writerequest: cred != NULL")); + if (kiop == NULL) { mtx_unlock(&ktrace_mtx); return; } - VREF(vp); + + vp = kiop->vp; + cred = kiop->cr; + + vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); crhold(cred); mtx_unlock(&ktrace_mtx); @@ -1260,7 +1329,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) VOP_UNLOCK(vp); vn_finished_write(mp); crfree(cred); - if (!error) { + if (error == 0) { vrele(vp); return; } @@ -1270,24 +1339,17 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) * process. Other processes might still be suitable for * writes to this vnode. */ - p = td->td_proc; log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped for pid %d\n", error, p->p_pid); - cred = NULL; - sx_slock(&allproc_lock); + PROC_LOCK(p); mtx_lock(&ktrace_mtx); - if (p->p_tracevp == vp) - ktr_freeproc(p, &cred, NULL); + if (p->p_ktrioparms != NULL && p->p_ktrioparms->vp == vp) + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (cred != NULL) { - crfree(cred); - cred = NULL; - } - sx_sunlock(&allproc_lock); - vrele(vp); + ktr_io_params_free(kiop); vrele(vp); } diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 33f168836370..ec732e8db060 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#endif #ifdef DDB #include @@ -1058,7 +1061,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_args = p->p_args; kp->ki_textvp = p->p_textvp; #ifdef KTRACE - kp->ki_tracep = p->p_tracevp; + kp->ki_tracep = ktr_get_tracevp(p, false); kp->ki_traceflag = p->p_traceflag; #endif kp->ki_fd = p->p_fd; diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index a0b02f7d3ac5..c4ab985722c0 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -265,6 +265,10 @@ struct ktr_struct_array { #define KTRFAC_DROP 0x20000000 /* last event was dropped */ #ifdef _KERNEL +struct ktr_io_params; + +struct vnode *ktr_get_tracevp(struct proc *, bool); +void ktr_io_params_free(struct ktr_io_params *); void ktrnamei(char *); void ktrcsw(int, int, const char *); void ktrpsig(int, sig_t, sigset_t *, int); @@ -275,7 +279,7 @@ void ktrsyscall(int, int narg, register_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); void ktrprocctor(struct proc *); -void ktrprocexec(struct proc *, struct ucred **, struct vnode **); +struct ktr_io_params *ktrprocexec(struct proc *); void ktrprocexit(struct thread *); void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b47af58c34be..fb5714818163 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -650,8 +650,8 @@ struct proc { int p_profthreads; /* (c) Num threads in addupc_task. */ volatile int p_exitthreads; /* (j) Number of threads exiting */ int p_traceflag; /* (o) Kernel trace points. */ - struct vnode *p_tracevp; /* (c + o) Trace to vnode. */ - struct ucred *p_tracecred; /* (o) Credentials to trace with. */ + struct ktr_io_params *p_ktrioparms; /* (c + o) Params for ktrace. */ + void *p_pad0; struct vnode *p_textvp; /* (b) Vnode of executable. */ u_int p_lock; /* (c) Proclock (prevent swap) count. */ struct sigiolst p_sigiolst; /* (c) List of sigio sources. */ From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B70654239; Sun, 13 Jun 2021 01:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpT0Jw9z4jPq; Sun, 13 Jun 2021 01:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA05E187E6; Sun, 13 Jun 2021 01:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j4vD051905; Sun, 13 Jun 2021 01:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j4D1051904; Sun, 13 Jun 2021 01:45:04 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:04 GMT Message-Id: <202106130145.15D1j4D1051904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a34a4807c9f7 - stable/13 - ktrace: add a kern.ktrace.filesize_limit_signal knob MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a34a4807c9f7fa4001e4b4fa8bf319b08b51390f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a34a4807c9f7fa4001e4b4fa8bf319b08b51390f commit a34a4807c9f7fa4001e4b4fa8bf319b08b51390f Author: Konstantin Belousov AuthorDate: 2021-05-18 16:05:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: add a kern.ktrace.filesize_limit_signal knob (cherry picked from commit ea2b64c2413355ac0d5fc6ff597342e9437a34d4) --- sys/kern/kern_ktrace.c | 10 ++++++++++ sys/kern/vfs_vnops.c | 10 +++++++--- sys/sys/ktrace.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index d44f6b9ab994..9568a752d820 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -142,6 +142,16 @@ u_int ktr_geniosize = PAGE_SIZE; SYSCTL_UINT(_kern_ktrace, OID_AUTO, genio_size, CTLFLAG_RWTUN, &ktr_geniosize, 0, "Maximum size of genio event payload"); +/* + * Allow to not to send signal to traced process, in which context the + * ktr record is written. The limit is applied from the process that + * set up ktrace, so killing the traced process is not completely fair. + */ +int ktr_filesize_limit_signal = 0; +SYSCTL_INT(_kern_ktrace, OID_AUTO, filesize_limit_signal, CTLFLAG_RWTUN, + &ktr_filesize_limit_signal, 0, + "Send SIGXFSZ to the traced process when the log size limit is exceeded"); + static int print_message = 1; static struct mtx ktrace_mtx; static struct sx ktrace_sx; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index fb94b1470a2d..9c3d261a25c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2361,6 +2362,7 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { off_t lim; + bool ktr_write; if (vp->v_type != VREG || td == NULL || (td->td_pflags2 & TDP2_ACCT) != 0) @@ -2370,9 +2372,11 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); - PROC_LOCK(td->td_proc); - kern_psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); + if (!ktr_write || ktr_filesize_limit_signal) { + PROC_LOCK(td->td_proc); + kern_psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + } return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index c4ab985722c0..50030d002f97 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -299,6 +299,7 @@ void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, #define ktrstat_error(s, error) \ ktrstruct_error("stat", (s), sizeof(struct stat), error) extern u_int ktr_geniosize; +extern int ktr_filesize_limit_signal; #else #include From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F259465444B; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpR6Db0z4jbc; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF75518C58; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j3K7051881; Sun, 13 Jun 2021 01:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j3rh051880; Sun, 13 Jun 2021 01:45:03 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:03 GMT Message-Id: <202106130145.15D1j3rh051880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 66200d321826 - stable/13 - ktrace: use the limit of the trace initiator for file size limit on writes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66200d32182612b90e3602877ff9a2deb867b252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66200d32182612b90e3602877ff9a2deb867b252 commit 66200d32182612b90e3602877ff9a2deb867b252 Author: Konstantin Belousov AuthorDate: 2021-05-14 23:51:01 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: use the limit of the trace initiator for file size limit on writes (cherry picked from commit 02645b886bc62dfd8a998fd51d2e6c1bbca03ecb) --- sys/kern/kern_ktrace.c | 6 ++++++ sys/kern/vfs_vnops.c | 18 ++++++++++-------- sys/sys/proc.h | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index c923149ed129..d44f6b9ab994 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -148,6 +149,7 @@ static struct sx ktrace_sx; struct ktr_io_params { struct vnode *vp; struct ucred *cr; + off_t lim; u_int refs; }; @@ -465,6 +467,7 @@ ktr_io_params_alloc(struct thread *td, struct vnode *vp) res = malloc(sizeof(struct ktr_io_params), M_KTRACE, M_WAITOK); res->vp = vp; res->cr = crhold(td->td_ucred); + res->lim = lim_cur(td, RLIMIT_FSIZE); res->refs = 1; return (res); } @@ -1257,6 +1260,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) struct uio auio; struct iovec aiov[3]; struct mount *mp; + off_t lim; int datalen, buflen; int error; @@ -1284,6 +1288,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) vp = kiop->vp; cred = kiop->cr; + lim = kiop->lim; vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); @@ -1321,6 +1326,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + td->td_ktr_io_lim = lim; #ifdef MAC error = mac_vnode_check_write(cred, NOCRED, vp); if (error == 0) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8be30df40dc5..fb94b1470a2d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2360,18 +2360,20 @@ int vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { + off_t lim; if (vp->v_type != VREG || td == NULL || (td->td_pflags2 & TDP2_ACCT) != 0) return (0); - if ((uoff_t)uio->uio_offset + uio->uio_resid > - lim_cur(td, RLIMIT_FSIZE)) { - PROC_LOCK(td->td_proc); - kern_psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - return (0); + ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; + lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); + if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) + return (0); + + PROC_LOCK(td->td_proc); + kern_psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + return (EFBIG); } int diff --git a/sys/sys/proc.h b/sys/sys/proc.h index fb5714818163..d4476ac8d410 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -377,6 +377,7 @@ struct thread { void *td_lkpi_task; /* LinuxKPI task struct pointer */ int td_pmcpend; void *td_coredump; /* (c) coredump request. */ + off_t td_ktr_io_lim; /* (k) limit for ktrace file size */ #ifdef EPOCH_TRACE SLIST_HEAD(, epoch_tracker) td_epochs; #endif From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C2AB6542DF; Sun, 13 Jun 2021 01:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpV1bXFz4jMR; Sun, 13 Jun 2021 01:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0CB318ACD; Sun, 13 Jun 2021 01:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j5wR051929; Sun, 13 Jun 2021 01:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j5Bh051928; Sun, 13 Jun 2021 01:45:05 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:05 GMT Message-Id: <202106130145.15D1j5Bh051928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cf852eda68a8 - stable/13 - libkvm: Fix build after removal of p_tracevp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:06 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 commit cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 Author: Konstantin Belousov AuthorDate: 2021-05-22 12:43:57 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 libkvm: Fix build after removal of p_tracevp (cherry picked from commit e67ef6ce667d42a235a70914159048e10039145d) --- lib/libkvm/kvm_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 63f7c2a8a824..aad2e0a672ed 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -218,7 +218,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p, /* kp->ki_kstack = proc.p_thread.td_kstack; XXXKSE */ kp->ki_args = proc.p_args; kp->ki_numthreads = proc.p_numthreads; - kp->ki_tracep = proc.p_tracevp; + kp->ki_tracep = NULL; /* XXXKIB do not expose ktr_io_params */ kp->ki_textvp = proc.p_textvp; kp->ki_fd = proc.p_fd; kp->ki_pd = proc.p_pd; From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EF446540E1; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpW27Cjz4jbv; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28D0918B41; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j7SH051959; Sun, 13 Jun 2021 01:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j7Wl051958; Sun, 13 Jun 2021 01:45:07 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:07 GMT Message-Id: <202106130145.15D1j7Wl051958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c1cbdaa22a33 - stable/13 - Fix tinderbox build after 1762f674ccb571e6 ktrace commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1cbdaa22a3377715afd271df4fb5acdeab4bead Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c1cbdaa22a3377715afd271df4fb5acdeab4bead commit c1cbdaa22a3377715afd271df4fb5acdeab4bead Author: Mateusz Guzik AuthorDate: 2021-05-22 19:37:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 Fix tinderbox build after 1762f674ccb571e6 ktrace commit. (cherry picked from commit 154f0ecc10abdd3c23d233bf85e292011a130583) --- sys/kern/kern_exec.c | 6 ++++-- sys/kern/vfs_vnops.c | 2 ++ sys/sys/ktrace.h | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2936e246f706..01ec7de5d3c1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -398,7 +398,9 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, static const char fexecv_proc_title[] = "(fexecv)"; imgp = &image_params; +#ifdef KTRACE kiop = NULL; +#endif /* * Lock the process and set the P_INEXEC flag to indicate that @@ -788,8 +790,6 @@ interpret: * we do not regain any tracing during a possible block. */ setsugid(p); - kiop = NULL; - #ifdef KTRACE kiop = ktrprocexec(p); #endif @@ -946,7 +946,9 @@ exec_fail: */ if (oldtextvp != NULL) vrele(oldtextvp); +#ifdef KTRACE ktr_io_params_free(kiop); +#endif pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9c3d261a25c4..95b6821bdff5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2372,11 +2372,13 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); +#ifdef KTRACE if (!ktr_write || ktr_filesize_limit_signal) { PROC_LOCK(td->td_proc); kern_psignal(td->td_proc, SIGXFSZ); PROC_UNLOCK(td->td_proc); } +#endif return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 50030d002f97..1fcac8e0cd26 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -267,7 +267,16 @@ struct ktr_struct_array { #ifdef _KERNEL struct ktr_io_params; +#ifdef KTRACE struct vnode *ktr_get_tracevp(struct proc *, bool); +#else +static inline struct vnode * +ktr_get_tracevp(struct proc *p, bool ref) +{ + + return (NULL); +} +#endif void ktr_io_params_free(struct ktr_io_params *); void ktrnamei(char *); void ktrcsw(int, int, const char *); From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC240654072; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpY48Hpz4jQ3; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680AB18D85; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j9eG052009; Sun, 13 Jun 2021 01:45:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j9jM052008; Sun, 13 Jun 2021 01:45:09 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:09 GMT Message-Id: <202106130145.15D1j9jM052008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1fef441079c3 - stable/13 - Fix limit testing after 1762f674ccb571e6 ktrace commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fef441079c38de177f3456e54f55931aebf2655 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1fef441079c38de177f3456e54f55931aebf2655 commit 1fef441079c38de177f3456e54f55931aebf2655 Author: Mateusz Guzik AuthorDate: 2021-05-22 20:12:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 Fix limit testing after 1762f674ccb571e6 ktrace commit. (cherry picked from commit e71d5c7331700504e58cf1a35dca529381723e02) --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9c3d261a25c4..cf6a1f715d83 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2369,7 +2369,7 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, return (0); ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); - if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) + if ((uoff_t)uio->uio_offset + uio->uio_resid <= lim) return (0); if (!ktr_write || ktr_filesize_limit_signal) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 347B3653FEF; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpX6405z4jc3; Sun, 13 Jun 2021 01:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A8B18CAB; Sun, 13 Jun 2021 01:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j8Cl051985; Sun, 13 Jun 2021 01:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j8XW051984; Sun, 13 Jun 2021 01:45:08 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:08 GMT Message-Id: <202106130145.15D1j8XW051984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e7d30206032a - stable/13 - Fix a braino in previous. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa commit e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa Author: Mateusz Guzik AuthorDate: 2021-05-22 19:48:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 Fix a braino in previous. (cherry picked from commit 48235c377f960050e9129aa847d7d73019561c82) --- sys/kern/vfs_vnops.c | 2 -- sys/sys/ktrace.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 95b6821bdff5..9c3d261a25c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2372,13 +2372,11 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); -#ifdef KTRACE if (!ktr_write || ktr_filesize_limit_signal) { PROC_LOCK(td->td_proc); kern_psignal(td->td_proc, SIGXFSZ); PROC_UNLOCK(td->td_proc); } -#endif return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 1fcac8e0cd26..739f5a5d7ea0 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -308,8 +308,12 @@ void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, #define ktrstat_error(s, error) \ ktrstruct_error("stat", (s), sizeof(struct stat), error) extern u_int ktr_geniosize; +#ifdef KTRACE extern int ktr_filesize_limit_signal; #else +#define ktr_filesize_limit_signal 0 +#endif +#else #include From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 690806540EF; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpZ4xS3z4jvC; Sun, 13 Jun 2021 01:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89C7918ACE; Sun, 13 Jun 2021 01:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1jA8T052033; Sun, 13 Jun 2021 01:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1jAvT052032; Sun, 13 Jun 2021 01:45:10 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:10 GMT Message-Id: <202106130145.15D1jAvT052032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cad10e50dce3 - stable/13 - ktrace: fix a race between writes and close MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cad10e50dce3732f4d664f8edf0c1d6818373239 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:11 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cad10e50dce3732f4d664f8edf0c1d6818373239 commit cad10e50dce3732f4d664f8edf0c1d6818373239 Author: Konstantin Belousov AuthorDate: 2021-05-22 12:40:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 ktrace: fix a race between writes and close (cherry picked from commit fc369a353b5b5e0f8046687fcbd78a7cd9ad1810) --- sys/kern/kern_ktrace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 9568a752d820..f8b2cf83e005 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1262,7 +1262,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, static void ktr_writerequest(struct thread *td, struct ktr_request *req) { - struct ktr_io_params *kiop; + struct ktr_io_params *kiop, *kiop1; struct ktr_header *kth; struct vnode *vp; struct proc *p; @@ -1277,14 +1277,10 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) p = td->td_proc; /* - * We hold the vnode and credential for use in I/O in case ktrace is + * We reference the kiop for use in I/O in case ktrace is * disabled on the process as we write out the request. - * - * XXXRW: This is not ideal: we could end up performing a write after - * the vnode has been closed. */ mtx_lock(&ktrace_mtx); - kiop = p->p_ktrioparms; /* @@ -1296,13 +1292,12 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) return; } + ktr_io_params_ref(kiop); vp = kiop->vp; cred = kiop->cr; lim = kiop->lim; - vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); - crhold(cred); mtx_unlock(&ktrace_mtx); kth = &req->ktr_header; @@ -1344,9 +1339,11 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred); VOP_UNLOCK(vp); vn_finished_write(mp); - crfree(cred); if (error == 0) { - vrele(vp); + mtx_lock(&ktrace_mtx); + kiop = ktr_io_params_rele(kiop); + mtx_unlock(&ktrace_mtx); + ktr_io_params_free(kiop); return; } @@ -1359,12 +1356,15 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) "ktrace write failed, errno %d, tracing stopped for pid %d\n", error, p->p_pid); + kiop1 = NULL; PROC_LOCK(p); mtx_lock(&ktrace_mtx); if (p->p_ktrioparms != NULL && p->p_ktrioparms->vp == vp) - kiop = ktr_freeproc(p); + kiop1 = ktr_freeproc(p); + kiop = ktr_io_params_rele(kiop); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); + ktr_io_params_free(kiop1); ktr_io_params_free(kiop); vrele(vp); } From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 01:45:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E3DB653FFB; Sun, 13 Jun 2021 01:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpc2W7Yz4jpy; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83BC18ACF; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1jBhK052057; Sun, 13 Jun 2021 01:45:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1jB2q052056; Sun, 13 Jun 2021 01:45:11 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:11 GMT Message-Id: <202106130145.15D1jB2q052056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 35e0ffef8e07 - stable/13 - ktrace: Remove vrele() at the end of ktr_writerequest() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35e0ffef8e07e95d6351bcb3677b181c56e9b317 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:12 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=35e0ffef8e07e95d6351bcb3677b181c56e9b317 commit 35e0ffef8e07e95d6351bcb3677b181c56e9b317 Author: Mark Johnston AuthorDate: 2021-05-23 17:20:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 ktrace: Remove vrele() at the end of ktr_writerequest() (cherry picked from commit 6f6cd1e8e8aa3a48b35598992f1b6c21003d35cd) --- sys/kern/kern_ktrace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index f8b2cf83e005..1b9e0942b702 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1366,7 +1366,6 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) PROC_UNLOCK(p); ktr_io_params_free(kiop1); ktr_io_params_free(kiop); - vrele(vp); } /* From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 02:16:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87810654F82; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2dVg3Gpmz4l58; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 594FD19046; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D2GRpp092553; Sun, 13 Jun 2021 02:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D2GRB5092552; Sun, 13 Jun 2021 02:16:27 GMT (envelope-from git) Date: Sun, 13 Jun 2021 02:16:27 GMT Message-Id: <202106130216.15D2GRB5092552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: cfd6c9b99f49 - stable/13 - vfs: slightly rework vn_rlimit_fsize MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cfd6c9b99f49dd24860456742eecccabfc100326 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 02:16:27 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd6c9b99f49dd24860456742eecccabfc100326 commit cfd6c9b99f49dd24860456742eecccabfc100326 Author: Mateusz Guzik AuthorDate: 2021-05-29 17:33:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-13 02:15:25 +0000 vfs: slightly rework vn_rlimit_fsize (cherry picked from commit 478c52f1e3654213c7d79096a2bc7f908e0b501d) --- sys/kern/vfs_vnops.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index cf6a1f715d83..fc5118e8aa24 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2364,12 +2364,25 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, off_t lim; bool ktr_write; - if (vp->v_type != VREG || td == NULL || - (td->td_pflags2 & TDP2_ACCT) != 0) + if (td == NULL) return (0); + + /* + * There are conditions where the limit is to be ignored. + * However, since it is almost never reached, check it first. + */ ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; - lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); - if ((uoff_t)uio->uio_offset + uio->uio_resid <= lim) + lim = lim_cur(td, RLIMIT_FSIZE); + if (__predict_false(ktr_write)) + lim = td->td_ktr_io_lim; + if (__predict_true((uoff_t)uio->uio_offset + uio->uio_resid <= lim)) + return (0); + + /* + * The limit is reached. + */ + if (vp->v_type != VREG || + (td->td_pflags2 & TDP2_ACCT) != 0) return (0); if (!ktr_write || ktr_filesize_limit_signal) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 03:47:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF206655D4C; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2gWD654cz4qJ0; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B93E61A52E; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D3l4kP012995; Sun, 13 Jun 2021 03:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D3l4b7012994; Sun, 13 Jun 2021 03:47:04 GMT (envelope-from git) Date: Sun, 13 Jun 2021 03:47:04 GMT Message-Id: <202106130347.15D3l4b7012994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: b0c251b0dea8 - stable/13 - zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0c251b0dea8ab1476e42aa49a888b0d969020d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 03:47:05 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=b0c251b0dea8ab1476e42aa49a888b0d969020d2 commit b0c251b0dea8ab1476e42aa49a888b0d969020d2 Merge: cfd6c9b99f49 c3b60ededa6e Author: Martin Matuska AuthorDate: 2021-06-13 02:47:27 +0000 Commit: Martin Matuska CommitDate: 2021-06-13 03:43:03 +0000 zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #12015 Replace zstreamdump with zstream link #12046 Improve scrub maxinflight_bytes math. #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI #12072 Let zfs diff be more permissive #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat #12104 Reminder to update boot code after zpool upgrade #12114 Introduce write-mostly sums #12125 Modernise all (most) remaining .TH manpages #12145 More aggsum optimizations #12149 Multiple man-pages: Move to appropriate section #12158 Re-embed multilist_t storage #12177 Livelist logic should handle dedup blkptrs #12196 Unify manpage makefiles, move pages to better sexions, revisit some #12212 Remove pool io kstats Obtained from: OpenZFS OpenZFS commit: c3b60ededa6e6ce36a457a54451ca153c4c630dc OpenZFS tag: zfs-2.1.0-rc7 ObsoleteFiles.inc | 10 + cddl/sbin/zfs/Makefile | 5 +- cddl/sbin/zpool/Makefile | 13 +- cddl/usr.bin/Makefile | 2 - cddl/usr.bin/zstream/Makefile | 3 + cddl/usr.bin/zstreamdump/Makefile | 11 - cddl/usr.bin/zstreamdump/Makefile.depend | 25 - .../openzfs/.github/ISSUE_TEMPLATE/config.yml | 2 +- sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/Makefile.am | 48 +- sys/contrib/openzfs/cmd/Makefile.am | 8 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary3 | 6 + sys/contrib/openzfs/cmd/fsck_zfs/Makefile.am | 1 + sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in | 6 +- sys/contrib/openzfs/cmd/vdev_id/Makefile.am | 2 + sys/contrib/openzfs/cmd/zdb/zdb.c | 117 +- sys/contrib/openzfs/cmd/zed/Makefile.am | 2 + sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am | 4 + sys/contrib/openzfs/cmd/zed/zed.d/all-debug.sh | 16 +- sys/contrib/openzfs/cmd/zed/zed.d/all-syslog.sh | 1 + .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 19 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 12 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 38 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 16 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 1 + .../openzfs/cmd/zpool/os/freebsd/zpool_vdev_os.c | 15 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 5 + sys/contrib/openzfs/cmd/zpool/zpool.d/smart | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 28 +- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 1 + .../ZFS-pool-latency-heatmaps-influxdb.json | 4 +- sys/contrib/openzfs/cmd/zstream/Makefile.am | 3 + sys/contrib/openzfs/cmd/zstream/zstream.c | 5 + sys/contrib/openzfs/cmd/zstreamdump/Makefile.am | 1 - sys/contrib/openzfs/cmd/zstreamdump/zstreamdump | 3 - sys/contrib/openzfs/cmd/ztest/ztest.c | 273 +- sys/contrib/openzfs/cmd/zvol_wait/Makefile.am | 2 + sys/contrib/openzfs/cmd/zvol_wait/zvol_wait | 1 + sys/contrib/openzfs/config/Shellcheck.am | 22 + sys/contrib/openzfs/config/always-shellcheck.m4 | 10 + sys/contrib/openzfs/config/ax_python_devel.m4 | 3 +- sys/contrib/openzfs/config/kernel-percpu.m4 | 27 + sys/contrib/openzfs/config/zfs-build.m4 | 18 + sys/contrib/openzfs/configure.ac | 5 +- sys/contrib/openzfs/contrib/Makefile.am | 4 + .../openzfs/contrib/bash_completion.d/Makefile.am | 5 + .../openzfs/contrib/bash_completion.d/zfs.in | 76 +- sys/contrib/openzfs/contrib/bpftrace/Makefile.am | 4 + .../dracut/02zfsexpandknowledge/Makefile.am | 1 + .../dracut/02zfsexpandknowledge/module-setup.sh.in | 50 +- .../openzfs/contrib/dracut/90zfs/.gitignore | 13 +- .../openzfs/contrib/dracut/90zfs/Makefile.am | 7 +- .../dracut/90zfs/import-opts-generator.sh.in | 5 + .../contrib/dracut/90zfs/module-setup.sh.in | 44 +- .../openzfs/contrib/dracut/90zfs/mount-zfs.sh.in | 10 +- .../openzfs/contrib/dracut/90zfs/parse-zfs.sh.in | 3 +- .../contrib/dracut/90zfs/zfs-generator.sh.in | 1 + .../openzfs/contrib/dracut/90zfs/zfs-lib.sh.in | 10 +- .../contrib/dracut/90zfs/zfs-load-key.sh.in | 8 +- sys/contrib/openzfs/contrib/dracut/Makefile.am | 3 + sys/contrib/openzfs/contrib/initramfs/Makefile.am | 3 + .../openzfs/contrib/initramfs/hooks/Makefile.am | 1 + sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 125 +- .../openzfs/contrib/initramfs/hooks/zfsunlock.in | 16 +- .../openzfs/contrib/initramfs/scripts/Makefile.am | 7 +- .../initramfs/scripts/local-top/Makefile.am | 2 + .../contrib/initramfs/scripts/local-top/zfs | 21 +- sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 65 +- sys/contrib/openzfs/etc/Makefile.am | 4 + sys/contrib/openzfs/etc/default/Makefile.am | 4 + sys/contrib/openzfs/etc/init.d/Makefile.am | 3 + sys/contrib/openzfs/etc/init.d/zfs-import.in | 26 +- sys/contrib/openzfs/etc/init.d/zfs-mount.in | 49 +- sys/contrib/openzfs/etc/init.d/zfs-share.in | 6 +- sys/contrib/openzfs/etc/init.d/zfs-zed.in | 31 +- sys/contrib/openzfs/etc/systemd/Makefile.am | 3 + .../etc/systemd/system-generators/Makefile.am | 14 +- .../system-generators/zfs-mount-generator.c | 1083 +++++ .../system-generators/zfs-mount-generator.in | 474 --- .../etc/systemd/system/zfs-import-cache.service.in | 2 +- .../etc/systemd/system/zfs-import-scan.service.in | 2 +- sys/contrib/openzfs/etc/zfs/Makefile.am | 3 + sys/contrib/openzfs/etc/zfs/zfs-functions.in | 97 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 1 + .../openzfs/include/os/freebsd/spl/sys/kstat.h | 4 - .../openzfs/include/os/freebsd/spl/sys/wmsum.h | 72 + .../openzfs/include/os/linux/spl/sys/Makefile.am | 1 + .../openzfs/include/os/linux/spl/sys/atomic.h | 4 + .../openzfs/include/os/linux/spl/sys/kstat.h | 4 - .../openzfs/include/os/linux/spl/sys/wmsum.h | 76 + sys/contrib/openzfs/include/sys/aggsum.h | 7 +- sys/contrib/openzfs/include/sys/arc_impl.h | 12 +- sys/contrib/openzfs/include/sys/dataset_kstats.h | 20 +- sys/contrib/openzfs/include/sys/dmu_objset.h | 4 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/multilist.h | 3 +- sys/contrib/openzfs/include/sys/spa.h | 1 - sys/contrib/openzfs/include/sys/zfs_context.h | 6 - sys/contrib/openzfs/include/sys/zfs_ioctl_impl.h | 1 + sys/contrib/openzfs/lib/libnvpair/libnvpair_json.c | 15 +- .../openzfs/lib/libspl/asm-generic/atomic.c | 13 + sys/contrib/openzfs/lib/libspl/include/atomic.h | 43 + .../openzfs/lib/libspl/include/sys/Makefile.am | 1 + sys/contrib/openzfs/lib/libspl/include/sys/kstat.h | 6 - sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h | 68 + sys/contrib/openzfs/lib/libspl/os/freebsd/mnttab.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 26 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 46 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 8 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 72 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 34 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 4 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 30 - sys/contrib/openzfs/man/Makefile.am | 118 +- sys/contrib/openzfs/man/man1/Makefile.am | 12 - sys/contrib/openzfs/man/man1/arcstat.1 | 652 +-- sys/contrib/openzfs/man/man1/cstyle.1 | 259 +- sys/contrib/openzfs/man/man1/raidz_test.1 | 153 +- sys/contrib/openzfs/man/man1/zhack.1 | 168 +- sys/contrib/openzfs/man/man1/ztest.1 | 327 +- sys/contrib/openzfs/man/man1/zvol_wait.1 | 37 +- sys/contrib/openzfs/man/man4/spl.4 | 195 + sys/contrib/openzfs/man/man4/zfs.4 | 2380 +++++++++++ sys/contrib/openzfs/man/man5/Makefile.am | 16 - .../openzfs/man/man5/spl-module-parameters.5 | 326 -- sys/contrib/openzfs/man/man5/vdev_id.conf.5 | 429 +- sys/contrib/openzfs/man/man5/zfs-events.5 | 965 ----- .../openzfs/man/man5/zfs-module-parameters.5 | 4354 -------------------- sys/contrib/openzfs/man/man5/zpool-features.5 | 1077 ----- .../man/{man8/zfsconcepts.8 => man7/zfsconcepts.7} | 66 +- .../man/{man8/zfsprops.8 => man7/zfsprops.7} | 730 ++-- sys/contrib/openzfs/man/man7/zpool-features.7 | 842 ++++ .../{man8/zpoolconcepts.8 => man7/zpoolconcepts.7} | 277 +- .../man/{man8/zpoolprops.8 => man7/zpoolprops.7} | 136 +- sys/contrib/openzfs/man/man8/Makefile.am | 102 - sys/contrib/openzfs/man/man8/fsck.zfs.8 | 100 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 6 +- sys/contrib/openzfs/man/man8/vdev_id.8 | 154 +- sys/contrib/openzfs/man/man8/zdb.8 | 126 +- sys/contrib/openzfs/man/man8/zed.8.in | 380 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 202 +- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 26 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 27 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 20 +- sys/contrib/openzfs/man/man8/zfs-diff.8 | 63 +- sys/contrib/openzfs/man/man8/zfs-hold.8 | 24 +- sys/contrib/openzfs/man/man8/zfs-jail.8 | 112 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 56 +- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 180 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 387 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 32 +- sys/contrib/openzfs/man/man8/zfs-program.8 | 416 +- sys/contrib/openzfs/man/man8/zfs-project.8 | 98 +- sys/contrib/openzfs/man/man8/zfs-promote.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-receive.8 | 125 +- sys/contrib/openzfs/man/man8/zfs-rename.8 | 5 +- sys/contrib/openzfs/man/man8/zfs-rollback.8 | 18 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 290 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 98 +- sys/contrib/openzfs/man/man8/zfs-share.8 | 16 +- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-upgrade.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-userspace.8 | 84 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 27 +- sys/contrib/openzfs/man/man8/zfs.8 | 486 ++- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 23 +- sys/contrib/openzfs/man/man8/zgenhostid.8 | 75 +- sys/contrib/openzfs/man/man8/zinject.8 | 378 +- sys/contrib/openzfs/man/man8/zpool-add.8 | 49 +- sys/contrib/openzfs/man/man8/zpool-attach.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-checkpoint.8 | 40 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 24 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 144 +- sys/contrib/openzfs/man/man8/zpool-destroy.8 | 17 +- sys/contrib/openzfs/man/man8/zpool-detach.8 | 21 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 452 +- sys/contrib/openzfs/man/man8/zpool-export.8 | 23 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-history.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 119 +- sys/contrib/openzfs/man/man8/zpool-initialize.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-iostat.8 | 236 +- sys/contrib/openzfs/man/man8/zpool-labelclear.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 43 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 29 +- sys/contrib/openzfs/man/man8/zpool-reguid.8 | 15 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 20 +- sys/contrib/openzfs/man/man8/zpool-reopen.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 44 +- sys/contrib/openzfs/man/man8/zpool-resilver.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 31 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 54 +- sys/contrib/openzfs/man/man8/zpool-sync.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-trim.8 | 51 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 35 +- sys/contrib/openzfs/man/man8/zpool-wait.8 | 54 +- sys/contrib/openzfs/man/man8/zpool.8 | 385 +- sys/contrib/openzfs/man/man8/zpool_influxdb.8 | 141 +- sys/contrib/openzfs/man/man8/zstream.8 | 26 +- sys/contrib/openzfs/man/man8/zstreamdump.8 | 59 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 62 - .../openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c | 17 + .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 15 + .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 11 +- .../openzfs/module/os/linux/spl/spl-kstat.c | 66 - .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 6 + sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 3 - sys/contrib/openzfs/module/zfs/aggsum.c | 125 +- sys/contrib/openzfs/module/zfs/arc.c | 163 +- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 48 +- sys/contrib/openzfs/module/zfs/dbuf.c | 20 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 30 +- sys/contrib/openzfs/module/zfs/dnode.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 65 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 40 +- sys/contrib/openzfs/module/zfs/metaslab.c | 24 +- sys/contrib/openzfs/module/zfs/multilist.c | 14 +- sys/contrib/openzfs/module/zfs/spa_stats.c | 50 - sys/contrib/openzfs/module/zfs/vdev_queue.c | 47 - sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 27 + sys/contrib/openzfs/rpm/generic/zfs.spec.in | 2 + sys/contrib/openzfs/scripts/Makefile.am | 17 +- sys/contrib/openzfs/scripts/commitcheck.sh | 4 +- sys/contrib/openzfs/scripts/dkms.mkconf | 12 +- sys/contrib/openzfs/scripts/dkms.postbuild | 7 +- sys/contrib/openzfs/scripts/kmodtool | 14 +- sys/contrib/openzfs/scripts/make_gitrev.sh | 6 +- sys/contrib/openzfs/scripts/man-dates.sh | 2 +- sys/contrib/openzfs/scripts/mancheck.sh | 43 + sys/contrib/openzfs/scripts/paxcheck.sh | 3 +- sys/contrib/openzfs/scripts/zfs-tests.sh | 1 - sys/contrib/openzfs/scripts/zfs.sh | 4 +- sys/contrib/openzfs/scripts/zimport.sh | 17 +- sys/contrib/openzfs/scripts/zloop.sh | 17 +- sys/contrib/openzfs/scripts/zol2zfs-patch.sed | 2 +- sys/contrib/openzfs/tests/Makefile.am | 5 + sys/contrib/openzfs/tests/runfiles/common.run | 4 +- .../openzfs/tests/test-runner/man/test-runner.1 | 598 ++- .../tests/functional/cli_root/zdb/zdb_checksum.ksh | 1 + .../functional/cli_root/zdb/zdb_objset_id.ksh | 1 + .../zfs_destroy/zfs_clone_livelist_dedup.ksh | 88 + .../zpool_events/zpool_events_duplicates.ksh | 3 +- .../tests/functional/l2arc/l2arc_mfuonly_pos.ksh | 2 +- .../zfs-tests/tests/perf/scripts/prefetch_io.sh | 42 +- sys/contrib/openzfs/udev/rules.d/.gitignore | 5 +- sys/modules/zfs/zfs_config.h | 4 +- 250 files changed, 11645 insertions(+), 13940 deletions(-) diff --cc ObsoleteFiles.inc index 761d5f61dadd,000000000000..6c7031842714 mode 100644,000000..100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@@ -1,12010 -1,0 +1,12020 @@@ +# +# $FreeBSD$ +# +# This file lists old files (OLD_FILES), libraries (OLD_LIBS) and +# directories (OLD_DIRS) which should get removed at an update. Recently +# removed entries first (with the date as a comment). Dynamic libraries are +# special cased (OLD_LIBS). Static libraries or the generic links to +# the dynamic libraries (lib*.so) should (if you don't know why to make an +# exception, make this a "must") be viewed as normal files (OLD_FILES). +# +# In case of a complete directory hierarchy the sorting is in depth first +# order. +# +# Before you commit changes to this file please check if any entries in +# tools/build/mk/OptionalObsoleteFiles.inc can be removed. The following +# command tells which files are listed more than once regardless of some +# architecture specific conditionals, so you can not blindly trust the +# output: +# ( grep '+=' /usr/src/ObsoleteFiles.inc | sort -u ; \ +# grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ +# sort | uniq -d +# +# To find regular duplicates not dependent on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done + ++# 20210613: Rename OpenZFS manual pages ++OLD_FILES+=usr/share/man/man5/spl-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-events.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man8/zfsconcepts.8.gz ++OLD_FILES+=usr/share/man/man8/zfsprops.8.gz ++OLD_FILES+=usr/share/man/man5/zpool-features.5.gz ++OLD_FILES+=usr/share/man/man8/zpoolconcepts.8.gz ++OLD_FILES+=usr/share/man/man8/zpoolprops.8.gz ++ +# 20210413: Remove pfctlinput2 +OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz + +# 20210329: Remove kernel-only crypto headers from /usr/include +OLD_FILES+=usr/include/crypto/_cryptodev.h +OLD_FILES+=usr/include/crypto/cbc_mac.h +OLD_FILES+=usr/include/crypto/deflate.h +OLD_FILES+=usr/include/crypto/gfmult.h +OLD_FILES+=usr/include/crypto/gmac.h +OLD_FILES+=usr/include/crypto/rijndael.h +OLD_FILES+=usr/include/crypto/rmd160.h +OLD_FILES+=usr/include/crypto/xform.h +OLD_FILES+=usr/include/crypto/xform_auth.h +OLD_FILES+=usr/include/crypto/xform_comp.h +OLD_FILES+=usr/include/crypto/xform_enc.h +OLD_FILES+=usr/include/crypto/xform_poly1305.h + +# 20210204: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + +# 20210116: if_wl_wavelan.h removed +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/if_wl_wavelan.h +.endif + +# 20210108: retire cmx, ng_bt3c, wi drivers +OLD_FILES+=usr/include/dev/wi/if_wireg.h +OLD_FILES+=usr/include/dev/wi/if_wavelan_ieee.h +OLD_FILES+=usr/include/dev/wi/if_wivar.h +OLD_FILES+=usr/sbin/bt3cfw +OLD_FILES+=usr/share/man/man4/cmw.4.gz +OLD_FILES+=usr/share/man/man4/ng_bt3c.4.gz +OLD_FILES+=usr/share/man/man4/wi.4.gz +OLD_FILES+=usr/share/man/man8/bt3cfw.8.gz + +# 20210107: retire a.out support +OLD_DIRS+=usr/lib/aout +OLD_DIRS+=usr/lib/compat/aout + +# 20210105: remove non widechar version of ncurses +OLD_LIBS+=lib/libncurses.so.9 + +# 20210103: new clang import which bumps version from 11.0.0 to 11.0.1. +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/11.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/complex +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/complex.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/new +OLD_DIRS+=usr/lib/clang/11.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/11.0.0/include/profile +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/xray +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_libdevice_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/11.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/amxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_bf16.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_cde.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_sve.h +OLD_FILES+=usr/lib/clang/11.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cet.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/11.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/11.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/11.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/serializeintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tsxldtrkintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wasm_simd128.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/11.0.0/include +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc64le.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/11.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/11.0.0/lib +OLD_DIRS+=usr/lib/clang/11.0.0 + +# 20201225: libregex removed +OLD_FILES+=usr/lib/libgnuregex.so +OLD_LIBS+=usr/lib/libgnuregex.so.5 +OLD_FILES+=usr/lib/libgnuregex_p.a +OLD_FILES+=usr/include/gnu/posix/regex.h +OLD_DIRS+=usr/include/gnu/posix +OLD_FILES+=usr/include/gnu/regex.h +OLD_DIRS+=usr/include/gnu +OLD_FILES+=usr/include/gnuregex.h + +# 20201225: gnugrep removed +OLD_FILES+=usr/bin/bsdgrep +OLD_FILES+=usr/bin/gnugrep +OLD_FILES+=usr/share/man/man1/bsdgrep.1.gz +OLD_FILES+=usr/share/man/man1/gnugrep.1.gz + +# 20201224: mk48txx(4) removed +OLD_FILES+=usr/share/man/man4/mk48txx.4.gz + +# 20201215: in-tree gdb removed +OLD_FILES+=usr/libexec/gdb +OLD_FILES+=usr/libexec/kgdb + +# 20201211: hme(4) removed +OLD_FILES+=usr/share/man/man4/hme.4.gz +OLD_FILES+=usr/share/man/man4/if_hme.4.gz + +# 20201124: ping6(8) was merged into ping(8) +OLD_FILES+=usr/lib/debug/sbin/ping6.debug +OLD_FILES+=usr/share/man/man8/ping6.8.gz +OLD_FILES+=usr/tests/sbin/ping6/Kyuafile +OLD_FILES+=usr/tests/sbin/ping6/ping6_c1_s8_t1.out +OLD_FILES+=usr/tests/sbin/ping6/ping6_test +OLD_DIRS+=usr/tests/sbin/ping6 + +# 20201025: Remove cal data files +OLD_FILES+=usr/share/calendar/calendar.all +OLD_FILES+=usr/share/calendar/calendar.australia +OLD_FILES+=usr/share/calendar/calendar.birthday +OLD_FILES+=usr/share/calendar/calendar.brazilian +OLD_FILES+=usr/share/calendar/calendar.christian +OLD_FILES+=usr/share/calendar/calendar.computer +OLD_FILES+=usr/share/calendar/calendar.croatian +OLD_FILES+=usr/share/calendar/calendar.dutch +OLD_FILES+=usr/share/calendar/calendar.french +OLD_FILES+=usr/share/calendar/calendar.german +OLD_FILES+=usr/share/calendar/calendar.history +OLD_FILES+=usr/share/calendar/calendar.holiday +OLD_FILES+=usr/share/calendar/calendar.hungarian +OLD_FILES+=usr/share/calendar/calendar.judaic +OLD_FILES+=usr/share/calendar/calendar.lotr +OLD_FILES+=usr/share/calendar/calendar.music +OLD_FILES+=usr/share/calendar/calendar.newzealand +OLD_FILES+=usr/share/calendar/calendar.russian +OLD_FILES+=usr/share/calendar/calendar.southafrica +OLD_FILES+=usr/share/calendar/calendar.ukrainian +OLD_FILES+=usr/share/calendar/calendar.usholiday +OLD_FILES+=usr/share/calendar/calendar.world +OLD_FILES+=usr/share/calendar/de_AT.ISO_8859-15/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.geschichte +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.kirche +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.literatur +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.musik +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.wissenschaft +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.fetes +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.french +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.jferies +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.proverbes +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.praznici +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.nevnapok +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.unnepek +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.commemorative +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.holidays +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.mcommemorative +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.all +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.commemorative +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.holidays +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.mcommemorative +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.all +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.common +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.holiday +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.military +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.orthodox +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.pagan +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.all +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.common +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.holiday +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.military +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.orthodox +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.pagan +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.all +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.holiday +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.misc +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.orthodox + +# 20201004: logo files renamed to type-agnostic gfx-*.lua +OLD_FILES+=boot/lua/logo-beastie.lua +OLD_FILES+=boot/lua/logo-beastiebw.lua +OLD_FILES+=boot/lua/logo-fbsdbw.lua +OLD_FILES+=boot/lua/logo-orb.lua +OLD_FILES+=boot/lua/logo-orbbw.lua + +# 20200825: merged OpenZFS support +OLD_LIBS+=lib/libzfs.so.3 +OLD_LIBS+=usr/lib32/libzfs.so.3 + +# 20200923: memfd_test moved to /usr/tests/sys/posixshm +OLD_FILES+=usr/tests/sys/kern/memfd_test + +# 20200910: remove vm_map_create(9) to sync with the code +OLD_FILES+=usr/share/man/man9/vm_map_create.9.gz + +# 20200820: Removal of the ufm driver. +OLD_FILES+=usr/share/man/man4/ufm.4.gz + +# 20200816: new clang import which bumps version from 10.0.1 to 11.0.0. +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.1/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.1/include/profile +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/xray +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.1/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.1/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.1/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.1/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.1/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.1/include +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-i386.a *** 12422 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 19:15:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3544B643C7F; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G34705MqPz4bg0; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68032264DB; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DJFu16047329; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DJFuxW047328; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git) Date: Sun, 13 Jun 2021 19:15:56 GMT Message-Id: <202106131915.15DJFuxW047328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2a8921c5d187 - stable/13 - pciconf: Use VM_MEMATTR_DEVICE on supported architectures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 19:15:57 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2a8921c5d187a2c3f1b709cc77c839568ede0b8d commit 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Author: Marcin Wojtas AuthorDate: 2021-04-06 15:00:05 +0000 Commit: Andrew Turner CommitDate: 2021-06-13 15:49:36 +0000 pciconf: Use VM_MEMATTR_DEVICE on supported architectures Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE when mapping device registers in kernel. Do the same in pciconf. On armada8k SoC all reads from BARs mapped with hitherto attribute (VM_MEMATTR_UNCACHEABLE) return 0xff's. Submitted by: Kornel Duleba Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell Differential revision: https://reviews.freebsd.org/D29603 (cherry picked from commit 1c1ead9b94a1a731646327ec3b09e8f3acd577b8) --- usr.sbin/pciconf/pciconf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 817de6ec09ed..6b54687d7c79 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -1126,7 +1126,11 @@ dump_bar(const char *name, const char *reg, const char *bar_start, if (*reg == '\0' || *el != '\0') errx(1, "Invalid bar specification %s", reg); pbm.pbm_flags = 0; - pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; /* XXX */ +#ifdef VM_MEMATTR_DEVICE + pbm.pbm_memattr = VM_MEMATTR_DEVICE; +#else + pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; +#endif fd = open(_PATH_DEVPCI, O_RDWR, 0); if (fd < 0) From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 19:15:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD0C064384F; Sun, 13 Jun 2021 19:15:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G34714Nqyz4blk; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F79D264DC; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DJFv2g047353; Sun, 13 Jun 2021 19:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DJFvlI047352; Sun, 13 Jun 2021 19:15:57 GMT (envelope-from git) Date: Sun, 13 Jun 2021 19:15:57 GMT Message-Id: <202106131915.15DJFvlI047352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ade8b810b02f - stable/13 - Create VM_MEMATTR_DEVICE on all architectures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 19:15:58 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 commit ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 Author: Andrew Turner AuthorDate: 2021-04-10 07:59:29 +0000 Commit: Andrew Turner CommitDate: 2021-06-13 15:49:36 +0000 Create VM_MEMATTR_DEVICE on all architectures This is intended to be used with memory mapped IO, e.g. from bus_space_map with no flags, or pmap_mapdev. Use this new memory type in the map request configured by resource_init_map_request, and in pciconf. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29692 (cherry picked from commit 5d2d599d3f3494d813e51e1bcd1c9693eb9c098b) --- sys/amd64/include/vm.h | 1 + sys/i386/include/vm.h | 1 + sys/kern/subr_bus.c | 2 +- sys/mips/include/vm.h | 1 + sys/powerpc/include/vm.h | 2 ++ usr.sbin/pciconf/pciconf.c | 4 ---- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/amd64/include/vm.h b/sys/amd64/include/vm.h index 2e9c30da9936..fef7a53ca317 100644 --- a/sys/amd64/include/vm.h +++ b/sys/amd64/include/vm.h @@ -43,5 +43,6 @@ #define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #endif /* !_MACHINE_VM_H_ */ diff --git a/sys/i386/include/vm.h b/sys/i386/include/vm.h index 2e9c30da9936..fef7a53ca317 100644 --- a/sys/i386/include/vm.h +++ b/sys/i386/include/vm.h @@ -43,5 +43,6 @@ #define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #endif /* !_MACHINE_VM_H_ */ diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 6d5607337ef6..f0198a0e1fa3 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3117,7 +3117,7 @@ resource_init_map_request_impl(struct resource_map_request *args, size_t sz) { bzero(args, sz); args->size = sz; - args->memattr = VM_MEMATTR_UNCACHEABLE; + args->memattr = VM_MEMATTR_DEVICE; } /** diff --git a/sys/mips/include/vm.h b/sys/mips/include/vm.h index 06af199db17b..c759d8cfa61e 100644 --- a/sys/mips/include/vm.h +++ b/sys/mips/include/vm.h @@ -38,6 +38,7 @@ #define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)MIPS_CCA_UNCACHED) #define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)MIPS_CCA_CACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #ifdef MIPS_CCA_WC #define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)MIPS_CCA_WC) #endif diff --git a/sys/powerpc/include/vm.h b/sys/powerpc/include/vm.h index 3af863509908..692bd8fc2d77 100644 --- a/sys/powerpc/include/vm.h +++ b/sys/powerpc/include/vm.h @@ -42,4 +42,6 @@ #define VM_MEMATTR_WRITE_THROUGH 0x10 #define VM_MEMATTR_PREFETCHABLE 0x20 +#define VM_MEMATTR_DEVICE VM_MEMATTR_DEFAULT + #endif /* !_MACHINE_VM_H_ */ diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 6b54687d7c79..ccc816d5986d 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -1126,11 +1126,7 @@ dump_bar(const char *name, const char *reg, const char *bar_start, if (*reg == '\0' || *el != '\0') errx(1, "Invalid bar specification %s", reg); pbm.pbm_flags = 0; -#ifdef VM_MEMATTR_DEVICE pbm.pbm_memattr = VM_MEMATTR_DEVICE; -#else - pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; -#endif fd = open(_PATH_DEVPCI, O_RDWR, 0); if (fd < 0) From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:02:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2CC06427DF; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qT504wz3F2R; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C9A01096; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2j2L074737; Sun, 13 Jun 2021 22:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2jIp074736; Sun, 13 Jun 2021 22:02:45 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:45 GMT Message-Id: <202106132202.15DM2jIp074736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 4458105f0647 - stable/13 - usbhid(4): Fix NULL pointer dereference in usbd_xfer_max_len() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4458105f064740da227ad608ccb5c58805cfac3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:45 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4458105f064740da227ad608ccb5c58805cfac3e commit 4458105f064740da227ad608ccb5c58805cfac3e Author: Vladimir Kondratyev AuthorDate: 2021-05-28 20:13:44 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:57:31 +0000 usbhid(4): Fix NULL pointer dereference in usbd_xfer_max_len() Which happens when USB transfer setup is failed. PR: 254974 Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30485 (cherry picked from commit e889a462d878675551b227a382764c3879e6c2b3) --- sys/dev/usb/input/usbhid.c | 64 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index 70b1f4ae99c2..4fb846840b8a 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -308,6 +308,22 @@ static const struct usb_config usbhid_config[USBHID_N_TRANSFER] = { }, }; +static inline usb_frlength_t +usbhid_xfer_max_len(struct usb_xfer *xfer) +{ + return (xfer == NULL ? 0 : usbd_xfer_max_len(xfer)); +} + +static inline int +usbhid_xfer_check_len(struct usbhid_softc* sc, int xfer_idx, hid_size_t len) +{ + if (sc->sc_xfer[xfer_idx] == NULL) + return (ENODEV); + if (len > usbd_xfer_max_len(sc->sc_xfer[xfer_idx])) + return (ENOBUFS); + return (0); +} + static void usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, struct hid_rdesc_info *rdesc) @@ -320,6 +336,7 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_intr_handler = intr; sc->sc_intr_ctx = context; bcopy(usbhid_config, sc->sc_config, sizeof(usbhid_config)); + bzero(sc->sc_xfer, sizeof(sc->sc_xfer)); /* Set buffer sizes to match HID report sizes */ sc->sc_config[USBHID_INTR_OUT_DT].bufsize = rdesc->osize; @@ -342,17 +359,15 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_xfer + n, sc->sc_config + n, 1, (void *)(sc->sc_xfer_ctx + n), &sc->sc_mtx); if (error) - break; + DPRINTF("xfer %d setup error=%s\n", n, + usbd_errstr(error)); } - if (error) - DPRINTF("error=%s\n", usbd_errstr(error)); - - rdesc->rdsize = usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]); - rdesc->grsize = usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT]); + rdesc->rdsize = usbhid_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]); + rdesc->grsize = usbhid_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT]); rdesc->srsize = rdesc->grsize; rdesc->wrsize = nowrite ? rdesc->srsize : - usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT]); + usbhid_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT]); sc->sc_intr_buf = malloc(rdesc->rdsize, M_USBDEV, M_ZERO | M_WAITOK); } @@ -371,6 +386,9 @@ usbhid_intr_start(device_t dev) { struct usbhid_softc* sc = device_get_softc(dev); + if (sc->sc_xfer[USBHID_INTR_IN_DT] == NULL) + return (ENODEV); + mtx_lock(&sc->sc_mtx); sc->sc_xfer_ctx[USBHID_INTR_IN_DT] = (struct usbhid_xfer_ctx) { .req.intr.maxlen = @@ -493,8 +511,9 @@ usbhid_get_report(device_t dev, void *buf, hid_size_t maxlen, union usbhid_device_request req; int error; - if (maxlen > usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, maxlen); + if (error) + return (error); req.ctrl.bmRequestType = UT_READ_CLASS_INTERFACE; req.ctrl.bRequest = UR_GET_REPORT; @@ -516,9 +535,11 @@ usbhid_set_report(device_t dev, const void *buf, hid_size_t len, uint8_t type, { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; - if (len > usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, len); + if (error) + return (error); req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.ctrl.bRequest = UR_SET_REPORT; @@ -538,8 +559,9 @@ usbhid_read(device_t dev, void *buf, hid_size_t maxlen, hid_size_t *actlen) union usbhid_device_request req; int error; - if (maxlen > usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_INTR_IN_DT, maxlen); + if (error) + return (error); req.intr.maxlen = maxlen; error = usbhid_sync_xfer(sc, USBHID_INTR_IN_DT, &req, buf); @@ -554,9 +576,11 @@ usbhid_write(device_t dev, const void *buf, hid_size_t len) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; - if (len > usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_INTR_OUT_DT, len); + if (error) + return (error); req.intr.maxlen = len; return (usbhid_sync_xfer(sc, USBHID_INTR_OUT_DT, &req, @@ -568,6 +592,11 @@ usbhid_set_idle(device_t dev, uint16_t duration, uint8_t id) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; + + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, 0); + if (error) + return (error); /* Duration is measured in 4 milliseconds per unit. */ req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; @@ -585,6 +614,11 @@ usbhid_set_protocol(device_t dev, uint16_t protocol) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; + + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, 0); + if (error) + return (error); req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.ctrl.bRequest = UR_SET_PROTOCOL; From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:02:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E90DA6427E5; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qV65ryz3DxB; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B85FFDF2; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2kg1074761; Sun, 13 Jun 2021 22:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2k52074760; Sun, 13 Jun 2021 22:02:46 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:46 GMT Message-Id: <202106132202.15DM2k52074760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: a303f4b1c1d3 - stable/13 - usbhid(4): Add second set of USB transfers to work in polled mode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a303f4b1c1d300488d5116bbf8f3692f545fbdd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:47 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a303f4b1c1d300488d5116bbf8f3692f545fbdd1 commit a303f4b1c1d300488d5116bbf8f3692f545fbdd1 Author: Vladimir Kondratyev AuthorDate: 2021-05-28 20:25:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:57:37 +0000 usbhid(4): Add second set of USB transfers to work in polled mode. The second set of USB transfer is requested by hkbd(4) and should improve HID keyboard handling in kdb and panic contexts. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30486 (cherry picked from commit 9aa0e5af75d033aa2dff763dd2886daaa7213612) --- sys/dev/hid/hid_if.m | 9 +++--- sys/dev/hid/hidbus.c | 3 ++ sys/dev/iicbus/iichid.c | 3 ++ sys/dev/usb/input/usbhid.c | 77 +++++++++++++++++++++++++++++++++++++--------- 4 files changed, 73 insertions(+), 19 deletions(-) diff --git a/sys/dev/hid/hid_if.m b/sys/dev/hid/hid_if.m index e33791ba24e8..896308fccd17 100644 --- a/sys/dev/hid/hid_if.m +++ b/sys/dev/hid/hid_if.m @@ -44,8 +44,8 @@ INTERFACE hid; # rdesc is pointer to structire containing requested maximal sizes of input, # output and feature reports. It is used by hardware transport drivers # to determine sizes of internal buffers. -# This function returns zero upon success. A non-zero return value indicates -# failure. +# This function can be subsequently called with intr parameter set to NULL +# to request intr_poll method support for transport driver. # METHOD void intr_setup { device_t dev; @@ -76,8 +76,9 @@ METHOD int intr_stop { }; # -# The following function gets called from the HID keyboard driver -# when the system has paniced. +# The following function gets called from the HID keyboard driver when +# the system has paniced. intr_setup method with NULL passed as intr parameter +# must be called once before to let transport driver to be prepared. # METHOD void intr_poll { device_t dev; diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index be3564842988..3064f9999f2f 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -457,6 +457,9 @@ hidbus_write_ivar(device_t bus, device_t child, int which, uintptr_t value) break; case HIDBUS_IVAR_FLAGS: tlc->flags = value; + if ((value & HIDBUS_FLAG_CAN_POLL) != 0) + HID_INTR_SETUP( + device_get_parent(bus), NULL, NULL, NULL); break; case HIDBUS_IVAR_DRIVER_INFO: tlc->driver_info = value; diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fe949f113984..7c51a697c4c7 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -782,6 +782,9 @@ iichid_intr_setup(device_t dev, hid_intr_t intr, void *context, { struct iichid_softc *sc; + if (intr == NULL) + return; + sc = device_get_softc(dev); /* * Do not rely on wMaxInputLength, as some devices may set it to diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index 4fb846840b8a..c6f2a1f24303 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR usbhid_debug #include @@ -85,6 +86,8 @@ SYSCTL_INT(_hw_usb_usbhid, OID_AUTO, debug, CTLFLAG_RWTUN, &usbhid_debug, 0, "Debug level"); #endif +/* Second set of USB transfers for polling mode */ +#define POLL_XFER(xfer) ((xfer) + USBHID_N_TRANSFER) enum { USBHID_INTR_OUT_DT, USBHID_INTR_IN_DT, @@ -123,8 +126,9 @@ struct usbhid_softc { struct mtx sc_mtx; struct usb_config sc_config[USBHID_N_TRANSFER]; - struct usb_xfer *sc_xfer[USBHID_N_TRANSFER]; - struct usbhid_xfer_ctx sc_xfer_ctx[USBHID_N_TRANSFER]; + struct usb_xfer *sc_xfer[POLL_XFER(USBHID_N_TRANSFER)]; + struct usbhid_xfer_ctx sc_xfer_ctx[POLL_XFER(USBHID_N_TRANSFER)]; + bool sc_can_poll; struct usb_device *sc_udev; uint8_t sc_iface_no; @@ -317,6 +321,8 @@ usbhid_xfer_max_len(struct usb_xfer *xfer) static inline int usbhid_xfer_check_len(struct usbhid_softc* sc, int xfer_idx, hid_size_t len) { + if (USB_IN_POLLING_MODE_FUNC()) + xfer_idx = POLL_XFER(xfer_idx); if (sc->sc_xfer[xfer_idx] == NULL) return (ENODEV); if (len > usbd_xfer_max_len(sc->sc_xfer[xfer_idx])) @@ -333,6 +339,39 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, bool nowrite; int error; + nowrite = hid_test_quirk(&sc->sc_hw, HQ_NOWRITE); + + /* + * Setup the USB transfers one by one, so they are memory independent + * which allows for handling panics triggered by the HID drivers + * itself, typically by hkbd via CTRL+ALT+ESC sequences. Or if the HID + * keyboard driver was processing a key at the moment of panic. + */ + if (intr == NULL) { + if (sc->sc_can_poll) + return; + for (n = 0; n != USBHID_N_TRANSFER; n++) { + if (nowrite && n == USBHID_INTR_OUT_DT) + continue; + error = usbd_transfer_setup(sc->sc_udev, + &sc->sc_iface_index, sc->sc_xfer + POLL_XFER(n), + sc->sc_config + n, 1, + (void *)(sc->sc_xfer_ctx + POLL_XFER(n)), + &sc->sc_mtx); + if (error) + DPRINTF("xfer %d setup error=%s\n", n, + usbd_errstr(error)); + } + mtx_lock(&sc->sc_mtx); + if (sc->sc_xfer[USBHID_INTR_IN_DT] != NULL && + sc->sc_xfer[USBHID_INTR_IN_DT]->flags_int.started) + usbd_transfer_start( + sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); + mtx_unlock(&sc->sc_mtx); + sc->sc_can_poll = true; + return; + } + sc->sc_intr_handler = intr; sc->sc_intr_ctx = context; bcopy(usbhid_config, sc->sc_config, sizeof(usbhid_config)); @@ -344,14 +383,6 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_config[USBHID_CTRL_DT].bufsize = MAX(rdesc->isize, MAX(rdesc->osize, rdesc->fsize)); - nowrite = hid_test_quirk(&sc->sc_hw, HQ_NOWRITE); - - /* - * Setup the USB transfers one by one, so they are memory independent - * which allows for handling panics triggered by the HID drivers - * itself, typically by hkbd via CTRL+ALT+ESC sequences. Or if the HID - * keyboard driver was processing a key at the moment of panic. - */ for (n = 0; n != USBHID_N_TRANSFER; n++) { if (nowrite && n == USBHID_INTR_OUT_DT) continue; @@ -378,6 +409,10 @@ usbhid_intr_unsetup(device_t dev) struct usbhid_softc* sc = device_get_softc(dev); usbd_transfer_unsetup(sc->sc_xfer, USBHID_N_TRANSFER); + if (sc->sc_can_poll) + usbd_transfer_unsetup( + sc->sc_xfer, POLL_XFER(USBHID_N_TRANSFER)); + sc->sc_can_poll = false; free(sc->sc_intr_buf, M_USBDEV); } @@ -397,7 +432,16 @@ usbhid_intr_start(device_t dev) .cb_ctx = sc, .buf = sc->sc_intr_buf, }; + sc->sc_xfer_ctx[POLL_XFER(USBHID_INTR_IN_DT)] = (struct usbhid_xfer_ctx) { + .req.intr.maxlen = + usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]), + .cb = usbhid_intr_handler_cb, + .cb_ctx = sc, + .buf = sc->sc_intr_buf, + }; usbd_transfer_start(sc->sc_xfer[USBHID_INTR_IN_DT]); + if (sc->sc_can_poll) + usbd_transfer_start(sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); mtx_unlock(&sc->sc_mtx); return (0); @@ -410,6 +454,8 @@ usbhid_intr_stop(device_t dev) usbd_transfer_drain(sc->sc_xfer[USBHID_INTR_IN_DT]); usbd_transfer_drain(sc->sc_xfer[USBHID_INTR_OUT_DT]); + if (sc->sc_can_poll) + usbd_transfer_drain(sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); return (0); } @@ -419,7 +465,9 @@ usbhid_intr_poll(device_t dev) { struct usbhid_softc* sc = device_get_softc(dev); + MPASS(sc->sc_can_poll); usbd_transfer_poll(sc->sc_xfer + USBHID_INTR_IN_DT, 1); + usbd_transfer_poll(sc->sc_xfer + POLL_XFER(USBHID_INTR_IN_DT), 1); } /* @@ -430,12 +478,13 @@ usbhid_sync_xfer(struct usbhid_softc* sc, int xfer_idx, union usbhid_device_request *req, void *buf) { int error, timeout; - struct usbhid_xfer_ctx *xfer_ctx, save; + struct usbhid_xfer_ctx *xfer_ctx; xfer_ctx = sc->sc_xfer_ctx + xfer_idx; if (USB_IN_POLLING_MODE_FUNC()) { - save = *xfer_ctx; + xfer_ctx = POLL_XFER(xfer_ctx); + xfer_idx = POLL_XFER(xfer_idx); } else { mtx_lock(&sc->sc_mtx); ++xfer_ctx->waiters; @@ -473,9 +522,7 @@ usbhid_sync_xfer(struct usbhid_softc* sc, int xfer_idx, if (error == 0) *req = xfer_ctx->req; - if (USB_IN_POLLING_MODE_FUNC()) { - *xfer_ctx = save; - } else { + if (!USB_IN_POLLING_MODE_FUNC()) { xfer_ctx->influx = false; if (xfer_ctx->waiters != 0) wakeup_one(&xfer_ctx->waiters); From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:02:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 038CB6429A8; Sun, 13 Jun 2021 22:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qW6bnFz3Dm1; Sun, 13 Jun 2021 22:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB03BFB3; Sun, 13 Jun 2021 22:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2lH4074791; Sun, 13 Jun 2021 22:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2lBS074790; Sun, 13 Jun 2021 22:02:47 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:47 GMT Message-Id: <202106132202.15DM2lBS074790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 927742783f9e - stable/13 - ums(4): Start USB xfers on opening of evdev node unconditionally. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 927742783f9e870d0a58196d2b64491e460f9af5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:48 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=927742783f9e870d0a58196d2b64491e460f9af5 commit 927742783f9e870d0a58196d2b64491e460f9af5 Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:41:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:58:44 +0000 ums(4): Start USB xfers on opening of evdev node unconditionally. This fixes inability to start USB xfers in a case when FIFO has been already open()-ed but no read() or poll() calls has been issued yet. MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D30343 (cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad) --- sys/dev/usb/input/ums.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 6b7c3d526ad0..3d57a6c7be5d 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -949,8 +949,8 @@ ums_ev_open(struct evdev_dev *evdev) if (sc->sc_fflags == 0) { ums_reset(sc); - ums_start_rx(sc); } + ums_start_rx(sc); return (0); } From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:02:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65DFF6424CE; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qY0pWyz3F03; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01AF6DF4; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2mxi074816; Sun, 13 Jun 2021 22:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2m7E074815; Sun, 13 Jun 2021 22:02:48 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:48 GMT Message-Id: <202106132202.15DM2m7E074815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: a4a738ba7575 - stable/13 - ums(4): Do not stop USB xfers on FIFO close when evdev is still active MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4a738ba757571088143c8c781d187b71c3a672d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:49 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a4a738ba757571088143c8c781d187b71c3a672d commit a4a738ba757571088143c8c781d187b71c3a672d Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:38:53 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:59:18 +0000 ums(4): Do not stop USB xfers on FIFO close when evdev is still active This fixes lose of evdev events after moused has been killed. While here use bitwise operations for UMS_EVDEV_OPENED flag. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30342 (cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35) --- sys/dev/usb/input/ums.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 3d57a6c7be5d..cce1831287e4 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -380,7 +380,7 @@ tr_setup: /* check if we can put more data into the FIFO */ if (usb_fifo_put_bytes_max(sc->sc_fifo.fp[USB_FIFO_RX]) == 0) { #ifdef EVDEV_SUPPORT - if (sc->sc_evflags == 0) + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) break; #else break; @@ -858,7 +858,10 @@ ums_fifo_stop_read(struct usb_fifo *fifo) { struct ums_softc *sc = usb_fifo_softc(fifo); - ums_stop_rx(sc); +#ifdef EVDEV_SUPPORT + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) +#endif + ums_stop_rx(sc); } #if ((MOUSE_SYS_PACKETSIZE != 8) || \ @@ -945,7 +948,7 @@ ums_ev_open(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = UMS_EVDEV_OPENED; + sc->sc_evflags |= UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) { ums_reset(sc); @@ -962,7 +965,7 @@ ums_ev_close(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = 0; + sc->sc_evflags &= ~UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) ums_stop_rx(sc); @@ -984,7 +987,7 @@ ums_fifo_open(struct usb_fifo *fifo, int fflags) /* check for first open */ #ifdef EVDEV_SUPPORT - if (sc->sc_fflags == 0 && sc->sc_evflags == 0) + if (sc->sc_fflags == 0 && (sc->sc_evflags & UMS_EVDEV_OPENED) == 0) ums_reset(sc); #else if (sc->sc_fflags == 0) From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:02:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBCBC642B19; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qZ2W9rz3Dpp; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 178DCE3F; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2n2m074840; Sun, 13 Jun 2021 22:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2nmR074839; Sun, 13 Jun 2021 22:02:49 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:49 GMT Message-Id: <202106132202.15DM2nmR074839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e9dd950507ed - stable/13 - iwmbtfw(8): Improve Intel 7260/7265 adaptors handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e9dd950507ed02b7d9ef1f78334246e757b47894 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:51 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e9dd950507ed02b7d9ef1f78334246e757b47894 commit e9dd950507ed02b7d9ef1f78334246e757b47894 Author: Vladimir Kondratyev AuthorDate: 2021-05-31 19:32:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:59:38 +0000 iwmbtfw(8): Improve Intel 7260/7265 adaptors handling - Allow firmware downloading for hw_variant #8; - Enter manufacturer mode for setting of event mask; - Handle multi-event response on HCI commands for 7260; This allows to remove kludge with skipping of 0xfc2f opcode. - Disable patch and exit manufacturer mode on downloading failure; - Use default firmware if correct firmware file is not found; Reviewed by: Philippe Michaud-Boudreault Tested by: arrowd Differential revision: https://reviews.freebsd.org/D30543 (cherry picked from commit da93a73f834612b659b37b513c8296e1178d249b) --- usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 14 ++++ usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 116 ++++++++++++++++++++-------------- usr.sbin/bluetooth/iwmbtfw/main.c | 9 ++- 3 files changed, 91 insertions(+), 48 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index fc93ce094adc..963d5d5d9008 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -116,10 +116,12 @@ char * iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, const char *prefix, const char *suffix) { + struct stat sb; char *fwname; switch (ver->hw_variant) { case 0x07: /* 7260 */ + case 0x08: /* 7265 */ asprintf(&fwname, "%s/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.%s", prefix, le16toh(ver->hw_platform), @@ -131,6 +133,18 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, le16toh(ver->fw_build_ww), le16toh(ver->fw_build_yy), suffix); + /* + * Fallback to the default firmware patch if + * the correct firmware patch file is not found. + */ + if (stat(fwname, &sb) != 0 && errno == ENOENT) { + free(fwname); + asprintf(&fwname, "%s/ibt-hw-%x.%x.%s", + prefix, + le16toh(ver->hw_platform), + le16toh(ver->hw_variant), + suffix); + } break; case 0x0b: /* 8260 */ diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index f4272548d560..218fd28b74a2 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -134,17 +134,18 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, struct iwmbt_firmware fw_job = *fw; uint16_t cmd_opcode; uint8_t cmd_length; - uint8_t cmd_buf[IWMBT_HCI_MAX_CMD_SIZE]; + struct iwmbt_hci_cmd *cmd_buf; uint8_t evt_code; uint8_t evt_length; uint8_t evt_buf[IWMBT_HCI_MAX_EVENT_SIZE]; - int skip_patch = 0; + int activate_patch = 0; - for (;;) { - skip_patch = 0; - - if (fw_job.len < 4) - break; + while (fw_job.len > 0) { + if (fw_job.len < 4) { + iwmbt_err("Invalid firmware, unexpected EOF in HCI " + "command header. Remains=%d", fw_job.len); + return (-1); + } if (fw_job.buf[0] != 0x01) { iwmbt_err("Invalid firmware, expected HCI command (%d)", @@ -159,47 +160,61 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, /* Load in the HCI command to perform. */ cmd_opcode = le16dec(fw_job.buf); cmd_length = fw_job.buf[2]; - memcpy(cmd_buf, fw_job.buf, 3); + cmd_buf = (struct iwmbt_hci_cmd *)fw_job.buf; iwmbt_debug("opcode=%04x, len=%02x", cmd_opcode, cmd_length); - /* For some reason the command 0xfc2f hangs up my card. */ - if (cmd_opcode == 0xfc2f) - skip_patch = 1; + /* + * If there is a command that loads a patch in the + * firmware file, then activate the patch upon success, + * otherwise just disable the manufacturer mode. + */ + if (cmd_opcode == 0xfc8e) + activate_patch = 1; /* Advance by three. */ fw_job.buf += 3; fw_job.len -= 3; - if (fw_job.len < cmd_length) - cmd_length = fw_job.len; - - /* Copy data to HCI command buffer. */ - memcpy(cmd_buf + 3, fw_job.buf, - MIN(cmd_length, IWMBT_HCI_MAX_CMD_SIZE - 3)); + if (fw_job.len < cmd_length) { + iwmbt_err("Invalid firmware, unexpected EOF in HCI " + "command data. len=%d, remains=%d", + cmd_length, fw_job.len); + return (-1); + } /* Advance by data length. */ fw_job.buf += cmd_length; fw_job.len -= cmd_length; + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_DEVICE, + 0, + 0, + 0, + (uint8_t *)cmd_buf, + IWMBT_HCI_CMD_SIZE(cmd_buf), + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0) { + iwmbt_err("libusb_control_transfer() failed: err=%s", + libusb_strerror(ret)); + return (-1); + } + /* * Every command has its associated event: data must match * what is recorded in the firmware file. Perform that check * now. - * - * Some commands are mapped to more than one event sequence, - * in that case we can drop the non-patch commands, as we - * probably don't need them for operation of the card. - * */ - for (;;) { + while (fw_job.len > 0 && fw_job.buf[0] == 0x02) { /* Is this the end of the file? */ - if (fw_job.len < 3) - break; - - if (fw_job.buf[0] != 0x02) - break; + if (fw_job.len < 3) { + iwmbt_err("Invalid firmware, unexpected EOF in" + "event header. remains=%d", fw_job.len); + return (-1); + } /* Advance by one. */ fw_job.buf++; @@ -219,30 +234,39 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, iwmbt_debug("event=%04x, len=%02x", evt_code, evt_length); + if (fw_job.len < evt_length) { + iwmbt_err("Invalid firmware, unexpected EOF in" + " event data. len=%d, remains=%d", + evt_length, fw_job.len); + return (-1); + } + + ret = libusb_interrupt_transfer(hdl, + IWMBT_INTERRUPT_ENDPOINT_ADDR, + evt_buf, + IWMBT_HCI_MAX_EVENT_SIZE, + &transferred, + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0) { + iwmbt_err("libusb_interrupt_transfer() failed:" + " err=%s", libusb_strerror(ret)); + return (-1); + } + + if ((int)evt_length + 2 != transferred || + memcmp(evt_buf + 2, fw_job.buf, evt_length) != 0) { + iwmbt_err("event does not match firmware"); + return (-1); + } + /* Advance by data length. */ fw_job.buf += evt_length; fw_job.len -= evt_length; - - if (skip_patch == 0) { - ret = iwmbt_hci_command(hdl, - (struct iwmbt_hci_cmd *)cmd_buf, - evt_buf, - IWMBT_HCI_MAX_EVENT_SIZE, - &transferred, - IWMBT_HCI_CMD_TIMEOUT); - - if (ret < 0) { - iwmbt_debug("Can't send patch: " - "code=%d, size=%d", - ret, - transferred); - return (-1); - } - } } } - return (0); + return (activate_patch); } int diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 3476e3fcd613..202894740805 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -441,13 +441,15 @@ main(int argc, char *argv[]) /* Download firmware and parse it for magic Intel Reset parameter */ r = iwmbt_patch_firmware(hdl, firmware_path); free(firmware_path); - if (r < 0) + if (r < 0) { + (void)iwmbt_exit_manufacturer(hdl, 0x01); goto shutdown; + } iwmbt_info("Firmware download complete"); /* Exit manufacturer mode */ - r = iwmbt_exit_manufacturer(hdl, 0x02); + r = iwmbt_exit_manufacturer(hdl, r == 0 ? 0x00 : 0x02); if (r < 0) { iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); goto shutdown; @@ -462,9 +464,12 @@ main(int argc, char *argv[]) iwmbt_dump_version(&ver); /* Set Intel Event mask */ + if (iwmbt_enter_manufacturer(hdl) < 0) + goto reset; r = iwmbt_set_event_mask(hdl); if (r == 0) iwmbt_info("Intel Event Mask is set"); + (void)iwmbt_exit_manufacturer(hdl, 0x00); } else { From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:08:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 261C3644503; Sun, 13 Jun 2021 22:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37xr0bNhz3FTR; Sun, 13 Jun 2021 22:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F11141026; Sun, 13 Jun 2021 22:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM8Fqj075400; Sun, 13 Jun 2021 22:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM8FOM075399; Sun, 13 Jun 2021 22:08:15 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:08:15 GMT Message-Id: <202106132208.15DM8FOM075399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7c55c8c7ff72 - stable/12 - ums(4): Start USB xfers on opening of evdev node unconditionally. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7c55c8c7ff7259bc40d2df7b07865bb800aba49f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:08:16 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7c55c8c7ff7259bc40d2df7b07865bb800aba49f commit 7c55c8c7ff7259bc40d2df7b07865bb800aba49f Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:41:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 22:05:21 +0000 ums(4): Start USB xfers on opening of evdev node unconditionally. This fixes inability to start USB xfers in a case when FIFO has been already open()-ed but no read() or poll() calls has been issued yet. Differential revision: https://reviews.freebsd.org/D30343 (cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad) --- sys/dev/usb/input/ums.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 40b7a8aed774..cd5cc905f1b5 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -959,8 +959,8 @@ ums_ev_open(struct evdev_dev *evdev) if (sc->sc_fflags == 0) { ums_reset(sc); - ums_start_rx(sc); } + ums_start_rx(sc); return (0); } From owner-dev-commits-src-branches@freebsd.org Sun Jun 13 22:08:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 627CB64441F; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37xs1jy2z3FD4; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E966CFC; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM8H3m075424; Sun, 13 Jun 2021 22:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM8HtC075423; Sun, 13 Jun 2021 22:08:17 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:08:17 GMT Message-Id: <202106132208.15DM8HtC075423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8696dd92ffb7 - stable/12 - ums(4): Do not stop USB xfers on FIFO close when evdev is still active MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8696dd92ffb776263226114f23715746a9abc296 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:08:17 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8696dd92ffb776263226114f23715746a9abc296 commit 8696dd92ffb776263226114f23715746a9abc296 Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:38:53 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 22:05:25 +0000 ums(4): Do not stop USB xfers on FIFO close when evdev is still active This fixes lose of evdev events after moused has been killed. While here use bitwise operations for UMS_EVDEV_OPENED flag. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30342 (cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35) --- sys/dev/usb/input/ums.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index cd5cc905f1b5..dced48754041 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -381,7 +381,7 @@ tr_setup: /* check if we can put more data into the FIFO */ if (usb_fifo_put_bytes_max(sc->sc_fifo.fp[USB_FIFO_RX]) == 0) { #ifdef EVDEV_SUPPORT - if (sc->sc_evflags == 0) + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) break; #else break; @@ -866,7 +866,10 @@ ums_fifo_stop_read(struct usb_fifo *fifo) { struct ums_softc *sc = usb_fifo_softc(fifo); - ums_stop_rx(sc); +#ifdef EVDEV_SUPPORT + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) +#endif + ums_stop_rx(sc); } @@ -955,7 +958,7 @@ ums_ev_open(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = UMS_EVDEV_OPENED; + sc->sc_evflags |= UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) { ums_reset(sc); @@ -972,7 +975,7 @@ ums_ev_close(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = 0; + sc->sc_evflags &= ~UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) ums_stop_rx(sc); @@ -994,7 +997,7 @@ ums_fifo_open(struct usb_fifo *fifo, int fflags) /* check for first open */ #ifdef EVDEV_SUPPORT - if (sc->sc_fflags == 0 && sc->sc_evflags == 0) + if (sc->sc_fflags == 0 && (sc->sc_evflags & UMS_EVDEV_OPENED) == 0) ums_reset(sc); #else if (sc->sc_fflags == 0)