Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Kuniyuki Iwashima <kuniyu@google.com>,
	Eric Dumazet <edumazet@kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH v1 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err().
Date: Thu, 19 Nov 2026 08:22:14 -0700	[thread overview]
Message-ID: <9315f508-0db9-42a5-9684-0b8e5c7d528f@kernel.org> (raw)
In-Reply-To: <20261117053543.84032-8-kuniyu@google.com>

On 11/16/26 11:35 PM, Kuniyuki Iwashima wrote:
> tcp_v4_err() passes 0 sdif to __inet_lookup_established().
> 
> So, ICMP error coming from VRF can be leaked to a socket not
> bound to the device.
> 
> For example, this test fails at the last assert because the
> socket receives ICMP error:
> 
>   --ip_version=ipv4
>    0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3
>   +0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
>   +0 > S 0:0(0) <...>
>   +0 `ip link add vrf0 type vrf table 10`
>   +0 `ip link set vrf0 up`
>   +0 `ip link set dev tun0 master vrf0`
>   +0 `ip route add 192.0.2.0/24 dev tun0 table 10`
>   +0 < icmp unreachable port_unreachable [0:0(0)]
>   +0 %{ assert tcpi_state == TCP_SYN_SENT, tcpi_state }%
> 
> Let's pass inet_sdif() to __inet_lookup_established().
> 
> Fixes: 3fa6f616a7a4 ("net: ipv4: add second dif to inet socket lookups")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
> ---
> Cc: David Ahern <dsahern@kernel.org>

just this one is needed.

> Cc: David Ahern <dsahern@gmail.com>
> ---
>  net/ipv4/tcp_ipv4.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: David Ahern <dsahern@kernel.org>



  parent reply	other threads:[~2026-11-19 15:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  5:35 [PATCH v1 net 0/8] tcp: Misc fixes for tcp_v[46]_err() Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 1/8] tcp: Don't accept ICMP for SND.NXT in TCP_SYN_SENT Kuniyuki Iwashima
2026-11-17  8:35   ` Eric Dumazet
2026-11-17 23:30     ` Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 2/8] tcp: Don't use inner IP TTL for IP_MINTTL in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  8:42   ` Eric Dumazet
2026-11-17 23:35     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 3/8] tcp: Don't bypass GTSM check for reqsk Kuniyuki Iwashima
2026-11-17  8:45   ` Eric Dumazet
2026-11-17 23:42     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors Kuniyuki Iwashima
2026-11-17  8:49   ` Eric Dumazet
2026-11-17 23:44     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 5/8] tcp: Check ip_sk_accept_pmtu() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  8:54   ` Eric Dumazet
2026-11-17  5:35 ` [PATCH v1 net 6/8] selftest: net: packetdrill: Add ICMP and ICMPv6 tests Kuniyuki Iwashima
2026-11-17  8:58   ` Eric Dumazet
2026-11-17 23:45     ` Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  9:01   ` Eric Dumazet
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-19 15:22   ` David Ahern [this message]
2026-11-17  5:35 ` [PATCH v1 net 8/8] tcp: Pass inet6_iif() to __inet6_lookup_established() in tcp_v6_err() Kuniyuki Iwashima
2026-11-17  9:03   ` Eric Dumazet
2026-11-17 23:56     ` Kuniyuki Iwashima

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=9315f508-0db9-42a5-9684-0b8e5c7d528f@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox