git: 672784750001 - main - Don't try to adjust a TLS TOE socket that has been closed.
John Baldwin
jhb at FreeBSD.org
Wed Dec 30 18:01:22 UTC 2020
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=67278475000116086fea848f22a8d0d1be885e26
commit 67278475000116086fea848f22a8d0d1be885e26
Author: John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2020-12-09 22:36:01 +0000
Commit: John Baldwin <jhb at 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
More information about the dev-commits-src-all
mailing list