netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Breno Leitao <leitao@debian.org>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH net-next] ip6_vti: fix memleak on netns dismantle
Date: Tue, 16 Apr 2024 15:03:50 +0100	[thread overview]
Message-ID: <20240416140350.GN2320920@kernel.org> (raw)
In-Reply-To: <20240415122346.26503-1-fw@strlen.de>

+ Steffen Klassert, Herbert Xu, David Ahern

On Mon, Apr 15, 2024 at 02:23:44PM +0200, Florian Westphal wrote:
> kmemleak reports net_device resources are no longer released, restore
> needs_free_netdev toggle.  Sample backtrace:
> 
> unreferenced object 0xffff88810874f000 (size 4096): [..]
>     [<00000000a2b8af8b>] __kmalloc_node+0x209/0x290
>     [<0000000040b0a1a9>] alloc_netdev_mqs+0x58/0x470
>     [<00000000b4be1e78>] vti6_init_net+0x94/0x230
>     [<000000008830c1ea>] ops_init+0x32/0xc0
>     [<000000006a26fa8f>] setup_net+0x134/0x2e0
> [..]
> 
> Cc: Breno Leitao <leitao@debian.org>
> Fixes: a9b2d55a8f1e ("ip6_vti: Do not use custom stat allocator")
> Signed-off-by: Florian Westphal <fw@strlen.de>

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  net/ipv6/ip6_vti.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
> index 4d68a0777b0c..78344cf3867e 100644
> --- a/net/ipv6/ip6_vti.c
> +++ b/net/ipv6/ip6_vti.c
> @@ -901,6 +901,7 @@ static void vti6_dev_setup(struct net_device *dev)
>  {
>  	dev->netdev_ops = &vti6_netdev_ops;
>  	dev->header_ops = &ip_tunnel_header_ops;
> +	dev->needs_free_netdev = true;
>  
>  	dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
>  	dev->type = ARPHRD_TUNNEL6;
> -- 
> 2.43.2
> 
> 

  reply	other threads:[~2024-04-16 14:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 12:23 [PATCH net-next] ip6_vti: fix memleak on netns dismantle Florian Westphal
2024-04-16 14:03 ` Simon Horman [this message]
2024-04-17  0:40 ` patchwork-bot+netdevbpf
2024-04-23  9:46 ` Breno Leitao
2024-04-23 19:53   ` Eric Dumazet
2024-04-24 15:11     ` Breno Leitao

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=20240416140350.GN2320920@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.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 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).