From: David Ahern <dsahern@gmail.com>
To: Sean Tranchetti <stranche@quicinc.com>,
davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Cc: subashab@codearurora.org,
Sean Tranchetti <stranche@codeaurora.org>,
Wei Wang <weiwan@google.com>
Subject: Re: [net PATCH 1/2] net: ipv6: fib: flush exceptions when purging route
Date: Wed, 6 Jan 2021 09:55:09 -0700 [thread overview]
Message-ID: <9290e64d-7e07-53c7-5b3a-4e24498c65be@gmail.com> (raw)
In-Reply-To: <1609892546-11389-1-git-send-email-stranche@quicinc.com>
On 1/5/21 5:22 PM, Sean Tranchetti wrote:
> From: Sean Tranchetti <stranche@codeaurora.org>
>
> Route removal is handled by two code paths. The main removal path is via
> fib6_del_route() which will handle purging any PMTU exceptions from the
> cache, removing all per-cpu copies of the DST entry used by the route, and
> releasing the fib6_info struct.
>
> The second removal location is during fib6_add_rt2node() during a route
> replacement operation. This path also calls fib6_purge_rt() to handle
> cleaning up the per-cpu copies of the DST entries and releasing the
> fib6_info associated with the older route, but it does not flush any PMTU
> exceptions that the older route had. Since the older route is removed from
> the tree during the replacement, we lose any way of accessing it again.
>
> As these lingering DSTs and the fib6_info struct are holding references to
> the underlying netdevice struct as well, unregistering that device from the
> kernel can never complete.
>
I think the right fixes tag is:
Fixes: 2b760fcf5cfb3 ("ipv6: hook up exception table to store dst cache")
cc'ed author of that patch.
> Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
> ---
> net/ipv6/ip6_fib.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index 605cdd3..f43e275 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -1025,6 +1025,8 @@ static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn,
> {
> struct fib6_table *table = rt->fib6_table;
>
> + /* Flush all cached dst in exception table */
> + rt6_flush_exceptions(rt);
> fib6_drop_pcpu_from(rt, table);
>
> if (rt->nh && !list_empty(&rt->nh_list))
> @@ -1927,9 +1929,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
> net->ipv6.rt6_stats->fib_rt_entries--;
> net->ipv6.rt6_stats->fib_discarded_routes++;
>
> - /* Flush all cached dst in exception table */
> - rt6_flush_exceptions(rt);
> -
> /* Reset round-robin state, if necessary */
> if (rcu_access_pointer(fn->rr_ptr) == rt)
> fn->rr_ptr = NULL;
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2021-01-06 16:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 0:22 [net PATCH 1/2] net: ipv6: fib: flush exceptions when purging route Sean Tranchetti
2021-01-06 0:22 ` [net PATCH 2/2] tools: selftests: add test for changing routes with PTMU exceptions Sean Tranchetti
2021-01-06 17:03 ` David Ahern
2021-01-06 16:55 ` David Ahern [this message]
2021-01-07 20:04 ` [net PATCH 1/2] net: ipv6: fib: flush exceptions when purging route Jakub Kicinski
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=9290e64d-7e07-53c7-5b3a-4e24498c65be@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stranche@codeaurora.org \
--cc=stranche@quicinc.com \
--cc=subashab@codearurora.org \
--cc=weiwan@google.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).