From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DA184BAA18 for ; Thu, 3 Sep 2026 14:31:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788445882; cv=none; b=gRVUAVMAgENkm3e1lAuci2Ua3m9fim1x0ktDn9vTnMNZIbvTcwVtnwK0oKQklMToQfYGKyvinwP57ONDtTwQMSf2YQn8qyW/hha3elUB38ZLxSgIlzOcuK2j1wqYu1IO0yBmr+MDVnWt710BZeJXVtgwHRKcyjY+mQ+tXGmL7zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788445882; c=relaxed/simple; bh=4UGQXAvgcLYx/szdnYeX0eORtcXmrnd5li3p/yLbNrI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=sRlj7E6gLvm8o4WNgtcUJ9KEf2Ttxp8NaaI9IafsLAoqGbdmdJhYRry6cG5VdZQawxXdPEEk/nNc3EiQ5nV6CkejSVpiMgjpiaqmpPiJZ+1EMwGq0KccwwFYRUEQHxAYe4T++CfhAj7rUTm4aGWYGCAhF69qzL5sjIAiurdBRw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Fp9EIbie; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Fp9EIbie" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 874191F00A3F; Thu, 3 Sep 2026 14:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788445872; bh=LTe1l/DuVM9ELBcRIEjSxJFCEaNeCJxsvE5C0SAX4JM=; h=Subject:To:Cc:From:Date; b=Fp9EIbieFmgkrOpU10+McM5tVd5JmHee7YxZFn8zGRT7ofLg7homTqUG9X8GiCOzI PUqa6mehcf8BOZnq4qZpqjRKqGOtBjaYrE24h5CUDRXa5GU0AsNoqOt5EsHgU8tLYw CytgPxkVM0zsC7QeES272e78caBNBvrdVAs4wElY= Subject: FAILED: patch "[PATCH] svcrdma: Reject connection when transport allocation fails" failed to apply to 6.6-stable tree To: cel@kernel.org,chuck.lever@oracle.com,jlayton@kernel.org Cc: From: Date: Thu, 03 Sep 2026 16:10:03 +0200 Message-ID: <2026090303-catcall-blinked-014b@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 0944462247dcb7de7622cdaaadf5f05c52707dab # git commit -s git send-email --to '' --in-reply-to '2026090303-catcall-blinked-014b@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0944462247dcb7de7622cdaaadf5f05c52707dab Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 27 May 2026 11:00:14 -0400 Subject: [PATCH] svcrdma: Reject connection when transport allocation fails handle_connect_req() returns without action when svc_rdma_create_xprt() fails to allocate the new transport. The CM core returns 0 for CONNECT_REQUEST events, so it does not destroy the new rdma_cm_id. Each allocation failure under memory pressure leaks one rdma_cm_id, and a remote peer driving connection attempts can amplify this. Reject the connection by returning a non-zero status from the CM event handler, which tells the CM core to destroy the orphaned cm_id. Fixes: 377f9b2f4529 ("rdma: SVCRDMA Core Transport Services") Cc: stable@vger.kernel.org Acked-by: Jeff Layton Link: https://patch.msgid.link/20260527-rdma-follow-on-v1-4-1b09bd87b6cd@oracle.com Signed-off-by: Chuck Lever diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 63dbf16dbe7f..656b2bd258a9 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -246,12 +246,16 @@ svc_rdma_parse_connect_private(struct svcxprt_rdma *newxprt, * structure for the listening endpoint. * * This function creates a new xprt for the new connection and enqueues it on - * the accept queue for the listent xprt. When the listen thread is kicked, it + * the accept queue for the listen xprt. When the listen thread is kicked, it * will call the recvfrom method on the listen xprt which will accept the new * connection. + * + * Return values: + * %0: Do not destroy @new_cma_id + * %1: Destroy @new_cma_id (allocation failure) */ -static void handle_connect_req(struct rdma_cm_id *new_cma_id, - struct rdma_conn_param *param) +static int handle_connect_req(struct rdma_cm_id *new_cma_id, + struct rdma_conn_param *param) { struct svcxprt_rdma *listen_xprt = new_cma_id->context; struct svcxprt_rdma *newxprt; @@ -261,7 +265,7 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id, listen_xprt->sc_xprt.xpt_net, ibdev_to_node(new_cma_id->device)); if (!newxprt) - return; + return 1; newxprt->sc_cm_id = new_cma_id; new_cma_id->context = newxprt; svc_rdma_parse_connect_private(newxprt, param); @@ -295,6 +299,7 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id, set_bit(XPT_CONN, &listen_xprt->sc_xprt.xpt_flags); svc_xprt_enqueue(&listen_xprt->sc_xprt); + return 0; } /** @@ -318,8 +323,7 @@ static int svc_rdma_listen_handler(struct rdma_cm_id *cma_id, switch (event->event) { case RDMA_CM_EVENT_CONNECT_REQUEST: - handle_connect_req(cma_id, &event->param.conn); - break; + return handle_connect_req(cma_id, &event->param.conn); case RDMA_CM_EVENT_ADDR_CHANGE: listen_id = svc_rdma_create_listen_id(cma_rdma->xpt_net, sap, cma_xprt);