Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Mar 2021 06:25:49 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2b82c94acff6 - main - if_wg: avoid null ptr deref
Message-ID:  <202103080625.1286PnkD059749@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans:

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

commit 2b82c94acff6b4a90da5af700b59cd398481e968
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-03-08 02:47:27 +0000
Commit:     Kyle Evans <kevans@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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103080625.1286PnkD059749>