Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2020 18:01:22 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 672784750001 - main - Don't try to adjust a TLS TOE socket that has been closed.
Message-ID:  <202012301801.0BUI1MRr086136@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=67278475000116086fea848f22a8d0d1be885e26

commit 67278475000116086fea848f22a8d0d1be885e26
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2020-12-09 22:36:01 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012301801.0BUI1MRr086136>