From: Lance Richardson <lrichard@redhat.com>
To: Jojy Varghese <jojy.varghese@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] net_namespace: fixed net_device reference leak
Date: Thu, 8 Sep 2016 15:32:45 -0400 (EDT) [thread overview]
Message-ID: <401753600.83187028.1473363165519.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAJD3hpUSqSxtgJMK__V-j8VKRwf-ftZFHw0J38VTxP9tDDZyhA@mail.gmail.com>
> From: "Jojy Varghese" <jojy.varghese@gmail.com>
> To: netdev@vger.kernel.org
> Cc: davem@davemloft.net
> Sent: Thursday, September 8, 2016 3:08:29 PM
> Subject: Re: [PATCH] net_namespace: fixed net_device reference leak
>
> (Updating the patch for the case when a non-loopback dev could be
> unregistered)
>
> Currently during namespace cleanup, if ‘dst’ subsystem is holding
> a reference to the interface in the namespace, it does not get released.
> Current code first does a ’dev_hold’ on the same device followed by a
> ‘dev_put’ on the same device resulting in a no-op.
>
> This change fixes this leak by assigning the initial namespace’s loopback
> device to the ‘dst’ before releasing the reference to the network
> device being released.
>
> Additional reference: https://github.com/docker/docker/issues/5618
>
> Signed-off-by: Jojy G Varghese <jojy.varghese@gmail.com>
> ---
If the dst wasn't being cleaned up in the namespace that's being deleted,
it is unlikely it will be cleaned up after moving it to the init namespace.
I think it would be better to figure out why this dst is being leaked
in the first place, otherwise this is probably still a memory leak.
Is this easily reproducible with current net or net-next kernels?
Regards,
Lance
next prev parent reply other threads:[~2016-09-08 19:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 1:55 [PATCH] net_namespace: fixed net_device reference leak Jojy Varghese
2016-09-08 19:08 ` Jojy Varghese
2016-09-08 19:32 ` Lance Richardson [this message]
2016-09-08 21:00 ` Eric Dumazet
2016-09-08 21:05 ` Eric Dumazet
2016-09-08 22:12 ` Jojy Varghese
2016-09-08 22:16 ` Eric Dumazet
2016-09-08 23:16 ` Jojy Varghese
2016-09-08 23:33 ` Jojy Varghese
2016-09-08 23:51 ` Eric Dumazet
2016-09-09 0:04 ` David Miller
2016-09-09 0:35 ` Jojy Varghese
2016-09-09 0:39 ` David Miller
2016-09-09 2:35 ` Eric Dumazet
2016-09-10 16:12 ` David Ahern
2016-09-08 23:37 ` Eric Dumazet
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=401753600.83187028.1473363165519.JavaMail.zimbra@redhat.com \
--to=lrichard@redhat.com \
--cc=davem@davemloft.net \
--cc=jojy.varghese@gmail.com \
--cc=netdev@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).