git: 2b82c94acff6 - main - if_wg: avoid null ptr deref
Kyle Evans
kevans at FreeBSD.org
Mon Mar 8 06:25:49 UTC 2021
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=2b82c94acff6b4a90da5af700b59cd398481e968
commit 2b82c94acff6b4a90da5af700b59cd398481e968
Author: Kyle Evans <kevans at FreeBSD.org>
AuthorDate: 2021-03-08 02:47:27 +0000
Commit: Kyle Evans <kevans at FreeBSD.org>
CommitDate: 2021-03-08 06:25:34 +0000
if_wg: avoid null ptr deref
While we're here, sync up with OpenBSD and don't use a keypair !kp_valid
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 0fa7664e66d5..08a0d8d32876 100644
--- a/sys/dev/if_wg/module/wg_noise.c
+++ b/sys/dev/if_wg/module/wg_noise.c
@@ -673,7 +673,7 @@ noise_remote_decrypt(struct noise_remote *r, struct noise_data *data,
* REKEY_AFTER_TIME_RECV seconds. */
ret = ESTALE;
kp = r->r_current;
- if (kp->kp_is_initiator &&
+ if (kp != NULL && kp->kp_valid && kp->kp_is_initiator &&
noise_timer_expired(&kp->kp_birthdate, REKEY_AFTER_TIME_RECV, 0))
goto error;
More information about the dev-commits-src-main
mailing list