From: "Jiayuan Chen" <jiayuan.chen@linux.dev>
To: "David Ahern" <dsahern@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: "Jiayuan Chen" <jiayuan.chen@shopee.com>,
syzbot+e738404dcd14b620923c@syzkaller.appspotmail.com,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Simon Horman" <horms@kernel.org>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v1] icmp: fix ip_rt_bug race in icmp_route_lookup reverse path
Date: Wed, 04 Feb 2026 02:27:12 +0000 [thread overview]
Message-ID: <985568ea543b05f52c453427a6125200bcff0aaf@linux.dev> (raw)
In-Reply-To: <1cbd0d2e-2002-4685-99eb-97dd8947cf16@kernel.org>
February 4, 2026 at 24:24, "David Ahern" <dsahern@kernel.org mailto:dsahern@kernel.org?to=%22David%20Ahern%22%20%3Cdsahern%40kernel.org%3E > wrote:
>
> On 2/3/26 3:41 AM, Paolo Abeni wrote:
>
> >
> > On 1/28/26 10:05 AM, Jiayuan Chen wrote:
> >
> > >
> > > diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> > > index 19c9c838967f..dc9dcc799824 100644
> > > --- a/net/ipv4/icmp.c
> > > +++ b/net/ipv4/icmp.c
> > > @@ -559,6 +559,23 @@ static struct rtable *icmp_route_lookup(struct net *net, struct flowi4 *fl4,
> > > /* steal dst entry from skb_in, don't drop refcnt */
> > > skb_dstref_steal(skb_in);
> > > skb_dstref_restore(skb_in, orefdst);
> > > +
> > > + /*
> > > + * At this point, fl4_dec.daddr should NOT be local (we
> > > + * checked fl4_dec.saddr above). However, a race condition
> > > + * may occur if the address is added to the interface
> > > + * concurrently. In that case, ip_route_input() returns a
> > > + * LOCAL route with dst.output=ip_rt_bug, which must not
> > > + * be used for output.
> > > + */
> > > + if (!err && rt2 && rt2->rt_type == RTN_LOCAL) {
> > > + net_warn_ratelimited("%s: detected local route for %pI4 "
> > > + "during ICMP error handling (src %pI4), "
> > > + "possible address race\n",
> > > + __func__, &fl4_dec.daddr, &fl4_dec.saddr);
> > >
> >
> > The fix looks correct to me, but this patch should target the 'net' tree
> > and the above warning message is a bit off: the text string should not
> > be broken to fit the 80 chars limit - it need to be greepable - it's
> > probably better to not include the function name.
> >
> > /P
> >
> Does the message even provide value? There is nothing a user can do
> about it.
>
Hi Paolo, David,
Thanks for the review.
Paolo, I'll fix it in newer version.
Regarding David's question about whether the message provides value:
I think it could still be useful for debugging. If a user's configuration
change causes ICMP packets to be silently dropped, there's currently no counter
or indication of what happened. Adding a dedicated counter for this rare race
condition seems overkill, so a rate-limited warning at least gives some visibility
into the failure.
That said, I'm open to dropping the message entirely if you both think silent handling
is preferred. Let me know and I'll send a new version either way.
Thanks,
Jiayuan
next prev parent reply other threads:[~2026-02-04 2:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 9:05 [PATCH net-next v1] icmp: fix ip_rt_bug race in icmp_route_lookup reverse path Jiayuan Chen
2026-02-03 10:41 ` Paolo Abeni
2026-02-03 16:24 ` David Ahern
2026-02-04 2:27 ` Jiayuan Chen [this message]
2026-02-04 16:29 ` David Ahern
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=985568ea543b05f52c453427a6125200bcff0aaf@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=jiayuan.chen@shopee.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+e738404dcd14b620923c@syzkaller.appspotmail.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