Skip to content

arp: Random clean up and RCU conversion for ioctl(SIOCGARP).

Kuniyuki Iwashima netdev 3 versions – 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 · linked by author and title

  1. v3 Latest7 patches 0 repliesApplied 7/7
  2. v26 patches 4 repliesSuperseded
  3. v16 patches 2 repliesSuperseded

Changes in v3 from the cover letter

    Add Patch 6 to read dev->name safely under seqlock.

Patches in v3 All 7 applied

#Subject and filesSizeRepliesApplied
1/7arp: Move ATF_COM setting in arp_req_set().net/ipv4/arp.c+6 -30 repliesApplied
2/7arp: Validate netmask earlier for SIOCDARP and SIOCSARP in arp_ioctl().net/ipv4/arp.c+15 -120 repliesApplied
3/7arp: Factorise ip_route_output() call in arp_req_set() and arp_req_delete().net/ipv4/arp.c+30 -200 repliesApplied
4/7arp: Remove a nest in arp_req_get().net/ipv4/arp.c+18 -130 repliesApplied
5/7arp: Get dev after calling arp_req_(delete|set|get)().net/ipv4/arp.c+50 -360 repliesApplied
6/7net: Protect dev->name by seqlock.include/linux/netdevice.h net/core/dev.c+24 -40 repliesApplied
7/7arp: Convert ioctl(SIOCGARP) to RCU.net/ipv4/arp.c+18 -100 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/7] arp: Random clean up and RCU conversion for ioctl(SIOCGARP).

arp_ioctl() holds rtnl_lock() regardless of cmd (SIOCDARP, SIOCSARP, and SIOCGARP) to get net_device by __dev_get_by_name() and copy dev->name safely.

In the SIOCGARP path, arp_req_get() calls neigh_lookup(), which looks up a neighbour entry under RCU.

This series cleans up ioctl() code a bit and extends the RCU section not to take rtnl_lock() and instead use dev_get_by_name_rcu() and netdev_copy_name() for SIOCGARP.

Changes:
v3:

    Add Patch 6 to read dev->name safely under seqlock.

v2: https://lore.kernel.org/netdev/[email protected]/

    Patch 5: s/!IS_ERR/IS_ERR/ in arp_req_delete().

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (7):
arp: Move ATF_COM setting in arp_req_set().
arp: Validate netmask earlier for SIOCDARP and SIOCSARP in

    arp_ioctl().
  arp: Factorise ip_route_output() call in arp_req_set() and
    arp_req_delete().

arp: Remove a nest in arp_req_get().
arp: Get dev after calling arp_req_(delete|set|get)().
net: Protect dev->name by seqlock.
arp: Convert ioctl(SIOCGARP) to RCU.

 include/linux/netdevice.h |   1 +
 net/core/dev.c            |  27 ++++-
 net/ipv4/arp.c            | 203 +++++++++++++++++++++++---------------
 3 files changed, 147 insertions(+), 84 deletions(-)
Signature · 1 line
2.30.2