git: 674cbf38f6d0 - main - cxgbe/t4_tom: Add synq entry to the list before calling send_synack.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Sep 2024 07:17:40 UTC
The branch main has been updated by np:
URL: https://cgit.FreeBSD.org/src/commit/?id=674cbf38f6d0a0b307e52c4265da9f077606b035
commit 674cbf38f6d0a0b307e52c4265da9f077606b035
Author: Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2024-09-06 06:21:59 +0000
Commit: Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2024-09-06 06:21:59 +0000
cxgbe/t4_tom: Add synq entry to the list before calling send_synack.
This fixes a panic where the peer's ack to the synack arrives on a
different queue and do_pass_establish tries to remove the synqe from
synqe_list before it has been added by do_pass_accept_req.
Reported by: Sony Arpita Das @ Chelsio
Fixes: 283333c0e329 cxgbe/t4_tom: Track all synq entries in a per-adapter list.
MFC after: 1 week
Sponsored by: Chelsio Communications
---
sys/dev/cxgbe/tom/t4_listen.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c
index f91d193c0fed..8a39218a55ba 100644
--- a/sys/dev/cxgbe/tom/t4_listen.c
+++ b/sys/dev/cxgbe/tom/t4_listen.c
@@ -1494,18 +1494,20 @@ found:
synqe->tid = tid;
synqe->syn = m;
m = NULL;
+ mtx_lock(&td->toep_list_lock);
+ TAILQ_INSERT_TAIL(&td->synqe_list, synqe, link);
+ mtx_unlock(&td->toep_list_lock);
if (send_synack(sc, synqe, opt0, opt2, tid) != 0) {
remove_tid(sc, tid, ntids);
m = synqe->syn;
synqe->syn = NULL;
+ mtx_lock(&td->toep_list_lock);
+ TAILQ_REMOVE(&td->synqe_list, synqe, link);
+ mtx_unlock(&td->toep_list_lock);
NET_EPOCH_EXIT(et);
REJECT_PASS_ACCEPT_REQ(true);
}
-
- mtx_lock(&td->toep_list_lock);
- TAILQ_INSERT_TAIL(&td->synqe_list, synqe, link);
- mtx_unlock(&td->toep_list_lock);
CTR6(KTR_CXGBE,
"%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x",
__func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2));