diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-06-04 18:17:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-05 00:25:14 +0300 |
commit | 24b70eeeb4f46c09487f8155239ebfb1f875774a (patch) | |
tree | 31268b9d1c991514bd604304fe3aebd7676dd685 /drivers/net/wireguard/socket.c | |
parent | cc5060ca0285efe2728bced399a1955a7ce808b2 (diff) | |
download | linux-24b70eeeb4f46c09487f8155239ebfb1f875774a.tar.xz |
wireguard: use synchronize_net rather than synchronize_rcu
Many of the synchronization points are sometimes called under the rtnl
lock, which means we should use synchronize_net rather than
synchronize_rcu. Under the hood, this expands to using the expedited
flavor of function in the event that rtnl is held, in order to not stall
other concurrent changes.
This fixes some very, very long delays when removing multiple peers at
once, which would cause some operations to take several minutes.
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireguard/socket.c')
-rw-r--r-- | drivers/net/wireguard/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c index d9ad850daa79..8c496b747108 100644 --- a/drivers/net/wireguard/socket.c +++ b/drivers/net/wireguard/socket.c @@ -430,7 +430,7 @@ void wg_socket_reinit(struct wg_device *wg, struct sock *new4, if (new4) wg->incoming_port = ntohs(inet_sk(new4)->inet_sport); mutex_unlock(&wg->socket_update_lock); - synchronize_rcu(); + synchronize_net(); sock_free(old4); sock_free(old6); } |