All of lore.kernel.org
 help / color / mirror / Atom feed
From: kuniyu@google.com
To: Eric Dumazet <edumazet@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Qiliang Yuan <odys.yuan@gmail.com>,
	 David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net] ipv6: account route exceptions to the netns of their dst
Date: Sat, 17 Oct 2026 04:13:21 +0000	[thread overview]
Message-ID: <atL1r9R5yfWs6Eu1@google.com> (raw)
In-Reply-To: <20261016091556.2750902-1-edumazet@kernel.org>

On Fri, 16 Oct 2026 11:15:56 +0200, Eric Dumazet wrote:
> rt6_insert_exception() and rt6_remove_exception() update
> rt6_stats->fib_rt_cache of dev_net(rt6i->dst.dev), but the device of an
> exception dst can move to another netns while the exception is still in
> its bucket.
> 
> This happens when the bucket is flushed from an RCU callback, for
> instance from nexthop_free_rcu() for the nh_info of a replaced nexthop,
> whose exceptions still point to live routes. If the device moves to
> another netns before that callback runs, the decrement hits the other
> netns, whose u32 counter underflows in /proc/net/rt6_stats, while the
> counter of the original netns never goes back down.
> 
> Account exceptions to the netns their dst was allocated in, derived from
> dst->ops as ip6_dst_gc() already does, which does not depend on the
> device. The dst already relies on that netns' ip6_dst_ops being alive
> when it is destroyed, which happens after the exception is removed.
> 
> Fixes: 81eb8447daae ("ipv6: take care of rt6_stats")
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

  parent reply	other threads:[~2026-10-17  4:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  9:15 [PATCH net] ipv6: account route exceptions to the netns of their dst Eric Dumazet
2026-10-16  9:19 ` netdev-bot+sinfo
2026-10-16  9:21   ` Eric Dumazet
2026-10-17  4:13 ` kuniyu [this message]
2026-10-18 15:25 ` Ido Schimmel

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=atL1r9R5yfWs6Eu1@google.com \
    --to=kuniyu@google.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=odys.yuan@gmail.com \
    --cc=pabeni@redhat.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 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.