From: liamsmith827 <liamsmith827@grapheneos.org>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
liamsmith827 <liamsmith827@proton.me>
Subject: Re: [RFC net-next 1/2] ipv4: Honor prohibit when oif specified
Date: Fri, 6 Nov 2026 22:40:53 +0000 [thread overview]
Message-ID: <c37801aa-94c0-455c-9b55-8746dec731e2@grapheneos.org> (raw)
In-Reply-To: <20261025171348.GA233026@shredder>
On 10/25/26 17:13, Ido Schimmel wrote:
> Given the above, I think that the patch is too specific to your use
> case. It doesn't make sense to only honor prohibit rules / routes. How
> about checking for 'err == -ENETUNREACH' [1]?
>
> It doesn't allow us to distinguish between "no route" and "unreachable
> rule", but we can probably ignore it given that it has always been the
> case and nobody complained. It needs to be explained in the commit
> message.
I was trying to sneak in just enough functionality for us to do what we
needed, but I'll gladly expand the scope.
I think if we were checking for -ENETUNREACH we would want to also check
for -EHOSTUNREACH to keep the semantics of unreachable consistent
between both the rule and route variants. However, I think we should
differentiate between a routing miss and an unreachable rule/route,
allowing the fallback only in the former case. Not only is this, as
you've said, the intention of the fallback, but it also has a concrete
benefit for Android's current networking implementation. Android
includes a final unreachable rule, so a routing miss is not possible. If
treated the same, this unreachable rule would not prevent apps from
being able to use the fallback to send traffic over interfaces which the
routing rules do not allow. This is a real cross-user leak which we were
going to fix by changing the final rule to prohibit (alongside the
original patch), but that would likely not have reached upstream.
This is easy to implement. In v2, I've added a FIB_LOOKUP_REPORT_MISS
flag that returns -ESRCH instead of -ENETUNREACH on an IPv4 lookup miss.
> Note that multicast needs to be exempted because of VRF. The lookup
> fails on the unreachable default route in the VRF table (-EHOSTUNREACH)
> and we construct the route anyway. It is also consistent with IPv6 where
> these routes / rules do not affect multicast traffic since the
> per-interface ff00::/8 routes in the local table are matched first.
I do agree that multicast needs to be exempted, and that's not
exclusively because of VRF. That same -EHOSTUNREACH can be encountered
with multicast outside VRF. In addition to the IPv6 reasoning you've
provided, there are 2 instances within ip_route_output_key_hash_rcu()
where multicast traffic goes directly to make_route without a
fib_lookup(). Whether fib_lookup() should be consulted for all multicast
is another discussion altogether.
> Why modify this hunk? Looks like an unrelated change.
This comment does need to be updated because it has multiple
inaccuracies, both with and without the new changes. I'll split it out.
next prev parent reply other threads:[~2026-11-06 22:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 3:24 [RFC net-next 0/2] " liamsmith827
2026-10-19 3:24 ` [RFC net-next 1/2] " liamsmith827
2026-10-25 17:13 ` Ido Schimmel
2026-11-06 22:40 ` liamsmith827 [this message]
2026-10-19 3:24 ` [RFC net-next 2/2] selftests: net: Test " liamsmith827
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=c37801aa-94c0-455c-9b55-8746dec731e2@grapheneos.org \
--to=liamsmith827@grapheneos.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=liamsmith827@proton.me \
--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 \
/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®