]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
neighbour: Move neigh_find_table() to neigh_get().
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 16 Jul 2025 22:08:09 +0000 (22:08 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Jul 2025 23:25:20 +0000 (16:25 -0700)
commit0e5ac19c78654abbf43dc4ffdae290c8cb81c59c
tree8903446233de02c2ee89f789d24cecdc3ec2ce5f
parent3dfe0b57dcda070d9f1ed2bfb3a9bf0ec8632e08
neighbour: Move neigh_find_table() to neigh_get().

neigh_valid_get_req() calls neigh_find_table() to fetch neigh_tables[].

neigh_find_table() uses rcu_dereference_rtnl(), but RTNL actually does
not protect it at all; neigh_table_clear() can be called without RTNL
and only waits for RCU readers by synchronize_rcu().

Fortunately, there is no bug because IPv4 is built-in, IPv6 cannot be
unloaded, and DECNET was removed.

To fetch neigh_tables[] by rcu_dereference() later, let's move
neigh_find_table() from neigh_valid_get_req() to neigh_get().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250716221221.442239-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/neighbour.c