All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Shearman <rshearma@brocade.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, Tom Herbert <tom@herbertland.com>,
	Roopa Prabhu <roopa@cumulusnetworks.com>,
	Robert Shearman <rshearma@brocade.com>
Subject: [PATCH net 2/2] ila: Fix memory leak of lwt dst cache on module unload
Date: Wed, 18 Jan 2017 15:32:03 +0000	[thread overview]
Message-ID: <1484753523-26230-3-git-send-email-rshearma@brocade.com> (raw)
In-Reply-To: <1484753523-26230-1-git-send-email-rshearma@brocade.com>

If routes with lwt state are present when the ila module is unloaded
and then subsequently deleted, the dst cache entry in the state will
be leaked.

Fix this by specifying the owning module in the lwt ops to allow lwt
to take a reference for each route and to keep the module around until
the last ila route is deleted.

Fixes: 79ff2fc31e0f ("ila: Cache a route to translated address")
Signed-off-by: Robert Shearman <rshearma@brocade.com>
---
 net/ipv6/ila/ila_lwt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c
index a7bc54ab46e2..13b5e85fe0d5 100644
--- a/net/ipv6/ila/ila_lwt.c
+++ b/net/ipv6/ila/ila_lwt.c
@@ -238,6 +238,7 @@ static const struct lwtunnel_encap_ops ila_encap_ops = {
 	.fill_encap = ila_fill_encap_info,
 	.get_encap_size = ila_encap_nlsize,
 	.cmp_encap = ila_encap_cmp,
+	.owner = THIS_MODULE,
 };
 
 int ila_lwt_init(void)
-- 
2.1.4

  parent reply	other threads:[~2017-01-18 15:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 15:32 [PATCH net 0/2] net: Fix oops on state free after lwt module unload Robert Shearman
2017-01-18 15:32 ` [PATCH net 1/2] lwtunnel: Fix oops on state free after encap " Robert Shearman
2017-01-18 15:32 ` Robert Shearman [this message]
2017-01-20 17:03 ` [PATCH net 0/2] net: Fix oops on state free after lwt " David Miller
2017-01-20 20:21   ` Robert Shearman
2017-01-21  0:21 ` [PATCH net v2 " Robert Shearman
2017-01-21  0:21   ` [PATCH net v2 1/2] net: Specify the owning module for lwtunnel ops Robert Shearman
2017-01-21  0:21   ` [PATCH net v2 2/2] lwtunnel: Fix oops on state free after encap module unload Robert Shearman
2017-01-23 20:42     ` David Miller
2017-01-24 16:26       ` Robert Shearman
2017-01-24 16:26   ` [PATCH net v3 0/2] net: Fix oops on state free after lwt " Robert Shearman
2017-01-24 16:26     ` [PATCH net v3 1/2] net: Specify the owning module for lwtunnel ops Robert Shearman
2017-01-24 16:26     ` [PATCH net v3 2/2] lwtunnel: Fix oops on state free after encap module unload Robert Shearman
2017-01-24 21:21     ` [PATCH net v3 0/2] net: Fix oops on state free after lwt " David Miller

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=1484753523-26230-3-git-send-email-rshearma@brocade.com \
    --to=rshearma@brocade.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=tom@herbertland.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.