From d9a50109e238e2d0171f0e647821f82efb8d037d Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 7 Mar 2021 20:25:33 -0600 Subject: [PATCH] if_wg: release correct lock in noise_remote_begin_session() The keypair lock is not taken until later. Obtained from: Jason A. Donenfeld via OpenBSD MFC after: 3 days --- sys/dev/if_wg/module/wg_noise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/if_wg/module/wg_noise.c b/sys/dev/if_wg/module/wg_noise.c index 946a570916a6..0fa7664e66d5 100644 --- a/sys/dev/if_wg/module/wg_noise.c +++ b/sys/dev/if_wg/module/wg_noise.c @@ -454,7 +454,7 @@ noise_remote_begin_session(struct noise_remote *r) NOISE_SYMMETRIC_SIZE, NOISE_SYMMETRIC_SIZE, 0, 0, hs->hs_ck); } else { - rw_exit_write(&r->r_keypair_lock); + rw_exit_write(&r->r_handshake_lock); return EINVAL; }