From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56050 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725783AbeJILSg (ORCPT ); Tue, 9 Oct 2018 07:18:36 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w993x5hC126247 for ; Tue, 9 Oct 2018 00:03:42 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2n0m0d1spt-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Oct 2018 00:03:42 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Oct 2018 05:03:40 +0100 Date: Tue, 9 Oct 2018 07:03:36 +0300 From: Mike Rapoport To: David Ahern Cc: "David S. Miller" , netdev@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net-next] net/ipv6: stop leaking percpu memory in fib6 info References: <1539000363-25333-1-git-send-email-rppt@linux.vnet.ibm.com> <8b36e7c9-0f9b-64c4-f7d6-1d1a92097eaa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b36e7c9-0f9b-64c4-f7d6-1d1a92097eaa@gmail.com> Message-Id: <20181009040335.GC28063@rapoport-lnx> Sender: stable-owner@vger.kernel.org List-ID: 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 > > 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 > -- Sincerely yours, Mike.