netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Chuck Lever <chuck.lever@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 26/26] svcrdma: Fix leak of transport addresses
Date: Sat, 11 Apr 2020 19:14:13 -0400	[thread overview]
Message-ID: <20200411231413.26911-26-sashal@kernel.org> (raw)
In-Reply-To: <20200411231413.26911-1-sashal@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

[ 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 <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 6035c5a380a6b..b3d48c6243c80 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
@@ -277,6 +277,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);
 	module_put(THIS_MODULE);
 }
-- 
2.20.1


      parent reply	other threads:[~2020-04-11 23:16 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 23:13 [PATCH AUTOSEL 4.9 01/26] net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 02/26] net: phy: probe PHY drivers synchronously Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 04/26] net: phy: mscc: accept all RGMII species in vsc85xx_mac_if_set Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 06/26] mwifiex: set needed_headroom, not hard_header_len Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 07/26] Bluetooth: L2CAP: handle l2cap config request during open state Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 09/26] net/mlx5e: Init ethtool steering for representors Sasha Levin
2020-04-12  7:10   ` Or Gerlitz
2020-04-12 17:59     ` Jakub Kicinski
2020-04-12 18:29       ` Or Gerlitz
2020-04-14  1:56       ` Sasha Levin
2020-04-14  7:16         ` Leon Romanovsky
2020-04-14 10:22         ` Or Gerlitz
2020-04-14 11:09           ` Greg KH
2020-04-14 14:38             ` Or Gerlitz
2020-04-14 15:16               ` Sasha Levin
2020-04-14 15:49               ` Edward Cree
2020-04-14 17:37                 ` Leon Romanovsky
2020-04-14 19:03                   ` Jakub Kicinski
2020-04-14 21:00                   ` Sasha Levin
2020-04-14 22:50                   ` Michal Kubecek
2020-04-15  5:31                     ` Leon Romanovsky
2020-04-15 14:07                     ` Sasha Levin
2020-04-14 20:57                 ` Sasha Levin
2020-04-15 16:18                   ` Edward Cree
2020-04-16  0:00                     ` Sasha Levin
2020-04-16  4:08                       ` Saeed Mahameed
2020-04-16  5:24                         ` Leon Romanovsky
2020-04-16 13:30                           ` Sasha Levin
2020-04-16 19:07                             ` Saeed Mahameed
2020-04-16 19:58                               ` Sasha Levin
2020-04-16 21:08                                 ` Saeed Mahameed
2020-04-17  8:28                                   ` gregkh
2020-04-17 22:23                                     ` Saeed Mahameed
2020-04-18 10:51                                       ` gregkh
2020-04-17 13:21                                   ` Sasha Levin
2020-04-17 22:38                                     ` Saeed Mahameed
2020-04-16 13:40                       ` Or Gerlitz
2020-04-16 14:04                         ` Sasha Levin
2020-04-16 14:17                           ` Or Gerlitz
2020-04-16 14:36                             ` Sasha Levin
2020-04-16 17:20                         ` Greg KH
2020-04-16 19:31                           ` Saeed Mahameed
2020-04-16 19:53                             ` Sasha Levin
2020-04-16 21:32                               ` Saeed Mahameed
2020-04-16 23:23                                 ` Sasha Levin
2020-04-21  3:07                                   ` Saeed Mahameed
2020-04-16 20:08                             ` Jakub Kicinski
2020-04-16 21:11                               ` Saeed Mahameed
2020-04-17  8:25                                 ` gregkh
2020-04-16 16:06                       ` Edward Cree
2020-04-16 18:49                         ` Sasha Levin
2020-04-20 11:45                           ` Edward Cree
2020-04-20 12:53                             ` Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 10/26] Bluetooth: Fix calculation of SCO handle for packet processing Sasha Levin
2020-04-11 23:13 ` [PATCH AUTOSEL 4.9 11/26] Bluetooth: guard against controllers sending zero'd events Sasha Levin
2020-04-11 23:14 ` [PATCH AUTOSEL 4.9 13/26] net: intel: e1000e: fix possible sleep-in-atomic-context bugs in e1000e_get_hw_semaphore() Sasha Levin
2020-04-11 23:14 ` [PATCH AUTOSEL 4.9 19/26] Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl Sasha Levin
2020-04-11 23:14 ` [PATCH AUTOSEL 4.9 20/26] brcmfmac: Fix driver crash on USB control transfer timeout Sasha Levin
2020-04-11 23:14 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200411231413.26911-26-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).