diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-07-31 16:45:54 +0000 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-08-04 15:47:49 +0200 |
| commit | 7df47efd6db1eb3cac2e938ca34b28216db4353f (patch) | |
| tree | d4b85d1f854cf8b7655bcb93ab5235dce208a86a /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | cf31c7f186edc0593081c49c7a4374a59c6e3496 (diff) | |
geneve: Protect geneve_net and geneve_sock with per-netns mutex.
struct geneve_dev.net is the netns where the backend geneve
socket resides.
struct geneve_dev is linked to the geneve_net.geneve_list of
the socket's netns.
During netns dismantle or module unload, geneve_exit_rtnl_net()
iterates the list and queues devices for destruction regardless
of devices' netns.
Moreover, a socket can be shared by multiple geneve devices in
different netns, and geneve_open() and geneve_stop() modify
geneve_sock.vni_list and geneve_net.sock_list.
Thus, once RTNL is removed, the three lists can be modified
concurrently from different netns due to device removal and
link-up/down.
Let's protect them with per-netns mutex.
geneve_newlink() is still protected by rtnl_net_lock()s, so
acquiring gn->lock twice in geneve_find_dev() and
geneve_configure() is not a problem.
Note that udp_tunnel_notify_add_rx_port() is moved outside of
the mutex, otherwise gn->lock -> utn->lock ordering would trigger
AB-BA deadlock in geneve_offload_rx_ports(), which acquires
gn->lock under utn->lock. Even without gn->lock, geneve_sock_add()
and geneve_offload_rx_ports() are still serialised with (per-netns)
RTNL, so there is no race.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260731164612.2148830-3-kuniyu@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
