Skip to content

ipv4: update rt_flush_dev() and two dst.dev readers

[email protected] lkml netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 2 repliesApplied 2/2

Changes in v3 from the cover letter

- 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.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2ipv4: use rcu_assign_pointer() in rt_flush_dev()net/ipv4/route.c+1 -11 replyApplied
2/2ipv4: snapshot dst.dev in ip_rt_send_redirect() and ip_rt_get_source()net/ipv4/route.c+18 -131 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchIdo Schimmel
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/2] ipv4: update rt_flush_dev() and two dst.dev readers

From: Xuanqiang Luo <[email protected]>

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/[email protected]/
- 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/[email protected]/

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(-)
Signature · 1 line
2.43.0