mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: qiliang.yuan@linux.dev
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, dsahern@kernel.org,
	idosch@nvidia.com, razor@blackwall.org, kuniyu@google.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 2/4] ipv6: take fib6_sernum from a sequence shared by all netns
Date: Sun, 22 Nov 2026 03:14:12 +0000	[thread overview]
Message-ID: <179531725203.3135.1479967142257708654@kernel.org> (raw)
In-Reply-To: <20261117-bug-net-netns-move-rcu-barrier-v4-2-43e1ca0aac7f@linux.dev>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit fixes a bug that is real and visible to users, but it
  carries no Fixes: tag and no Cc: stable.

--

ipv6: take fib6_sernum from a sequence shared by all netns

This patch makes fib6_new_sernum() take every fib6_sernum bump from one
sequence shared by all netns, starting at 2. A per-cpu nexthop route
cached in one netns then no longer matches the sernum of another netns
after its device moves. rt6_is_valid() also rejects 1, the initial value
that every netns starts with.

> When a device moves to another netns, such a route remains usable until
> nexthop_free_rcu() releases it, and fib6_info_destroy_rcu() queues that
> callback from inside an RCU callback, after the device has moved. If the
> fib6_sernum of the new netns matches the cached one in that window,
> ip6_dst_check() accepts the route and a socket in the old netns keeps
> sending through a device that now belongs to another netns.

[ ... ]

> Signed-off-by: Qiliang Yuan <qiliang.yuan@linux.dev>

[Severity: Low]
This fixes a netns isolation problem that users can hit, but the patch has
no Fixes: tag and no Cc: stable. Should it have them?

Two pieces of code came in with the same commit. One records the sernum in
ip6_rt_pcpu_alloc(). The other compares it across netns in rt6_is_valid():

net/ipv6/route.c:ip6_rt_pcpu_alloc() {
    ...
	if (f6i->nh)
		pcpu_rt->sernum = rt_genid_ipv6(dev_net(dev));
    ...
}

net/ipv6/route.c:rt6_is_valid() {
	return rt6->sernum == rt_genid_ipv6(dev_net(rt6->dst.dev));
}

Going by git blame, both lines come from this commit:

Fixes: 8f34e53b60b3 ("ipv6: Use global sernum for dst validation with nexthop objects")

The commit message also never calls this a netns isolation problem: a
socket in netns A keeps sending through a device that netns B now owns.
Could the message say so explicitly, for stable and security triage?

The IPv4 companion patch in this series, "ipv4: draw rt_genid from a
sequence shared by all netns", seems to be missing the same tags.

The series also puts these fixes together with "net: remove rcu_barrier()
from __dev_change_net_namespace()", which looks like a net-next style
optimization. Would it make sense to split the fixes out and send them to
net, so they can be picked up for stable?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-bug-net-netns-move-rcu-barrier-v4-0-43e1ca0aac7f%40linux.dev

  parent reply	other threads:[~2026-11-22  3:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  2:28 [PATCH net-next v4 0/4] net: make moving a device to another netns cheaper Qiliang Yuan
2026-11-18  2:28 ` [PATCH net-next v4 1/4] ipv4: draw rt_genid from a sequence shared by all netns Qiliang Yuan
2026-11-22  3:14   ` netdev-bot+sashiko
2026-11-18  2:28 ` [PATCH net-next v4 2/4] ipv6: take fib6_sernum " Qiliang Yuan
2026-11-20 17:52   ` Ralf Lici
2026-11-20 23:13     ` Qiliang Yuan
2026-11-22  3:14   ` netdev-bot+sashiko [this message]
2026-11-18  2:28 ` [PATCH net-next v4 3/4] nexthop: release cached routes when a nexthop leaves a group Qiliang Yuan
2026-11-22  3:14   ` netdev-bot+sashiko
2026-11-18  2:28 ` [PATCH net-next v4 4/4] net: remove rcu_barrier() from __dev_change_net_namespace() Qiliang Yuan
2026-11-22  3:14   ` netdev-bot+sashiko

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=179531725203.3135.1479967142257708654@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --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=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qiliang.yuan@linux.dev \
    --cc=razor@blackwall.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

all inboxes | Powered by JetHome®