The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2b82c94acff6b4a90da5af700b59cd398481e968

commit 2b82c94acff6b4a90da5af700b59cd398481e968
Author:     Kyle Evans <kev...@freebsd.org>
AuthorDate: 2021-03-08 02:47:27 +0000
Commit:     Kyle Evans <kev...@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;
 
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to