summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2025-02-18 05:49:31 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-07 16:56:36 +0100
commita0bad5c7c2b4128953ba95476807d806cc10899b (patch)
treef747b6eac2e8e8970881954a61fe1a1916c0c051 /net
parent0f038b945474a031faf93e3af1423d14690bd59f (diff)
downloadlinux-a0bad5c7c2b4128953ba95476807d806cc10899b.tar.gz
linux-a0bad5c7c2b4128953ba95476807d806cc10899b.tar.bz2
linux-a0bad5c7c2b4128953ba95476807d806cc10899b.zip
arp: switch to dev_getbyhwaddr() in arp_req_set_public()
[ Upstream commit 4eae0ee0f1e6256d0b0b9dd6e72f1d9cf8f72e08 ] The arp_req_set_public() function is called with the rtnl lock held, which provides enough synchronization protection. This makes the RCU variant of dev_getbyhwaddr() unnecessary. Switch to using the simpler dev_getbyhwaddr() function since we already have the required rtnl locking. This change helps maintain consistency in the networking code by using the appropriate helper function for the existing locking context. Since we're not holding the RCU read lock in arp_req_set_public() existing code could trigger false positive locking warnings. Fixes: 941666c2e3e0 ("net: RCU conversion of dev_getbyhwaddr() and arp_ioctl()") Suggested-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20250218-arm_fix_selftest-v5-2-d3d6892db9e1@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/arp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 8f9b5568f1dc..50e2b4939d8e 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1030,7 +1030,7 @@ static int arp_req_set_public(struct net *net, struct arpreq *r,
if (mask && mask != htonl(0xFFFFFFFF))
return -EINVAL;
if (!dev && (r->arp_flags & ATF_COM)) {
- dev = dev_getbyhwaddr_rcu(net, r->arp_ha.sa_family,
+ dev = dev_getbyhwaddr(net, r->arp_ha.sa_family,
r->arp_ha.sa_data);
if (!dev)
return -ENODEV;