All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: David Ahern <dsahern@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net-next] net/ipv6: stop leaking percpu memory in fib6 info
Date: Tue, 9 Oct 2018 07:03:36 +0300	[thread overview]
Message-ID: <20181009040335.GC28063@rapoport-lnx> (raw)
In-Reply-To: <8b36e7c9-0f9b-64c4-f7d6-1d1a92097eaa@gmail.com>

On Mon, Oct 08, 2018 at 12:15:54PM -0600, David Ahern wrote:
> On 10/8/18 6:06 AM, Mike Rapoport wrote:
> > The fib6_info_alloc() function allocates percpu memory to hold per CPU
> > pointers to rt6_info, but this memory is never freed. Fix it.
> > 
> > Fixes: a64efe142f5e ("net/ipv6: introduce fib6_info struct and helpers")
> > 
> > Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> > ---
> >  net/ipv6/ip6_fib.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> > index cf709eadc932..cc7de7eb8b9c 100644
> > --- a/net/ipv6/ip6_fib.c
> > +++ b/net/ipv6/ip6_fib.c
> > @@ -194,6 +194,8 @@ void fib6_info_destroy_rcu(struct rcu_head *head)
> >  				*ppcpu_rt = NULL;
> >  			}
> >  		}
> > +
> > +		free_percpu(f6i->rt6i_pcpu);
> >  	}
> >  
> >  	lwtstate_put(f6i->fib6_nh.nh_lwtstate);
> > 
> 
> Odd that KMEMLEAK is not detecting this. Thanks for the fix.

There's a comment in kmemleak that says:

	/*
	 * Percpu allocations are only scanned and not reported as leaks
	 * (min_count is set to 0).
	 */

No idea why, though...
 
> Reviewed-by: David Ahern <dsahern@gmail.com>
> 

-- 
Sincerely yours,
Mike.

      reply	other threads:[~2018-10-09  4:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 12:06 [PATCH net-next] net/ipv6: stop leaking percpu memory in fib6 info Mike Rapoport
2018-10-08 17:46 ` David Miller
2018-10-08 18:15 ` David Ahern
2018-10-09  4:03   ` Mike Rapoport [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=20181009040335.GC28063@rapoport-lnx \
    --to=rppt@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --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 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.