From: Ido Schimmel <idosch@nvidia.com>
To: hengyul@cs.unc.edu
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
Jiayuan Chen <jiayuan.chen@shopee.com>,
Jiayuan Chen <jiayuan.chen@linux.dev>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH net 1/2] ipv6: route: do not validate nexthop of routes promoted to reject routes
Date: Thu, 1 Oct 2026 18:46:29 +0300 [thread overview]
Message-ID: <20261001154629.GA1611116@shredder> (raw)
In-Reply-To: <20260930152229.1453929-2-hengyul@cs.unc.edu>
On Wed, Sep 30, 2026 at 11:22:28AM -0400, hengyul@cs.unc.edu wrote:
> From: Hengyu Liang <hengyul@cs.unc.edu>
>
> ip6_route_info_create_nh() promotes routes that use the loopback device
> as their nexthop device to reject routes, except for local and anycast
> routes and routes to the loopback address, as true routes via the
> loopback device would result in kernel looping.
>
> Before commit 21ec92774d15 ("net: ipv6: fix panic when IPv4 route
> references loopback IPv6 nexthop"), fib6_nh_init() also treated these
> routes as reject routes, so it neither validated their gateway nor
> checked the state of the loopback device. That commit restricted the
> check in fib6_nh_init() to explicit reject routes to fix IPv6 nexthop
> objects that use the loopback device. As a side effect, the nexthop of a
> route via the loopback device is now validated like the nexthop of a
> regular route before the route is promoted to a reject route, and adding
> such a route fails in cases that used to work:
>
> # ip link set dev lo down
> # ip -6 route add 2001:db8::/32 dev lo
> Error: Nexthop device is not up.
Consistent with IPv4 and expected:
# ip link set dev lo down
# ip route add 192.0.2.0/24 dev lo
Error: Device for nexthop is not up.
> # ip link set dev lo up
> # ip -6 route add 2001:db8::/32 via 2001:db8:1::1 dev lo
> RTNETLINK answers: No route to host
> # ip -6 route add default via ::ffff:192.0.2.1 dev lo
> RTNETLINK answers: No route to host
Likewise:
# ip link set dev lo up
# ip route add 192.0.2.0/24 via 198.51.100.1 dev lo
Error: Nexthop has invalid gateway.
> # sysctl -qw net.ipv6.conf.lo.disable_ipv6=1
> # ip -6 route add 2001:db8::/32 dev lo
> Error: IPv6 is disabled on nexthop device.
Inapplicable, but expected.
I don't understand what motivated this series.
next prev parent reply other threads:[~2026-10-01 15:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 15:22 [PATCH net 0/2] ipv6: route: fix adding routes via the loopback device hengyul
2026-09-30 15:22 ` [PATCH net 1/2] ipv6: route: do not validate nexthop of routes promoted to reject routes hengyul
2026-10-01 15:46 ` Ido Schimmel [this message]
2026-10-02 3:21 ` Hengyu Liang
2026-09-30 15:22 ` [PATCH net 2/2] selftests: net: fib_tests: add tests for IPv6 routes via loopback device hengyul
2026-09-30 15:28 ` [PATCH net 0/2] ipv6: route: fix adding routes via the " netdev-bot+sinfo
2026-10-01 20:44 ` [syzbot ci] " syzbot ci
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=20261001154629.GA1611116@shredder \
--to=idosch@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=hengyul@cs.unc.edu \
--cc=horms@kernel.org \
--cc=jiayuan.chen@linux.dev \
--cc=jiayuan.chen@shopee.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.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®