summaryrefslogtreecommitdiff
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-02-13 12:43:01 -0800
committerJakub Kicinski <kuba@kernel.org>2025-02-13 12:43:30 -0800
commit7a7e0197133d18cfd9931e7d3a842d0f5730223f (patch)
treeb9e558f5cbc5e4bec8c32b37e4168976f52f6cc7 /net/core/neighbour.c
parent4079918ae720e842ed7dff65fedeb9980b374995 (diff)
parent348f968b89bfeec0bb53dd82dba58b94d97fbd34 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.14-rc3). No conflicts or adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 73260ca0fc22..d8dd686b5287 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3440,10 +3440,12 @@ static const struct seq_operations neigh_stat_seq_ops = {
static void __neigh_notify(struct neighbour *n, int type, int flags,
u32 pid)
{
- struct net *net = dev_net(n->dev);
struct sk_buff *skb;
int err = -ENOBUFS;
+ struct net *net;
+ rcu_read_lock();
+ net = dev_net_rcu(n->dev);
skb = nlmsg_new(neigh_nlmsg_size(), GFP_ATOMIC);
if (skb == NULL)
goto errout;
@@ -3456,9 +3458,11 @@ static void __neigh_notify(struct neighbour *n, int type, int flags,
goto errout;
}
rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC);
- return;
+ goto out;
errout:
rtnl_set_sk_err(net, RTNLGRP_NEIGH, err);
+out:
+ rcu_read_unlock();
}
void neigh_app_ns(struct neighbour *n)