From: netdev-bot+sashiko@kernel.org
To: kuniyu@google.com
Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
kuni1840@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH v1 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err().
Date: Wed, 18 Nov 2026 20:36:28 +0000 [thread overview]
Message-ID: <179503418850.3136.10740335529901076189@kernel.org> (raw)
In-Reply-To: <20261117053543.84032-8-kuniyu@google.com>
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 message for "tcp: Pass inet_sdif() to
__inet_lookup_established() in tcp_v4_err()." only describes half of…
--
tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err().
This commit changes tcp_v4_err() to pass inet_sdif(skb) instead of 0 as
the sdif argument to __inet_lookup_established(). The goal is to stop
ICMP errors that arrive through a VRF from reaching sockets that are not
bound to the device.
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index bc909fedda3a8..35a1309f8b21c 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -504,7 +504,8 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
> int err;
>
> sk = __inet_lookup_established(net, iph->daddr, th->dest, iph->saddr,
> - ntohs(th->source), inet_iif(skb), 0);
> + ntohs(th->source), inet_iif(skb),
> + inet_sdif(skb));
[Severity: Low]
The code change looks correct to me. It now uses the same dif/sdif pair
that tcp_v4_rcv() already uses. However, the commit message only covers
half of the behavior change:
So, ICMP error coming from VRF can be leaked to a socket not
bound to the device.
Should the commit message also say what changes for sockets bound to the
VRF slave device?
For a packet received through a VRF, inet_iif(skb) returns the VRF master
ifindex. inet_sdif(skb) returns IPCB(skb)->iif, which is the slave
ifindex. The match is done here:
include/net/inet_sock.h:inet_bound_dev_eq() {
if (!bound_dev_if)
return !sdif || l3mdev_accept;
return bound_dev_if == dif || bound_dev_if == sdif;
}
With the old sdif of 0, a socket whose sk_bound_dev_if is the slave
ifindex never matched in tcp_v4_err(). Such sockets got no ICMP errors at
all, which could leave them in a PMTU black hole.
After this patch those sockets do match. They will now see:
ICMP_DEST_UNREACH / ICMP_FRAG_NEEDED -> tcp_v4_mtu_reduced()
hard errors in TCP_SYN_SENT / TCP_SYN_RECV -> tcp_done_with_error()
Users can see this change. Would it help stable backporters and
maintainers to mention it in the changelog?
> if (!sk) {
> __ICMP_INC_STATS(net, ICMP_MIB_INERRORS);
> return -ENOENT;
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117053543.84032-1-kuniyu%40google.com
next prev parent reply other threads:[~2026-11-18 20:36 UTC|newest]
Thread overview: 27+ 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 [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=179503418850.3136.10740335529901076189@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--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