From nobody Mon Dec 27 18:43:09 2021 X-Original-To: dev-commits-src-all@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 02A101921DCC; Mon, 27 Dec 2021 18:43: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 4JN64F5B9Fz3qjb; Mon, 27 Dec 2021 18:43: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 935AD22EC4; Mon, 27 Dec 2021 18:43: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 1BRIh9gD097764; Mon, 27 Dec 2021 18:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BRIh9Jt097762; Mon, 27 Dec 2021 18:43:09 GMT (envelope-from git) Date: Mon, 27 Dec 2021 18:43:09 GMT Message-Id: <202112271843.1BRIh9Jt097762@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: 37a7f5573716 - main - tcp_usr_rcvd: don't cast inp_ppcb to tcpcb before checking inp_flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 37a7f55737164e05d4bc4fa1f6510b4e624b6c45 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640630589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wg02aD8CZq6DDyH/j0xm1ShffNgMsMLPah/EfTO7b5M=; b=n6uxmyq0E/DJQJ68Y4xUVDsny3eMw6GOgaKXSU86liU1X+Oczjup06BMfBnxO3yH7QGC/i YsL3OZ7jpNWwnGrGVEn7DHWy5Ykrs0KjVV2ufh0n+bde+PM6eiLtc6onMIEU4gkrE8GkfG +0PjeQ1ioadxtyQr0oNhVWop7zoM5l1IKjYFwcJSfDA6awuslhBPcAhgD8NlnTnjNj0Kpy sG/66rJS/kMYOERkNpfhsLO5fDWhCED3n1+WvJUaTm19CJXYS6XjLbM62xNp7NaisMpxWO QPNzi5N6UG4Mq+uZbJHS/3XEVKwhZFlzdhMShxQu21w7QxXUMB5xEuHn+qGgJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640630589; a=rsa-sha256; cv=none; b=d/4mWrg3igYLrHoySU9geo8czm5XZGelYoZ9+jkMl21AxzTPTXFPc9fCYLvx5Tov3Mn6ng ivRn+zxI17NadQjH+0mb5AeHEqpsz8tGADLLmsONrTdensk6aZBx0MBeIjwqdfmIvrL/jE SyoyjGpf/VqPJcP2kH4OltXAX7X59uKZLJMEsY8PUw/90THzg19KWX/Fsoulghuvx+x4pE jZrgy+BhB0UrSzIDq/CR+4mO4Md9ygidTXMuj+5j5Ktt/Sho9WgWOpzmODEt5S8iOuVmoA SCsWOhajrlVhKE3f+DAPDJtM8sEHhfun4qUqPoGt7jF2g4EiVKNVGeAiuEN5aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=37a7f55737164e05d4bc4fa1f6510b4e624b6c45 commit 37a7f55737164e05d4bc4fa1f6510b4e624b6c45 Author: Gleb Smirnoff AuthorDate: 2021-12-27 18:41:51 +0000 Commit: Gleb Smirnoff CommitDate: 2021-12-27 18:41:51 +0000 tcp_usr_rcvd: don't cast inp_ppcb to tcpcb before checking inp_flags Fixes: f64dc2ab5be38e5366271ef85ea90d8cb1c7841a --- sys/netinet/tcp_usrreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 06dee4c90ed6..7c791e0c4871 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -934,12 +934,12 @@ tcp_usr_rcvd(struct socket *so, int flags) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL")); INP_WLOCK(inp); - NET_EPOCH_ENTER(et); - tp = intotcpcb(inp); if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - error = ECONNRESET; - goto out; + INP_WUNLOCK(inp); + return (ECONNRESET); } + tp = intotcpcb(inp); + NET_EPOCH_ENTER(et); TCPDEBUG1(); /* * For passively-created TFO connections, don't attempt a window