From: "Jiayuan Chen" <jiayuan.chen@linux.dev>
To: "David Ahern" <dsahern@kernel.org>, 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>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3] xfrm: fix ip_rt_bug race in icmp_route_lookup reverse path
Date: Thu, 05 Feb 2026 15:29:53 +0000 [thread overview]
Message-ID: <3864f233d228b86ea89f224e39ed77b05c298e54@linux.dev> (raw)
In-Reply-To: <62b51184-cc76-42cc-beea-91b6e815132f@kernel.org>
2026/2/5 23:17, "David Ahern" <dsahern@kernel.org mailto:dsahern@kernel.org?to=%22David%20Ahern%22%20%3Cdsahern%40kernel.org%3E > 写到:
>
> On 2/5/26 12:02 AM, Jiayuan Chen wrote:
>
> >
> > diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> > index 4abbec2f47ef..35816ac749bc 100644
> > --- a/net/ipv4/icmp.c
> > +++ b/net/ipv4/icmp.c
> > @@ -554,6 +554,22 @@ 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("detected local route for %pI4 "
> > + "during ICMP sending, src %pI4\n",
> > + &fl4_dec.daddr, &fl4_dec.saddr);
> >
> per Paolo comment on the previous revision of this patch, strings should
> not be split across lines like this. It should be:
>
> net_warn_ratelimited("detected local route for %pI4 during ICMP sending,
> src %pI4\n",
Sorry about that. I totally misunderstood Paolo's comment.
pw-bot: cr
> >
> > + dst_release(&rt2->dst);
> > + err = -EINVAL;
> > + }
> > }
> >
> > if (err)
> >
>
prev parent reply other threads:[~2026-02-05 15:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 7:02 [PATCH net v3] xfrm: fix ip_rt_bug race in icmp_route_lookup reverse path Jiayuan Chen
2026-02-05 15:17 ` David Ahern
2026-02-05 15:29 ` Jiayuan Chen [this message]
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=3864f233d228b86ea89f224e39ed77b05c298e54@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.