mbox series

[v1,net-next,0/6] arp: Random clean up and RCU conversion for ioctl(SIOCGARP).

Message ID 20240422194755.4221-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series arp: Random clean up and RCU conversion for ioctl(SIOCGARP). | expand

Message

Kuniyuki Iwashima April 22, 2024, 7:47 p.m. UTC
arp_ioctl() holds rtnl_lock() regardless of cmd (SIOCDARP, SIOCSARP,
and SIOCGARP) to get net_device by __dev_get_by_name().

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() for SIOCGARP.


Kuniyuki Iwashima (6):
  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)().
  arp: Convert ioctl(SIOCGARP) to RCU.

 net/ipv4/arp.c | 203 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 123 insertions(+), 80 deletions(-)