summaryrefslogtreecommitdiff
path: root/drivers/net/wireguard/receive.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-05-19 22:49:28 -0600
committerMichael Bestas <mkbestas@lineageos.org>2020-12-31 19:40:44 +0200
commita5f6e25141e288af101fdbcecfcb9a532a5c1c9f (patch)
treeaadebbc74638fae72fd214e5313556eb06920ad2 /drivers/net/wireguard/receive.c
parentb0592db752dd40d0e34ae57791542bacc4a2e316 (diff)
UPSTREAM: 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: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit bc67d371256f5c47d824e2eec51e46c8d62d022e) Bug: 152722841 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I41c2eeee65162fac791cd27812c6b9ba5a9eeec2
Diffstat (limited to 'drivers/net/wireguard/receive.c')
0 files changed, 0 insertions, 0 deletions