diff options
author | David S. Miller <davem@davemloft.net> | 2020-02-05 14:14:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-05 14:14:19 +0100 |
commit | a25ee2347537207bc24a5c51a6e9493a745460b9 (patch) | |
tree | b96a7b35194c5b42783da38b4a94529718a59faf /drivers/net/wireguard/netlink.c | |
parent | b5c094430092b4baf71d276b3ab7896bb4530951 (diff) | |
parent | 298f25ad3d9c59072bfb730469dedc6897fa3d85 (diff) | |
download | wireguard-linux-trimmed-a25ee2347537207bc24a5c51a6e9493a745460b9.tar.gz wireguard-linux-trimmed-a25ee2347537207bc24a5c51a6e9493a745460b9.zip |
Merge branch 'wg-fixes'
Jason A. Donenfeld says:
====================
wireguard fixes for 5.6-rc1
Here are fixes for WireGuard before 5.6-rc1 is tagged. It includes:
1) A fix for a UaF (caused by kmalloc failing during a very small
allocation) that syzkaller found, from Eric Dumazet.
2) A fix for a deadlock that syzkaller found, along with an additional
selftest to ensure that the bug fix remains correct, from me.
3) Two little fixes/cleanups to the selftests from Krzysztof Kozlowski
and me.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireguard/netlink.c')
-rw-r--r-- | drivers/net/wireguard/netlink.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireguard/netlink.c b/drivers/net/wireguard/netlink.c index 0fdbd1c..bda2640 100644 --- a/drivers/net/wireguard/netlink.c +++ b/drivers/net/wireguard/netlink.c @@ -569,10 +569,8 @@ static int wg_set_device(struct sk_buff *skb, struct genl_info *info) private_key); list_for_each_entry_safe(peer, temp, &wg->peer_list, peer_list) { - if (wg_noise_precompute_static_static(peer)) - wg_noise_expire_current_peer_keypairs(peer); - else - wg_peer_remove(peer); + BUG_ON(!wg_noise_precompute_static_static(peer)); + wg_noise_expire_current_peer_keypairs(peer); } wg_cookie_checker_precompute_device_keys(&wg->cookie_checker); up_write(&wg->static_identity.lock); |