]> git.baikalelectronics.ru Git - kernel.git/commit
wireguard: use synchronize_net rather than synchronize_rcu
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 4 Jun 2021 15:17:33 +0000 (17:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jun 2021 21:25:14 +0000 (14:25 -0700)
commit9fc860d3ae721b7a4c64445beb0c2803b0c44e53
tree31268b9d1c991514bd604304fe3aebd7676dd685
parent4bf396ed926c6c2011900d844c12584740902710
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: 4dff5496e367 ("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>
drivers/net/wireguard/peer.c
drivers/net/wireguard/socket.c