The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/2] ipv4: update rt_flush_dev() and two dst.dev readers
@ 2026-07-08  6:05 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-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
  0 siblings, 2 replies; 3+ messages in thread
From: xuanqiang.luo @ 2026-07-08  6:05 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	David Ahern, Ido Schimmel
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, linux-kernel,
	Xuanqiang Luo

From: Xuanqiang Luo <xuanqiang.luo@linux.dev>

Patch 1 makes the rt_flush_dev() write to rt->dst.dev use
rcu_assign_pointer(), matching the existing dst_dev_rcu() readers.

Patch 2 makes ip_rt_send_redirect() and ip_rt_get_source() use one
dst.dev snapshot throughout each operation, so a concurrent rt_flush_dev()
update cannot make them use values from two devices.

v3:
- Split the rt_flush_dev() change into a separate patch.
- Update PATCH 2 subject and commit message to describe the actual scope
  more clearly.
- Drop the Fixes tag.
- Fix local variable ordering for netdev reverse xmas tree style.

Thanks to Ido Schimmel for the feedback.

v2: https://lore.kernel.org/lkml/20260701032434.17500-1-xuanqiang.luo@linux.dev/
- Use dst_dev_rcu() and dev_net_rcu() for the RCU readers.
- Use rcu_assign_pointer() when publishing the uncached route device
  replacement.
- Slightly adjust the commit message wording because this issue was found
  by inspection, not from an observed user-visible failure.

v1: https://lore.kernel.org/all/20260630094250.29386-1-xuanqiang.luo@linux.dev/

Xuanqiang Luo (2):
  ipv4: use rcu_assign_pointer() in rt_flush_dev()
  ipv4: snapshot dst.dev in ip_rt_send_redirect() and ip_rt_get_source()

 net/ipv4/route.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

-- 
2.43.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-08  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox