]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
neighbour: Remove __pneigh_lookup().
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 16 Jul 2025 22:08:17 +0000 (22:08 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Jul 2025 23:25:21 +0000 (16:25 -0700)
commitdd103c9a53752d3754a3182ec8dd97885680cfe2
treea7c72c07baf447fdb412409f2673b0425f082aaf
parentb9c89fa128fa41e56300434dfca1138459b29384
neighbour: Remove __pneigh_lookup().

__pneigh_lookup() is the lockless version of pneigh_lookup(),
but its only caller pndisc_is_router() holds the table lock and
reads pneigh_netry.flags.

This is because accessing pneigh_entry after pneigh_lookup() was
illegal unless the caller holds RTNL or the table lock.

Now, pneigh_entry is guaranteed to be alive during the RCU critical
section.

Let's call pneigh_lookup() and use READ_ONCE() for n->flags in
pndisc_is_router() and remove __pneigh_lookup().

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