diff options
| author | 2025-10-22 05:39:48 +0000 | |
|---|---|---|
| committer | 2025-10-24 17:57:20 -0700 | |
| commit | 55a6046b48a8c7d3ea164d9b68902b4ea6930cf3 (patch) | |
| tree | 832a0ac79f902510d0273226383681b873193960 /net/ipv4/arp.c | |
| parent | neighbour: Convert RTM_GETNEIGHTBL to RCU. (diff) | |
| download | wireguard-linux-55a6046b48a8c7d3ea164d9b68902b4ea6930cf3.tar.xz wireguard-linux-55a6046b48a8c7d3ea164d9b68902b4ea6930cf3.zip | |
neighbour: Convert RTM_SETNEIGHTBL to RCU.
neightbl_set() fetches neigh_tables[] and updates attributes under
write_lock_bh(&tbl->lock), so RTNL is not needed.
neigh_table_clear() synchronises RCU only, and rcu_dereference_rtnl()
protects nothing here.
If we released RCU after fetching neigh_tables[], there would be no
synchronisation to block neigh_table_clear() further, so RCU is held
until the end of the function.
Another option would be to protect neigh_tables[] user with SRCU
and add synchronize_srcu() in neigh_table_clear().
But, holding RCU should be fine as we hold write_lock_bh() for the
rest of neightbl_set() anyway.
Let's perform RTM_SETNEIGHTBL under RCU and drop RTNL.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251022054004.2514876-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/arp.c')
0 files changed, 0 insertions, 0 deletions
