arp: Convert SIOCDARP and SIOCSARP to per-netns RTNL.
Subsystems (3)
PATCH 1/1 arp: Convert SIOCDARP and SIOCSARP to per-netns RTNL.
ioctl(SIOCDARP/SIOCSARP) operates on a single netns fetched from an AF_INET socket in inet_ioctl().
Let's hold rtnl_net_lock() for SIOCDARP and SIOCSARP.
Signed-off-by Kuniyuki Iwashima <[email protected]>
--- net/ipv4/arp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/ipv4/arp.c +6 -6
@@ -1062,8 +1062,8 @@ static int arp_req_set_proxy(struct net *net, struct net_device *dev, int on)IPV4_DEVCONF_ALL (net,PROXY_ARP ) = on;return 0 ; } -if (__in_dev_get_rtnl (dev)) { -IN_DEV_CONF_SET (__in_dev_get_rtnl (dev),PROXY_ARP , on); +if (__in_dev_get_rtnl_net (dev)) { +IN_DEV_CONF_SET (__in_dev_get_rtnl_net (dev),PROXY_ARP , on);return 0 ; }return -ENXIO ;
@@ -1293,14 +1293,14 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)switch (cmd) {case SIOCDARP : -rtnl_lock (); +rtnl_net_lock (net); err =arp_req_delete (net, &r); -rtnl_unlock (); +rtnl_net_unlock (net);break ;case SIOCSARP : -rtnl_lock (); +rtnl_net_lock (net); err =arp_req_set (net, &r); -rtnl_unlock (); +rtnl_net_unlock (net);break ;case SIOCGARP :rcu_read_lock ();
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 7 lines · Kuniyuki Iwashima
ioctl(SIOCDARP/SIOCSARP) operates on a single netns fetched from an
AF_INETsocket ininet_ioctl().Let's hold
rtnl_net_lock()for SIOCDARP and SIOCSARP.Signed-off-by Kuniyuki Iwashima <[email protected]>
Reviewed-by Eric Dumazet <[email protected]>
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Tue, 11 Feb 2025 13:50:57 +0900 you wrote:
ioctl(SIOCDARP/SIOCSARP) operates on a single netns fetched from an
AF_INETsocket ininet_ioctl().Let's hold
rtnl_net_lock()for SIOCDARP and SIOCSARP.Signed-off-by Kuniyuki Iwashima <[email protected]>[...]
Here is the summary with links:
- [v1,net-next] arp: Convert SIOCDARP and SIOCSARP to per-netns RTNL.
https://git.kernel.org/netdev/net-next/c/7aca0d8a727d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html