From nobody Mon Oct 21 18:39:27 2024 X-Original-To: dev-commits-src-all@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 4XXPH36ylpz5Zcty; Mon, 21 Oct 2024 18:39:27 +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 4XXPH33FrWz4GLp; Mon, 21 Oct 2024 18:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535967; 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=rQHALfZMw1voDocTbamXJb5OjDxXMY59N+cvS9QFNjE=; b=S1XJzfwMutZrCipKDtGqPzsDFC9ok7n7fSX2hQBXXX82aZ5vQRxSj1sjIB74NojxFtRXrW NpU0gHfgjyyng9QsY8LFlTxwVqlzcZNHPKv6R9keMkP66iezg3R5i1+APTf7L2KLFAzEoO 8iom6I2eWtHlna63xnq9HnvqW4xd+aoGThTFcIoQYbQ4sO5vVC5/ZE3CIJ6U4I+Ep8n2rT 7uN2u/tg/VH23u5btCh9d0b86LXDMgQSa07hsEvWHog1JiuwiS2R7MGcGbI2/7nZrJ+OkS 7+ri4V8FGywkZ1aSqXduITxJdW969DERu6Ud70azFGhVvD4yQ0T2nj9gNHDbwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535967; 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=rQHALfZMw1voDocTbamXJb5OjDxXMY59N+cvS9QFNjE=; b=YyCFshAV1LU0Wb45lT7SC3QR1KmK1BiU+YE8I+wJacVfVrRU2coWPI6TCbvmWAvmrUMA0W szz4UJTBjHbClHPIQo2wsNd864oHeSSGhKd8mUuVEiEULnIdZnY4HRMJcCHKekqjMasqOT 5zLJhK6+1FIuo5lnEU35+xHfZhrIO8rovvfK+26pZMxmjMyVe7/h/UYZ40pcx3YOLRi+rV PIXFVv+KU4FVDDQAIqPhPcGQ04Y5qgZRgOz8OPF2YnLhG2z61KRxCgvaWD9XzglKGZ4Eh9 qMzSC45R2KidnlD3cr20HsRix011wg10MGNwCudfIzdCs8y/3qk4BaSJ4H8qWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729535967; a=rsa-sha256; cv=none; b=l9paxvVpnqKOPW900fj58eFxpu1QUsMZifnpja7QDnwSqqJIdPtNzPXC+4aOZ86eHGyjBK VbpGP3bu4X92Ju9JeEzuNHJAfzQjvu8o1+qi3xWgrLhNEuibO6NIHSH0pxTKrRHzkE6Hli cc/SYqfMJEmswXzlmXa1gb0uki/0vD1FGgY+XpYyLmNyJN7k8PeIogv7GmCvQ9UOl/L6AR BQZRonOuxR5/aZ18VT+8WlZYtzMjsXk33qCt7ycjbSxvlZq4CDttjgoxxf5V5wRA7vjNNU d78b2XaZShsSGDgOq52LERMi2kgeuv3jTUkWgSHisAWP934G5ZpObLnn0Dl41g== 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 4XXPH32qdczhjL; Mon, 21 Oct 2024 18:39:27 +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 49LIdReM036964; Mon, 21 Oct 2024 18:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LIdRah036961; Mon, 21 Oct 2024 18:39:27 GMT (envelope-from git) Date: Mon, 21 Oct 2024 18:39:27 GMT Message-Id: <202410211839.49LIdRah036961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: b5c08433224b - stable/14 - cxgbe/t4_tom: Add synq entry to the list before calling send_synack. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b5c08433224be47da8ce5d4ea66f17e58cfbf650 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b5c08433224be47da8ce5d4ea66f17e58cfbf650 commit b5c08433224be47da8ce5d4ea66f17e58cfbf650 Author: Navdeep Parhar AuthorDate: 2024-09-06 06:21:59 +0000 Commit: Navdeep Parhar CommitDate: 2024-10-21 17:09:37 +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. Sponsored by: Chelsio Communications (cherry picked from commit 674cbf38f6d0a0b307e52c4265da9f077606b035) --- 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));