mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
netkit: no longer rely on RTNL in netkit_fill_info()
netkit_fill_info() used rtnl_dereference() to fetch nk->peer, and thus required RTNL. nk->peer is already an RCU protected pointer, updated with rcu_assign_pointer() and read from the fast path with rcu_dereference(). Simply use rcu_dereference() under rcu_read_lock() instead. While at it, use READ_ONCE() when reading nk->policy, because netkit_change_link() can change it at any time (it already uses WRITE_ONCE()). Other fields (primary, mode, pair, scrub) are only set from netkit_new_link(), before the device is visible to dumps. Also add missing const qualifiers. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20260916111953.1611574-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
8050e0efd4
commit
aea70e81be
1 changed files with 11 additions and 6 deletions
Loading…
Add table
Add a link
Reference in a new issue