From: Ido Schimmel <idosch@nvidia.com>
To: xuanqiang.luo@linux.dev
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Subject: Re: [PATCH net-next v3 2/2] ipv4: snapshot dst.dev in ip_rt_send_redirect() and ip_rt_get_source()
Date: Mon, 13 Jul 2026 18:59:01 +0300 [thread overview]
Message-ID: <20260713155901.GB656327@shredder> (raw)
In-Reply-To: <20260708060537.17188-3-xuanqiang.luo@linux.dev>
On Wed, Jul 08, 2026 at 02:05:37PM +0800, xuanqiang.luo@linux.dev wrote:
> From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
>
> rt_flush_dev() can replace rt->dst.dev with blackhole_netdev while RCU
> readers are running. ip_rt_send_redirect() and ip_rt_get_source() both
> read rt->dst.dev more than once and use the results in one operation.
>
> If rt->dst.dev changes between those reads, the operation can use values
> from two devices. For example, ip_rt_send_redirect() can use in_dev from
> the old device and the L3 master ifindex from blackhole_netdev.
>
> Read rt->dst.dev once in these two functions and use the snapshot for the
> later device accesses.
>
> Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
prev parent reply other threads:[~2026-07-13 15:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 6:05 [PATCH net-next v3 0/2] ipv4: update rt_flush_dev() and two dst.dev readers xuanqiang.luo
2026-07-08 6:05 ` [PATCH net-next v3 1/2] ipv4: use rcu_assign_pointer() in rt_flush_dev() xuanqiang.luo
2026-07-13 15:58 ` Ido Schimmel
2026-07-08 6:05 ` [PATCH net-next v3 2/2] ipv4: snapshot dst.dev in ip_rt_send_redirect() and ip_rt_get_source() xuanqiang.luo
2026-07-13 15:59 ` Ido Schimmel [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=20260713155901.GB656327@shredder \
--to=idosch@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luoxuanqiang@kylinos.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xuanqiang.luo@linux.dev \
/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.