linux-stable/drivers/net/wireguard
Jason A. Donenfeld bc67d37125 wireguard: noise: read preshared key while taking lock
Prior we read the preshared key after dropping the handshake lock, which
isn't an actual crypto issue if it races, but it's still not quite
correct. So copy that part of the state into a temporary like we do with
the rest of the handshake state variables. Then we can release the lock,
operate on the temporary, and zero it out at the end of the function. In
performance tests, the impact of this was entirely unnoticable, probably
because those bytes are coming from the same cacheline as other things
that are being copied out in the same manner.

Reported-by: Matt Dunwoodie <ncon@noconroy.net>
Fixes: e7096c131e ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-20 20:55:09 -07:00
..
selftest wireguard: selftests: initalize ipv6 members to NULL to squelch clang warning 2020-05-06 20:03:47 -07:00
allowedips.c wireguard: allowedips: fix use-after-free in root_remove_peer_lists 2020-02-05 14:14:18 +01:00
allowedips.h
cookie.c
cookie.h
device.c wireguard: queueing: account for skb->protocol==0 2020-03-18 18:51:43 -07:00
device.h net: introduce skb_list_walk_safe for skb segment walking 2020-01-08 15:19:54 -08:00
main.c wireguard: main: remove unused include <linux/version.h> 2019-12-16 19:22:22 -08:00
Makefile
messages.h
netlink.c wireguard: noise: error out precomputed DH during handshake rather than config 2020-03-18 18:51:43 -07:00
netlink.h
noise.c wireguard: noise: read preshared key while taking lock 2020-05-20 20:55:09 -07:00
noise.h wireguard: noise: error out precomputed DH during handshake rather than config 2020-03-18 18:51:43 -07:00
peer.c wireguard: noise: error out precomputed DH during handshake rather than config 2020-03-18 18:51:43 -07:00
peer.h
peerlookup.c
peerlookup.h
queueing.c wireguard: queueing: cleanup ptr_ring in error path of packet_queue_init 2020-04-29 14:23:05 -07:00
queueing.h net: Fix CONFIG_NET_CLS_ACT=n and CONFIG_NFT_FWD_NETDEV={y, m} build 2020-03-25 12:24:33 -07:00
ratelimiter.c
ratelimiter.h
receive.c wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing 2020-05-06 20:03:47 -07:00
send.c wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing 2020-05-06 20:03:47 -07:00
socket.c wireguard: socket: remove errant restriction on looping to self 2020-05-06 20:03:47 -07:00
socket.h
timers.c
timers.h
version.h