From nobody Sat Nov 13 16:34:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 71646183B16C; Sat, 13 Nov 2021 16:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs1J52FlLz4rZQ; Sat, 13 Nov 2021 16:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F05C168F1; Sat, 13 Nov 2021 16:34:29 +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 1ADGYTxZ069604; Sat, 13 Nov 2021 16:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADGYThL069603; Sat, 13 Nov 2021 16:34:29 GMT (envelope-from git) Date: Sat, 13 Nov 2021 16:34:29 GMT Message-Id: <202111131634.1ADGYThL069603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: ef396441ceb8 - main - tcp_usr_detach: revert debugging piece from f5cf1e5f5a500. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef396441ceb8bce4e5d7382ff7c76928721297a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ef396441ceb8bce4e5d7382ff7c76928721297a3 commit ef396441ceb8bce4e5d7382ff7c76928721297a3 Author: Gleb Smirnoff AuthorDate: 2021-11-10 19:35:50 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-13 16:33:32 +0000 tcp_usr_detach: revert debugging piece from f5cf1e5f5a500. The code was probably useful during the problem being chased down, but for brevity makes sense just to return to the original KASSERT. Reviewed by: rrs Differential revision: https://reviews.freebsd.org/D32968 --- sys/netinet/tcp_usrreq.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 968e102248d7..198852cc8fac 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef DDB @@ -262,26 +261,10 @@ tcp_usr_detach(struct socket *so) * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { + KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " + "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); - if (__predict_true(tp == NULL)) { - in_pcbfree(inp); - } else { - /* - * This case should not happen as in TIMEWAIT - * state the inp should not be destroyed before - * its tcptw. If INVARIANTS is defined, panic. - */ -#ifdef INVARIANTS - panic("%s: Panic before an inp double-free: " - "INP_TIMEWAIT && INP_DROPPED && tp != NULL" - , __func__); -#else - log(LOG_ERR, "%s: Avoid an inp double-free: " - "INP_TIMEWAIT && INP_DROPPED && tp != NULL" - , __func__); -#endif - INP_WUNLOCK(inp); - } + in_pcbfree(inp); } else { in_pcbdetach(inp); INP_WUNLOCK(inp);