From nobody Fri Sep 06 07:17:40 2024 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 4X0SH90YgGz5WC0J; Fri, 06 Sep 2024 07:17:41 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0SH904Jxz4KYk; Fri, 6 Sep 2024 07:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725607061; 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=euIRwqxLb1sq3IYquP8Ss7+nHFVbX5IuP6IjBpS6x8Q=; b=T2QuJyHYyv8IhDP9+AC5IOelB3lHlEb27OQ3IK7UVjnhyhyUnceYQeA1qDU3j+XpM1x3Mx xMA2f0KvX85wDIUcAVfriDQD0/6PewFB3LUNP98TlNVU/0UaieTPzLyxfWynY9IM0z2shk ikW5EQcPLJt0E6ibVBVyvhQNIwB+3ryMQ9FXW7al60EYZyRsKaIdSVIFYsIG6ulc6Vu2NC 12LHotuVL9pT3gcvPAM0CBAZYj03vcnBWoZV0bPjtdnmFPsQyud74hzaXq30QG/i27Q5rc A3eTJjswwjUyogwzP3eMRdY0MDMaEOFw3bTaj3Ghea6IumhuXNomLkhIf1PLrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725607061; a=rsa-sha256; cv=none; b=kugGIF8lQd/m6setUZigQ94njk8+MRLp0ees5MRhKJ7PCbrjA3dP+Mh0XBP+XcwkAp82U3 mDhCeT6n4iAXEkdNMIuTf+rpaIW6nZ+8vUAcTtL0pKc+/o3eRxxJ71bl8GKDDzgjZkxPOd VzcEL5RK39LxrH3ke9iJLO4kN2w+qr/d/DYPYskYZBkg8Dpkgcjb71pNa28ZK4dO/AULQV +6XBghhyJvLqiXhSmQVxGHwhlmqbZO8bRqsrlKknF/chaYW6zgr9jOwZ5jVyCnliuDoUzc VcZiIgU+MHjD2JFkQeqLPaCX7TZGtYmA+SIfaY0MH5aZPo8xHBdrkvcaC8V9TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725607061; 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=euIRwqxLb1sq3IYquP8Ss7+nHFVbX5IuP6IjBpS6x8Q=; b=nZVYLQfbnJ4TZt7V8FyoX9G3bwPdzTo3ZM+6NUwDqHW7kxCEEBeYD8vrdIWHVLHpiYypaj brJsYMerzirD88BrleAR766osXop2ux1DFNglR2KnNO/iNTu2wHuUcyfDE8aWrhJVmJsaF YeXxifXBdEO8XXfVyCN45IeGwTIblR5Wj8R6tzFYrTe2A+l1OoEOa8Mzp5g4xvUUb1nydX ZqqUu/8XHAqcXUsMCzaLwdHgBjSBWOdm/9UYEU1YZ979IevXW7OP56KqMB7Jyv873ZAZSA dlIGechLInJzcVVSoraXXJroDssab0Ug+KgQckgWKd4i4cPmFFj+hnZd8hP8og== 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 4X0SH86NXfzhBy; Fri, 6 Sep 2024 07:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4867HeUs050415; Fri, 6 Sep 2024 07:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4867HemL050412; Fri, 6 Sep 2024 07:17:40 GMT (envelope-from git) Date: Fri, 6 Sep 2024 07:17:40 GMT Message-Id: <202409060717.4867HemL050412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 674cbf38f6d0 - main - cxgbe/t4_tom: Add synq entry to the list before calling send_synack. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 674cbf38f6d0a0b307e52c4265da9f077606b035 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=674cbf38f6d0a0b307e52c4265da9f077606b035 commit 674cbf38f6d0a0b307e52c4265da9f077606b035 Author: Navdeep Parhar AuthorDate: 2024-09-06 06:21:59 +0000 Commit: Navdeep Parhar 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));