Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp877157pxk; Thu, 17 Sep 2020 20:04:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiXBhUJ7H/F7hQthM9me8MRQwGeQ2noW34I36vP3Mn0bx1VRKjbCFY8GK3VPEk8JNb9/Tm X-Received: by 2002:a05:6402:3076:: with SMTP id bs22mr13194473edb.17.1600398295587; Thu, 17 Sep 2020 20:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398295; cv=none; d=google.com; s=arc-20160816; b=SAVUCuqIH3KPJIx4KaNquSPy0UT0G5k+WkBo/RzLQNGwhx9i23AqHO7E/TulBzQriQ bEnCXNfnDi5At+d5uGdnczVP7PlCT1ETx5qLIhZpbIzGrOKJ68t53UXTpYaGY8wNf4d5 rm8jg0NN4Ccb06Ve6HWBk4kLyjRr7GbiDHeWui/HC0qWUUCvE3/bzd4puyEJVxxmksxZ SaB6/7PsQ0tZpmaVqqdh+b98aN4JoT407t3c/kk2+A7GuW3cEUXv9U4QdFKeOAD6JpX/ 8Ko5A9zPN1gZqLDQCxmgUovvX1JXcdxGUJ8UHvAZ98/A2XJkHT/NkZdlDBjjs2x4dn82 ch/g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TIeT92SxG965W2JwWBijHTmctOUoXiwcEWsPtZXZMkY=; b=hf2SDTqE4bjCFg3IKZt/EFeCS/yMd4pF47IXD8tNQ7ismqzZouNDEYOvTPFaX0xEGB RaA+bLN6u4Dh9PFNh0plKYoTONKA9WBwSFt+t+QOCsUCNECairP1x4xAjDOH1JsP0t3b O7tCY9AStQD64+gE5mrKglZFzSnkLDu9dE97ZMb0oo77GMmPIil/e7RNCj5mykfvoDh6 yp6gsTdLl6X3TQSuIJ2qI/A+lRWGgdcyXN5X04BRP9RtIsQaLfCQRmGzeNFL1aHcm9sp LtmiUqe+0etJK/vZtOaMi+QP0+98T2aM6NidPrIyu3wfGYYFAEbMWCexrHW66S72eCQs U85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="n/P1sxm8"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp19si1151179ejc.122.2020.09.17.20.04.32; Thu, 17 Sep 2020 20:04:55 -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=@kernel.org header.s=default header.b="n/P1sxm8"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729359AbgIRDA7 (ORCPT + 99 others); Thu, 17 Sep 2020 23:00:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:53478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgIRCFd (ORCPT ); Thu, 17 Sep 2020 22:05:33 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A1BB2376F; Fri, 18 Sep 2020 02:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394732; bh=zxErcgS1+K4ChJIZil+KpRkv08EjIJEwkac6PNqxhA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n/P1sxm88DWWNJkiO9wvoRG/Q4v3AeoTTW8/eh5Ks5iDEfo/7YnsvCXxpvF4CUij2 pzUQMOFYUy7sf3MfvfAppVzbibSkjFp/kJP4FqM2xDWDgWZQS+L+Pjsms6Ql+Rz+pv D5s4qVaCddBSYy5IYLIXD4V4vKvCbgT153VoQG9M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chuck Lever , Sasha Levin , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 214/330] svcrdma: Fix leak of transport addresses Date: Thu, 17 Sep 2020 21:59:14 -0400 Message-Id: <20200918020110.2063155-214-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuck Lever [ Upstream commit 1a33d8a284b1e85e03b8c7b1ea8fb985fccd1d71 ] Kernel memory leak detected: unreferenced object 0xffff888849cdf480 (size 8): comm "kworker/u8:3", pid 2086, jiffies 4297898756 (age 4269.856s) hex dump (first 8 bytes): 30 00 cd 49 88 88 ff ff 0..I.... backtrace: [<00000000acfc370b>] __kmalloc_track_caller+0x137/0x183 [<00000000a2724354>] kstrdup+0x2b/0x43 [<0000000082964f84>] xprt_rdma_format_addresses+0x114/0x17d [rpcrdma] [<00000000dfa6ed00>] xprt_setup_rdma_bc+0xc0/0x10c [rpcrdma] [<0000000073051a83>] xprt_create_transport+0x3f/0x1a0 [sunrpc] [<0000000053531a8e>] rpc_create+0x118/0x1cd [sunrpc] [<000000003a51b5f8>] setup_callback_client+0x1a5/0x27d [nfsd] [<000000001bd410af>] nfsd4_process_cb_update.isra.7+0x16c/0x1ac [nfsd] [<000000007f4bbd56>] nfsd4_run_cb_work+0x4c/0xbd [nfsd] [<0000000055c5586b>] process_one_work+0x1b2/0x2fe [<00000000b1e3e8ef>] worker_thread+0x1a6/0x25a [<000000005205fb78>] kthread+0xf6/0xfb [<000000006d2dc057>] ret_from_fork+0x3a/0x50 Introduce a call to xprt_rdma_free_addresses() similar to the way that the TCP backchannel releases a transport's peer address strings. Fixes: 5d252f90a800 ("svcrdma: Add class for RDMA backwards direction transport") Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c index cf80394b2db33..325eef1f85824 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c +++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c @@ -252,6 +252,7 @@ xprt_rdma_bc_put(struct rpc_xprt *xprt) { dprintk("svcrdma: %s: xprt %p\n", __func__, xprt); + xprt_rdma_free_addresses(xprt); xprt_free(xprt); } -- 2.25.1