From: Ido Schimmel <idosch@idosch.org>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
roopa@cumulusnetworks.com, eric.dumazet@gmail.com,
weiwan@google.com, kafai@fb.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH RFC v2 net-next 19/21] net/ipv6: separate handling of FIB entries from dst based routes
Date: Sat, 24 Mar 2018 19:02:09 +0300 [thread overview]
Message-ID: <20180324160209.GB15120@splinter> (raw)
In-Reply-To: <b5912ae8-0495-3df9-177d-ddd83d5248aa@gmail.com>
On Sat, Mar 24, 2018 at 09:31:02AM -0600, David Ahern wrote:
> On 3/24/18 8:31 AM, Ido Schimmel wrote:
> > On Sun, Mar 18, 2018 at 08:36:20PM -0700, David Ahern wrote:
> >> @@ -405,18 +383,9 @@ static void ip6_dst_destroy(struct dst_entry *dst)
> >> rt->rt6i_idev = NULL;
> >> in6_dev_put(idev);
> >> }
> >> - bucket = rcu_dereference_protected(rt->rt6i_exception_bucket, 1);
> >> - if (bucket) {
> >> - rt->rt6i_exception_bucket = NULL;
> >> - kfree(bucket);
> >> - }
> >> -
> >> - m = rt->fib6_metrics;
> >> - if (m != &dst_default_metrics && refcount_dec_and_test(&m->refcnt))
> >> - kfree(m);
> >
> > You remove this...
> >
> >>
> >> rt->from = NULL;
> >> - dst_release(&from->dst);
> >> + fib6_info_release(from);
> >
> > Yet fib6_info_release() doesn't take care of it (unlike the IPv4
> > equivalent), which means you're leaking the metrics.
> >
> >> }
>
> ok, I'll take a look. I thought I verified both paths (fib6_info and
> dst) were freeing the metrics.
I get this from kmemleak (applied your patchset on top of fe2d55d295cf):
unreferenced object 0xffff88004e2c16c8 (size 96):
comm "systemd-network", pid 1255, jiffies 4295166424 (age 957.858s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
ip6_route_info_create (/net/ipv6/route.c:2849)
ip6_route_add (/net/ipv6/route.c:2975)
inet6_rtm_newroute (/net/ipv6/route.c:4357)
rtnetlink_rcv_msg (/net/core/rtnetlink.c:4643)
netlink_rcv_skb (/net/netlink/af_netlink.c:2445)
netlink_unicast (/net/netlink/af_netlink.c:1309 /net/netlink/af_netlink.c:1334)
netlink_sendmsg (/net/netlink/af_netlink.c:1897)
sock_sendmsg (/net/socket.c:630 /net/socket.c:639)
SYSC_sendto (/net/socket.c:1748)
do_syscall_64 (/arch/x86/entry/common.c:287)
entry_SYSCALL_64_after_hwframe (/arch/x86/entry/entry_64.S:239)
0xffffffffffffffff (/./include/asm-generic/sections.h:42)
next prev parent reply other threads:[~2018-03-24 16:02 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 3:36 [PATCH RFC v2 net-next 00/21] net/ipv6: Separate data structures for FIB and data path David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 01/21] net: Move fib_convert_metrics to metrics file David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 02/21] net: Handle null dst in rtnl_put_cacheinfo David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 03/21] vrf: Move fib6_table into net_vrf David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 04/21] net/ipv6: Pass net to fib6_update_sernum David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 05/21] net/ipv6: Pass net namespace to route functions David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 06/21] net/ipv6: Move support functions up in route.c David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 07/21] net/ipv6: Save route type in rt6_info David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 08/21] net/ipv6: Move nexthop data to fib6_nh David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 09/21] net/ipv6: Defer initialization of dst to data path David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 10/21] net/ipv6: move metrics from dst to rt6_info David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 11/21] net/ipv6: move expires into rt6_info David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 12/21] net/ipv6: Add fib6_null_entry David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 13/21] net/ipv6: Add rt6_info create function for ip6_pol_route_lookup David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 14/21] net/ipv6: Move dst flags to booleans in fib entries David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 15/21] net/ipv6: Create a neigh_lookup for FIB entries David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 16/21] net/ipv6: Add gfp_flags to route add functions David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 17/21] net/ipv6: Cleanup exception and cache route handling David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 18/21] net/ipv6: introduce fib6_info struct and helpers David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 19/21] net/ipv6: separate handling of FIB entries from dst based routes David Ahern
2018-03-24 14:31 ` Ido Schimmel
2018-03-24 15:31 ` David Ahern
2018-03-24 16:02 ` Ido Schimmel [this message]
2018-03-25 14:49 ` David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 20/21] net/ipv6: Flip FIB entries to fib6_info David Ahern
2018-03-19 3:36 ` [PATCH RFC v2 net-next 21/21] net/ipv6: Remove unused code and variables for rt6_info David Ahern
2018-03-19 14:23 ` [PATCH RFC v2 net-next 00/21] net/ipv6: Separate data structures for FIB and data path David Miller
2018-03-24 15:05 ` Ido Schimmel
2018-03-24 15:28 ` David Ahern
2018-03-24 15:59 ` Ido Schimmel
2018-03-25 15:09 ` David Ahern
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=20180324160209.GB15120@splinter \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=weiwan@google.com \
--cc=yoshfuji@linux-ipv6.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