Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp208673pxj; Thu, 20 May 2021 07:42:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoWf/vEVPhNdd4DhS0qWrOnywqFVpHLAiwZMgSltHdZo/T+tCBQ1VfIclw2B2sw93UUj64 X-Received: by 2002:a17:907:98e6:: with SMTP id ke6mr4993854ejc.107.1621521740608; Thu, 20 May 2021 07:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621521740; cv=none; d=google.com; s=arc-20160816; b=ECgybkN3l0FtBecYUKzko1TbKn+IfEn1WyNWZQ1/L9XShGeEUyQ1RQ917Oa0trb26E wJVCSuZhk+rNXwklL4wgLksUgFBtznHfxBSHHPaE+FuEbdAf5g/ZbpEvubmPvpjO1T4V rDLRvxRNUK9eYMpEjJNWGiE4Dbg+Us/isUwh9AMg6uoYse8iP1RKwLxeQcyV0EVbgleS 7W+GPEBpndhuZBVxuPEvhHmzgijnocgjX//fju73uC/bk57J1zMFGj3qGDgDnBPX3AaA Tu3wWYBDKoyCftVPWyXkJ617A4OtY9VdUkiP6Be9flvxIe2xQ3Ik8+P7xcuJJKT2dp6f FUYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/ZBYBBF8VAxdCIvDr8IybLM1qOIhF3Ze7Ax6ywLiw/4=; b=f+k6JL0UgKnhaVIeNuqX//LqW4q3qfnk9SQBOWU0m3hB0HB7HzVyHGlbJZqdd47DUp qknX9bKzBi2yrDoSCzPdoquCDxVcjJW8HDmoz67CzyacE0Oynoz0s1K8wyrPEzunVPFj CaqdsVqy2lBqWCBwtwWQHZgQJWi8bMnBEPWMoFESr+6zQjTknjv/ddQ3L7hz4vL3g//S ymur1/pbB/yid0oqN3QYzjD+xQEE3jglBbwnHYeRXVSmgCNke4+09hunjs1GJD3RMC+/ IAU3OPxJTjDJGeESHlYEIrD1N4FUN0gu3cGa0IuHh0bVSRlV86wye1RaPkU4vYZQhyRc F21A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mYD9IY2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si2858707ede.603.2021.05.20.07.41.56; Thu, 20 May 2021 07:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mYD9IY2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbhETJ0W (ORCPT + 99 others); Thu, 20 May 2021 05:26:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbhETJ0P (ORCPT ); Thu, 20 May 2021 05:26:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 30F7761244; Thu, 20 May 2021 09:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621502693; bh=tUlpM3DQBjSnWR7vaADyD1QCt5Vsf2xpNC/talcvKrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mYD9IY2aLVVKeXzlxH9Y9JW4jDGD7ki06xfnuivUNFztMuLqL+4d76Cx02Xc+HstF tmZhcHFcr4/5pURY9PBH+9r9GZeXFLnEBLsL8PHw+/60EGa22sEcO7ZGKM0f07cGEE QxWPd1lY126SLSu/PlBf5plnC/0DmhJDZKYmVs+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Sasha Levin Subject: [PATCH 5.12 17/45] svcrdma: Dont leak send_ctxt on Send errors Date: Thu, 20 May 2021 11:22:05 +0200 Message-Id: <20210520092054.083978290@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092053.516042993@linuxfoundation.org> References: <20210520092053.516042993@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuck Lever [ Upstream commit 351461f332db5670056a9c6bce6916027f91072f ] Address a rare send_ctxt leak in the svc_rdma_sendto() error paths. Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 52c759a8543e..3669661457c1 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -958,7 +958,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) p = xdr_reserve_space(&sctxt->sc_stream, rpcrdma_fixed_maxsz * sizeof(*p)); if (!p) - goto err0; + goto err1; ret = svc_rdma_send_reply_chunk(rdma, rctxt, &rqstp->rq_res); if (ret < 0) @@ -970,11 +970,11 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) *p = pcl_is_empty(&rctxt->rc_reply_pcl) ? rdma_msg : rdma_nomsg; if (svc_rdma_encode_read_list(sctxt) < 0) - goto err0; + goto err1; if (svc_rdma_encode_write_list(rctxt, sctxt) < 0) - goto err0; + goto err1; if (svc_rdma_encode_reply_chunk(rctxt, sctxt, ret) < 0) - goto err0; + goto err1; ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp); if (ret < 0) -- 2.30.2