From nobody Fri Oct 28 20:56:00 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MzZZm3Y2kz4h4wx; Fri, 28 Oct 2022 20:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MzZZm35cMz4Q4H; Fri, 28 Oct 2022 20:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666990560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d/IRZcETuOOj06ambe/qx+9DFXpbRA0nKRUnlQYtZQ=; b=dwj4LhmejGVKl6evdX7zWH8Vqmi7HNyp8gVwXH+pgYFxM4h1BhAd16Uy3fMuj/RRfCGbTg 4jOLniztoRsNGr8nOpRQJBhwqWrNvrgjBsNhkEjHuhe1jh6qm5yctTzW95GG1gljE2qvCb 7zQlMfI3+aQTFjelbvyoD/bASbddsNQpGO/iiWOqe93XNWkUq9Upkky3mvlHqqhxwS0ZKs OVQwLqM4PwhcpxMs10g2ycUs/xL+LQfkUh7vrq4eb8e0c14Iw67vO1neguL8XTIKEqJWU4 8bT7Y2kBj2qa9s1ZoQF/pJSODIGHAuRV1gMSoTfCPziXlohojv16b0siwSlcBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MzZZm25Ywzrpq; Fri, 28 Oct 2022 20:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29SKu0tF007181; Fri, 28 Oct 2022 20:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29SKu0qf007180; Fri, 28 Oct 2022 20:56:00 GMT (envelope-from git) Date: Fri, 28 Oct 2022 20:56:00 GMT Message-Id: <202210282056.29SKu0qf007180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: dcf581bb49be - main - wg: Use zfree. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcf581bb49bedcf9c18d6cccc80a9fbd68516d23 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666990560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d/IRZcETuOOj06ambe/qx+9DFXpbRA0nKRUnlQYtZQ=; b=Mln58pvfGz+QqnlbqucUtWPaF1vaaxib9ad1Hj5/ZvatnN2Rp9L3yw9h6NGLdY19xybrhn Zkd0vTg+pcwB0AZfzYYYPYXq7XT4GuXyulLpyFh/xUDm/3oFzBI3Gjr3c6jyAESsEbQ8iJ mQXWtJwew/46d29evHqVAU4txkngTYcV3aFwLslsVU4/FLquBjlZNU8Y1J3Hzlyl8Tuo0V wYvMZKrs5ulZwXzvLeKdflqiLKtvbVS7Q3DdXeHjRHKX6eaGXZLVJttTr4DfiSbwglxe/T +uPwvqoIq0paLpugypFrYleQnbz8BTFYlMnhKGoNzul3s/dPGqzLCh0T+BL8Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666990560; a=rsa-sha256; cv=none; b=NbTMvhGUVilGknV2QpaC5dJOSQuYnTo98xYZZCEmfyuGGgV0o6++kznxJ6OmepvgZlSSaI 5sNo6KpWSLNRg8RkkHsKrY/U54TNPnNXGfkhCwEpL26gumqaABZvM/j25v8x6IyJJpCbbS HOtgwvEozdphPzEGb0o5cr/1Y1V/sSe4oJnKCZ8vETq50kIVBAoMBcRZwTaLnRXAu4ETw0 5zbd3sbM9lgMOlsZuJ8Nr7k7HFH9y67i9qlUl0GVDXAvMCfvAFjc9CgSqb4c55mBmYV5LI o4S42S/ntt0YLMYcmUHqqEUppQhnP8OeBpTBPqU58GZrcWYsTE9whx2tGsIydw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dcf581bb49bedcf9c18d6cccc80a9fbd68516d23 commit dcf581bb49bedcf9c18d6cccc80a9fbd68516d23 Author: John Baldwin AuthorDate: 2022-10-28 20:36:13 +0000 Commit: John Baldwin CommitDate: 2022-10-28 20:36:13 +0000 wg: Use zfree. Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36911 --- sys/dev/wg/if_wg.c | 6 ++---- sys/dev/wg/wg_noise.c | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 59a8d949e8c1..07c33fb98158 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2452,8 +2452,7 @@ out_locked: sx_xunlock(&sc->sc_lock); nvlist_destroy(nvl); out: - explicit_bzero(nvlpacked, wgd->wgd_size); - free(nvlpacked, M_TEMP); + zfree(nvlpacked, M_TEMP); return (err); } @@ -2577,8 +2576,7 @@ wgc_get(struct wg_softc *sc, struct wg_data_io *wgd) wgd->wgd_size = size; out: - explicit_bzero(packed, size); - free(packed, M_NVLIST); + zfree(packed, M_NVLIST); err: nvlist_destroy(nvl); return (err); diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c index 095da9dd4a7b..73ee712b11e9 100644 --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -223,8 +223,7 @@ noise_local_put(struct noise_local *l) rw_destroy(&l->l_identity_lock); mtx_destroy(&l->l_remote_mtx); mtx_destroy(&l->l_index_mtx); - explicit_bzero(l, sizeof(*l)); - free(l, M_NOISE); + zfree(l, M_NOISE); } } @@ -472,8 +471,7 @@ noise_remote_smr_free(struct epoch_context *smr) noise_local_put(r->r_local); rw_destroy(&r->r_handshake_lock); mtx_destroy(&r->r_keypair_mtx); - explicit_bzero(r, sizeof(*r)); - free(r, M_NOISE); + zfree(r, M_NOISE); } void @@ -754,8 +752,7 @@ noise_keypair_smr_free(struct epoch_context *smr) kp = __containerof(smr, struct noise_keypair, kp_smr); noise_remote_put(kp->kp_remote); rw_destroy(&kp->kp_nonce_lock); - explicit_bzero(kp, sizeof(*kp)); - free(kp, M_NOISE); + zfree(kp, M_NOISE); } void