From owner-dev-commits-src-main@freebsd.org Wed Dec 30 18:01:22 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 630FF4CA618; Wed, 30 Dec 2020 18:01: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5fH62QCmz4Rvd; Wed, 30 Dec 2020 18:01: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 45CBF2207B; Wed, 30 Dec 2020 18:01: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 0BUI1MgF086137; Wed, 30 Dec 2020 18:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BUI1MRr086136; Wed, 30 Dec 2020 18:01:22 GMT (envelope-from git) Date: Wed, 30 Dec 2020 18:01:22 GMT Message-Id: <202012301801.0BUI1MRr086136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 672784750001 - main - Don't try to adjust a TLS TOE socket that has been closed. 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/main X-Git-Reftype: branch X-Git-Commit: 67278475000116086fea848f22a8d0d1be885e26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 18:01:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=67278475000116086fea848f22a8d0d1be885e26 commit 67278475000116086fea848f22a8d0d1be885e26 Author: John Baldwin AuthorDate: 2020-12-09 22:36:01 +0000 Commit: John Baldwin CommitDate: 2020-12-30 17:56:24 +0000 Don't try to adjust a TLS TOE socket that has been closed. The handshake timer can race with another thread sending a FIN or RST to close a TOE TLS socket. Just bail from the timer without rescheduling if the connection is closed when the timer fires. Reported by: Sony Arpita Das @ Chelsio QA Reviewed by: np Differential Revision: https://reviews.freebsd.org/D27583 --- sys/dev/cxgbe/tom/t4_tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 5cd043a68533..4016a4f1995a 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -739,6 +739,10 @@ tls_send_handshake_ack(void *arg) struct tls_ofld_info *tls_ofld = &toep->tls; struct adapter *sc = td_adapter(toep->td); + /* Bail without rescheduling if the connection has closed. */ + if ((toep->flags & (TPF_FIN_SENT | TPF_ABORT_SHUTDOWN)) != 0) + return; + /* * If this connection has timed out without receiving more * data, downgrade to plain TOE mode and don't re-arm the