From nobody Mon Sep 5 17:26:54 2022 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 4MLwRy5D7yz4bB82; Mon, 5 Sep 2022 17:26: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 4MLwRy4ZVKz47j2; Mon, 5 Sep 2022 17:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662398814; 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=oJPfS0iDUHp68MtQ4vmGW5AHB01G0sYpKsZTZjIBemU=; b=p38KmgJJNXu+KciP0tH0mP1TSPPIxhb3dmoX8fCYY71Ul1MUc5Dgbs2E/r7vqK8qjDCsB+ Fq7yE55mXd9/rMWca5x3hy8KbPcxIQIo30vSuyiVIhmaF5dui6xMllO1vnnmRfdslbZeup vksm7cWt7XddqdBt5A9e773lOFQ9AcHu/5Y1l5wLt9aJyPlsO2nvC+XQBEtYknoNt5wv9g vf99rgnMrGpNPPADGpkZ+ljXkpvA/Vv8z8kF0S7HqeE2Qrr36k4cMDbjESsoDG/kQRNe4L 61EYu3xakByU/3gH6ZrHiRFTfaQqVIsqAeKqIhNGCgsR9fxZdnl+/Rynp4T8KQ== 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 4MLwRy3PLJztkk; Mon, 5 Sep 2022 17:26: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 285HQsUw087286; Mon, 5 Sep 2022 17:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 285HQs75087285; Mon, 5 Sep 2022 17:26:54 GMT (envelope-from git) Date: Mon, 5 Sep 2022 17:26:54 GMT Message-Id: <202209051726.285HQs75087285@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: 0773b44e8294 - main - tcp: tcp6_connect() requires net epoch 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: 0773b44e829421a806a89087009b294f16ee51fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662398814; 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=oJPfS0iDUHp68MtQ4vmGW5AHB01G0sYpKsZTZjIBemU=; b=ja2uGQuD2jXHCdI01w54f12P5J8nN6uyXAwHw5asF85DQHOk+G1beP7yn3Vqh1wQTBGWw1 bInwtwMHR86OpCohIIvVUuI9/SLt0H/eNoHrwgeZLOt9dJURDiaJkZYHqMnY8kVexRH1WA bjjBvbeTLJ7M+3lnC+ujYu4NgWoMXRhkc6+CdVW9VVxCFaCZlMthMDBRfgqnyWWPbLY71h 3yJ8/WoBsJP7w+Imdnam5C8XaNlTugm7EQUnogHLHwBkjYCbNFbweRZWgYBlI4DPe5Uc0D ljlxgSGz2UHA8h95T8cafhfYzTYoRt2NyrFWPvq3Cyz1gN8tRF2XwWO6WNCgXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662398814; a=rsa-sha256; cv=none; b=eiZuxjN7zuNVkvm+44X35Z3a5N0HcPd9edEXixwJRv1ZnNkwgnSp1c0V4SYFOLgtLxesMR OcPVWEPIb1M0FJHLjiPR4Rblie5KNCo73lfAYNzu8HuIJxxNUv/u1v5V8F3pOVFg2Kd5Z8 QbngNDAJxRH0AVjLzuevU3fK/cZIpXR1mIF9UTDlgFlN5nP9uAGVk5isDe/nZ/Ss7wOqzK tR2WFyukdGGC9IOxaTXxWK4ropOS7dtXaV+aJ96ahiIwnrywl1b1uDcTuPze9FnrMUIQ65 +WB6Z80ceoq38/KkfLeoxctLq7XwJ6YNC1d+ijMNkdpjXe+awrobPR0YG53Y1w== 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=0773b44e829421a806a89087009b294f16ee51fd commit 0773b44e829421a806a89087009b294f16ee51fd Author: Gleb Smirnoff AuthorDate: 2022-09-05 17:15:19 +0000 Commit: Gleb Smirnoff CommitDate: 2022-09-05 17:19:11 +0000 tcp: tcp6_connect() requires net epoch PR: 262663 Reported & tested by: dch MFC after: 2 weeks --- sys/netinet/tcp_usrreq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 291d6a76bb20..d1b7ce5daa67 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -693,20 +693,18 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) inp->inp_vflag &= ~INP_IPV4; inp->inp_vflag |= INP_IPV6; inp->inp_inc.inc_flags |= INC_ISIPV6; + NET_EPOCH_ENTER(et); if ((error = tcp6_connect(tp, nam, td)) != 0) - goto out; + goto out_in_epoch; #ifdef TCP_OFFLOAD if (registered_toedevs > 0 && (so->so_options & SO_NO_OFFLOAD) == 0 && (error = tcp_offload_connect(so, nam)) == 0) - goto out; + goto out_in_epoch; #endif tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); - NET_EPOCH_ENTER(et); error = tcp_output(tp); -#ifdef INET out_in_epoch: -#endif NET_EPOCH_EXIT(et); out: KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()"